#2015-08-2009:33malabarba@andrea.crotti: yep, that would be it#2015-08-2009:33malabarbaYou can user cider with figwheel too: https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#2015-08-2013:50agile_geekIs there a create new test file func in cider? i.e. I’m writing implementation and want to create the associated test file#2015-08-2014:18bozhidarno, there isn't#2015-08-2014:19bozhidaryou can use projectile to do this, though#2015-08-2014:19bozhidarhttps://github.com/bbatsov/projectile/issues/642#2015-08-2014:22agile_geek@bozhidar: thanks. Will take a look.#2015-08-2018:52mitchelkuijperserror in process filter: user-error: Some namespaces are in a bad state: error "Class not found: clojure.core/long" in relations-for-jira.atlassian
error in process filter: Some namespaces are in a bad state: error "Class not found: clojure.core/long" in relations-for-jira.atlassian
#2015-08-2018:52mitchelkuijpersI saw some issues about this does anyone has a hint what might cause this? I could not find any hints towards a long in that namespace#2015-08-2019:03mitchelkuijpersWow this mranderson stacktrace is scary#2015-08-2019:14benedekhaha sry about that#2015-08-2019:16mitchelkuijpersI get more hints already with eastwood#2015-08-2019:16mitchelkuijperssrc/clj/relations_for_jira/atlassian.clj:147:4: wrong-tag: Wrong tag: clojure.core/long on form: idx__9449__auto__
src/clj/relations_for_jira/atlassian.clj:147:4: wrong-tag: Wrong tag: clojure.core/long on form: idx29785
#2015-08-2019:16benedekso how does this code look like? can you show a bit of it?#2015-08-2019:17mitchelkuijperssure not my prettiest code#2015-08-2019:17mitchelkuijpers(defn get-public-key
[base-url]
(->
(d/chain
(http/get (str base-url "/plugins/servlet/oauth/consumer-info"))
:body
xml/parse
:content
#(filter (fn [{:keys [tag]}] (= tag :publicKey)) %)
first
:content
first)
(d/catch java.lang.Throwable
(fn [e]
(log/warn e "Could not find public key for host" base-url)
nil))))
#2015-08-2019:17mitchelkuijperssrc/clj/relations_for_jira/atlassian.clj:147:4: wrong-tag: Wrong tag: clojure.core/long on form: idx__9449__auto__
src/clj/relations_for_jira/atlassian.clj:147:4: wrong-tag: Wrong tag: clojure.core/long on form: idx29785
#2015-08-2019:18mitchelkuijperslinenumber 147 is the start of d/chain#2015-08-2019:19mitchelkuijpersd/chain is something from manifold btw#2015-08-2019:20benedekis that a macro?#2015-08-2019:21mitchelkuijpershttp://ideolalia.com/manifold/manifold.deferred.html#var-chain#2015-08-2019:22mitchelkuijpersYeah could be I guess#2015-08-2019:22mitchelkuijpersmaybe the -> with d/chain clashes?#2015-08-2019:22mitchelkuijpershttps://github.com/ztellman/manifold/blob/master/src/manifold/deferred.clj#L910#2015-08-2019:22mitchelkuijperslooks like a macro#2015-08-2019:25benedekdon’t you need to wrap the anon fn in parens?#2015-08-2019:26benedekok... ignore previous...#2015-08-2019:26mitchelkuijpersHmm if I remove d/chain it's fixed#2015-08-2019:27mitchelkuijpersIt seems to only happen when I set more than 3 arguments#2015-08-2019:27benedeki don’t know manifold and looking at the source code just blowing my mind...#2015-08-2019:28mitchelkuijpersYeah me too#2015-08-2019:28mitchelkuijpersI fixed it by giving less than 3 arguments, no worries#2015-08-2019:28mitchelkuijpersThanks for the help @benedek#2015-08-2019:29benedekwell I did not do much 😉#2015-08-2019:29mitchelkuijpersSometimes talking to someone helps#2015-08-2019:29benedek/me :rubber_duck:#2015-08-2019:29mitchelkuijpersHehe#2015-08-2019:32mitchelkuijpersNow I can finally rename stuff with refactor-nrepl whohooo!#2015-08-2116:06ericnormandhello!#2015-08-2116:06ericnormandI have a question about cider-connect#2015-08-2116:06ericnormandit's asking for my ssh password#2015-08-2116:07ericnormanddoes anyone know what this means?#2015-08-2116:09ericnormandor even where to start figuring out why?#2015-08-2116:49bozhidarif you try to connect to a host you’ve connected to via ssh in the past#2015-08-2116:49bozhidarit will try to establish an ssh tunnel to it#2015-08-2116:49bozhidarfor security reasons#2015-08-2116:49bozhidarwe were supposed to document this simple_smile#2015-08-2116:51bozhidarhttps://github.com/clojure-emacs/cider/pull/808#2015-08-2116:51bozhidarsome historical context#2015-08-2119:09jrotenbergi’ve somehow broken C-j in cider-scratch#2015-08-2119:09jrotenbergSymbol's function definition is void: clojure-backward-logical-sexp#2015-08-2119:26pandeirowhat is cider-scratch?#2015-08-2119:27pandeiroi mean, it creates a scratch buffer in clojure-mode? and ... something else?#2015-08-2119:35jrotenbergyeah, i guess thats basically it#2015-08-2119:35jrotenbergbut it sticks around through cider-restarts#2015-08-2119:36jrotenbergi dunno, might be a better way but i got used to having it be my emacs session scratch buffer for stuff i wanted to toy with#2015-08-2119:36jrotenbergbut i broke it somehow i think#2015-08-2119:36jrotenbergwell#2015-08-2119:36jrotenbergit works, but i can’t eval from it#2015-08-2121:39malabarba@jrotenberg: Make sure your clojure-mode package is up to date#2015-08-2121:40malabarbaThat function it's complainning about is relatively new, so you might be running an older clojure-mode#2015-08-2122:06jrotenbergaahhh, that fixed it#2015-08-2122:06jrotenbergjust blew away a bunch of packages and reinstalled#2015-08-2122:06jrotenbergand finally fixed it so i can have paredit-mode on and still use C-j to eval#2015-08-2123:47malabarbasimple_smile#2015-08-2217:25angelinihey, has anyone else run into the bug where “run namespace tests” seems to cache a version of the test code? i.e. The first time I run it, it works great, but if I modify my test code and run it again, I get the results of the first run#2015-08-2218:24malabarba@angelini: Did you reevaluate the modified code?#2015-08-2219:40angelinihaha nope. well that was easy#2015-08-2219:41angelinithanks#2015-08-2303:34zentropeDoes clj-refactor support ClojureScript?#2015-08-2303:35zentropeI suppose I could just give it a try. ;)#2015-08-2303:53zentropeAh. Not especially good. For instance, cljr-sort-ns messes up the require-macros form.#2015-08-2309:35benedek@zentrope partially. the emacslisp only features should work basically (threading related stuff for example) the ones backed by the middleware wont work. our main focus to improve this. for example you have a working clean ns in the latest snapshot for cljs#2015-08-2309:36benedekwe would actually welcome some feedback for it ;)#2015-08-2417:44alejandrowhen cider debugging is set up for a function, is there a way to only break on a condition? or to disable it temporarily?#2015-08-2507:27bozhidar@alejandro: can you share with us some concrete use-case regarding what you want to do?#2015-08-2507:27bozhidarwe don’t have real conditional breaks (although you can definitely request their addition)#2015-08-2507:27bozhidarbut at least we can suggest some reasonable workarounds#2015-08-2510:30malabarba@alejandro: You can add an if into your code, and then break inside a branch of that if#2015-08-2510:34malabarba(defn do-it [arg]
(if (i-want-to-break arg)
#break arg
arg))
#2015-08-2510:36malabarbaYOu can also try binding the *skip-breaks* var to (atom true), this is leveraging on internal debugger stuff, but it might work#2015-08-2510:36malabarba(defn do-it [arg]
(binding [cider.nrepl.middleware.debug/*skip-breaks*
(if (i-want-to-break arg)
cider.nrepl.middleware.debug/*skip-breaks*)
(atom true)]
(do-the-usual-function-here)))
#2015-08-2512:49alejandro@bozhidar: really just want to use it for a clause in a loop (or function called in a loop), but only on like the 10,000th iteration#2015-08-2512:49alejandro@malabarba: I actually haven’t been able to get #break or #dbg to work at all. I use the "cider instrument top level form” to get it to work#2015-08-2512:50malabarba@alejandro: Oh, then you're probably using 0.9.1. The #break and #dbg are only on the snapshot release for now.#2015-08-2512:51alejandro@malabarba: got it. what’s the best way to move to the snapshot release? I have no problem using a later build#2015-08-2512:51malabarba@alejandro: The *skip-breaks* solution might still work#2015-08-2512:52malabarbaOr not ... 😛#2015-08-2512:52malabarbaTo install the snapshot, just bump the version to 0.10.0-SNAPSHOT#2015-08-2512:52malabarba(on the clojure side)#2015-08-2512:53malabarbaAnd install the cider package from Melpa (on the emacs side)#2015-08-2512:55alejandro@malabarba: hmm, says I’m on cider snapshot already 0.10.0snapshot (20150824.244)#2015-08-2512:55alejandroand [cider/cider-nrepl "0.10.0-SNAPSHOT”]#2015-08-2512:55malabarbahm#2015-08-2512:55malabarbathen the reader macros should work#2015-08-2512:56malabarbaWhat happens if you write in a file (let [x 1] #break (inc x)) and hit C-x C-e?#2015-08-2512:57alejandroyeah that work#2015-08-2512:57alejandros#2015-08-2513:01alejandrohmm, maybe I was using it incorrectly? I tried it in a lengthy let statement and it wasn’t triggering yesterday#2015-08-2513:01malabarbaHow were you evaluating it? C-c C-k won't work#2015-08-2513:01alejandroah that’s probably it#2015-08-2513:01malabarbaYeah, you're not the first to run into that.#2015-08-2513:02alejandroso I need to C-x C-e the form itself#2015-08-2513:02malabarbaIt has to be one of the evaluation commands, like C-x C-e or C-M-x#2015-08-2513:02malabarbaLoading the file (`C-c C-k`) doesn't do it#2015-08-2513:03alejandrocool, I’ll roll with that. That will make a conditional break much easier to set up#2015-08-2513:03alejandrothank you!#2015-08-2513:04malabarbanp :thumbsup:#2015-08-2513:04alejandrooh, one more question: if I’ve setup debugging on a top level form, is there a way to then disable it?#2015-08-2513:04malabarbayes, just reevaluate it normally#2015-08-2513:04alejandroso just C-x C-e it#2015-08-2513:05alejandroand it will not be instrumented anymore#2015-08-2513:05malabarbaYes#2015-08-2513:05malabarbaI think C-c C-k will work in this case too#2015-08-2513:05malabarbaAt least it should, so if it doesn't do let us know simple_smile#2015-08-2513:05alejandrocool, thanks again#2015-08-2712:12jonasHere's a basic emacs/cider question from someone who has used emacs for a long time but is still (and forever) an emacs noob simple_smile
My favorite cider feature is C-c C-p where the result of the evaluated expression is pretty printed in *cider-result*. I would like the font size of *cider-result* to be the same as the code buffer. Is this possible? I can increase the font size of *cider-result* but when I hit C-c C-p it's reset to its default value.#2015-08-2712:18malabarbaI take it you've changed the size with C-x C-+?#2015-08-2712:21malabarba@jonas: If you increase the font-size globally with (set-face-attribute 'default nil :height 160) then they should always be the same#2015-08-2712:22jonas@malabarba: yes, I use C+x C-+#2015-08-2712:23malabarbaIf you need to increase the font only locally in the code buffer, then it's still possible to keep them in sync, but it'll take some hacking on your part. 😉#2015-08-2712:25jonasThanks (set-face-attribute 'default nil :height 160) works fine!#2015-08-2721:15Michael Griffiths@jonas @malabarba zoom-frm is good for easy per-buffer or per-frame font size adjustment, but unfortunately it's only available on the wiki - http://www.emacswiki.org/emacs/zoom-frm.el#2015-08-2817:59zentropeIs there a thing in cider to run tests every time a file is changed? #2015-08-2818:04voxdolozentrope: AFAIK, there is not. I still rely on a combination of manually sending tests to cider-repl for evaluation from within the editor and https://github.com/jakemcc/lein-test-refresh for when that workflow isn't working for me for some reason.#2015-08-2818:06zentropeAh. C-c , works pretty well. (I'm not a heavy test first kinda dev.)#2015-08-2818:06zentropeTest first at the repl, then "save" it to a test file. ;)#2015-08-2818:06zentropeSaw that parens-of-the-dead had something like that going, but maybe he just hit a key to make it work.#2015-08-2908:15bozhidar@zentrope: there’s nothing built-in#2015-08-2908:15bozhidarbut something like that would be trivial to implement#2015-08-2908:15bozhidarbasically you can need an after save hook#2015-08-2908:16bozhidarrunning the test command#2015-08-2908:17bozhidarthis can be made as fancy as you want#2015-08-2908:17bozhidarthe magic of Emacs - you don’t really need me to implement such a feature for you#2015-08-2908:17bozhidareveryone can easily add it themselves#2015-08-2915:03jwmyeah, I have to use the ip to avoid ssh#2015-08-2915:04jwmoops, scrolled back heh#2015-08-2915:35zentropebozhidar: Was just curious if it already existed and "was a thing". ;) Magnars has an example: https://github.com/magnars/.emacs.d/blob/master/site-lisp/clj-autotest.el#2015-08-2917:45zentropeYikes! Updated to cider-nrepl "0.10.0-SNAPSHOT" and the latest melpa cider, and Emacs locked up on cider-jack-in.#2015-08-2917:48zentropeHappens when running Emacs from the terminal as well. Hm.#2015-08-2917:51zentropeNuke and paved elpa, still dead on connect. (minibuffer says, "nREPL: Direct connection established."#2015-08-2917:57zentropeMaybe it had something to do with clj-refactor? Anyway, using stable for cider, clj-refactor solves the probs. ;)#2015-08-2918:04zentropeInteresting. If (in project.clj) I set the default ns to user, none of the middleware loads. {:repl-options {:init-ns user}}.#2015-08-2919:24malabarba@zentrope cider is undergoing some big changes right now, so the snapshots are a little unstable ATM #2015-08-2923:28zentropemalabarba: No prob. I guess it's a testament to how stable it usually is to feel like snapshots are no big deal. ;)#2015-08-3006:32bozhidaryeah, it’s usually pretty stable#2015-08-3006:33bozhidarbut the ongoing refactorings are quite sweeping#2015-08-3006:33bozhidarand our tests are quite non-existing#2015-08-3006:33bozhidarso usually there turns out to be some place where you forgot to rename something#2015-08-3006:33bozhidaror introduce an extra param#2015-08-3006:35bozhidarlong story short - we’re working in a direction that would decouple CIDER from nREPL#2015-08-3006:35bozhidarand would make it possible to support both nREPL and Clojure 1.8’s proposed network REPL down the line#2015-08-3006:36bozhidarit’s unlikely that CIDER will actually support the new REPL right after it’s released, but at least we’re making progress in this direction#2015-08-3021:40zentropeWhen running services via a Cider repl, stdout appears in the nrepl-server buffer. How do I cause that buffer to always have the last line in view?#2015-08-3021:40zentropeOr, is it possible to force stdout into the cider-repl itself?#2015-08-3108:42bozhidarthat’s a pretty nasty topic#2015-08-3108:42bozhidarsearch the github tickets and you’ll see what I mean simple_smile#2015-08-3108:43bozhidarthere are some workarounds, there’s no “real” solution#2015-08-3108:43bozhidaror if it exists - we haven’t found it yet#2015-08-3116:58malabarbaHey everyone. If you do simultanenous Clojure and ClojureScript development, you may want to try the current CIDER snapshots. As long as you have both a clj and a cljs REPL connected on the same project, CIDER will automatically know which to use when evaluating any code from any buffer.#2015-08-3116:59malabarbaThis is the same effect you get from the cider-jack-in-clojurescript command from a few weeks ago, except it works even if you manually create those REPL buffers under whatever workflow you use. As everyone knows, there are dozens of ways to create cljs repls, so we'd love any feedback confirming where it does (or doesn't work).#2015-08-3117:41bozhidarafter you do this you’ll also need to give me and Michael ownership in clojar, in case we need to cut releases ourselves#2015-08-3117:41gtrakright, well I don't mind if you change groupid#2015-08-3117:42gtrakafaik cider is the only consumer#2015-08-3118:01gtrakI added bozhidar and cichli to clojars#2015-08-3118:02bozhidarthanks!#2015-08-3120:00mitchelkuijpersI currently use figwheel nrepl with cider and it works like a charm but it seems that cider does not detect the cljs repl so it does not do the switching is there anything obvious I am missing how to do this?#2015-08-3120:47malabarba@mitchelkuijpers are you running today's snapshot? #2015-08-3120:48mitchelkuijpersI just updated with elpa so I guess so?#2015-08-3120:49mitchelkuijpersCIDER 0.10.0snapshot (package: 20150831.715)
#2015-08-3120:51mitchelkuijpers@malabarba: The version seems to indicate that I did#2015-08-3120:52mitchelkuijpersBut I just do a cider-connect
and then I use figwheel repl-api to start a cljs repl with (cljs-repl)
#2015-08-3120:52mitchelkuijpersSo I don't know how it would know it's a clojurescript repl#2015-08-3122:06whackedhow does one install the cider-nrepl 0.10.0-snapshot?#2015-08-3122:06whackedthe github repo master looks like it's at 0.9.1, what am i missing?#2015-08-3122:09whackednevermind stupid me. it's just master#2015-08-3122:20malabarba@mitchelkuijpers I'll give your scenario a try tomorrow. See if it works for me.
As for how it would know... Cider has a middleware that checks if it's a cljs repl and informs emacs automatically. #2015-09-0120:10mitchelkuijpersThnx @malabarba #2015-09-0123:00ppoldhey does anyone have any issues with the ~cider-inspect~ command? it doesn't seem to work anymore#2015-09-0123:01ppoldI get that error in nrepl-messages though ^#2015-09-0123:03malabarbaYeah, I'm getting that too. I'll see if I can fix it.#2015-09-0123:04ppoldthanks!!#2015-09-0123:08malabarbaShould be fixed now. But it may take an hour for Melpa to pull in the changes#2015-09-0123:09ppoldthank you again 😄! 👏#2015-09-0123:13malabarba:)#2015-09-0212:02robert-stuttafordhey @malabarba @bozhidar @magnars, do any of you know if there’s an easy way to perform a lein check type action on the project, as so to confirm that everything compiles, in CIDER?#2015-09-0212:03robert-stuttafordlein check works but i don’t want it to stop at the first error, i want all the errors at once#2015-09-0215:18robert-stuttafordC-c C-p has broken in the latest Cider - nrepl-send-request: No buffer named #2015-09-0215:59bozhidarI was under the impression this was fixed today#2015-09-0216:00bozhidarhttps://github.com/clojure-emacs/cider/commit/3e349682323e5bec9e562c8c6971a87e9543da72#commitcomment-13021161#2015-09-0218:01malabarba@robert-stuttaford you can run cider-refresh . It's also going to stop at the first problem (and worse, your repl will be half loaded in that case) but it's much faster than lein check.#2015-09-0218:02malabarbaDoesn't lein check offer options to not stop at the first error?#2015-09-0218:04robert-stuttafordno, it doesn’t have any args at all as far as i can see#2015-09-0218:05robert-stuttafordthanks bozhidar i’ll update again#2015-09-0218:06robert-stuttaford@malabarba: does cider-refresh have any relationship with tools.namespace/refresh?#2015-09-0218:08malabarbaDon't know. :-/
@cichli, you wrote this feature right? #2015-09-0218:08malabarbaBut I would expect so. Why? #2015-09-0218:09robert-stuttafordjust curious simple_smile#2015-09-0218:10robert-stuttafordour biggest codebase predates that library and that library goes into an infini-loop when used on our code. never figured out why#2015-09-0218:10robert-stuttafordwill give cider-fresh a go even so. thanks!#2015-09-0218:13robert-stuttafordbozhidar: that was the issue, thank you#2015-09-0222:06robertohow can I use source in cider?#2015-09-0222:06robertorepl> (require 'clojure.repl)
nil
repl> (source reduce)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: source in this context, compiling:(/private/var/folders/0m/cjqkxdl50131dgfkz3mnlk300000gp/T/form-init4949860656631746773.clj:1:1)
#2015-09-0304:05jcsims@roberto: I tend to use M-. when I want to see the source of something#2015-09-0305:48bozhidaryep, that’s the idea#2015-09-0305:49bozhidaroriginally we had a command that would simply dump the source of some var in a dedicated temp buffer#2015-09-0305:49bozhidar(similar to what clojure.repl/source does)#2015-09-0305:49bozhidarbut I decided this was pointless, as going to the actual source is way more useful#2015-09-0305:50bozhidaras for @roberto’s issue - this should work fine#2015-09-0305:51bozhidarthere are no limitations regarding what you can do in cider’s repl#2015-09-0305:51bozhidarhis actual problem seems to be the use of require instead of use#2015-09-0305:52bozhidaras he has to do clojure.repl/source to actually refer to the var from his current namespace#2015-09-0307:30robert-stuttafordanother annoyance, when i connect cider: cider-string-join: Wrong type argument: sequencep, #<buffer *cider-repl localhost:60408*> this happens when reusing a previous buffer#2015-09-0307:31robert-stuttafordkilling all the cider repl buffers and trying again fixes it#2015-09-0309:21bozhidarseems somewhere we’re passing a buffer instead of string#2015-09-0309:21bozhidarplease, file a ticket for this and we’ll have it fixed#2015-09-0309:24malabarbaprobably my fault, from my recent change for managing buffers directly instead of their names#2015-09-0309:25malabarbaYep: (cider-string-join zombie-buffs ", ") :)#2015-09-0309:27malabarbaShould be fixed now.#2015-09-0313:28socksyi’m getting this nrepl error:
user=> 2015-09-03 13:21:53,186 ERROR (clojure.tools.nrepl.server) - Unhandled REPL handler exception processing message {:op describe, :id 3}
java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry
previously, this has meant a mismatch in cider-nrepl and cider version, but at the moment they are both 0.10.0 SNAPSHOT, so I’m not sure what’s up?#2015-09-0315:10jcsimsbozhidar: ah yes, makes sense - source is unqualified in his snippet#2015-09-0315:12robertoyeah, silly me#2015-09-0315:12robertothank you guys#2015-09-0407:44niquolaWho is working on clojurescript support?#2015-09-0407:46niquolaIt would be wonderful to have at least half of clj features ;)#2015-09-0411:19bozhidareveryone and noone simple_smile#2015-09-0411:20bozhidarit’s on our radar and some people are pushing things forward (mostly Michael aka @cichli)#2015-09-0411:21bozhidarbut overall there’s a ton of other work to be done, so things are progressing rather slowly#2015-09-0412:17malabarbanicola: Any features in particular that you miss the most?#2015-09-0412:19malabarbanicola: Sometimes, the only thing preventing cljs support for a feature are a couple of small details. And it just hasn't happened because nobody has taken a moment to look into it.
So anyone can help by just looking into it and filing an issue with the findings. 😉#2015-09-0415:15niquola@malabarba: code navigation, doc & signature, clj-refactor#2015-09-0415:59malabarbaWell, at least clj-refactor's cljs support has been progressing in leaps and bounds thanks to Lars. It's not complete, but it's getting there. #2015-09-0416:01malabarbaDoc and signature should be really easy to make work too (in fact, I'm surprised they don't). #2015-09-0419:30bozhidarcode navigation, doc & signature have been working with cljs for quite a while#2015-09-0419:30bozhidarthere’s a list of the things that don’t work in the README#2015-09-0509:20benedekre. clj-refactor: true Lars doing amazing work for cljs around clean-ns, add missing libspec and the like (basically the stuff what in the jvm world needs to inspect the classpath). however we have a blocker for those features which need an AST (find-usages, extract-fn, rename-symbol etc): https://github.com/clojure/tools.analyzer.js#outdated#2015-09-0509:21benedekbasically we don’t have a working analyzer for cljs atm#2015-09-0509:21benedekanybody interested in jumping there and help out bronsa?! 😉 (lots of work and fame awaits, haha)#2015-09-0509:22benedekcc @nicola#2015-09-0514:06luxbockI already asked about this in #C03S1KBA2 but it might belong here#2015-09-0514:06luxbockhas anyone got cider-find-var working with the Java sources of Clojure itself?#2015-09-0514:07luxbockthey are not included in the normal Clojure jar, so I assume it would work if I could use a version of the jar that did ship with them#2015-09-0514:08luxbockand you can get them via [... :classifier "sources"] in the dependency vector, but I can't seem to use the -sources.jar to evaluate anything#2015-09-0521:27benedek@otijhuis: thx for the typo fix#2015-09-0618:38michal@bozhidar: after last packages update in emacs cider (20150906.638) totally blew up. i can’t connect neither to existing repl (via cider-connect) nor start a new one (cider-jack-in). both based on boot (instead of lein). "cider-nrepl-sync-request:eval: Wrong type argument: stringp, nil”. cider-nrepl is 0.10.0-SNAPSHOT. is it something on my side only or may I start creating a ticket? simple_smile#2015-09-0618:56michalhm.. sorry, looks like a false alarm. deleting cider and reinstalling again fixed the problem. big relief simple_smile#2015-09-0619:19ebaxtAfter installing cider/cider-nrepl 0.9.1 and nrepl 0.2.10 the nrepl-server buffer is no longer available after running cider-jack-in. Anyone had the same problem? I managed to open it by running list-processes and clicking on the nrepl-server buffer.#2015-09-0619:21malabarbaebaxt: the server buffer is not displayed to the user (because it's usually not useful), but it is created and you can switch to it like any other buffer#2015-09-0619:21malabarbaI think there's an option to display it if you want#2015-09-0619:23ebaxt@malabarba: Shouldn’t it be available in Buffer List then?#2015-09-0619:23malabarbayes it shouldn't#2015-09-0619:23malabarbaoops#2015-09-0619:23malabarbayes it should :)#2015-09-0619:25malabarbaWhen you say “Buffer List”, do you mean C-x C-b or the Buffers entry on the menu-bar?#2015-09-0619:26ebaxtM-x list-buffers#2015-09-0619:27ebaxtIt’s not there so I can’t switch to it without first running M-x list-processes and then clicking the nrepl-server buffer#2015-09-0619:28malabarbalet me check#2015-09-0619:29malabarbaIt does show up at the bottom of the buffer list for me#2015-09-0619:30malabarbaCould you file a bug report with more information?#2015-09-0619:35ebaxtHmm… fixed it by setting (setq nrepl-hide-special-buffers nil)#2015-09-0619:40ebaxtSorry, my bad. After upgrading to Emacs 24.5.1 I got a warning that I needed to move custom functions to a subfolder (not .emacs.d/). In the process I enabled a cider-setup.el file I found once but never used. It set (nrepl-hide-special-buffers t) 😒#2015-09-0619:40malabarba:)#2015-09-0619:40ebaxtThanks for being my rubber duck @malabarba 😉#2015-09-0619:40malabarbano problem#2015-09-1101:44redbeardymcgeemy emacs nrepl is echoing input, and garbage escape characters#2015-09-1101:45redbeardymcgeegoogle shows a windows related issue with jline2 but i don't see how that would apply here#2015-09-1113:52bozhidarEmacs nREPL?#2015-09-1113:52bozhidarI’m not sure what you mean by this#2015-09-1115:02blueberryI have a problem with the newest cider. I have posted it on gitter, just dropping the notification here if someone could help#2015-09-1115:06redbeardymcgeeI mean...nrepl, that i'm connected to in emacs#2015-09-1115:07redbeardymcgeestarted initially from cider-jack-in if that makes any matter#2015-09-1115:26blueberry@bozhidar After upgrade of cider 20150910 to 20150911 every time I evaluate (C-c C-k) a buffer clojure-mode is disabled and I have to manually enable it (M-x clojure-mode) to get rainbow parens and other clojure syntax highlighting again). Tried all reinstallation tips with no success. Reproducible?#2015-09-1115:31bozhidarwe’ve just add some smart font-locking in cider and I’m guessing you’re experiencing a bug related to it#2015-09-1115:31bozhidarplease submit some bug report with simple repro steps in github#2015-09-1115:32bozhidarand we’ll look into the problem#2015-09-1115:36blueberryok. is there any temporary fix at least?#2015-09-1115:42bozhidarI’m not sure exactly what the problem that you have is, so no#2015-09-1115:42bozhidarbut I guess we’ll figure something out pretty quickly once we have more data#2015-09-1115:44blueberryI have just opened a new issue on gh#2015-09-1115:49blueberrybtw is there a (sane) way to downgrade to a previous snapshot package build? or at least to disable automatic updates?#2015-09-1120:34bozVery sorry to double post, but I’m not sure this is a cider or boot thing.
Having trouble getting cider and boot repl to play nice.
boot repl starts like this
nREPL server started on port 60461 on host 127.0.0.1 -
REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_40-b26
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=>
and cider-connect does this…
nREPL: Establishing direct connection to localhost:60461 ...
nREPL: Direct connection established
nrepl-log-message: Wrong number of arguments: (1 . 1), 0
I’ve just updated to the latest cider and configured ~/.boot/profile.boot as per the wiki
cider-20150911.253
boot.user=> boot.repl/*default-middleware*
#object[clojure.lang.Atom 0x1a9e7523 {:status :ready, :val [boot.from.io.aviso.nrepl/pretty-middleware cider.nrepl/cider-middleware]}]
does that all look right?#2015-09-1120:55upgradingdave@boz, I just started seeing some strangeness too#2015-09-1120:56upgradingdaveI was able to workaround using a version of the snapshot from sept 2 like this:#2015-09-1120:57upgradingdaveIf I use the latest 0.10.0-SNAPSHOT, I’m seeing this error:#2015-09-1121:24boz@upgradingdave: thanks for the snapshot idea … didn’t work for me tho
maybe I’ll just get an older version of cider#2015-09-1201:06bozGot past my cider vs emacs issue. I must have mucked up my emacs settings at some point. A fresh install, with Prelude, and using 0.10.0-SNAPSHOT for boot all works#2015-09-1218:06martintrojer‘lo#2015-09-1218:07martintrojerIf I have multiple cider-jack-in going, how do I quit ONE of them but leave the others running?#2015-09-1218:07martintrojerM-x cider-quit and cider-quit in the REPL buffer closes all of them.#2015-09-1218:10martintrojerReading the code, the answers seems to be M-x nrepl-close#2015-09-1218:11martintrojerA README.md update seems to be required.#2015-09-1220:50bhaumanJust want to let CLJS cider users know that the latest figwheel 0.4.0-SNAPSHOT allows you to configure middleware so folks can use the figwheel nrepl connection. In fact it would be great to get some experienced folks trying it out.#2015-09-1408:00bozhidar@martintrojer: this behaviour was changed in 0.10#2015-09-1408:00bozhidarcider-quit will kill just the current connection#2015-09-1408:01bozhidarand with a prefix argument it will kill all connections#2015-09-1408:01bozhidaryou can also use the connection browser to kill a particular connection#2015-09-1408:53martintrojercool, ta#2015-09-1413:23Lambda/SierraWhat determines the "current" namespace in CIDER, when invoked from a buffer which is neither a REPL nor a Clojure source file (e.g. org-mode)?#2015-09-1413:26malabarbaI think we just don't send a namespace in that case#2015-09-1413:26malabarbayou can check the *nrepl-messages* buffer to see what's being sent#2016-02-1501:52samedhiPossibly related issues:#2016-02-1501:52samedhihttp://www.dotkam.com/2015/12/22/the-story-of-booting-mount/#2016-02-1501:52samedhihttp://hoplon.discoursehosting.net/t/question-about-data-readers-with-datomic-and-boot/99#2016-02-1506:33bozhidar@samedhi: are you using 0.11-snapshot?#2016-02-1506:34bozhidarthe timing of your report seems to coincide with a change we made yesterday https://github.com/clojure-emacs/cider-nrepl/commit/1723057b7dcba57fc10108b0b38f0e6a5293df6d#2016-02-1506:34bozhidar@malabarba: ^^#2016-02-1507:27samedhi@bozhidar Yes, I am using 0.11.0-SNAPSHOT#2016-02-1508:47bozhidarso, this is certainly caused by this recent commit#2016-02-1508:47bozhidarunfortunately I’m not familiar with boot and I’m not sure what’s the best approach here#2016-02-1508:48bozhidarmight actually be this commit https://github.com/clojure-emacs/cider-nrepl/commit/2226f517a61b8dde3028bf3c29f8387150833709#2016-02-1508:48bozhidarsomeone with more boot knowledge should help us figure this out#2016-02-1508:48bozhidarI’ve always used only leiningen#2016-02-1510:01jan.zyHi, which version of clj-refactor and refactor-nrepl should I use to avoid these warnings?
; CIDER 0.10.2 (Java 1.8.0_25, Clojure 1.6.0, nREPL 0.2.12)
WARNING: The following nREPL ops are not supported:
artifact-list artifact-versions clean-ns extract-definition find-symbol find-used-locals hotload-dependency namespace-aliases rename-file-or-dir resolve-missing stubs-for-interface version warm-ast-cache
Please, install (or update) refactor-nrepl and restart the REPL.
You can mute this warning by changing cljr-suppress-middleware-warnings.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.0.0-SNAPSHOT (package: 20151210.200) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
and this is my profiles.clj
{:repl {:dependencies [[pjstadig/humane-test-output "0.7.0"]
[org.clojure/tools.nrepl "0.2.12"]]
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:plugins [[cider/cider-nrepl "0.10.2"]
[refactor-nrepl "2.0.0-SNAPSHOT"]]}
:user {:dependencies [[slamhound "1.5.5"]]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:plugins [[lein-ancient "0.6.8"]]}}
#2016-02-1510:08malabarba@r0man I didn't test, so it might not work. But it should #2016-02-1510:09malabarba@samedhi @bozhidar that's annoying. I guess we should just revert the commit and go back to nagging the boot people. :-P#2016-02-1510:13bozhidarI’m guessing it’d be best to revert it for now#2016-02-1510:14bozhidarunless someone wants to fix it properly really fast#2016-02-1510:32jan.zySecond try: I removed refactor-nrepl from my profiles.clj
{:repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]
:plugins [[cider/cider-nrepl "0.10.2"]
#_[refactor-nrepl "2.0.0"]]}
:user {:dependencies [[pjstadig/humane-test-output "0.7.1"]
[slamhound "1.5.5"]]
:injections[(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:plugins [[lein-ancient "0.6.8"]]}}
and cider repl still complains about invalid version of refactor-nrepl:
; CIDER 0.10.2 (Java 1.8.0_25, Clojure 1.6.0, nREPL 0.2.12)
WARNING: The following nREPL ops are not supported:
artifact-list artifact-versions clean-ns extract-definition find-symbol find-used-locals hotload-dependency namespace-aliases rename-file-or-dir resolve-missing stubs-for-interface version warm-ast-cache
Please, install (or update) refactor-nrepl and restart the REPL.
You can mute this warning by changing cljr-suppress-middleware-warnings.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.0.0-SNAPSHOT (package: 20151210.200) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
user>
#2016-02-1510:32jan.zyWhat am I doing wrong?#2016-02-1510:44malabarbaThat's not cider complaining. That's clj-refactor #2016-02-1510:44malabarbaYou need to uninstall it if you don't want it #2016-02-1510:45malabarbaYour you can fix your refactor-nrepl version to the correct one 2.0.0-SNAPSHOT
#2016-02-1511:46jan.zyI was using 2.0.0-SNAPSHPOT#2016-02-1511:46jan.zyand I saw the above message when I upgraded cider to v0.10.2#2016-02-1511:49jan.zyI didn’t change versions of clj-refactor and refactor-nrepl - that’s why I am asking here what might happen simple_smile#2016-02-1512:29bozhidarshare with us your config#2016-02-1512:59malabarba@jan.zy: But your config says [refactor-nrepl "2.0.0"] =/#2016-02-1513:01jan.zyok guys let’s start once again. Forget about everything you’ve seen so far 😉
This is my profiles.clj:
{:repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]
:plugins [[cider/cider-nrepl "0.10.2"]
#_[refactor-nrepl "2.0.0"]]}
:user {:dependencies [[pjstadig/humane-test-output "0.7.1"]
[slamhound "1.5.5"]]
:injections[(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:plugins [[lein-ancient "0.6.8"]]}}
and this is output from my repl:
; CIDER 0.10.2 (Java 1.8.0_25, Clojure 1.7.0, nREPL 0.2.12)
WARNING: The following nREPL ops are not supported:
artifact-list artifact-versions clean-ns extract-definition find-symbol find-used-locals hotload-dependency namespace-aliases rename-file-or-dir resolve-missing stubs-for-interface version warm-ast-cache
Please, install (or update) refactor-nrepl and restart the REPL.
You can mute this warning by changing cljr-suppress-middleware-warnings.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.0.0-SNAPSHOT (package: 20151210.200) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
#2016-02-1513:01jan.zyI am 100% sure that I don’t have refactor-nrepl pulled in as deps in project.clj etc#2016-02-1513:03jan.zyI started seeing this messages in repl when I upgraded cider to v0.10.2 in emacs and changed plugin depenency from [cider/cider-nrepl "0.10.1”] to [cider/cider-nrepl "0.10.2”] in profiles.clj.#2016-02-1513:03jan.zyso the question is, why am i still seeing these warnings in repl#2016-02-1513:03jan.zysecond question is how can i enable refactor-nrepl in cider 0.10.2 ?#2016-02-1513:04jan.zy(and thanks for your help 😉 )#2016-02-1514:03pandeiro@malabarba I'm a Boot person -- what can I do to help?#2016-02-1514:03pandeiro(by person, I mean user, not developer)#2016-02-1514:05pandeiroI can also confirm I see the same error in 0.11.x snapshot#2016-02-1514:18benedek@jan.zy: you are getting the warning because the emacs package is installed but there is no nrepl middleware on your classpath:
> WARNING: clj-refactor and refactor-nrepl are out of sync.
> Their versions are 2.0.0-SNAPSHOT (package: 20151210.200) and n/a, respectively.#2016-02-1514:20benedekuncomment the refactor-nrepl line in you profiles.clj and change the version to `2.0.0-SNAPSHOT or alternitvely (perhaps even better): upgrade to either 2.0.0 (if you prefer stable) or 2.2.0-SNAPSHOT on both the emacs package and the middleware#2016-02-1514:26jan.zyahh ok, thanks#2016-02-1514:29benedekjust one caveat @jan.zy: if you keep using cider 0.10.2 you better go with 2.0.0 stable clj-refactor#2016-02-1514:29benedek2.2.0-snapshot is compatible with cider 0.11.0-snapshot#2016-02-1514:29benedekdependencies, i know… 😕#2016-02-1514:30jan.zyok so my profiles.clj should look like this:
{:repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]
:plugins [[cider/cider-nrepl "0.10.2"]
[refactor-nrepl "2.0.0-SNAPSHOT"]]}
:user {:dependencies [[pjstadig/humane-test-output "0.7.1"]
[slamhound "1.5.5"]]
:injections[(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]
:aliases {"slamhound" ["run" "-m" "slam.hound"]}
:plugins [[lein-ancient "0.6.8"]]}}
#2016-02-1514:30benedekyup#2016-02-1514:30jan.zybut how can I change the version of refactor-nrepl on the emacs package?#2016-02-1514:30benedekgiven that you have not upgraded your emacs package#2016-02-1514:31jan.zyI installed version 0.10.2 from melpa stable yesterday#2016-02-1514:31benedekso the emacs package is clj-refactor.el#2016-02-1514:31jan.zyahh#2016-02-1514:31benedekso reinstall clj-refactor.el from melpa stable to get 2.0.0#2016-02-1514:31jan.zyyes, that should solve the problem#2016-02-1514:31benedekand then change the version 2.0.0-SNAPSHOT to 2.0.0 in your profiles.clj#2016-02-1514:32jan.zyI’ll check it later now I have to go back to writing selenium tests 😕#2016-02-1514:32jan.zyin clojure simple_smile#2016-02-1514:32benedekhaha sounds like fun 😉#2016-02-1514:32benedekgood luck for both simple_smile#2016-02-1514:51jan.zyThanks benedek#2016-02-1514:51jan.zyYet another question: Sometimes I can see this message in my Messages buffer:
error in process filter: nREPL: No response handler with id nil found
#2016-02-1514:51jan.zyWhat is that?#2016-02-1514:54benedekthis looks weird tbh. if you by any chance can reliably reproduce pls create an issue on github#2016-02-1515:10jan.zythat’s one of two race conditions I have while working with cider#2016-02-1515:10jan.zyquite hard to reliably reproduce#2016-02-1517:45malabarbaI haven't seen an error like that in a while now#2016-02-1517:45malabarbaCheck your *nrepl-messages ...* buffers when that happens, and file a github issue with the last 10 messages or so.#2016-02-1517:46malabarba@jan.zy#2016-02-1518:55jan.zymmkay#2016-02-1518:56jan.zyshould i file this issue in cider-nrepl proejct? #2016-02-1519:32malabarbayep#2016-02-1519:32malabarbaor cider#2016-02-1519:32malabarbaeither one is fine#2016-02-1619:38samedhiI am getting 100% cpu utilization when running cider, not sure really how to debug it. Everything seems to work, just high usage.#2016-02-1619:41samedhiThis is after running M-x cider-jack-in as I usually do.#2016-02-1619:41samedhiM-x cider-version => CIDER 0.11.0snapshot (package: 20160216.208)#2016-02-1619:44pbostrom@samedhi: if you are running locally with JDK8 you can use jmc/Flight Recorder to see where it's stuck#2016-02-1619:51benedek@samedhi if u use clj-refactor too this is clj-refactor indexing your project after repl start up#2016-02-1619:52samedhiAhh, I do use clj-refactor.#2016-02-1619:52benedekWhich version of clj-refactor do u use (if any)?#2016-02-1619:53benedekIt should stop after a while tho after repl started up#2016-02-1619:53samedhiSorry, maybe I don’t.
{:user {:plugins [[cider/cider-nrepl "0.11.0-SNAPSHOT"]
[refactor-nrepl "2.2.0-SNAPSHOT"]
[com.jakemccrary/lein-test-refresh "0.11.0"]
[lein-autoexpect "1.7.0"]
[lein-ancient "0.6.8"]
[lein-localrepo "0.5.3"]]
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}#2016-02-1619:54benedekYou might be ;)#2016-02-1619:55benedek can u paste what M-x cljr-version returns?#2016-02-1619:56samedhiM-x cljr-version => clj-refactor 2.2.0-SNAPSHOT (package: 20160216.402), refactor-nrepl 2.2.0-SNAPSHOT#2016-02-1619:56benedekThat is cutting edge :)#2016-02-1619:57samedhiYeah, maybe not the best idea 😬#2016-02-1619:57benedekIt is doing useful stuff#2016-02-1619:57samedhiOk, I will just let it go.#2016-02-1619:57benedekyou can opt out but I don't recommend it#2016-02-1619:58samedhiYeah, no problem. I just feel guilty as it sounds like a airplane is taking off in the office. Haha.#2016-02-1619:58benedekAs some features will get really slow for the first run#2016-02-1619:58samedhiThank you.#2016-02-1619:58benedekno worries :)#2016-02-1620:02benedekIf u set (cljr--debug-mode t) it will get chatty about what is it doing btw (just to explain the airplanes to the office ;))#2016-02-1621:14samedhi@benedek Thanks, I just relied on appeal to authority. I also can report that it has finished indexing and everything is back to normal.#2016-02-1621:16benedekhaha thx ;)#2016-02-1715:43sashtonI'm trying to reload changed files in classpath 'C-c C-x', but when I do I get this error: 'error in process filter symbols function definition is void: s-trim'
I have stripped my emacs config down to just loading cider.
Any ideas why?#2016-02-1715:43anmonteiro@sashton: probably need to install the s package#2016-02-1716:24sashton@anmonteiro thanks that did the trick. I don't see that mentioned in the cider install steps. Should it happen automatically when cider is installed? If so, then maybe my work proxy got in the way. I had to manually copy/install s.el#2016-02-1716:28bozhidarwe don’t use this package#2016-02-1716:29bozhidarso this error is definitely not coming from cider#2016-02-1716:29bozhidarmaybe it’s from clj-refactor#2016-02-1716:29bozhidarif you’re using it#2016-02-1716:29bozhidarif you’re using package.el deps are installed automatically#2016-02-1716:31sashtonI'm using a blank 'lein new app' with no extra dependencies and only cider loaded in emacs, via package.el. is clj-refactor loaded transitively anywhere?#2016-02-1718:15benedekit should not be if you only have cider installed#2016-02-1721:23sashtonturns out it was an old version of cider and other packages left over in my .emacs.d/elpa directory#2016-02-1815:33jonpitherTrying to debug https://github.com/clojure-emacs/cider/issues/533. When in Windows you try to kill a process running a 'batch job', you get 'Terminate batch job (Y/N)?', I wonder if this is responsible for the hanging processes#2016-02-1815:38jonpitherNot sure if related, but when kill cider (via cider-quit), I often get (error "Selecting deleted buffer")), it seems that nrepl-server-filter is being called, but when the (with-current-buffer (process-buffer process)) is called, the result from (process-buffer process) is null#2016-02-1815:42jonpither^ is it possible for nrepl-server-filter to be called, even though the process buffer has been killed? If so, the CIDER code should guard against this#2016-02-1815:50jonpitherI've raised https://github.com/clojure-emacs/cider/issues/1578#2016-02-1821:40sanjaylGetting a massive error when trying to build with lein 2.6.1. Looks like it's related to mranderson. Are you guys having a problem too, or is my setup just borked? Ended up downgrading lein to 2.5.3 and now everything works fine#2016-02-1822:02benedekYou mean you tried to build cider, @sanjayl ?#2016-02-1822:03benedekif so I know: https://github.com/benedekfazekas/mranderson/issues/11#2016-02-1822:03benedekOn my todo list#2016-02-1823:55sanjaylThat's right @benedek, I got it when trying to build cider-nrepl. I checked in the leinigen issue tracker but somehow didn't think to look in yours! Thanks for the quick reply. sl#2016-02-1919:29catonanoHello, firstly thank you so much for the awesome work on Cider.
After hearing Bug talking about Cider, today I freshly installed it via MELPA and I tested a cool feature that got me interested: the injection of the nREPL middleware in my project.
Too bad this is what I get
WARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version (0.9.1). Things will break!
user>#2016-02-1920:50arrdemcatonano: so the thing you can do is use [clojure-emacs/cider-nrepl "[0.9.1,)"] or whatever the artifact name is sorry I'm forgetting in you profile.clj. It's a version range which will cause Leiningen to pull down the very latest build of cider-nrepl which should be consistent with the melpa snapshot.#2016-02-1920:50arrdemtechnically speaking this is kinda unstable, practically speaking I've been doing this for three years with maybe one day of downtime.#2016-02-1920:57arrdemalternatively you could use melpa-stable to install CIDER 0.9.1#2016-02-1921:43benedek@catonano can u paste what shows up on ur minibuffer (see it in *Messages*) eg what are the params for lein/boot when you jack-in?#2016-02-1921:53benedek@arrdem there is a new feature in 0.11 which injects the middleware so u don't need to add anything to ur profiles.clj#2016-02-1922:07arrdem@benedek: right I remeber seeing that. sorry.#2016-02-1922:10benedekNo worries. Really interested at this point if there is a bug tho ;)#2016-02-1922:19robertoI upgraded to cider 0.10 and now I’m getting this error symbol's function definition is void clojure-project-dir#2016-02-1922:23catonano@benedek: there's a *nrepl-messages my-project-name buffer. It contains the traffic between the Emacs side and the nREPL side. Is taht the one you want ?#2016-02-1922:26catonanoAnyway, this is the plain old Messages form Emacs
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/git-init.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making nrepl-create-client-buffer-function local to nrepl-server openArpa while let-bound!
Making nrepl-use-this-as-repl-buffer local to nrepl-server openArpa while let-bound!
Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.11.0-SNAPSHOT\"\] -- repl :headless...
You can run the command `cider-jack-in' with C-c M-j
Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.11.0-SNAPSHOT\"\] -- repl :headless...
nREPL server started on 46317
nREPL: Establishing direct connection to localhost:46317 ...
nREPL: Direct connection established
Connected. This REPL is yours to command!
delete-backward-char: Text is read-only [2 times]
Beginning of buffer [11 times]
End of buffer
Beginning of buffer [12 times]
Mark set
End of buffer [11 times]
End of buffer#2016-02-1922:30robertofixed#2016-02-1922:31benedekHmmm that is what I meant#2016-02-1922:32benedekWhat is in ur profiles.clj? (Although it should be ovverriden by the update-in)#2016-02-1922:33benedekfurther questions ;) what is ur lein version?#2016-02-1922:36robertoi had to upgrade clojure-mode#2016-02-1922:37robertoit is sort of hit and miss when upgrading packages#2016-02-1922:37robertoi have cider working fine now#2016-02-2003:04catonano@benedek: I forgot I had a .profiles-clj. It's like this
{:user {:plugins [[cider/cider-nrepl "0.9.1"]
[refactor-nrepl "1.1.0"]
]
:dependencies [[org.clojure/tools.nrepl "0.2.7"]]
}
}#2016-02-2003:04catonanoand lein versin is
Leiningen 2.6.1 on Java 1.8.0_71 OpenJDK 64-Bit Server VM#2016-02-2003:05catonanoI had just forgot .profiles. Sorry#2016-02-2003:09catonano@benedek: I removed it and no warnings came up#2016-02-2003:10catonano@benedek: thank you#2016-02-2009:25benedekno worries. i tested that the params override profiles which is not working for your case. my guess is that the override did not happen because you had the stuff defined in the user profile#2016-02-2009:25benedekwill check this tho#2016-02-2014:34sashtonis there a way to get the cider-test-report buffer to use pjstadig/humane-test-output? I've added it as an injection in :user in my profiles.clj, and i can see that it is loaded when I manually run a test in the REPL, but when I use the cider-test-run-test command, the output is not formatted.#2016-02-2017:48benedek@catonano: tested this. overriding did not happen because deps/plugins were defined in the :user profile#2016-02-2018:15catonano@benedek thank you !#2016-02-2018:15benedekno worries, I am adding a section about this to the cider readme so thanks for bringing it up#2016-02-2018:21catonano👍#2016-02-2019:32andrea.crottiuhm#2016-02-2019:32andrea.crottiWARNING: CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version (0.10.2). Things will break!#2016-02-2019:32andrea.crottibut I don't see any 0.11 on Clojars#2016-02-2019:33andrea.crottihow do I get that version then?#2016-02-2020:12catonano@andrea.crotti: 0.11.0-snapshot is the version of the part of Cider runningn inside Emacs. It's not on Clojars#2016-02-2020:13catonanoas fot the mismatching versions, see what happened to me, just a few lines above#2016-02-2020:15andrea.crottiYes I know, but the problem is that my emacs package is too new right? #2016-02-2020:15andrea.crottiAnd I would need the equivalent clojure backend package? #2016-02-2020:16catonano@andrea.crotti: it's not "too" new. It's new to the right extent 😉#2016-02-2020:16catonanoyes, you need the matching version of the cnREPL package on the clojure side#2016-02-2020:17catonanobut that's injected automatically by the Emacs Cider#2016-02-2020:17catonanoyou don't need to set it up yoursef#2016-02-2020:17catonanoprobably you have a profile.clj file#2016-02-2020:18catonanoand that's forcing the wrong version of the nREPL clojure "backend"#2016-02-2020:18catonanothis was explained to me a few lines above#2016-02-2020:22andrea.crottiAh that might explain another issue as well #2016-02-2020:22andrea.crottiGood to know thanks #2016-02-2020:26benedekJust for the record there is a 0.11.0-snapshot on clojars#2016-02-2020:58sashtonAlso something that got me recently is that if you use clojure 1.6, it will automatically use 10.x cider nrepl, instead of 11#2016-02-2021:13andrea.crottiall sorted by the way simplified my lein_profiles.clj as well, great#2016-02-2021:14andrea.crottithe only annoying thing maybe is that it means you always need internet access when starting a REPL#2016-02-2021:14andrea.crottiif using the snapshot version for the emacs pacakge#2016-02-2021:17benedekthat may be so but same should be true if you use profiles.clj#2016-02-2021:18benedekyou can always make sure that -o is used i guess so your already retrieved snapshot is used#2016-02-2021:19benedek@sashton: i might have missed that but not sure that is actually so#2016-02-2021:22benedekwonder what are the steps you are taking...#2016-02-2021:22sashtonThat was my experience, I had a brand new empty app, no profile dependencies or plugins. With clojure 1.6 it failed with errors, when I switched to 1.7 it worked#2016-02-2021:25sashtonThe cider readme does say that 10.2 is the last version to support 1.6. That's what made me think to switch clojure versions#2016-02-2021:26sashtonAh actually, maybe I misspoke earlier... it doesn't pick up 10.x nrepl, I think it claimed it couldn't find one at all#2016-02-2021:27sashtonIn any case, it didn't work#2016-02-2022:12benedekoh right. I misunderstood. yes, right. 0.11 needs clojure 1.7 or newer. that is basically due to reader conditionals i think#2016-02-2104:28samedhiI am using boot, I can correctly cider-connect to my boot repl. I can also start up a cljs repl by typing (start-repl) within cider-repl. I can confirm that this does work because I can see the results of the following:
boot.user> (start-repl)
<< started Weasel server on ws://127.0.0.1:60722 >>
<< waiting for client to connect ... Connection is ws://localhost:60722
Writing boot_cljs_repl.cljs...
connected! >>
To quit, type: :cljs/quit
nil
cljs.user> (+ 2 3)
5
cljs.user> (js/alert "hello”) ;; The js alert dialog popped up
nil
However, I can’t do any actual cider commands. C-x C-e for instance returns
user-error: `cider-eval-last-sexp' needs a Clojure REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-j’).
Any idea what is going wrong?#2016-02-2108:32benedekmy first guess is that you don't have cider-nrepl on your classpath#2016-02-2120:21samedhi@benedek: Not really sure, have downgraded cider-nrepl from [cider/cider-nrepl “0.11.0-snapshot”] to [cider/cider-nrepl "0.10.2”]. The cljs repl now seem to work again, though naturally I am now getting CIDER's version (0.11.0-snapshot) does not match cider-nrepl's version (0.10.2). Things will break!#2016-02-2120:23benedeknot sure then. and not really an expert on working with boot for cljs. you perhaps better file an issue on cider github#2016-02-2120:23samedhiWill do, thank you.#2016-02-2214:15Lambda/SierraWhen CIDER (0.10.2) pops up an exception for a compilation error, it seems to hide the Compiler's error message that shows the source file and line number where the error occurred. E.g. ..., compiling:(dev.clj:44:3) Is there a way to get it back?#2016-02-2214:28robertofor that reason I normally connect to a repl instead of cider-jack-in. I start the repl in the cli, and use cider-connect.#2016-02-2214:28robertothen exceptions that cider hides, are displayed in the repl#2016-02-2214:29Lambda/SierraYes, there are ways to get at them, in the REPL or *e.#2016-02-2214:29Lambda/SierraBut why doesn't CIDER's pop-up show the message?#2016-02-2214:29robertoi have no idea#2016-02-2214:30robertoas a newbie I have to pick my battles simple_smile#2016-02-2218:20bozhidar@stuartsierra: repro steps, please simple_smile#2016-02-2218:35Lambda/Sierra@bozhidar: OK, I'll see what I can do.#2016-02-2221:26cap10morganIs there a way to suppress the output of evaling a large value in the REPL? I’ve got (def huge-thing …) and just want the var def’d. I don’t need to see the whole value in the REPL.#2016-02-2221:50dorab@cap10morgan: AFAIK, (def x 12) will print #'user/x in the REPL and not 12.#2016-02-2221:51cap10morgan@dorab: I think that used to be true, but either it changed (running CIDER 0.10.2) or I turned on some setting that now makes it do both.#2016-02-2221:53dorab@cap10morgan: I just verified that in my CIDER 0.10.2 it still works the original way. I run a pretty stock CIDER.#2016-02-2221:53cap10morganhmm...#2016-02-2222:05cap10morganI wonder why mine is printing out the value too.#2016-02-2223:49malabarbaSounds like you're overriding def somewhere. #2016-02-2301:47cap10morganI can’t imagine where I would be doing that#2016-02-2302:19malabarba😛 #2016-02-2302:20malabarbaEither that or you have a special print-method defined for vars. #2016-02-2302:21malabarbaDoes this happen consistently? #2016-02-2308:07jonpitherCan you spawn nrepl-middleware requests from within nrepl-middleware?#2016-02-2308:19benedekI think u should be able to. And u should be able to define kinda chains of middlewares too but I could nor really figure that out. Sometimes worked sometimes did not#2016-02-2308:23jonpitherreading clojure.tools.nrepl.server, I can't quite see how nrepl-middlewares are setup in the first place#2016-02-2308:23jonpitheri.e., there's default-middlewares, but how do other ones get added#2016-02-2308:25jonpitherAh, it's cider-nrepl-handler in cider-nrepl#2016-02-2308:27benedekU either explicitly define them or for leinengen u can use a lein plugin for adding them#2016-02-2308:28benedekBoth cider and refactor-nrepl does that#2016-02-2308:28jonpitherYou couldn't spawn a request from inside middleware, as the handler isn't def'd anywhere#2016-02-2308:28benedekBoot is diff a bit as u don't have lein plugins obvs#2016-02-2308:29jonpitherTBH I don't really need to, but just from a theoretical perspective#2016-02-2309:20benedeki meant :expects like :expects #{#'pr-values} (from cider-nrepl source)
doc here: https://github.com/clojure/tools.nrepl#middleware-descriptors-and-nrepl-server-configuration#2016-02-2316:11cap10morgan@malabarba: It happens every time, yes. I should look over my init.el again and see if I cargo-culted anything I didn’t mean to. simple_smile#2016-02-2316:18cap10morgan@malabarba: looks like (setq cider-repl-use-pretty-printing t) was the culprit. is that expected behavior?#2016-02-2316:20malabarba@cap10morgan: It's not. And it's not the first issue we have with the current pretty-printer#2016-02-2316:20malabarbaWe also had some issue with defrecords not being printed appropriately#2016-02-2316:20cap10morgan@malabarba: OK, I’ll file a bug.#2016-02-2316:21malabarbahttps://github.com/clojure-emacs/cider/issues/1505#2016-02-2316:21malabarbaCheck out the one I linked#2016-02-2316:22malabarbaIf you see the same behavior, add a comment there explaining what you observed instead of filing a new one#2016-02-2316:22cap10morgan@malabarba: OK, will do.#2016-02-2316:22cap10morganThanks!#2016-02-2316:23malabarbanp 👍 simple_smile#2016-02-2409:24jan.zy; CIDER 0.10.2 (Java 1.8.0_25, Clojure 1.7.0, nREPL 0.2.12)
user> (try
(throw (Exception. "dupa"))
(catch Exception e (.printStackTrace e)))
;; => nil
#2016-02-2409:24jan.zyhmm#2016-02-2409:24jan.zyHow can I print the stacktrace in repl?#2016-02-2409:26jan.zyuser> (try
(throw (Exception. "dupa"))
(catch Exception e (println "this works")
(.printStackTrace e)))
this works
;; => nil
#2016-02-2409:26jan.zylooks like stderr is redirected somewhere else#2016-02-2409:44bozhidarhmm#2016-02-2409:48bozhidarI can reproduce your behaviour, but I notice there’s actually not stderr from this method call#2016-02-2409:49bozhidaryou can check your nrepl-messages buffer#2016-02-2409:49bozhidarclojure.stacktrace/print-stack-trace works just fine, though#2016-02-2409:59bozhidar@malabarba: this might be some bug in the stderr redirection middleware#2016-02-2410:03jan.zyconfirmed clojure.stacktrace/print-stack-trace works#2016-02-2410:14bozhidarstill, this is definitely a bug in cider#2016-02-2412:25jan.zyis there any hack around that? how can i redirect stderr to where stdout is printed?#2016-02-2415:15bozhidarthere’s no hack#2016-02-2415:16bozhidarmaybe disabling it the middleware will fix this, but I’m not sure#2016-02-2415:16bozhidarhas to be tested#2016-02-2415:16bozhidarif there’s no output coming from nREPL#2016-02-2415:16bozhidarthere’s nothing you can do but find why the output is missing there#2016-02-2415:58malabarbaI'm not sure if our stdout middleware even tries to do anything about stderr #2016-02-2415:58malabarbaProbably not #2016-02-2415:59malabarbaWhich would explain why it's left on the server buffer #2016-02-2508:38bozhidarah, I didn't think about this at all#2016-02-2508:38bozhidarlikely we just forgot about the stderr#2016-02-2508:38bozhidaralthough in this code example it seems to me that the stderr shouldn't be attached to the server process#2016-02-2508:39bozhidar@jan.zy: please, file this as an issue and we'll investigate it further#2016-02-2508:39jan.zyin cider-nrepl?#2016-02-2514:18malabarba@samedhi: Did you file that issue after all? I can't seem to find it now#2016-02-2514:23malabarba@samedhi: Never mind, I'm just being stupid. 😛#2016-02-2516:58sanderIn 0.10.2, I'm often getting Wrong number of arguments: (0 . 0), 1 errors when trying cider commands. I don't get them when calling (load "dash") right before calling the cider command, but am not sure whether it is directly related (got that from https://github.com/clojure-emacs/cider/issues/1343). is there anything I can do to fix it?#2016-02-2517:16bozhidarstop using clj-refactor.el simple_smile#2016-02-2517:16bozhidarcider doesn’t use dash.el anymore, so if you run into a problem like this - it’s definitely outside cider#2016-02-2517:17sanderthanks! i'm not using clj-refactor.el directly but will try to find out what includes dash.el then#2016-02-2517:18sanderok apparently dash was just installed (maybe as a dependency of some old package), removed it simple_smile#2016-02-2517:20sandernot so optional in my setup after all: https://gist.github.com/sander/5ce380b9be68a3e68dbb#2016-02-2517:38sanderreinstalled with only the packages i really need, things work now!#2016-02-2518:27benedekwell, start using clj-refactor.el @sander 😉 and 😜 for @bozhidar#2016-02-2518:27benedekit is a nice package apart from the small beauty spot that it uses dash 😜#2016-02-2518:29benedekactually, just watch a 5mins episode of http://parens-of-the-dead.com simple_smile#2016-02-2518:37benedekhaha checked your gist, it seems clj-refactor is in a good company with magit 😉 — pun aside I understand the reasoning behind as few deps as possible @bozhidar 😉#2016-02-2518:38bozhidarsure, I was just joking myself#2016-02-2518:38bozhidaras usually the dash.el issues are coming from clj-refactor#2016-02-2518:38bozhidarand before this they were coming from cider itself simple_smile#2016-02-2518:38benedekyup i know you were joking, no worries#2016-02-2518:49benedektbh the main value dash still has that it brings elisp dev much closer to clojure coding#2016-02-2520:51fenton@bozhidar: Hi Bozhidar, you can persist the command history to a file?#2016-02-2520:54arrdem@fenton: which history? the repl history?#2016-02-2520:54fenton@arrdem#2016-02-2520:54fentonyes#2016-02-2520:54arrdem@fenton: in the repl buffer just C-x C-s and it'll prompt for a location to save the repl history to.#2016-02-2520:55arrdemthere's also options documented in the CIDER README for saving history on every REPL command as well as for what file to save it too.#2016-02-2520:56arrdemhttps://github.com/clojure-emacs/cider#repl-history#2016-02-2520:56fenton@arrdem okay...sorry i missed that...that is exactly what I'd be looking for!#2016-02-2520:56arrdem@fenton: quite alright happy hacking!#2016-02-2520:57fenton@arrdem: thank you guys for suck an awesome product!!!#2016-02-2520:57fenton*such!#2016-02-2520:57fentonlol#2016-02-2520:57fentonoops#2016-02-2520:57arrdemI can take no credit for cider 😛 I'm just a user.#2016-02-2520:57fenton@arrdem: well thanks for helping me anyway! simple_smile#2016-02-2520:58arrdemI do have a series of fine libraries and http://conj.io which may be useful to you#2016-02-2520:58arrdem/s#2016-02-2520:59fentonah this file only gets written on a clean exit...what wondering about continuous writing to it for recovery from a laptop crash#2016-02-2521:00arrdemI have a snippet for that...#2016-02-2521:00fentonooooh#2016-02-2521:02fentonpray tell ! simple_smile#2016-02-2521:02arrdem(require 'advice)
(advice-add 'cider-repl--add-to-input-history
:after #'(lambda (x)
(cider-repl-history-just-save)))
#2016-02-2521:02arrdemalso
(define-key cider-repl-mode-map (kbd "C-x C-s")
'cider-repl-history-save)
#2016-02-2521:09fenton@arrdem: hmmm...doesn't allow me to enter things in my repl anymore... Is this intended to persist after each command in the REPL? Or requiring an explicit save of it?#2016-02-2521:15arrdem@fenton: advice is a way to chain functions together... that first snippet should just cause history to be saved after every sent command.#2016-02-2521:15arrdemif the history file is set.#2016-02-2521:21fenton@arrdem: ok got it, hist file has to be explicitly set.#2016-02-2606:23bozhidarI'm guessing it makes sense to just bake this into CIDER - the ability to save the history more frequently#2016-02-2606:23bozhidarthe current situation is simply legacy from SLIME#2016-02-2606:24bozhidarwe can also add fancy stuff like project-specific history, which would be pretty cool IMO#2016-02-2607:21benedek+1#2016-02-2617:21nkraftAnyone here using Emacs Cider on OS X? It used to work great but today cider-jack-in gives: "cider-project-type: Symbol's function definition is void: closure-project-dir". Any ideas for fixes?#2016-02-2617:23bozhidarclosure-project-dir?#2016-02-2617:23bozhidaror clojure-project-dir#2016-04-2519:17plexusthat's how it goes with these things. I thought I saw somewhere the regular eldoc-mode works with CIDER now#2016-04-2519:17robertoI was using it to provide minibuffer documentation#2016-04-2519:17robertooh, cool#2016-04-2519:18plexusor it might just be on by default, I don't have anything in my clojure setup to enable it and I'm still seeing function signatures in the minibuffer#2016-04-2519:21robertocool#2016-04-2606:10piotrek@malabarba: Starting nREPL server via /usr/local/bin/boot -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.12.0 repl -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware -s wait…#2016-04-2606:12piotrekthis is was is executed when I use cider-jack-in-clojurescript. It works with my sample project: https://github.com/pbzdyl/cider-boot-cljs#2016-04-2606:13piotrekWhat I think is missing in the command run by cider-jack-in-clojurescript are some dependencies required by boot-cljs-repl (https://github.com/adzerk-oss/boot-cljs-repl#boot-cljs-repl)#2016-04-2606:13piotrekMy project includes them so it works#2016-04-2614:37robertois there a way to clear the entire buffer when pressing C-c-Co?#2016-04-2614:37robertoit used to work before upgrading#2016-04-2614:47hans@roberto: i think C-c M-o is the "official" way to clear the repl buffer#2016-04-2614:49robertothat gives me some weird error: There is no other repl for the current buffer#2016-04-2616:42malabarba@roberto: yes, with a prefix argument it clears the whole buffer #2016-04-2616:43malabarba@piotrek: thanks. I'll try to use that to figure out what went wrong. #2016-04-2623:47preafter upgrading to 0.12.0 I can’t debug forms using C-M-x: “symbol#2016-04-2623:48pre“symbol’s function definition is void: cider—region-for-defnu-at-point"#2016-04-2623:49preis there a dep clash with pjstadig/humane-test-output?#2016-04-2701:49bozhidardid you restart Emacs after doing the package update?#2016-04-2701:50bozhidar@plexus: eldoc is not enabled by default, but just enabling eldoc-mode works out of the box now#2016-04-2701:50bozhidarthat’s why we dropped the custom function#2016-04-2701:50bozhidarestablished practices for the win simple_smile#2016-04-2712:20niquolaHi all, is there some magic config to show ClojureScript/JS exceptions in emacs when evaling expressions by piggyback?#2016-04-2712:41rmuslimov@nicola sorry, I didn’t get that, can you please explain the problem by example?#2016-04-2712:45jonpitherIs there a way to prevent closing parens being on their own line? Want to have it automatically enforced.#2016-04-2712:47niquola@rmuslimov: For cljs i see exceptions in repl, but not in error popup (like in clojure)#2016-04-2712:51niquolaSo i eval expression, awaiting for result, but nothing happens if exception - it would be nice to see red colored popup.#2016-04-2712:54rmuslimovI see, have same behaviour here, actually I would like to make this working too simple_smile#2016-04-2713:08xcthulhuHey, I was wondering if someone could quickly point me to the font face for inline evaluation? I can't read it right since I'm using a white font#2016-04-2714:43bozhidar@xcthulhu: M-x describe-face#2016-04-2714:43xcthulhuty#2016-04-2714:44bozhidarthis particular face is cider-result-overlay-face#2016-04-2714:45xcthulhuCool, I'll go hack it and make sure it makes the font black#2016-04-2717:56aaelonyarghh, it happened again. I switched to another machine with an existing cider version, removed the ~/.emacs.d dir, pointed to melpa, refreshed packages, and installed cider 12.
The repl won't start cider-jack-in though, reporting "Cannot open load file: no such file or directory, cl-generic". This is using Emacs 25.0.50.1.
What is the best way to "start fresh" with cider 12?#2016-04-2718:17aaelonyit's mostly stating: cider-apropos.el:28:1:Error: Cannot open load file: no such file or directory, cl-generic#2016-04-2718:19aaelonyinstalling cl-generic succeeds but then attempting to install cider yields: Package 'highlight-0' is unavailable
#2016-04-2718:29aaelonyok, I removed emacs and reinstalled emacs. re-installed cider, and I get a cider repl now... with a warning that the cider version 0.12.0 does not match cider-nrepl's version (nil). Things will break! No hunting around for where in the heck to set cider-nrepl version (thought I didn't need that..)#2016-04-2718:32aaelonyok, nuked all ~/.emacs.d/elpa dirs related to clojure and cider and re-installed, this time via package-list-packages, now everything works again. Maybe there is something weird with package-install, which didn't work for me. All good now.#2016-04-2718:36aaelonyhuh. Despite the cider repl, it does still say |WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break!
how to fix that? I don't set that anywhere at all.. http://cider.readthedocs.org/en/latest/installation/ doesn't seem to help#2016-04-2718:37dpsutton@aaelony: what version of clojure is specified in the project?#2016-04-2718:37dpsuttonthis error appears when a clojure < 1.7 is used in cider 0.12#2016-04-2718:37aaelony[org.clojure/clojure "1.8.0"]#2016-04-2718:37aaelonylein did that#2016-04-2718:38dpsuttonlein did what?#2016-04-2718:38aaelonylein chose the version of clojure#2016-04-2718:38aaelonyvia lein new#2016-04-2718:38dpsuttonah ok#2016-04-2718:39aaelonyLeiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM#2016-04-2718:39dpsuttoncan you post the project.clj file here?#2016-04-2718:39aaelonysure, it's rather bare#2016-04-2718:39aaelony(defproject mapviz "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[rhizome "0.2.5"]
]) #2016-04-2718:40dpsuttonah. i think i might know what's up#2016-04-2718:40xcthulhurhizome is using Clojure 1.6.0#2016-04-2718:40dpsuttonrhizome requires clojure 1.6#2016-04-2718:40aaelonyis it rhizome?#2016-04-2718:40xcthulhulol#2016-04-2718:40aaelonylet me remove it and see#2016-04-2718:41xcthulhuYeah, you need to exclude the clojure that project ropes in#2016-04-2718:41dpsuttoni'm not sure what the resolution is when multiple versions of clojure are specified#2016-04-2718:41dpsuttoni raised an issue on that with zach to update it but I haven't heard anything back#2016-04-2718:41dpsuttonall of the tests pass with clojure 1.8#2016-04-2718:41dpsuttonyou could create a pull request for him against clojure 1.8#2016-04-2718:41aaelonyIf I remove rhizome I still get the cider warning though...#2016-04-2718:42xcthulhu[rhizome "0.2.5"] => [rhizome "0.2.5" :exclusions [[org.clojure/clojure]]] #2016-04-2718:42xcthulhuOh?#2016-04-2718:42aaelonyI've tried: (defproject mapviz "0.0.1-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
;; [rhizome "0.2.5"]
]) #2016-04-2718:42aaelonymaybe I'll delete it entirely#2016-04-2718:42dpsuttondon't worry about that#2016-04-2718:42xcthulhulein clean#2016-04-2718:42dpsuttonhow did you restart the repl#2016-04-2718:42dpsuttoni'm guessing the artifiact is still laying around#2016-04-2718:43aaelonyjust did lein clean and the cli#2016-04-2718:43aaelonywarning is still there#2016-04-2718:43aaelonyI don't think it is rhizome dependent#2016-04-2718:43dpsuttoncan you restart emacs?#2016-04-2718:43aaelonyI've done so (many times)#2016-04-2718:44dpsuttonsince you removed the rhizome dependency?#2016-04-2718:44aaelonytwice#2016-04-2718:45xcthulhuHmm... I wonder what # ls -d ~/.emacs.d/elpa/*cider* says at the CLI#2016-04-2718:45xcthulhuMaybe you have an old version of CIDER kicking around#2016-04-2718:45aaelonywait... the require was still pointing to rhizome... my bad#2016-04-2718:45aaelonyre-trying#2016-04-2718:46aaelonynope still gives the warning. project.clj contains only clojure 1.8.0 and the core.clj file contains (ns mapviz.core), and nothing else#2016-04-2718:46aaelony;; Connected to nREPL server -
;; CIDER 0.12.0 (Seattle), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_20
#2016-04-2718:46aaelonyWARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break!
#2016-04-2718:48xcthulhuI'm sorry this is so painful dude. Have you tried upgrading JAVA?#2016-04-2718:48aaelonybefore the connection I see: Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.12.0\"\] -- repl :headless...
#2016-04-2718:49aaelonyI could upgrade java, i guess...#2016-04-2718:49xcthulhuAnother idea might be to make sure that ~/.m2/repository/cider/cider-nrepl/ only has one subdirectory 0.12.0#2016-04-2718:49xcthulhuAnd then wipe your ~/.emacs.d/elpa dir#2016-04-2718:50xcthulhu(I had to program my .emacs.d to auto-detect whether to install stuff because I had to wipe that so many times)#2016-04-2718:50aaelonywow that might be it! $ ls -1 ~/.m2/repository/cider/cider-nrepl/
0.10.0-SNAPSHOT/
0.10.1/
0.11.0/
0.12.0/
0.2.7/
0.7.0/
0.8.1/
0.8.2/
0.9.1/
#2016-04-2718:50aaelonyI'll nuke that stuff#2016-04-2718:51xcthulhuSounds like a good idea, all I've got in mine is 0.11.0 and 0.12.0#2016-04-2718:52aaelonyno change... 😞#2016-04-2718:52aaelonyInteresting though that it believes the version is nil... WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break!
#2016-04-2718:52xcthulhuBummer#2016-04-2718:52xcthulhuWhere did you get CIDER? MELPA-Stable?#2016-04-2718:52aaelonymelpa#2016-04-2718:53aaelonyhttp://stable.melpa.org#2016-04-2718:53xcthulhuOkay so melpa-stable then#2016-04-2718:53aaelonyOpening TLS connection to `'...done
#2016-04-2718:54aaelonythere should be some kind of sanity clean everything mode before starting the install...#2016-04-2718:55aaelonyI guess I can upgrade java... but doubt that's it#2016-04-2718:55aaelonyI can easily get a repl via lein repl#2016-04-2718:55dpsuttoni ran into an issue like this and resolved it by edebug instrumenting cider-jack-in#2016-04-2718:55xcthulhuI don't know things only started working for me with 0.12.0 last month I was in your boat#2016-04-2718:56dpsuttonstep through the jack in function and see what's up#2016-04-2718:56aaelonyI've only had issues with boxes that had a previous cider install#2016-04-2718:56aaelonyeach time it's something different#2016-04-2718:57aaelonythis is (now) from mac os 10.9.5#2016-04-2718:57dpsuttonparticularly the middleware check#2016-04-2718:57aaelonymaybe a list of all the things to check...#2016-04-2718:57xcthulhuSorry buddy. I suppose this is a bridge too far, but here's my Makefile for my .emacs.d file where I wrote "install" to nail this dumb problem#2016-04-2718:57xcthulhuhttps://github.com/xcthulhu/config-files/blob/master/.emacs.d/Makefile#2016-04-2718:59xcthulhuI'd make sure lein and java are upgraded before diving into edebug#2016-04-2718:59aaelonyinstalled java 8 update 91#2016-04-2718:59xcthulhuHmm... lein --version ?#2016-04-2719:01aaelonyLeiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM#2016-04-2719:01aaelonyhmmm, I might have to select that java version#2016-04-2719:01xcthulhuMaybe#2016-04-2719:01xcthulhuAnother thought: try lein deps :tree in your virginal project#2016-04-2719:02xcthulhuIn particular if something is depending on tools.nrepl or cider-nrepl then you'll still have lein hit the wrong versions of things#2016-04-2719:03aaelonyI also have a ~/lein/profiles.clj that might be interfering... {:user {:plugins [
[lein-ancient "0.5.5"]
[criterium "0.3.1"]
[http-kit/lein-template "1.0.0-SNAPSHOT"]
[lein-gorilla "0.3.4"]
[lein-try "0.4.3"]
]
}
}#2016-04-2719:03dpsuttonthe function cider--connected-handler is what sets up the communication. It calls (cider--check-middleware-compatibility) to check the compatibility. This is what prints the message that you are seeing. It may be worth your while to instrument the cider--check-middleware-compatibility function to see what it sees#2016-04-2719:04aaelonystill unchanged#2016-04-2719:04xcthulhuaaelony: That might be doing it... what does lein deps :tree spit out?#2016-04-2719:05aaelonyafter removing the ~/.lein/profiles.clj, it reports now: $ lein deps :tree
[clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.8.0"]
[org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]
#2016-04-2719:05aaelonyclojure-complete??#2016-04-2719:05xcthulhuOne of your plugins I guess#2016-04-2719:06aaelonyI'm ok with nuking everything to start fresh#2016-04-2719:06dpsuttoncan you jack-in without the dependenices?#2016-04-2719:06dpsuttondon't do that quite yet#2016-04-2719:06dpsuttonand even if you get the warning, jack in and run a command#2016-04-2719:06dpsutton*clojure-version* or (clojure-version)#2016-04-2719:06aaelonyhow to jack-in without dependencies?#2016-04-2719:06dpsuttoni meant removing the lein profiles thing#2016-04-2719:06aaelonythat's gone#2016-04-2719:06dpsuttonbut just run a standard jackin#2016-04-2719:07dpsuttoncriterium looks outdated. i checked their repo and they are on 0.4.4#2016-04-2719:07aaelonyI removed the ~/.lein/profiles.clj entirely#2016-04-2719:07dpsuttonok. what's the result of jacking in now#2016-04-2719:07aaelonythen lein clean#2016-04-2719:07aaelonythe only dependency is : :dependencies [[org.clojure/clojure "1.8.0"]]
#2016-04-2719:08aaelonysame warning... WARNING: CIDER's version (0.12.0) does not match cider-nrepl's version (nil). Things will break!#2016-04-2719:08dpsuttonand what's the output of running (clojure-version)#2016-04-2719:08aaelonyuser> *clojure-version*
{:major 1, :minor 8, :incremental 0, :qualifier nil}
user> (clojure-version)
"1.8.0"
user> #2016-04-2719:08dpsuttonhmm. weird#2016-04-2719:09aaelonytempted to remove then reinstall the packages for clojure and cider#2016-04-2719:10aaelonyjust did rm -rf ~/.emacs.d/elpa/
and about to re-install#2016-04-2719:11xcthulhuGood luck.#2016-04-2719:12aaelonythanks... repl is back with the same warning though...#2016-04-2719:12aaelonyokay, enough on this.. will have to pursue it later... 😞#2016-04-2719:14dpsuttonwell i think it is time to edebug the functions i mentioned earlier#2016-04-2719:16aaelonyhow would I edebug?#2016-04-2719:17dpsuttonjust go to that function and C-u C-M-x#2016-04-2719:18dpsuttonthen the next time the function is called it will let you step in#2016-04-2719:18aaelonyC-u M-x cider--connected-ha [No match]
#2016-04-2719:18dpsuttonhowever there isn't much in that function#2016-04-2719:19dpsuttonits not interactive so M-x shouldn't see it#2016-04-2719:19dpsuttonC-h C-f will navigate straight to it#2016-04-2719:20dpsuttonthe function just takes values out of a dictionary#2016-04-2719:20aaelonywhich function?#2016-04-2719:20dpsuttoncider-check-required-nrepl-version#2016-04-2719:20dpsuttonand check-middleware-compatibility#2016-04-2719:21aaelonyI'm confused... user> (cider-check-required-version)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: cider-check-required-version in this context, compiling:(*cider-repl mapviz*:44:6)
#2016-04-2719:21dpsuttonthose are emacs functions#2016-04-2719:21dpsuttonyou will be debugging cider#2016-04-2719:21aaelonyah okay.#2016-04-2719:21dpsuttonyou don't run these in clojure#2016-04-2719:21aaelonyI don't know elisp#2016-04-2719:21dpsuttonwhen you run cider-jack-in, these functions are called#2016-04-2719:22aaelonyI can read up on that, but I fear there is too much there to grok#2016-04-2719:22aaelonyfor now#2016-04-2719:25dpsuttonyou should be able to just press n to keep stepping next and c to continue or q to quit#2016-04-2719:25dpsuttonit'll highlight the expression that its on and display the value. its actually quite nice and easy#2016-04-2719:55aaelonyfrom which starting point?#2016-04-2719:59dpsuttoni'm not sure i know what you mean#2016-04-2719:59aaelonywhere and when should I press n to keep stepping next...?#2016-04-2720:00dpsuttonif you instrumented the function with C-u C-M-x then when you run cider-jack-in it will launch the debugger#2016-04-2720:00aaelonyI'm basically launching a bare lein project and launching cider, and seeing the warning. that's it.#2016-04-2720:01aaelonyI don't know what it means to "instrument a function"#2016-04-2720:01dpsuttonnavigate to the function you want to debug (cider-jack-in) and run C-u C-M-x#2016-04-2720:02dpsuttonyou are setting a breakpoint in elisp code that you want to debug#2016-04-2720:02dpsuttonthen, when that function is called, it lets you step through it#2016-04-2720:02aaelonyhow do I find cider-jack-in to navigate to it? where is it?#2016-04-2720:02dpsuttoninstrument is a weird word for set a break point#2016-04-2720:02dpsuttonC-h C-f cider-jack-in#2016-04-2720:02aaelonykk#2016-04-2720:02dpsuttonsuper cool thing in emacs. that will navigate to the source code#2016-04-2720:02dpsuttonC-h f will show the documenation for a function#2016-04-2720:03aaelonyNo `cider-jack-in' in index#2016-04-2720:03aaelonythe C-h f works though#2016-04-2720:04aaelonyah, from *scratch* this works#2016-04-2720:04dpsuttonwell, the file you want is in cider.el in the elpa directory where emacs downloads its packages#2016-04-2720:04aaelonyI see now.. thanks, never done that#2016-04-2720:04dpsuttonno problem#2016-04-2720:04aaelonyless of a black box now!#2016-04-2720:05dpsuttonemacs gets amazing when you learn a few conventions#2016-04-2720:05aaelonyit's great#2016-04-2720:05dpsuttonabsolutely. it seems really complicated but lots of smart and creative people have been working on it for a long time#2016-04-2720:05aaelonyknowing where to look is the hardest part#2016-04-2720:06dpsuttonthe fun thing is that you get used to bouncing around to the source. basically, if emacs knows about it, C-h C-f will navigate to it#2016-04-2720:06aaelonyyes, I was in my core.clj file though, and that wouldn't work. From *scratch* it's nice.#2016-04-2720:07aaelonyso now, I can step through the code by navigating to cider-jack-in and pressing n ?#2016-04-2720:07aaelonyI'll read up... lol#2016-04-2720:08dpsuttonnot by navigating to cider-jack-in, but just by invoking the function#2016-04-2720:08dpsuttonie, in a clojure project run C-c M-j, the shortcut for cider jack in#2016-04-2720:08dpsuttonyou "set a breakpoint" on this functino, so when you call it it will debug it#2016-04-2720:08aaelonyC-M-x cider-jack-in worked#2016-04-2720:08aaelonycool, I'll tinker with this#2016-04-2720:10dpsuttonno problem.#2016-04-2720:10dpsuttonyou basically have all the tools now. feel free to edit the cider code, etc#2016-04-2720:11aaelonythanks, at some point as a result I'll know elisp 😉#2016-04-2720:11dpsuttonthen you'll end up cloning the git repo, adding that location to your load path, and then running your own custom cider#2016-04-2720:11aaelonymight be a while ...#2016-04-2720:25xcthulhu@aaelony: Happy you figured everything out 😄#2016-04-2721:05aaelonyyes, interestingly the cider-repl mostly works (so far) despite the warning. Also interested in digging into understanding cider.el but that will be a slow process to ease into over time#2016-04-2721:56malabarba@aaelony: you're not the first to inexplicably see that warning. Maybe there's something wrong with the checker function.#2016-04-2721:57malabarbaDoes documentation work for you? Invoke C-c C-d C-d on a symbol. #2016-04-2721:57malabarbaEvaluation can work even without the cider midddleware, but if documentation works then you definitely have the midddleware. #2016-04-2721:58aaelonyI get a "Doc for:" prompt#2016-04-2721:58malabarbaType inc and hit RET #2016-04-2721:58aaelonyWrong type argument: stringp, nil
#2016-04-2721:59malabarbaHm. And this is with a repl running?
#2016-04-2721:59malabarbaI mean, it's after Jack in? #2016-04-2721:59aaelonycorrect#2016-04-2721:59aaelonyyes#2016-04-2722:00aaelonyso that's likely an issue#2016-04-2722:01malabarbaOK. Then I think you don't have the midddleware #2016-04-2722:01malabarbaTry upgrading your leiningen #2016-04-2722:01malabarbaI think you're a couple of minor versions behind #2016-04-2722:01aaelony$ lein version
Leiningen 2.6.1 on Java 1.8.0_20 Java HotSpot(TM) 64-Bit Server VM
#2016-04-2722:01aaelonyis that not current?#2016-04-2722:03aaelonyI'm on mac os x with a brew installed lein. Brew refuses to upgrade further... I suppose I could grab something from github though if I override it#2016-04-2722:06malabarbaMy bad#2016-04-2722:07malabarbaI thought the most recent was 2.6.3#2016-04-2722:07malabarbabut you're on the most recent#2016-04-2722:09aaelonyok, good to know#2016-04-2804:16escherizecider debugger--- thanks you guys it rocks my socks#2016-04-2804:17escherize😂👍:skin-tone-3:👏:skin-tone-3:metalmetal#2016-04-2818:40preI’m unable to get cider debugger in 0.12, though I used it extensively in 0.11. I requested help earlier this week and I still can’t figure out what’s missing. Does anyone know how to debug the debugger!#2016-04-2818:43preI start a repl manually on a lein profile with a headless port.#2016-04-2819:03preThe error message after C-u C-M-x is generic: symbol’s function definition is void: cider—region-for-defun-at-point#2016-04-2819:06malabarba@pri: try reinstalling CIDER. Looks like a bad compilation issue #2016-04-2819:06malabarbaI still don't understand why so many people have this. #2016-04-2819:06preWill do.#2016-04-2819:06malabarbaPackage.el is not that incompetent #2016-04-2819:06preI’m using cask#2016-04-2819:06malabarbaAh #2016-04-2819:07malabarbaThen I guess all bets are off. 😛 #2016-04-2819:09preGiven that I can manage dependencies at the top-level, I assume cask is better at managing them. Oh well simple_smile#2016-04-2819:09preDo you see any conflicts with this dependency list https://github.com/priyatam/emacs.d/blob/master/Cask#2016-04-2819:45xcthulhuIt looks like it might be using the CIDER in Marmalade rather than melpa-stable#2016-04-2819:45xcthulhuNot sure how cask works, I have my own home-brewed thing that I use#2016-04-2820:12preI reordered the list with melpa-stable, followed by marmalade. Reinstalled all my Emacs deps from scratch. Still same error.#2016-04-2820:34dpsuttoni'm looking and i don't see any function named cider--region-for-defun-at-point#2016-04-2820:40precider-version=0.12.0, clojure-mode: 5.3.0, cider-nrepl=0.12.0#2016-04-2820:41preI also removed my ~/.lein/profiles.clj#2016-04-2821:02dpsuttoncan you tell me the result of *clojure-version* ?#2016-04-2821:02dpsuttonevaluated in the clojure repl?#2016-04-2821:03pre1.7.0#2016-04-2821:29malabarba@pri I just don't use marmalade at all.#2016-04-2821:32malabarba@pri: And the function you're getting the error for doesn't even exist anymore#2016-04-2821:32malabarbaSo you're clearing fetching an old cider somehow#2016-04-2821:33malabarbado M-x toggle-debug-on-error. When you reproduce the error you'll get a backtrace#2016-04-2821:34malabarbaThis will tell you which is the function that is trying to call cider—region-for-defun-at-point#2016-04-2821:34malabarbaYou can then click through to the function's source, and that should pinpoint the problem.#2016-04-2821:35prelet me try.#2016-04-2821:40prethe debugger throws at https://github.com/clojure-emacs/cider/blob/master/cider-interaction.el#L1162#2016-04-2821:40prehowever the top error is different: Debugger entered--Lisp error: (void-function cider--region-for-defun-at-point)
cider--region-for-defun-at-point()
ad-Advice-cider-eval-defun-at-point((closure (t) (&optional debug-it) "Evaluate the current toplevel form, and print result in the minibuffer.\nWith DEBUG-IT prefix argument, also debug the entire form as with the\ncommand `cider-debug-defun-at-point'." (interactive "P") (let ((inline-debug (eq 16 (car-safe debug-it)))) (if debug-it (progn (if (derived-mode-p (quote clojurescript-mode)) (progn (if (y-or-n-p ...) (progn ...)) (user-error "The debugger does not support ClojureScript"))) (if inline-debug (progn (cider--prompt-and-insert-inline-dbg))))) (cider-interactive-eval (if (and debug-it (not inline-debug)) (progn (concat "#dbg\n" (cider-defun-at-point)))) nil (cider-defun-at-point (quote bounds))))) (4))
apply(ad-Advice-cider-eval-defun-at-point (closure (t) (&optional debug-it) "Evaluate the current toplevel form, and print result in the minibuffer.\nWith DEBUG-IT prefix argument, also debug the entire form as with the\ncommand `cider-debug-defun-at-point'." (interactive "P") (let ((inline-debug (eq 16 (car-safe debug-it)))) (if debug-it (progn (if (derived-mode-p (quote clojurescript-mode)) (progn (if (y-or-n-p ...) (progn ...)) (user-error "The debugger does not support ClojureScript"))) (if inline-debug (progn (cider--prompt-and-insert-inline-dbg))))) (cider-interactive-eval (if (and debug-it (not inline-debug)) (progn (concat "#dbg\n" (cider-defun-at-point)))) nil (cider-defun-at-point (quote bounds))))) (4))
cider-eval-defun-at-point((4))
#2016-04-2821:41prethe error points to cask's 0.12.0 cider source.#2016-04-2821:41malabarbaYou have an advice there#2016-04-2821:41preI was wondering too.#2016-04-2821:41prehow can I find who added that?#2016-04-2821:42malabarbaC-h f cider-eval-defun-at-point#2016-04-2821:42malabarbadepending on your Emacs version#2016-04-2821:42malabarbashould give you a link to see the advice#2016-04-2822:10prefixed!#2016-04-2822:10malabarbaGreat#2016-04-2822:10prehttps://github.com/clojure-emacs/cider-eval-sexp-fu is the aspect#2016-04-2822:10malabarbawhere was it?#2016-04-2822:10preI removed it from my dep#2016-04-2822:10malabarbahmm#2016-04-2822:10preDo you want me to file a bug?#2016-04-2822:11malabarbaYes#2016-04-2822:11malabarbaIt might be fixed in the snapshots#2016-04-2822:11malabarbabut even then, it's a bug that it's not tagged stable yet#2016-04-2822:11preOk, thanks for your help.#2016-04-2822:28preI can’t live without cider debug.#2016-04-2907:14bbssHey cider loving folks, I just started to switch away from intellij towards spacemacs. So far so good. But I am running into an issue after running cider-jack-in-clojurescript#2016-04-2907:15bbssI am connecting to a chrome extension. And so figwheel needs this option: :figwheel {:websocket-url ""}#2016-04-2907:16bbssSeems that is not working when running with this approach. Any ideas where I can look?#2016-04-2908:06plexus@bbss have a look here https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#integration-with-emacscider#2016-04-2908:07bbss@plexus, thanks I did follow that one.#2016-04-2908:07plexusyeah I just realized that's probably not the issue#2016-04-2908:08bbssYeah I think somehow the :figwheel option in [:cljsbuild :builds] build object is not being passed.#2016-04-2908:08bbssBut I am pretty new to emacs (second day trying)#2016-04-2908:09plexusit does work from lein figwheel or lein repl ?#2016-04-2908:09bbsslet me have a look, usually run script/figwheel.clj using intellij cursive#2016-05-1007:37slipsetit makes writing tests worth while simple_smile#2016-05-1007:38slipsetCurious though, I see from the code that it’s run from cider-file-loaded-hook#2016-05-1007:39slipsetis there a cider-file-saved-hook so I could run the tests when the file is saved?#2016-05-1007:41slipsetAlso, I understand that the suggestion I’m about to make would wreak-havoc, but normally, when I run C-cl in foo.clj it’s foo.clj I want to reload, but today I’m being prompted. Could I suggest that C-cl loads current file if it’s a clojure file, and maybe add a prefix, C-u C-cl to load some other file?#2016-05-1012:31dpsuttoni'm looking to add the variable information to the popup windows according to issue 1737. I'm running the debugger looking at the messages popping up and I was hoping they would leave some information in Messages about where I might start investigating the call stack, but i'm not really seeing it#2016-05-1012:31dpsuttonWhere's the best place to grab a handle on some part of the call stack and investigate the best place to add in the locals information#2016-05-1015:20malabarba@dpsutton I think there's already an open PR for that though. simple_smile #2016-05-1015:20dpsuttonah. haha ok#2016-05-1015:20dpsuttonneed to make sure to check both from now on:)#2016-05-1015:21malabarbaHehe #2016-05-1015:21malabarbaCider's been pretty active lately 😄 #2016-05-1015:22malabarba@slipset: i think you're looking for C-c C-k. That should load the buffer without prompting. #2016-05-1016:39slipset@malabarba: thanks!#2016-05-1020:24preHas anyone been able to get fipp pretty-print working on lein repl and cider-nrepl consistently on cider 0.12.0?#2016-05-1020:28premy workflow: I start a lein profile with repl headless and connect to it from cider. I don’t jack-in because I need to switch profiles and I have no idea who to jack-in with them. I added mvxcvi/whidbey “1.3.0” in global lein profiles, and set this in emacs (setq cider-pprint-fn "puget.printer/pprint”). Still, I don’t see pprint on console or cider repl inline.#2016-05-1020:28preI tried with plain puget as well, no results#2016-05-1020:29preI had this working in cider 0.10.0#2016-05-1021:42bozhidaryou can submit an issue#2016-05-1021:42bozhidarmaybe there was some regression#2016-05-1021:42bozhidarI rarely use pretty-printing, so not noticing this is possible#2016-05-1022:14malabarba@brian_mingus yes, I did write aggressive-indent-mode. What's the file that's giving you trouble? #2016-05-1022:15brian_mingusit's not public, but it's deeply nested and so i know to disable the mode when i open it#2016-05-1022:15brian_mingusit's a monster compojure data structure#2016-05-1022:15malabarbaAggressive-indent-mode can be slow on files with huge top-level sexps. #2016-05-1022:16malabarbaSadly there's not much to do about it other than disable it. #2016-05-1107:08arrdemSorry about the ungodly hour, but if someone could merge this it'd be great. https://github.com/clojure-emacs/cider-nrepl/pull/356#2016-05-1108:35wagjolatest commit broke the cider-nrepl, it throws with see-also.edn not found. probably a wrong path at https://github.com/clojure-emacs/cider-nrepl/commit/089fda4c141208d2a896136a4eb9370deffd40b1#diff-7e5759ae416dd076f6227ef23d80414dR143 (`see-also.edn` seems to be packeded so it's in the root class-path, not under resources)#2016-05-1108:37wagjoAh I'm late to the party#2016-05-1108:40plexus@wagjo I just opened a PR to get feedback simple_smile https://github.com/clojure-emacs/cider-nrepl/pull/357#2016-05-1108:42plexusif you want to get the workaround now you can do#2016-05-1108:42plexusgit clone -b see-also-fix
cd cider-nrepl
lein install
#2016-05-1108:43wagjothanks, for now I disabled cider-nrepl altogether simple_smile#2016-05-1108:43plexusI guess that also works simple_smile#2016-05-1108:45wagjoit would also be nice if the file itself was not in the root of the classpath#2016-05-1108:45plexusI was really confused first because I was trying to use cider for org-babel so I was convinced it was something with my org-mode setup, then I tried it in another project and it also blew up simple_smile#2016-05-1108:45plexusgood point, I guess it might shadow or be shadowed by another file#2016-05-1108:46plexushow would you do it? put it under resources/cider-nrepl/see-also.edn or something?#2016-05-1108:52wagjoyeah, this or resources/cider/nrepl/see-also.edn#2016-05-1109:14vschepik@plexus: Thanks for your workaround. I ran into the problem just now when doing a fresh install of cider on a new machine.#2016-05-1109:44cskkscI apologise for this major fuck up. Don’t hate simple_smile#2016-05-1109:59plexushehe no worries simple_smile CIDER has been pretty stable lately and has seen a lot of new development, so that's great. People running from -SNAPSHOT should be prepared for some occasional breakage#2016-05-1110:15jan.zyHi, when I started CIDER today I saw the following error in Messages:
Starting nREPL server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.13.0-SNAPSHOT\"\] -- repl :headless...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException: resources/see-also.edn (No such file or directory), compiling:(info.clj:143:38)
at clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3657)
clojure.lang.Compiler$NewExpr.eval (Compiler.java:2568)
clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3651)
clojure.lang.Compiler$DefExpr.eval (Compiler.java:451)
clojure.lang.Compiler.eval (Compiler.java:6932)
#2016-05-1110:16jan.zyahh, you already noticed that simple_smile#2016-05-1110:20jonpitherMy emacs has starting occasionally crashing in windows when using CIDER. Anyone seen this? Not saying CIDER is responsible. Just did a packages upgrade, hoping someone else is seeing..#2016-05-1110:22aspraDamn... at first I couldn’t pin-point what is going on simple_smile Oh well, snapshot version at our own risk#2016-05-1110:24jan.zycoming back to see-also.edn problem I deleted broken jar from my .m2 folder :
/Users/jan/.m2/repository/cider/cider-nrepl/0.13.0-SNAPSHOT:
total used in directory 3424 available 10493789
drwxr-xr-x 26 jan staff 884B May 11 12:22 .
drwxr-xr-x 23 jan staff 782B Apr 25 01:08 ..
-rw-r--r-- 1 jan staff 209B May 11 12:22 _maven.repositories
-rw-r--r-- 1 jan staff 322K Apr 25 01:08 cider-nrepl-0.13.0-20160424.042936-2.jar
-rw-r--r-- 1 jan staff 40B Apr 25 01:08 cider-nrepl-0.13.0-20160424.042936-2.jar.sha1
-rw-r--r-- 1 jan staff 3.2K Apr 25 01:08 cider-nrepl-0.13.0-20160424.042936-2.pom
-rw-r--r-- 1 jan staff 40B Apr 25 01:08 cider-nrepl-0.13.0-20160424.042936-2.pom.sha1
-rw-r--r-- 1 jan staff 323K May 4 11:50 cider-nrepl-0.13.0-20160504.055219-4.jar
-rw-r--r-- 1 jan staff 40B May 4 11:50 cider-nrepl-0.13.0-20160504.055219-4.jar.sha1
-rw-r--r-- 1 jan staff 3.2K May 4 11:50 cider-nrepl-0.13.0-20160504.055219-4.pom
-rw-r--r-- 1 jan staff 40B May 4 11:50 cider-nrepl-0.13.0-20160504.055219-4.pom.sha1
-rw-r--r-- 1 jan staff 323K May 10 09:57 cider-nrepl-0.13.0-20160508.163905-6.jar
-rw-r--r-- 1 jan staff 40B May 10 09:57 cider-nrepl-0.13.0-20160508.163905-6.jar.sha1
-rw-r--r-- 1 jan staff 3.2K May 10 09:57 cider-nrepl-0.13.0-20160508.163905-6.pom
-rw-r--r-- 1 jan staff 40B May 10 09:57 cider-nrepl-0.13.0-20160508.163905-6.pom.sha1
-rw-r--r-- 1 jan staff 769B May 11 11:35 maven-metadata-annadale.xml
-rw-r--r-- 1 jan staff 41B May 11 11:35 maven-metadata-annadale.xml.sha1
-rw-r--r-- 1 jan staff 769B May 11 11:35 maven-metadata-clojars.xml
-rw-r--r-- 1 jan staff 40B May 11 11:35 maven-metadata-clojars.xml.sha1
-rw-r--r-- 1 jan staff 234B May 11 11:35 resolver-status.properties
#2016-05-1110:25jan.zynow, how can I force CIDER to user 20160508 version and not to download today version once again?#2016-05-1110:27jan.zyhmm, actually cloning and installing patched version from github was uber-fast#2016-05-1110:27jan.zythanks @plexus!#2016-05-1114:21bozhidarsorry about this#2016-05-1114:21bozhidarI’ve merged @arrdem’s fix#2016-05-1114:21bozhidarI’ve been pretty busy lately and haven’t been reviewing PRs as carefully as I usually do#2016-05-1114:22bozhidaranyways, when you see the new feature in action#2016-05-1114:22bozhidaryou’re probably going to forgive us the downtime#2016-05-1114:22bozhidarit’s pretty cool simple_smile#2016-05-1114:32arrdem@bozhidar: I could have merged that 8hrs earlier if I had merge access :P#2016-05-1114:32arrdemAlso good morning thanks for taking that #2016-05-1114:33bozhidarsimple_smile#2016-05-1114:33bozhidaryou’re welcome#2016-05-1114:33bozhidardo some more cider work and you’re bound to get merge access 😉#2016-05-1114:33bozhidar(still people also need to be able to push to Clojars)#2016-05-1114:33arrdemNow where have I heard that before... #2016-05-1114:34arrdemWait your ci doesn't deploy? Heathens. #2016-05-1114:35arrdemIt would be nice if the tests actually built and ran there jar so this doesn't happen again. I may take a swing at that later. #2016-05-1114:56bozhidarhehe#2016-05-1114:56bozhidarI wouldn’t mind this#2016-05-1114:57bozhidargetting travis involved in the deployment has been on my todo for a while#2016-05-1116:47agile_geekcircleci is nice too#2016-05-1117:46bozhidarguess so#2016-05-1117:47bozhidarI just use travis by default, as a few years ago it was the only ci with the explicit goal of providing trivial github integration#2016-05-1118:09malabarbaWe could set up an instance on AWS that builds and deploys the latest master. Travis already lets you ping a webhook when all builds pass, so they'd be trivial to integrate. #2016-05-1118:10malabarbaAnd AWS instances are pretty cheap AFAIK, so it wouldn't take a noticeable bite out of the donations. #2016-05-1118:42dpsuttonI'd be down with sponsoring a year of that#2016-05-1118:42dpsuttonif you can estimate the cost I can make a contribution of that amount#2016-05-1200:33arrdemIs there a way I can make the CIDER "eval form" result overlay persist rather than disappearing when I do anything? A common pattern in my code is that I'll have macros generating several defs. I'd like to be able to eval every form in the file and have the overlay display the result of each macro which is the vector of vars created by that macro.#2016-05-1204:40malabarba@arrdem yes. You can configure the duration of the overlay. Set it to nil and it stays around indefinitely. #2016-05-1204:40malabarbaI always forget the name of the variable #2016-05-1204:41malabarbaBut you can find it if you browse around the customise menu #2016-05-1204:49arrdem@malabarba: nice, I'll check it out. #2016-05-1214:32malabarba@arrdem could you file a quick issue about the screenshots? Just so we don't forget#2016-05-1216:25brian_mingusis there a way to have multiple repls open and to toggle between them as the target for code evaluation?#2016-05-1216:29jcsims@brian_mingus: it’s been a couple months since I’ve used it, but cider-rotate-default-connection will rotate through (and display) the active connection#2016-05-1216:29jcsimsbound to C-c M-r by default, I think#2016-05-1216:30jcsims@bozhidar and @malabarba (among others I’m sure): thanks guys for all your hard work on Cider. It’s a treat to use#2016-05-1216:30brian_mingushmm, C-c M-r is undefined for me#2016-05-1216:30brian_mingusi have CIDER 0.12.0snapshot (package: 20160404.239), nREPL 0.2.12#2016-05-1216:31jcsimsI’m on 0.12.0 stable - maybe try a C-h f on the function name?#2016-05-1216:31jcsimsit might only be available when you have an active connection already#2016-05-1216:31jcsimsor after Cider’s loaded#2016-05-1216:32brian_mingusit works only in a clj buffer#2016-05-1216:32brian_mingusthanks simple_smile#2016-05-1216:37brian_mingusanother question - is there a way to get C-c C-e to pretty-print the output ?#2016-05-1216:37jcsimshmm I don’t know the answer to that one 🙂#2016-05-1216:38jcsimsfor more info on managing repl connections, though: https://cider.readthedocs.io/en/latest/managing_connections/#2016-05-1217:27jonas@brian_mingus: C-c C-p#2016-05-1217:28brian_mingus@jonas: looking for cider-pprint-eval-last-sexp-to-repl#2016-05-1217:28brian_mingusfiled a ticket requesting it#2016-05-1218:12arrdem@malabarba: willdo.#2016-05-1218:18trissHope this is the right place to ask - Does anyone know if clj-refactor can rename a whole project? If so can it do so via CIDER in emacs?#2016-05-1218:21arrdemRename a whole project? What do you mean by that?#2016-05-1218:21arrdemAs in change all the namespaces to share some other common prefix?#2016-05-1219:07malabarbaClj-refactor can rename directories #2016-05-1219:08malabarbaWhich recursively renames all the namespaces inside that directory #2016-05-1219:09malabarbaYou should be able to use it to rename src/old_project/ to src/nee_project/#2016-05-1219:09malabarbaNot sure if that's what you're looking for @triss #2016-05-1219:18trissAh thanks @malabarba I'll see how far the rename directory stuff gets me.#2016-05-1220:08peejaIs it possible to get the info op (or an equivalent) to work in ClojureScript?#2016-05-1220:08peejaI'm trying to get jump-to-symbol in my editor#2016-05-1221:33brian_mingus@peeja not sure what you mean. Try M-.#2016-05-1221:48peeja@brian_mingus: Oh, that does work! I had to turn lispy-mode off.#2016-05-1221:48peejaThanks!#2016-05-1221:49peejaI wonder why Lispy doesn't use cider-find-var…#2016-05-1222:20brian_mingus@peeja lispy-mode looks promising#2016-05-1222:21peejaIt does its own symbol resolution, which appears to fail in clojurescript#2016-05-1222:22brian_mingusah.#2016-05-1222:23peejaI just PRed here: https://github.com/abo-abo/lispy/pull/273#2016-05-1509:53decoursinWhat does Cider think of new error messages coming to Cursive: https://www.youtube.com/watch?v=kt4haSH2xcs. Does it have any plans to do a similar thing?#2016-05-1515:33mhcat@decoursin: https://github.com/cursive-ide/error-test#2016-05-1515:33mhcat> A few people have asked about this so I put it up here, but it's in an as-is where-is state. Allegedly something like this may be in Clojure 1.9 so I won't update this until there's some indication of what that will look like.#2016-05-1515:33mhcatSounds promising#2016-05-1515:45decoursin@j0ni: Thank you!#2016-05-1517:46bozhidar@decoursin: a lot of things are possible, but someone has to work on them#2016-05-1517:46bozhidarI’ve got a ton of work on my plate, so I’ll definitely not be working on anything like this in the foreseeable future#2016-05-1518:42fodegood morning all. i'm new here.#2016-05-1518:43fodeI'm having a hard time getting cider-jack-in to fire up. i've been looking online all day and night with no luck. I'm getting: error in process filter: nREPL: Direct connection faile#2016-05-1518:43arrdemfode: do you have leiningen installed and on your emacs path?#2016-05-1518:45fode@arrdem: yes. lein repl works from the command line. let me double check my emacs path#2016-05-1518:45arrdemwhat's in *messages*?#2016-05-1518:47fode@arrdem: nREPL server started on port 62140 on host 127.0.0.1 - <nrepl://127.0.0.1:62140>#2016-05-1518:48arrdemdo you have a *nrepl-server <something>*?#2016-05-1518:48fodeStarting nREPL server via lein repl :headless...
nREPL server started on 62140#2016-05-1518:48arrdemHuh. So your server started fine and is still running...#2016-05-1518:48fode@arrdem: is that what you meant? sorry i'm fairly new to emacs#2016-05-1518:49arrdemYep. You got it.#2016-05-1518:49fode@arrdem: thank you#2016-05-1518:49arrdemTry M-x cider-connect and using those nrepl details above.#2016-05-1518:50fode@arrdem: Ok one sec#2016-05-1518:53fode@arrdem: ok i did cider-connect then pluggen in the host. is the repl supposed to pop up now?#2016-05-1518:54arrdem@fode: you should plug in host, port and get a popup repl yeah#2016-05-1518:54arrdemnot host:port, host RET port RET#2016-05-1518:55fode@arrdem: Ah! one moment#2016-05-1518:55arrdemYou should have still had a Port: ... prompt in the minbuffer.#2016-05-1518:56fode@arrdem: Yep did just now. Here' what's I'm getting now: nrepl--ssh-tunnel-connect: nREPL: SSH port forwarding failed. Check the 'nrepl-tunnel' buffer.#2016-05-1518:56arrdemuuuuuh#2016-05-1518:57fode@aardem wait i think it added the port number twice#2016-05-1519:01fode@arrdem: for some reason it's entering the port number twice: nREPL: Establishing direct connection to <nrepl://127.0.0.1:62140:62140> ...
nREPL: Direct connection failed#2016-05-1519:01fodeeven though i do host:ret then port:ret#2016-05-1519:02arrdemone sec#2016-05-1519:02fodeok#2016-05-1519:02arrdemOkay.#2016-05-1519:02arrdemTry this.#2016-05-1519:03arrdem<esc> : (cider-connect "localhost" "62140") <RET>#2016-05-1519:03arrdemso <esc>: should open up a lisp prompt in the minibuffer.#2016-05-1519:03arrdemthen just paste in the cider-connect form and hit enter.#2016-05-1519:04arrdemShould be the same as M-x cider-connect but I'm curious what'll happen.#2016-05-1519:04fodeok one sec#2016-05-1519:06arrdemFair warning, if that doesn't work pretty much all I can suggest is blowing away all your .elc files, restarting emacs and trying again 😕#2016-05-1519:07fode@arrdem: ok thank you for all your help. yes it' the same thing. i'm not sure whats going on. i'm goign to try to clean up emacs and try again. thanx again#2016-05-1519:07arrdemSure, sorry I can't be of more help.#2016-05-1519:07arrdemIf this persists, definitely open an issue on github.#2016-05-1519:08fode@arrdem: Ok cool. Thank you for taking the time.#2016-05-1519:19fode@arrdem: It worked! 🙂#2016-05-1519:19arrdem@fode: sweet! happy hacking 😄#2016-05-1519:20fode@arrdem: Yessir! I restarted emacs and it cleared the buffer. So I restarted cider-jack-in, checked the new port number in the buffer, typed in host:ret then port:ret and it worked :0#2016-05-1519:21arrdemHum... cider-jack-in should have connected magically for you...#2016-05-1519:22arrdemso something's still not quite right.#2016-05-1519:22fodeYea i know. but for some reason it keeps failing. I'll have to look into it deeper. I've only been using emacs the last 72 hours, so quite a long ways to go lol#2016-05-1519:23arrdemWelcome to the last editor you'll ever need then 😛#2016-05-1519:23arrdemStick around, someone else may have more useful commentary.#2016-05-1519:24arrdemHow long does it take to start a REPL on your machine?#2016-05-1519:24arrdemIt's possible that CIDER initially times out trying to connect to the nrepl instance...#2016-05-1519:25arrdemAnyway. You've got a REPL and can muck about some so that's headway at least...#2016-05-1620:00bhaumanSo is there socket REPL support? Have things been refactored for it?#2016-05-1620:14bhaumanLooking at sources I think that I answered my own question. Not yet.#2016-05-1623:02fode@malabarba: Yes I've tried reinstalling cider as well clojure-mode#2016-05-1623:03fode@arrdem: haha thank you. it takes a while to start the REPL, but I have not timed it yet. It is possible that Cider initially times out. I'll keep you posted as to my findings#2016-05-1701:56twashingIs there a way to make cider-connect auto inject dependencies, the same way cider-jack-in does?
https://github.com/clojure-emacs/cider/blob/master/cider.el#L512#2016-05-1701:56twashingI tried setting cider-jack-in-auto-inject-clojure, but to no avail.
https://github.com/clojure-emacs/cider/blob/master/cider.el#L245#2016-05-1702:04malabarba@twashing: no, it isn't. #2016-05-1702:06twashing@malabarba I’m just playing around with some of the functions. And this:#2016-05-1702:06twashing(cider-inject-jack-in-dependencies
(cider-jack-in-params "lein")
"lein")
#2016-05-1702:06twashinggives me this:#2016-05-1702:06twashing"update-in :dependencies conj \\[org.clojure/clojure\\ \\\"1.8.0\\\"\\] -- update-in :dependencies conj \\[org.clojure/tools.nrepl\\ \\\"0.2.12\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.3.0-SNAPSHOT\\\"\\] -- update-in :plugins conj \\[cider/cider\
-nrepl\\ \\\"0.13.0-SNAPSHOT\\\"\\] -- repl :headless"
#2016-05-1702:07twashingWhy can’t we inject cider deps on connect?#2016-05-1702:12twashingSo on startup we’re executing lein update-in :dependencies conj \\[org.clojure/clojure\\ \\\"1.8.0\\\"\\] -- update-in ... -- repl :headless#2016-05-1702:15twashingWondering if can’t just inject those deps into a running repl, like how pomegranate does.#2016-05-1702:24malabarbaYou can inject dependencies with a bit of work #2016-05-1702:24malabarbaBut I don't know if you can inject midddleware after the repl had started #2016-05-1702:25malabarbaIt's probably possible to implement. I just meant you can't do it right now with cider simple_smile #2016-05-1702:25malabarbaPRs welcome, though 😉 #2016-05-1702:25twashingRight right#2016-05-1702:25twashingIndeed, lol.#2016-05-1702:26twashingWell, from what I can tell, we have:
update-in :dependencies conj [org.clojure/clojure "1.8.0"]
update-in :dependencies conj [org.clojure/tools.nrepl "0.2.12"]
update-in :plugins conj [refactor-nrepl "2.3.0-SNAPSHOT"]
update-in :plugins conj [cider/cider-nrepl "0.13.0-SNAPSHOT"]
#2016-05-1702:26twashingIs the middleware refactor-nrepl and cider-nrepl ?#2016-05-1703:08malabarba@twashing sort of. Those are actually lein plugins (sort of dependencies). But they do contain the midddleware that is injected, yes. #2016-05-1703:10twashing@malabarba Yeah, I’m crawling through tools.nrepl middleware docs right now: https://github.com/clojure/tools.nrepl#middleware#2016-05-1703:11twashing… and while there’s no indication that middleware can be injected after the fact.#2016-05-1703:12twashingthe whole concept of middlewares in this case (decorating requests before being sent to the server), exists entirely on the client’s side.#2016-05-1703:12twashingSo yeah, I’d have to play around with it a bit more.#2016-05-1703:13twashingThanks for the feedback 👍:skin-tone-5:#2016-05-1703:30malabarbaI'm not sure I understand you. Nrepl middlewares go on the server. #2016-05-1719:45fentoni want to cider-connect to an nrepl server... however, when i do, my cider functions dont seem connected to that REPL. is there an emacs variable or something that needs to be set like cider-cljs-lein-repl. i dont want to jack-in#2016-05-1719:48plexus@fenton: cider consist of a part in emacs and a part in Clojure. The project you're connecting to needs to have the Clojure part loaded. Either add cider as a dev dependency in your project.clj, or inject it on the command line when starting lein repl #2016-05-1719:50fenton@plexus: key lemme try.#2016-05-1719:50plexusTry cider-jack-in and have a look at your *messages* buffer, then you can see the invocation of lein repl that cider uses to inject itself #2016-05-1719:50fentonahh, good idea...#2016-05-1719:53malabarbaThe easiest way to get the cider midddleware in a repl that you start separately is to add it as a lein plugins #2016-05-1719:53malabarbaThere's a recipe in the manual #2016-05-1719:54malabarbaBut copying the jack in command should work too #2016-05-1719:58fenton@malabarba gonna go look at manual...#2016-05-1720:22malabarba👍 #2016-05-1720:57mikerodIf I do cider-connect and have orphaned buffers, it prompts me if I want to use them. If I say yes, it ask which one, but always says "no match"#2016-05-1720:57mikerodThere is no tab completion, and I cannot type the name into the minibuffer because when I hit a <space> it tries to find it and fails#2016-05-1720:57mikerodso I cannot manually type the whole buffer name, and I have no autocomplete#2016-05-1720:57mikerodnot sure how to search for this one online#2016-05-1720:58mikerod0.12.0 cider with the same cider-nrepl version and 5.3.0 clojure-mode version#2016-05-1723:49iku000888@mikerod: I had a completely unrelated weirdness with 0.12 version of cider and upgrading it to the snapshot version somehow fixed it. If everything else fails, maybe that is an option.#2016-05-1801:49malabarba@mikerod: could you report that as a bug so we can look into it? #2016-05-1803:07mikerodmalabarba: I can do that yes. Do I do that as a GitHub issue?#2016-05-1803:07mikerodiku000888: thanks I can try that out#2016-05-1812:58malabarbaYep 👍 #2016-05-1816:09socksystupid question#2016-05-1816:10socksyhow on earth do i de-instrument a function with cider debug?#2016-05-1816:33socksyah, it seems if i do cider-eval-defun-at-point this resets the instrumentation at this function... doesn't seem so intuitive though#2016-05-1823:13escherizeRe evaluating a function clears out its defun'd status for me. #2016-05-1910:54mikerodWhen I connect to a running nrepl process with cider's cider-connect#2016-05-1910:55mikerodWhen I start typing in the repl buffer, it hangs for 5-10 seconds#2016-05-1910:55mikerodIt doesn't let me type during this time. It is just locked up. Cider 0.12.0 with the correspond cider-nrepl middleware etc (no warnings there)#2016-05-1915:00mikerodmalabarba: I ended up reporting my first issue https://github.com/clojure-emacs/cider/issues/1755 just FYI#2016-05-1915:00mikerodhaven't posted anything for my current issue with a lock up every time I cider-connect to a running nREPL server. I'll probably do that soon.#2016-05-1915:19kingcodeI love CIDER! Thanks for the great work..!#2016-05-1915:20kingcodeQuestion about the debugger: is it possible to configure locals to show selected items, without too much work? E.g. I have 20+ locals showing up on everything view, but only need to check a few: filtering would be a great speed-up...thx#2016-05-1915:32robertoYou can eval the one you want. #2016-05-1915:38kingcode@roberto thx....but I am trying to #break at a single location inside a loop using 'H command, and which to see only those locals each time, without having to select my way to them everytime. So, once configured to view only those locals I am interested in, A successions of H, l commands should do the trick, or so I hope?#2016-05-1915:39kingcodeI tried the p command, but it forces me to wade through selecting each local individually every time 😞#2016-05-1915:46robertothat is how I’ve seen most debuggers work. This is more due to the limitations of the Emacs UI#2016-05-1915:46robertopersonally, I break out the loop in to a function so I can limit the locals, debug there, and once i’m happy with the outcome, I put it back where it was.#2016-05-1915:47robertobut generally, my functions don’t have too many locals, so haven’t really had to the need you have#2016-05-1915:47kingcodeawright...great idea, I'll try that...thx!#2016-05-2004:27richiardiandreaSometimes when I work using tools.namespace I refresh/reload with the classic refresh in the repl but I have an exception... Everything is ok, but the exception does not appear as popup as the others, it is there in the Repl with its huge stacktrace. Is it because it not thrown but printed to out/err?#2016-05-2007:41pesterhazyAre you using emacs?#2016-05-2009:18pesterhazyahh... in the cider channel, I guess the answer is yes 🙂#2016-05-2009:18pesterhazysorrry, don't know the answer. I know the problem and always keep an eye on the repl for this reason.#2016-05-2015:19richiardiandreayes this is weird because all the other exceptions are popped up#2016-05-2015:20richiardiandreabut this particular one (I am using mount for component management) doesn't#2016-05-2015:33robertothis has happened to me when I connect to a repl instead of using cider-jack-in#2016-05-2015:38richiardiandreaah so that's the problem then#2016-05-2015:38richiardiandreaI am doing exactly that#2016-05-2015:39richiardiandreai wonder if we can do something about it#2016-05-2511:08jgertmeldoc isn't displaying any information anymore since a couple of days. i'm running spacemacs from develop branch with up-to-date packages. any ideas why this could be?#2016-05-2515:06cskksceldoc has been through some changes recently. do you get any error message in the *Messages* buffer ?#2016-05-2515:24bbssHmm after doing cider-jack-in-clojurescript the repl of both clj and cljs start and connect, I can evaluate in them, and I can C-c C-c in a clj file but the clojurescript buffer I started the jack-in says:
user-error: `cider-eval-defun-at-point' needs a ClojureScript REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-J').
#2016-05-2515:25bbssDidn't change the project but did recently add clj-refactor and ac-cider.#2016-05-2515:26bbssAny idea how to proceed? I am pretty new to emacs (using spacemacs).#2016-05-2515:40malabarba@bbss: Are you sure the Cljs repl is not just a clojure-repl?#2016-05-2515:41bbssYes I am sure, it's printing to the browser console#2016-05-2515:41malabarbaFor instace, if you evaluate inc. Do you see a java class or a javascript function?#2016-05-2515:41malabarbaah, ok#2016-05-2515:41malabarbaOn that repl, do M-: cider-repl-type. What do you get?#2016-05-2515:42bbss"clj"#2016-05-2515:45malabarbaYeah, that's the problem.#2016-05-2515:45malabarbaDid you get any warnings when you connected?#2016-05-2515:45malabarbaSounds like you don't have the middleware#2016-05-2515:46bbssI did not see any warnings, in the repl at least. Let me check messages#2016-05-2515:47malabarbaHm#2016-05-2515:48bbssStarting nREPL server via /Users/baruchberger/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.13.0-SNAPSHOT\"\] -- repl :headless...
nREPL server started on 55866
[nREPL] Establishing direct connection to localhost:55866 ...
[nREPL] Direct connection established
Connected. May the Source be with you!
[nREPL] Establishing direct connection to localhost:55866 ...
[nREPL] Direct connection established
Connected. Learn the rules like a pro, so you can break them like an artist. -Pablo Picasso
Starting a custom ClojureScript REPL
#2016-05-2515:48bbssLooks fine to me.#2016-05-2515:48malabarbaWhat's your ClojureScript repl?#2016-05-2515:48bbssfigwheel#2016-05-2515:49malabarbaOk#2016-05-2515:50malabarbaCOuld you file an issue with reproduction instructions?#2016-05-2515:50malabarbaSounds like this is a tricky one#2016-05-2515:50malabarbaIt really should be working#2016-05-2515:50malabarbaI can get you a workaroudn in the meantime#2016-05-2515:51bbssHmm okay, I am so afraid it will be one of those "local to my machine" kind of things.#2016-05-2515:52malabarbaWith cljs, there's a good chance it's a real bug#2016-05-2515:52malabarbathe spectrum of cljs repls is just absurd#2016-05-2515:53bbssYeah, hard to find my way 😄#2016-05-2515:55bbssI must add that I have a kind-of exotic set-up. I am connecting to a chrome-extension, which required me to tunnel 443 to 3449 (figwheel) and set-up figwheel to use secure websockets.#2016-05-2515:55bbssActually let me check if it's not somehow related to nginx, didn't try that yet.#2016-05-2515:55malabarbaI got dizzy just by reading that. 🙃#2016-05-2515:56bbssHahah.. Yeah.. But it did work before for some time!#2016-05-2515:57stephenmhopperI have a quick question (and let me know if I’m way off base or doing something horribly wrong), but I’m starting up a remote nrepl server for my app and connecting to it from cursive’s built in remote REPL functionality. Is there a way to force everything that’s sent to and from that session to print to the console out on the server? I’m using an uberjar at the moment and my startup code looks like this:
(ns my-ns.core
(:require [clojure.tools.nrepl.server :as nrepl]
[cider.nrepl :as cider])
(:gen-class))
(defonce server (atom nil))
(defn shutdown [] (nrepl/stop-server (deref server)))
(defn -main
[& args]
(reset! server (nrepl/start-server :port 1234 :bind "localhost" :handler cider/cider-nrepl-handler))
(println "Hello, World!"))
#2016-05-2516:03malabarba@stephenmhopper: You could write a middleware for that. But I'm not sure how you would add it to nrepl#2016-05-2516:03malabarbaThere's certainly a way, though#2016-05-2516:03stephenmhopperokay#2016-05-2516:03stephenmhopperBut this isn’t some pre-existing functionality?#2016-05-2516:04bbss@malabarba: you mentioned a work-around?#2016-05-2516:05malabarba@bbss what's you emacs version?#2016-05-2516:06bbss@malabarba: GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, NS apple-appkit-1348.17) of 2016-04-27 on Baruchs-MBP#2016-05-2516:07bbssWith spacemacs, don't know if that could be related#2016-05-2516:12malabarba`#2016-05-2516:12malabarba(defun hack-connection-type (cs)
(mapcar (lambda (c)
(with-current-buffer c
(when (string-match "CLJS" (buffer-name))
(setq cider-repl-type "cljs"))))
cs)
cs)
(advice-add 'cider-connections :filter-return #'hack-connection-type)
#2016-05-2516:13bbssI put that in the spacemacs config init function?#2016-05-2516:16bbssIt worked!#2016-05-2516:17bbssYou voodoo master!#2016-05-2516:19bbss@malabarba: Thanks a bunch 🙂 Really amazing how quickly you helped me. I am not sure what to include in a bug report.#2016-05-2516:21bbssMight try to re-install emacs, spacemacs and the redo the configuration first either way.#2016-05-2516:29malabarbaYeah. I was going to suggest at least reinstalling CIDER first, just in case. #2016-05-2518:47adamfreyhas anyone else reported a error with Cider and company-mode completions? I get this error consistently when typing clojure function names: Error running timer company-echo-show: (error "Company: backend (company-capf company-dabbrev-code) error \"Wrong type argument: sequencep, 115\" with args (meta reductions)” I just wanted to check before trying to find a minimal repro case.#2016-06-1422:45bvulpesi just typed (d/q in a new ns and cljr auto-imported [datomic.api :as d]#2016-06-1422:45bvulpesi am both awed and terrified#2016-06-1423:22hrathodrichiardiandrea: may be try to see if define-clojure-indent settings can help?#2016-06-1423:23richiardiandreayes I was checking exactly that some time ago, but could not avoid having it (default indent is like a defun, I could not find "don't indent")#2016-06-1423:23richiardiandreawill try again#2016-06-1423:29hrathodYeah, I played around with it right now, and even giving it indent of 0 or negative value doesn't adjust it properly. Sorry.#2016-06-1423:48hrathodapparently I should have read a bit more. Those values are not indentation at all. D'oh!#2016-06-1504:02malabarbaTry setting it to (lambda () 0)#2016-06-1504:02malabarbaI'm not 100% sure if the indent spec accepts a function, but it might. #2016-06-1504:47richiardiandreaI'll try tomorrow thanks Malabarba#2016-06-1514:16Lambda/SierraHow does clojure-defun-indents work?#2016-06-1514:16Lambda/SierraI tried setting it as a file-local variable but it doesn't seem to have any effect.#2016-06-1514:37malabarba@stuartsierra: Looks like the way it's designed it won't work as a file-local variable.#2016-06-1514:37malabarbaIt won't even work if you setq it either 🙂#2016-06-1514:37malabarbaIt'll only work by configuring it via the customize menu#2016-06-1514:38malabarbaObviously, the variable's doc shouldn't say that:
> This variable is safe as a file local variable if its value satisfies the predicate ‘listp’.#2016-06-1514:39Lambda/Sierraah, thanks @malabarba#2016-06-1514:40malabarba@bozhidar I think this variable is left-over from a previous version of the indentation engine. We should either change the way it's used so that it works as a file-local, or make it obsolete and tell people to use define-clojure-indent instead.#2016-06-1514:42malabarba@stuartsierra: You can still have file-local indent by putting something like this as a file-local eval: (define-clojure-indent (my-fn :defn) (some-def :defn))#2016-06-1514:42Lambda/SierraYes, that's what I've been doing.#2016-06-1514:42malabarbaOk then 🙂#2016-06-1515:24bozhidarguess we should make it obsolete#2016-06-1515:25bozhidardefine-clojure-ident is the way to go#2016-06-1515:25bozhidaralthough we should have probably named this clojure-define-indentation 🙂#2016-06-1517:29richiardiandreammm no, I don't think (trace-handlers (lambda () 0) works here...#2016-06-1517:36richiardiandreathe doc of clojure-indent-function is pretty clear:
The property value can be
- `defun', meaning indent `defun'-style;
- an integer N, meaning indent the first N arguments specially
like ordinary function arguments and then indent any further
arguments like a body;
- a function to call just as this function was called.
If that function returns nil, that means it doesn't specify
the indentation.
- a list, which is used by `clojure-backtracking-indent'.
#2016-06-1517:37richiardiandreaso I tried to return nil, but the minimum indendantation I get is 1 space, probably taking into consideration the initial paren#2016-06-1517:37richiardiandrea(rf/trace-handlers
(rf/reghandler :reset-db app-mw
[_ []]
db/initial-state))
#2016-06-1517:37richiardiandreawith (trace-handlers (lambda () nil))#2016-06-1519:09malabarbaReturning nil means it doesn't specify indentation#2016-06-1519:09malabarbathat's not the same as specifying 0 indentation#2016-06-1519:09malabarbathat just means "not my problem, do the default"#2016-06-1519:09malabarba@richiardiandrea: Try this instead: (define-clojure-indent (trace-handlers (lambda (&rest _) 0)))#2016-06-1519:10malabarbaI forgot the function has to take arguments#2016-06-1519:10richiardiandreaOh ok, I also opened an issue in clojure-mode to add :never-align #2016-06-1519:11richiardiandreaI was playing with clojure-mode earlier#2016-06-1519:14richiardiandreaIt looks like that 0 is not directly the column shift#2016-06-1519:14richiardiandreaSo that is why I was thinking of adding a keyword to handle that case#2016-06-1519:32richiardiandrea@malabarba: I checked the code and it looks like your option should work but for some reason (functionp method) returns nil here https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1238#2016-06-1519:33richiardiandreawhere method is the lambda (not an emacs expert here so maybe it does not match against lambdas?)#2016-06-1519:35malabarbaOdd. Can you see what's the value of method in that case?#2016-06-1519:39richiardiandreaedebug returns lambda#2016-06-1519:41richiardiandreathe doc says and returns nil for special forms#2016-06-1519:41richiardiandreaagain, dunno what this means in elisp though 🙂#2016-06-1519:42richiardiandreaah @malabarba ok, lambda is a special form 😄#2016-06-1519:42richiardiandreaeverything makes sense now ahah#2016-06-1519:42malabarbahm#2016-06-1519:43malabarbait might be a bug in our code#2016-06-1519:46malabarbaYep#2016-06-1519:46richiardiandreayeah#2016-06-1519:46malabarbajust found it#2016-06-1519:46richiardiandreaI opened an issue, I can take care of the pr if you tell which is the right function 😉#2016-06-1519:47richiardiandreabut I still think that a :never-align option might be good#2016-06-1519:48richiardiandreaso #'(lambda () ... should work right?#2016-06-1519:48malabarbaI don't think so#2016-06-1519:48malabarbafor the same reason#2016-06-1519:49richiardiandreatrue, I tried#2016-06-1519:49malabarbaI've already written the fix#2016-06-1519:49richiardiandreagreat, I can try it out#2016-06-1519:49malabarbaIf you'd like to write a couple of tests I can let you open the PR 🙂#2016-06-1520:02richiardiandreaI am adding the test#2016-06-1520:07richiardiandrea@malabarba: no honey with (trace-handlers (lambda (_ _) 0))#2016-06-1520:09malabarbaWeird#2016-06-1520:09malabarbait worked for me with (define-clojure-indent (trace-handlers (lambda (&rest _) 0)))#2016-06-1520:09richiardiandreaI'll check again#2016-06-1520:10richiardiandreathe test passes#2016-06-1612:24fgiasson@bozhidar: I am looking to continue to improve org-babel-clojure. The next thing I am looking to do is to detect possible exception raised in the code that is being executed. However due to my lack of nrepl knowledge, I am not sure it is possible. Right now if you run code in a Org-mode code block and if there is an exception, then it is just silent. You have to switch to the major mode to get the exception screen. If there some API in nrepl that would tell me if an exception got throw, and if so to get that exception (such that I can display it)? Right now, depending on the mode I am using, org-bable-clojure uses nrepl-sync-request:eval or nrepl-request:eval to communicate with nrepl#2016-06-1612:48fgiasson@bozhidar: ok forget this, I found my way with "ex", "root-ex" and "err" from the nrepl response#2016-06-1614:00bozhidar🙂#2016-06-1614:00bozhidarhappy to be of service 😉#2016-06-1614:06fgiasson@bozhidar: ahahah right 🙂 Will write a post about my latest upgrades, and will try to take the time to propose it to Org-mode and then to let Nicolas committing it to the master#2016-06-1614:27xeqiIs there way to define cider-refresh-before-fn on a per project basis?#2016-06-1614:37malabarba@xeqi: Search for "emacs dir-local variables"#2016-06-1614:37malabarbaWe really should have a manual section on that 🙂#2016-06-1614:38malabarba"How do I define X on a per project basis?" is one of our most common questions#2016-06-1614:42xeqiThanks. 👍 on manual. I had looked under https://cider.readthedocs.io/en/latest/configuration/ hoping to find something#2016-06-1721:06gowdercan I ask an emacs/cider total noob question? I'm using cider with emacs, and whenever the repl throws an error, in addition to throwing an error in the window I'm using for the repl, it also pops up a special buffer of its own in a window along the bottom to throw the error. That second window drives me a little insane, but I'm too new to emacs to have any clue how to make it stop doing that. Can anyone give me a pointer? Thanks!#2016-06-1721:37zzamboni@gowder: add this to your .emacs:#2016-06-1721:38zzamboni;; error buffer not popping up
(setq cider-show-error-buffer nil)#2016-06-1723:09gowderthanks @zzamboni!#2016-06-1818:43nes@zzamboni also you can close it by pressing q#2016-06-1818:43neshey ppl, I’m trying https://github.com/clojure-emacs/helm-cider and its very cool#2016-06-1820:19niquolaHi, all - error in process filter: nrepl-dict-map: Not an nREPL dict - while running tests. As i understand, this error could be related to some versions mismatch? I've got this type of errors already 3rd time for half year 🙂 May be fix it forever.#2016-06-1820:20niquolafresh spacemacs (cider-20160612.1230)#2016-06-1918:48zzamboni@nes: sure, but that's one keystroke too many most of the time 🙂#2016-06-2011:54robert-stuttafordwhen i use cljr-project-clean, after accepting the warning, it asks me to save a file (which turns out to likely be the first file it'd work on), and then it hangs. what gives?#2016-06-2011:55robert-stuttafordon refactor-nrepl 2.3.0-SNAPSHOT. upgrading Emacs packages now.#2016-06-2012:00benedekI assume you run clean-ns on your project with project clean#2016-06-2012:00benedekThat is the default afaik#2016-06-2012:01benedekCan you try to run clean-ns on the ns project clean hangs on?#2016-06-2012:07robert-stuttafordyes, that's right. i'll run clean-ns manually on the first couple nses in the list and see what happens#2016-06-2012:10robert-stuttafordthey all clean fine#2016-06-2012:10robert-stuttafordhow do i tell which ns it hangs on, @benedek ?#2016-06-2012:11robert-stuttafordi don't understand why it's asking to save a file#2016-06-2012:24benedekHm.. that is weird.. rings a bell tho let me dig around a bit.#2016-06-2012:28benedekare there any irregular files in your project with clj or cljc extension?#2016-06-2012:29benedekBy irregular I mean w/o ns declaration like data or config edns or the like#2016-06-2013:24robert-stuttafordyes, there are a couple like that#2016-06-2013:25robert-stuttafordif i can know where it's failing, i'll just move those files out temporarily#2016-06-2013:25benedekyou can add those to cljr-project-clean-exceptions#2016-06-2013:26benedekuse customize-variable#2016-06-2013:27robert-stuttafordERROR: Unhandled REPL handler exception processing message {:op clean-ns, :prefix-rewriting false, :debug false, :path test.txt, :libspec-whitelist [^cljsns ^slingshot.test ^monger.joda-time ^monger.json], :prune-ns-form true, :session df361756-9b31-4aa2-a9d8-8fe727e78db3, :id 11}
java.lang.AssertionError: Assert failed: (core/source-file? path)
#2016-06-2013:27robert-stuttafordi got this after i triggered clean-project, and it asked me to save a file, so i gave test.txt#2016-06-2013:28robert-stuttafordtest.txt contains source from the first clj file clean-project would likely have found when globbing the fs#2016-06-2013:28robert-stuttafordalthough its lost all of its indentation#2016-06-2013:29robert-stuttaford-confused-#2016-06-2013:30robert-stuttafordi did this after a clean repl and emacs start, with only project.clj open and the repl connected (which i used lein repl :headless to do)#2016-06-2013:31robert-stuttafordso, no unsaved buffers etc#2016-06-2013:33benedeksounds weird. can you pls dump this into a bugreport on github?#2016-06-2013:34robert-stuttafordtotally can#2016-06-2013:34robert-stuttafordthank you for spending some time so far, i'll try to provide a repro case for you#2016-06-2013:34robert-stuttafordperhaps learn some elisp 🙂#2016-06-2013:41benedeksounds cool, thx 🙂#2016-06-2023:40malabarbaWRT tracking down a hang, debug on quit is your friend. ;-)#2016-06-2107:03robert-stuttafordone small extra bit of info on this - C-g restores the Emacs UI. so it's not hanging, it's just that command that's stuck#2016-06-2109:12reefersleepI'm using Spacemacs and for some reason cider-jump-to-resource is void. I have the Clojure layer active, and some Cider commands work. Does anyone have an idea why this particular command does not work?
I've connected to a working ClojureScript repl.
I've also tried including an nrepl in ~/.lein/profiles.clj#2016-06-2109:13reefersleepSymbol's function definition is void: cider-jump-to-resource#2016-06-2109:39reefersleepWell, actually, the functionality I was looking for turned out to be jump-to-var, which works fine. I still wonder why the other definition is void, though.#2016-06-2112:36robert-stuttaford@benedek, i haven't gotten to writing up a github issue, but i do have one more thing to report. when prompted for a filename to save, if i save it in .clj in the classpath, it saves the cleaned file to the name i nominate. so the bug is that it's not saving to the path it read from, and instead is prompting me for a filename for each file.#2016-06-2112:43robert-stuttaford@benedek this bit, here, is what's causing it to ask me for a filename https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L274-L278 . perhaps something to do with how my emacs is setup as it relates to with-temp-file and/or insert-file-contents?#2016-06-2114:05robert-stuttafordhmm. i think it may be because we're gitignoring emacs' temp files#2016-06-2114:07robert-stuttafordnope. that's not it#2016-06-2114:17robert-stuttaford@benedek: i think i may have the bug .. https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L1030-L1032 arg is 'filename' but the body of this fn checks (buffer-file-name). this fn is only used by project-clean#2016-06-2114:20benedekhaha, that looks pretty bad#2016-06-2114:20benedeknot sure how this results in saving the cleaned namespace tho...#2016-06-2114:21benedekthat should just let loads of crap through… (which is bad enough)#2016-06-2114:23robert-stuttafordso, i know nothing about elisp, but i think i may have found the issue#2016-06-2114:24robert-stuttafordi put this right after dolist here https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L1976:
(cljr--post-command-message " filename: %s clojure-filename: %s excluded: %s "
filename
(cljr--clojure-filename-p filename)
(cljr--excluded-from-project-clean-p filename))
#2016-06-2114:24robert-stuttafordand, nothing actually happens to my files, but, i get output like this:#2016-06-2114:24robert-stuttafordCleaning your project might change many of your clj files. Do you want to proceed? (y or n) y
Project clean done.
filename: /Users/robert/Cognician/Server//src/shoreleave/middleware/rpc.clj is being cleaned!
filename: /Users/robert/Cognician/Server//src/shoreleave/middleware/rpc.clj clojure-filename: t excluded: nil
filename: /Users/robert/Cognician/Server//src/cognician/yeller.clj is being cleaned!
filename: /Users/robert/Cognician/Server//src/cognician/yeller.clj clojure-filename: t excluded: nil
#2016-06-2114:25robert-stuttafordperhaps the double / is affecting with-temp-file?#2016-06-2114:25robert-stuttafordi see that cljr--project-files is also only used by this code#2016-06-2114:26robert-stuttafordof course, clojure-filename is always t because i do this while the active buffer has a clj file in it#2016-06-2114:27robert-stuttafordi put this inside the when:
(cljr--post-command-message " filename: %s is being cleaned!"
filename)
#2016-06-2114:28robert-stuttafordthat pretty much exhausts my knowledge, though. i hope this is helpful?#2016-06-2114:32benedekindeed it is. have you tried to fix the bug above and rerun? eg, just fix the buggy cljr--clojure-filename-p then C-x C-e at the end of the function and rerun project clean#2016-06-2114:34robert-stuttafordi've fixed that, and it's returning t, but i'm still being prompted to enter a new filename to save the file to#2016-06-2114:35benedekhm… will dig around this as soon as i get some time on my hands. thanks for info#2016-06-2114:37robert-stuttafordi print out ,fn here https://github.com/clojure-emacs/clj-refactor.el/blob/0f75216908c54948e5ad01564c3284d61488ce8c/clj-refactor.el#L274 and it's also the same path#2016-06-2114:39robert-stuttafordhow might i replace // with / in filename, @benedek ?#2016-06-2114:39robert-stuttafordi want to try doing that as a last-ditch thing before accepting defeat 🙂#2016-06-2114:40robert-stuttafordi found s-replace, trying that#2016-06-2114:41robert-stuttafordnope. that didn't help#2016-06-2114:41robert-stuttafordoh well#2016-06-2114:41robert-stuttafordmy namespaces shall remain dirty for now 🙂#2016-06-2114:44benedeksad times...#2016-06-2114:44robert-stuttaford-grin- https://github.com/clojure-emacs/clj-refactor.el/blob/master/CONTRIBUTING.md 404s, btw#2016-06-2114:45robert-stuttafordthe obvious fix as a PR: https://github.com/clojure-emacs/clj-refactor.el/pull/338#2016-06-2114:46benedekeh sorry, here: https://github.com/clojure-emacs/clj-refactor.el/blob/master/.github/CONTRIBUTING.md#2016-06-2114:46benedekthx for the PR#2016-06-2219:59josh.freckletoncider freebie: Sometimes I'll be working in a (defn f ...) and want to eval (f ...), and it sucks navigating back and forth, so I wrote this for my emacs config. C-c C-v evals the next sexp:
Any recommendations for improving it?
(defun cider-eval-next-sexp ()
;; useful where I'm working in `(defn f ...)` and want to evan the following `(f ...)`
(interactive)
(save-excursion
(setq go-up t)
(while go-up
(condition-case nil ; go forward-up as far as you can
(paredit-forward-up)
(error (setq go-up nil))))
(paredit-forward) ; go to the next sexp
(cider-eval-last-sexp) ;eval it
))
(define-key cider-mode-map (kbd "C-c C-v") nil) ; overwrite cider's use of C-c C-v
(global-set-key (kbd "C-c C-v") 'cider-eval-next-sexp)
#2016-06-2306:38escherizeI'm not sure, but you may want to use forward-sexp instead of paredit-forward for those who use smart parens or just the built-in lisp.el.#2016-06-2314:32helioshey guys, I'm encountering a weird error with cider (i'm not really sure when it started). Instead of showing the output of clojure.tools.logging/info to my *cider-repl* window, it's complaining about Error in process filter [nREPL]: no response handler with id nil found. nrepl.messages only shows the message that it was supposed to be logged, but no other messages. Cider seems to be hanging afterwards 😕#2016-06-2314:36heliosfor now i switched away from tools.logging to a normal prn#2016-06-2314:50heliosor maybe the question is, how can i redirect the output of logging to cider-repl window?#2016-06-2315:44dhruv1question regarding cider debugger:#2016-06-2315:45dhruv1(defn add
[& many]
(apply + many))
(defn randomize
[n]
(rand-int n))
#dbg
(defn add-two-nums
[n1 n2]
(add (randomize n1) (randomize n2)))
I want to debug add-two-nums.
but every time there is a function call, i also want to know what’s going on in that function (in this case randomize and add.#2016-06-2315:46dhruv1is it possible to do that?
if so, how?#2016-06-2317:32malabarba@dhruv1: you can instrument those functions with #dbg too. Or you can step through the function with i instead of n. #2016-06-2317:42dhruv1ah!
i i works perfectly.#2016-06-2317:42dhruv1thanks!#2016-06-2317:42dhruv1the reason i don’t want to instrument those functions is because they can be in different namespaces.#2016-06-2320:24benedek@robert-stuttaford: i am guessing the problem with project-clean is here: https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2649-L2650#2016-06-2320:25benedekcan you replace this with:
(when (and (not *cljr--noninteractive*)
(buffer-modified-p))
(save-buffer))
and let me know if it helped#2016-06-2320:59josh.freckleton@escherize: ah, good advice, thx!#2016-06-2404:45robert-stuttaford@benedek i'll give that a go, thank you!#2016-06-2404:49robert-stuttafordit looks like that was it!!#2016-06-2404:51robert-stuttafordwell, that fixes that problem. i've got a new problem:
ERROR: Unhandled REPL handler exception processing message {:op clean-ns, :prefix-rewriting false, :debug false, :path [], :libspec-whitelist [^cljsns ^slingshot.test ^monger.joda-time ^monger.json], :prune-ns-form true, :session a8d7a0bb-203e-4372-84fb-4cbc40cd80af, :id 14}
java.lang.AssertionError: Assert failed: (seq path)
at refactor_nrepl.ns.clean_ns$clean_ns.invokeStatic(clean_ns.clj:38)
i'll put refactor-nrepl src in my classpath and instrument and see what could be going wrong#2016-06-2406:47benedekThis could be an actual bug with clean ns#2016-06-2406:47benedekStrange your path is empty#2016-06-2406:47benedekSo should be something in the elisp code...#2016-06-2406:58robert-stuttafordi'll share news soon 🙂#2016-06-2407:00benedekTa#2016-06-2407:13robert-stuttaford@benedek, both path and (buffer-file-name) are null here https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2652 when i have when instead of unless here https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L2649#2016-06-2407:51benedekwell it can be if the buffer does not have a file related to it.#2016-06-2407:51benedekonly those should be filtered out i guess….#2016-06-2407:51benedekany chance you know what buffer is this?#2016-06-2408:58heliosis it normal that clj-refactor wants to analyze the project every time i do find-usages ?#2016-06-2409:28benedekdepends on your config.#2016-06-2409:28benedekyou can set (setq cljr-warn-on-eval nil) so it won’t ask you but analyze in the background#2016-06-2409:29benedekif you let it analyze it will cache the results tho#2016-06-2409:30benedekso next time it analyzes it should not take long as it only builds ASTs for changed files#2016-06-2409:31benedekso to summarize: yes, but it should just use the already cached ASTs for most (not changed) namespaces#2016-06-2409:32cskkscIs there any way to tell clj-refactor to exclude a specific directory (eg. test) when it tries to analyse all the files ?#2016-06-2409:47benedeki don’t think there is at the moment. all clj files get analyzed on your classpath#2016-06-2410:10cskkscalright. we have some custom readers in a project, and they’re referenced in some test files. clj-refactor is not able to parse that#2016-06-2410:18benedekyou can set cljr-ignore-analyzer-errors to t#2016-06-2410:18benedekso clj-refactor will ignore errors in those ns-s and carry on with find-usages/rename symbol#2016-06-2410:18benedekleaving these nses out obviously. kinda best effort really...#2016-06-2410:19benedekthat is not any worse than excluding some file tho either.#2016-06-2410:56cskkscalright. that works for me. thanks!#2016-06-2410:58benedekwlc#2016-06-2410:59robert-stuttaford@benedek: well, i'm running project-clean, where the file isn't in a buffer. with-temp-file, remember#2016-06-2410:59robert-stuttafordor, otherwise, i don't understand enough about this to know what i'm talking about 🙂#2016-06-2721:44josh.freckletonI'm having trouble finding this, how do I run all tests in the current buffer?
I'm working in a lib where all the tests are named x-spec.clj instead of x-test.clj, and cider is having trouble finding the right files to test, so I'm just as happy to go into a x-spec buffer, and run the tests myself. Any advice?#2016-06-2800:43Chris O’Donnell@josh.freckleton: I use spacemacs, but if it's the same in vanilla emacs cider-test-run-ns-tests should do the trick (`C-c C-t n`)#2016-06-2800:45josh.freckleton@codonnell: hm, unfortunately I'm getting no namespace: <x>-spec-test.clj when the test is named <x>-spec.clj, and the spec is the test. I'd rename it, but its a public lib...#2016-06-2800:46josh.freckletoncan I make that cider-test-run-ns-tests satisfied with a different source for tests?#2016-06-2801:01Chris O’Donnell@josh.freckleton: the cider-test-run-ns-tests function takes an initial argument suppress-inference. If you call (cider-test-run-ns-tests t) it will run the tests in your current namespace, regardless of its name.#2016-06-2801:02josh.freckletonexactly what I needed, thank you!#2016-06-2801:03Chris O’Donnellno problem#2016-06-2818:56vinnyataidehello, I've tried to enable to make my terminal clojure enabled so I've enable clojure-mode but I can't disable right now, I'm in a shell command window#2016-06-2818:57vinnyataidehow can I disable it? I cant send my commands through enter or ctrl j#2016-06-2818:58vinnyataidesorry, should've asked in emacs channel#2016-06-2911:56slipsetHello, I’ve (lazily) searched the issues for cider, but haven’t found any matching exclamation.#2016-06-2911:57slipsetProblem is, C-c C-d d when point is at swap! suggests that I want documentation for swap, which is not what I want.#2016-06-2911:57slipsetIs this a known bug that I havent found, or should an issue be filed?#2016-06-2912:26slipsetSeems like (modify-syntax-entry ?! "w”), eg changing the meaning of ! to be word-class fixes this.#2016-06-2912:27slipsetUnaware of how much breakage though#2016-06-3009:51rmuslimovI’m playing with sente and using cider-refresh to reload the system. My setting are:
`(setq cider-refresh-before-fn "reloaded.repl/suspend"
cider-refresh-after-fn "reloaded.repl/resume”)`
When I’m reloading system that way all messages from sente goes to cider-refresh-log buffer, which is suprise for me
If call in reloaded.repl/suspend, refresh-all, ‘reloaded.repl/resume’ I see messages in standard emacs cider repl#2016-06-3009:52rmuslimovany ideas how to fix that?#2016-06-3021:53jasonjcknwhen I introduce a compiler error and do cider-refresh, it errors as expected, if I fix it and cider-refresh, i get "user/go" no such namespace user#2016-06-3021:53jasonjcknso my before-fn doesn't exist anymore#2016-06-3021:53jasonjcknI set this to nil, and tried cider-refresh again#2016-06-3021:54jasonjcknhm, i had some other error after, but it just dissapeared scatches head#2016-06-3021:55jasonjcknanyways what's the solution for user/go thing?#2016-06-3023:03vinnyataideis there any format command for clojure?#2016-07-0100:11malabarba@jasonjckn: I've seen that too. The work around in to just load the namespace with C-c C-k. Though it would be nice to fix properly #2016-07-0101:41montanonicI'm new to emacs. Following Clojure for Brave and True. I want to update to the latest cider. How can I do that? Wasn't able to find anything re updating via google#2016-07-0102:39malabarbaJust delete whatever version you have and install it via the package menu #2016-07-0102:40malabarbaAnd you'll probably want to remove any configure you added to project.clj. Those are not necessary any more #2016-07-0103:53noonianI really like how the result of a an evaluated form is displayed inline in my buffer. Is it possible to get an exception value or some notification when an exception occurs inline in my buffer the same way instead of in the repl buffer?#2016-07-0104:15montanonicmalabarba: thank you; I'm just using LightTable for now while I learn the language. When I tried installing cider it said that it couldn't find the package (I tried a few things; same issue). I don't want to waste any more time tooling at this point, but will probably try cider again in a couple of weeks.#2016-07-0121:19bvulpesvinnyataide: yeah it's called format#2016-07-0121:46radonIs it possible to make CIDER show any messages from starting up the REPL in the *cider-repl* buffer? If an error occurs and some namespaces can’t be required, I’d like to see that error message at the top of *cider-repl* without manually switching to the *nrepl-server* buffer.#2016-07-0214:55malabarba@radon Cider doesn't load any of your namespaces when starting up. That's probably refactornrepl #2016-07-0217:25radon@malabarba: Really? When I start a plain lein repl, whatever namespace I’ve set as :main in project.clj is automatically loaded and switched to. I would have expected CIDER to do the same by default; is this not the case?#2016-07-0217:33bvulpesy'all want {:repl-options {:init-ns foo}} somewhere in project.clj#2016-07-0217:34bvulpesin order for repl-opening processes like cursive or cider to drop you into the right ns, precompiled#2016-07-0217:34bvulpesi think leiningen does this implicitly with the :main ns, as radon pointed out#2016-07-0218:03radonRight. This part is working. That is, I’m in the :main namespace when I cider-jack-in. However, I work on quite a large project that loads configuration files, makes database connections, etc. when it is loaded. Sometimes there’s an error message, which I need to know about. The problem is, all of these messages, which show up in lein repl, do not show up in *cider-repl*, but only in *nrepl-server*, which means I’m not aware of any errors that occur unless I check manually. Ideally, I’d like cider-jack-in to open *cider-repl* immediately, wherein all the initialization messages (if any) would be shown, and then the REPL prompt would appear after everything is loaded. (Like lein repl.)#2016-07-0218:23malabarbaI see what you mean #2016-07-0218:23malabarbaI'm not sure if there's anything cider can do. #2016-07-0218:24malabarbaThe repl buffer is started as soon as we know that the nrepl server has started. #2016-07-0218:25malabarbaBut it's lein that decides when that happens. #2016-07-0218:26malabarbaI guess lein chooses to load your namespaces first, and then start the repl. It makes sense, but it means that the repl doesn't exist yet by the time the exceptions are thrown. #2016-07-0222:23malabarbaI suppose we could do some basic parsing of the nrepl-server buffer, and display it if we detect there's an exception in there. #2016-07-0300:07radonIs there an easy way for me to just tell messages sent to the *nrepl-server* buffer to instead show up in the *cider-repl* buffer?#2016-07-0300:08radonIt seems likely that most people would not want this behavior but can I do it in my init.el or something?#2016-07-0301:03malabarbaThere's no config option or anything, but we could write you a hack for that. #2016-07-0301:04malabarbaI won't touch a computer until Monday though. :-)#2016-07-0317:06richiardiandreathere is a slack for emacs iirc#2016-07-0317:09bvulpesit is horrendous.#2016-07-0317:09bvulpesor was, last i checked.#2016-07-0317:10bvulpesirc bridge isn't much better. worse uptime than fleanode.#2016-07-0317:15richiardiandreaahah ok, I have never tried it but I was wondering#2016-07-0317:20malabarbaThere's a Slack app for phones 😉 #2016-07-0317:21richiardiandrea@malabarba: because you use emacs on the phone as well ??? 😁#2016-07-0317:25malabarbaEmacs on the phone is actually super easy 😄 #2016-07-0317:25malabarbaI do actually have it set up here #2016-07-0317:26malabarbaThe problem is the keyboard 😛 #2016-07-0317:26malabarbaI'd probably actually use it if I had a Bluetooth keyboard #2016-07-0317:26richiardiandrealol I knew that 😄#2016-07-0320:01malabarba😄 #2016-07-0402:28bvulpesmalabarba: phone's a computer too :P#2016-07-0409:17jan.zyHi, I’d like to use this setting:
(setq cider-refresh-before-fn "start-server"
cider-refresh-after-fn "stop-server”)
but only for one project#2016-07-0409:18jan.zyso, what would be a nice way of storing custom settings for a selected projectile project?#2016-07-0409:18jan.zy[hm, maybe I should ask on emacs channel]#2016-07-0409:57malabarba@jan.zy: dir-local variables #2016-07-0409:57malabarbaThough it looks like you might have swapped the order there. ;-)#2016-07-0410:08malabarbaI think I have a post topic for this week. Way too many people ask about this. 🙂 #2016-07-0410:32jan.zy👍#2016-07-0410:32jan.zythanks#2016-07-0410:43jan.zyhmm, ok I created .dir-locals.el file using projectile-edit-dir-locals function#2016-07-0410:43jan.zyI switched to to this project#2016-07-0410:43jan.zyand still my vars are unset#2016-07-0410:44jan.zyThis is my .dir-locals.el:
((nil . ((cider-refresh-before-fn . "wunder-auth.repl/stop-server")
(cider-refresh-after-fn . "wunder-auth.repl/start-server"))))
#2016-07-0410:47jan.zyhmm, it should just work#2016-07-0414:40dhruv1this is the output I see when I exectue the function describe-personal-keybindings
C-c C-o `cider-repl-clear-buffer’
but when i execute C-c C-o it doesn’t do anything#2016-07-0414:40dhruv1can anyone tell me how I can debug this?
I don’t see any messages in the *Messages* buffer#2016-07-0414:55jan.zyi had the same problem#2016-07-0414:55jan.zyit deletes only output of the last command#2016-07-0414:55jan.zyor the output of earlier command - if you move your cursor on it#2016-07-0416:10malabarbaPress C-u before it #2016-07-0416:13malabarba@jan.zy did you reopen the file? #2016-07-0422:35malabarba@cddr: not that I know #2016-07-0422:35malabarbaBut PRs welcome simple_smile #2016-07-0508:48jan.zy@malabarba: reopening the file did help. Thanks!#2016-07-0508:49jan.zyDon’t forget to mention that in your future blog post;)#2016-07-0512:06chrisetheridgecould anyone help me with specifying an indent spec?#2016-07-0512:06chrisetheridgethe docs are a bit confusing#2016-07-0512:24pesterhazyWhen I use cider with boot, cider-find-var jumps to a path in my boot tempdir. Is there a way around that?#2016-07-0512:27pesterhazylooks like this should be handled by https://github.com/clojure-emacs/cider-nrepl/pull/270#2016-07-0512:44pesterhazyhm... I'm using boot 2.5.5, cider/cider-nrepl "0.12.0" and cider 20160629.946#2016-07-0512:44pesterhazystill jumps to the tempdir#2016-07-0513:21radon@malabarba: Did you have any ideas on getting *nrepl-server* to mirror its messages to *cider-repl*?#2016-07-0513:42robertoI’m getting this error now when starting cider:
[nREPL] Establishing direct connection to localhost:49716 ...
error in process filter: [nREPL] Direct connection failed [2 times]
#2016-07-0513:42robertoit just started yesterday#2016-07-0513:43robertoI upgraded cider this morning and still have the same issue#2016-07-0513:43robertoi have no idea what might have caused it. I haven’t modified my emacs configuration in months#2016-07-0513:47robertohmm, nevermind, I figured it out. Something screwed up my hosts file.#2016-07-0521:40malabarba@radon what emacs version are you on?#2016-07-0521:40radon24.5.1#2016-07-0521:43malabarba@pesterhazy: It works fine for me. Are you sure these are boot tempdir and not clojurescript tempdirs?
Also, maybe try 0.13.0-snapshot#2016-07-0521:48malabarba@radon: Try this:
`#2016-07-0521:48malabarba(add-hook 'cider-connected-hook
(lambda ()
(save-excursion
(goto-char (point-min))
(insert
(with-current-buffer nrepl-server-buffer
(buffer-string))))))
#2016-07-0521:49malabarbaIt'll just insert on the repl buffer everything that's on the nrepl buffer when you connect#2016-07-0521:50radonWhat if it never connects? When something goes terribly wrong, e.g. with the dependencies, sometimes the REPL fails to even start, and I just end up waiting five minutes before I check *nrepl-server* and realize that the *cider-repl* buffer is never going to open. (This is the primary reason that the default behavior annoys me.)#2016-07-0521:50radonBut I will try your code, for sure.#2016-07-0521:54malabarbaah#2016-07-0521:54malabarbathat should never happen#2016-07-0521:54malabarbaif the server fails to start Emacs should tell you#2016-07-0521:54radonI think I’ve gotten that a few times. But maybe I just needed to wait longer?#2016-07-0521:54radonI guess that’s possible.#2016-07-0521:54malabarbaIn that case cider prints the stacktrace on the *messages* buffer#2016-07-0521:54radonOh, well, yes, but *messages* isn’t open by default.#2016-07-0521:55malabarbaC-h e will open it. But you should still get a message on the echo-are#2016-07-0521:55radonThat’s probably true as well, but since the REPL for a large project can take several minutes to start up, I’ll be in the middle of other editing by that point.#2016-07-0521:55malabarbaIn fact, I think the message is the entire stacktrace, so it usually resizes my whole window to make the echo-area fit the stack trace. It's quite hard to miss ^^#2016-07-0521:56malabarbaah#2016-07-0521:56malabarbathat's possible#2016-07-0521:56malabarbaWe could popup the buffer in that case anyway#2016-07-0521:56malabarbaThe user is probably interested in the exception#2016-07-0521:58radonYes, I think that would be good default behavior. I would still prefer the REPL buffer to open immediately, so it can show log messages even if the REPL server hasn’t properly started, but I can see why other people wouldn’t want that.#2016-07-0521:59malabarbaIt's not that people wouldn't want that. I think it's more that it would complicate code.#2016-07-0522:00malabarbaThe repl buffer is created when the repl connection process is started. Separating the two would not be worth the complications.#2016-07-0522:01malabarbaAnd we can't make the repl connection any sooner than we already do, because that's up to lein/boot, not us.#2016-07-0522:03radonI am really very knowledge-less in the field of elisp, but it seems to me that it wouldn’t be too hard to make cider-jack-in create a buffer named *cider-repl*, and then replace the code that creates the buffer with code that uses the existing buffer (or creates a new one, if the first one has been killed by the user in the interim).#2016-07-0522:04radonBut, you know more than I do about how this works.#2016-07-0522:18malabarbaExcept we already have code that uses pre-existing buffers (which applies to cases where a REPL has previously existed), and it would conflict with this situation. 🙂#2016-07-0522:18radonOhhh…#2016-07-0522:18malabarbaOf course we can workaround it.#2016-07-0522:18malabarbaBut that's how complexity slowly increases. 🙂#2016-07-0606:56pesterhazy@malabarba: maybe you're right and I'm confused about clj vs cljs...#2016-07-0615:15malabarba@pesterhazy: I just mean that find-var is indeed broken for ClojureScript. But it should alway work with Clojure (even in boot). If you keeps experiencing the problem feel free to file an issue. #2016-07-0615:16pesterhazyI will, thanks!#2016-07-0621:35malabarba@channel People are always asking here about how to configure a variable per project. Hopefully this will help clear that up: http://endlessparentheses.com/a-quick-guide-to-directory-local-variables.html#2016-07-0708:42ordnungswidrigAny thoughts about https://github.com/kovrik/cider-diet ?#2016-07-0714:20dhruv1I am using use-package and using the :bind option to bind C-c C-o to another function.
For some reason it’s not over riding the keybinding defined in the cider package.
The function I’m trying to bind the key to:
(defun cider-repl-clear-output-and-buffer ()
(cider-repl-clear-output t))
#2016-07-0714:22dhruv1here is how the cider package is initialized:
(use-package cider :ensure t
:bind (("C-c C-o" . cider-repl-clear-output-and-buffer))
:init (progn
(setq nrepl-hide-special-buffers nil
cider-repl-pop-to-buffer-on-connect nil)))#2016-07-0715:28richiardiandrea@ordnungswidrig: I wrote a small task for boot yesterday and I am using it myself #2016-07-0715:29richiardiandreaStill alpha beta gamma software but it cuts down the startup time by 50+ % here#2016-07-0715:30richiardiandreaThen of course there is the time it takes for loading the first namespace you load #2016-07-0715:30richiardiandreaBut at least it feels faster#2016-07-0715:31richiardiandreaThe normal Clojure repl , starting in user, is instantaneous #2016-07-0715:31richiardiandreaBut again then you need to load the namespace(s) you want to work in#2016-07-0715:33richiardiandreahttps://github.com/kovrik/cider-diet/issues/1#2016-07-0715:53ordnungswidrig@richiardiandrea: thanks #2016-07-0718:05aengelbergAt the moment, my Cider REPL attempts to match {'s with }, but doesn't behave specially with any other delimiter. The "half paredit" functionality is mostly just getting in my way since I don't have access to all the paredit commands. Is there a way to turn that off, or enable full paredit support in the REPL? The latter is more ideal.#2016-07-0718:07aengelbergWhen I type {(abc the REPL does this which is not very useful: (`|` is my cursor)
> |
> {|}
> {(abc|}
At this point I cannot hit [RET] and continue my expression, it will just send to the REPL and get RuntimeException Unmatched delimiter#2016-07-0718:11aengelbergAlso, if I type { then backspace, I get this:
> |
> {|}
> |}
#2016-07-0718:12aengelbergUnfortunately the solution isn't as simple as M-x paredit-mode, since if I do something weird like (println "(") the REPL output will interfere with future input.#2016-07-0804:19malabarba@aengelberg: that doesn't sound like any default behaviour. There's probably some odd configuration in your init file #2016-07-0804:20malabarbaWhat I mean is, the repl buffer doesn't handle { specially #2016-07-0804:39aengelbergOk thanks, I'll look later into more depth on which of my plugins is causing that issue#2016-07-0804:39aengelbergCould clj-refactor be the issue? That's the only other plugin I know that might be messing with things#2016-07-0920:49malabarba@aengelberg I don't know. But if you just check which command is bound to that key it should tell you all lot #2016-07-1000:23zaneAnyone have ideas here:#2016-07-1000:23zane(`, t a` is bound to cider-test-run-all-tests)#2016-07-1012:53radon@zane: I get that error when I try to cider-load-buffer if the *cider-doc* buffer is also active, even if I’m in a different, Clojure buffer. This might be related.#2016-07-1118:44chrisetheridgeCould anyone help me with {:style/indent …} ?#2016-07-1119:46malabarbaSure. What's your issue? #2016-07-1119:54chrisetheridgejust unsure on how to style a certain indent i want to implement#2016-07-1119:55chrisetheridgei’ve got the macro
(defc afn < another-fn
fn-2
fn-3
{:map “too”}
[args])
#2016-07-1119:56chrisetheridgeso, i’d like to have another-fn fn-2 fn-3 all indent under each other#2016-07-1119:56chrisetheridge< is not a macro, it’s just a symbol#2016-07-1119:56chrisetheridgebut, defc does not have to have <#2016-07-1119:56chrisetheridgeit can just be
(defc afn [args] …)
#2016-07-1120:05chrisetheridgeanother example:#2016-07-1120:08chrisetheridgerum/static or rum/reactive are just maps / can be fn's#2016-07-1204:03malabarba@biscuitpants: there's no way to achieve that. The indent styles let you specify that a certain number of arguments are supposed to get a larger indentation. However, in your case the number of arguments you want isn't fixed, and the level of indentation you want isn't fixed either. :-/#2016-07-1206:55chrisetheridgeah I see 😕#2016-07-1206:55chrisetheridgeso the indentation only works for a set amount of args, i’m guessing?#2016-07-1213:41malabarbaYes. 😕 #2016-07-1214:28jan.zyHi, I am having a problem with refactoring code in cider. When I invoke M-x cljr-rename-symbol then emacs freezes for ca. 20 seconds and when it becomes responsive again I can see a following message in *Messages* buffer:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug false ns abcd.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/abcd/service/transaction.clj line 204 column 19 name persist-transaction ignore-errors nil)
#2016-07-1214:29jan.zythis is happening only in one project#2016-07-1214:30jan.zy$ find . -name '*.clj' | xargs wc -l
…
142912 total
#2016-07-1214:30jan.zyi guess that it happens because it has quite big codebase#2016-07-1214:31jan.zybut i’d really appreciate any workaround for this issue#2016-07-1214:31jan.zythe only relevant settings for cljr in my custom.el (I use Prelude):
(setq cljr-warn-on-eval nil)
#2016-07-1214:50benedeknice big project @jan.zy 😉#2016-07-1214:51jan.zyheh true, not my creation though#2016-07-1214:51jan.zyi am just a low-level peasant there#2016-07-1214:52benedekso try to set cljr--debug-mode to t#2016-07-1214:52benedekwhen you connect to cider your AST cache should be warmed#2016-07-1214:53benedekdebug mode would help in terms of telling you when warming is done#2016-07-1214:53benedekcould take longish on such a big project#2016-07-1214:53benedektbh if you keep on eye on cpu activity that would tell you the same too#2016-07-1214:54benedekalso in such a big project there could be some namespaces which we can’t build an AST for. so you can set cljr-ignore-analyzer-errors to t as well#2016-07-1214:54jan.zy(setq cljr--debug-mode t) ?#2016-07-1214:54benedekyup#2016-07-1214:55benedekso it tells you when you have all the ASTs built. after that rename should be relatively snappy 😉#2016-07-1214:55jan.zyhmm, it’s been ca. 30 minutes since I opened this project and started cider#2016-07-1214:55jan.zyand i still see the same error#2016-07-1214:56benedekdo you still have a high cpu activity?#2016-07-1214:57jan.zyyes#2016-07-1214:57benedekhm...#2016-07-1214:57jan.zyand it looks that this is exactly this process#2016-07-1214:58benedekhm.. try to set cljr-ignore-analyzer-errors too and restart#2016-07-1214:59jan.zyok, I can’t do that right now but I’ll come back to that soon#2016-07-1214:59jan.zythanks for help#2016-07-1214:59benedekno worries. let me know how you get on#2016-07-1214:59jan.zyi will, stay tuned#2016-07-1219:10jan.zy@benedek: I retested refactoring. My config:
(setq cljr-warn-on-eval nil)
(setq cljr-ignore-analyzer-errors nil)
(setq cljr--debug-mode t)`
*Messages* Comments relate to logs below them:
;; T 0 min:
Connected. Jan, this could be the start of a beautiful program.
;; CPU ~100% T 1 min:
Artifact cache updated
;; CPU stays at 100%...
;; T 5 min. CPU dropped to ca. 0%:
error in process filter: user-error: Some namespaces are in a bad state: error "nil" in taxamo.test.service.settlement-global-test; error "nil" in taxamo.test.service.tax-service-globalisation-test
error in process filter: Some namespaces are in a bad state: error "nil" in taxamo.test.service.settlement-global-test; error "nil" in taxamo.test.service.tax-service-globalisation-test
#2016-07-1219:11jan.zyNext, I tried to rename a symbol.
1. CPU grew up to 100%
2. In minibuffer I saw: Fetching symbol occurences….
3. After ca. 20 seconds in *Messages* I noticed the same message as before:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug true ns taxamo.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj line 204 column 20 name persist-transaction ignore-errors nil)
4. CPU decreased to ca. 0%#2016-07-1219:12jan.zyI can recreate it every time I restart REPL in this project#2016-07-1219:13jan.zyI’ve seen error in process filter:… message in this project for a year now.#2016-07-1219:13jan.zyand finally I’d like to solve debug and solve it.#2016-07-1219:17benedekset ignore-AMALYZER-ERRORS to t#2016-07-1219:18benedekSorry for typos, uppercase. On my phone...#2016-07-1219:18jan.zyI also found an exception in *nrepl-messages* ^^#2016-07-1219:19jan.zy[baselayer is one of our home-made libraries]#2016-07-1219:19jan.zyok i’ll start again with (setq cljr-ignore-analyzer-errors t)#2016-07-1219:20benedekCool. That should help with those test nses which seem to be broken#2016-07-1219:28jan.zyhmm, this time, there was no exception but the same error in *Messages*:
Fetching symbol occurrences...
nrepl-send-sync-request: Sync nREPL request timed out (op find-symbol prefix-rewriting true debug true ns taxamo.service.transaction dir /Users/jan/Dev/evat/ file /Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj line 160 column 9 name prepare-transaction-data ignore-errors true)
#2016-07-1219:29jan.zyin *nrepl-messages*:
(-->
op "info"
session "de980247-4255-4072-8115-5c7955f3c0ad"
ns "taxamo.service.transaction"
symbol "prepare-transaction-data"
id "17"
)
(<--
arglists-str "([merchant transaction-data])"
column 1
file "file:/Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj"
id "17"
line 160
name "prepare-transaction-data"
ns "taxamo.service.transaction"
session "de980247-4255-4072-8115-5c7955f3c0ad"
status ("done")
)
(-->
op "find-symbol"
prefix-rewriting "true"
debug "true"
ns "taxamo.service.transaction"
dir "/Users/jan/Dev/evat/"
file "/Users/jan/Dev/evat/src/clj/taxamo/service/transaction.clj"
line 160
column 9
name "prepare-transaction-data"
ignore-errors "true"
session "de980247-4255-4072-8115-5c7955f3c0ad"
id "18"
)
(<--
id "14"
occurrence "REMOVED"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
(<--
id "14"
occurrence "REMOVED"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
(<--
id "14"
occurrence "{:line-beg 295, :line-end 295, :col-beg 33, :col-end 77, :file \"/Users/jan/Dev/evat/src/clj/taxamo/service/transaction_upload_service.clj\", :name \"taxamo.service.transaction/prepare-transaction-data\", :match \"transaction-data (transaction-service/prepare-transaction-data merchant transaction-data)\"}"
session "de980247-4255-4072-8115-5c7955f3c0ad"
)
#2016-07-1219:30jan.zycider properly found occurences of the symbol (I removed that piece of log) and nothing else happened#2016-07-1219:32jan.zyit looks like I’ll have to spend an evening debugging cider-nrepl unless you have some other ideas 🙂#2016-07-1219:41benedekHave you seen a msg after jacking in like: "AST cache updated"?#2016-07-1220:57benedekso I see two options here:
- after jacking in you wait until you see "AST cache updated”, on a project this large this could take a long time. but after that rename-symbol should be snappy. (if it is not, that is deffo a bug, pls report it on github)
other option needs a bit of explanation. rename symbol calls the middleware synchronously, reason being the project being in a broken state until the renaming is finished. so we want to block until all the renaming is finished. however if cljr-warn-on-eval is nil we define 25sec timeout, see line 2102 in clj-refactor.el: (let* ((nrepl-sync-request-timeout (if cljr-warn-on-eval nil 25)). I guess my reasoning here was that if warn-on-eval is nil we warm the ast cache so the whole thing should not take longer than 25sec. perhaps this is a wrong assumption. anyhow you can rewrite this line to be (nrepl-sync-request-timeout nil) re-evaluate the defun and see if that helps.#2016-07-1500:04noogaI’m using https://github.com/ptaoussanis/tufte for profiling, readme says it should append its ouput to *out* but when I try to profile some forms, the output is nowhere to be found - not in the repl buffer, not in the server buffer, nowhere#2016-07-1500:05noogaI noticed that sometimes stdout from my processes gets lost whilie using cider#2016-07-1501:04Drew Verleenewbie question, how do you invoke cider-debugger as part of a more complicated application that i would need to start from the command like via lien test-something#2016-07-1502:10scriptorif C-c C-c isn't working, is there anything else I can try to stop evaluation in a repl?#2016-07-1512:38bozhidar@nooga: I’d suggest filing a ticket regarding this; you should attach the nrepl messages in the nrepl-messages buffer there#2016-07-1512:39bozhidar@drewverlee: not sure what you mean by this; more details would be useful#2016-07-1512:39bozhidar@scriptor: nope, there’s nothing else you can do#2016-07-1512:40bozhidarwhat happening when you press C-c C-c in the REPL? what are the message in nrepl-messages?#2016-07-1515:19jan.zy@nooga: could you mention me in the ticket when you create it? I think I had the same problem#2016-07-1515:21nooga@jan.zy sure, though I’m still investigating to eliminate my own fault before submitting the ticket#2016-07-1517:40Drew Verlee@bozhidar:
If I want to set a break point inside a function that gets called as part of test. How do i run the tests lein test something and have the program stop at the break point so i can inspect stuff.#2016-07-1522:42malabarba@drewverlee: It should work if you run the tests from cider#2016-07-1522:42malabarbalike with cider-run-ns-tests#2016-07-1522:42malabarbaIf you run lein test something in the terminal then that's an entirely separate JVM process#2016-07-1522:43malabarbacider has no access to that#2016-07-1602:51dpsuttoni'm running make test and I'm getting them all erroring. No such file queue, spinner, clojure-mode, etc#2016-07-1603:05dpsuttonmay be that my version for emacs is 25.0.91.4 or something and the cask deps are going into a version file for 25.1.x.x or something#2016-07-1603:05dpsuttonpulling from git and rebuilding emacs to see if that fixes things#2016-07-1606:37blueberry@drewverlee: Are you sure you want do call that defn inside -main? Does it work with regular Clojure code outside -main?#2016-07-1612:45akiva@drewverlee, using defn or def inside of a defn is not idiomatic Clojure. That’s what letfn and let are for. Anything beginning with def is meant for top-level definitions.#2016-07-1614:09malabarba@drewverlee: that command instruments the function. You still need to call the function in order to step through it. #2016-07-1614:45Drew Verleeright that all makes sense.
trying to get something else to work. I correct the test below to work then save the file.
(ns sad.core-test
(:require [clojure.test :refer :all]
[sad.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 1 1))))
and i call cider-test-run-ns-tests and i get
Test Summary
sad.core-test
Tested 1 namespaces
Ran 1 assertions, in 1 test functions
1 failures
Results
sad.core-test
1 non-passing tests:
Fail in a-test
FIXME, I fail.
expected: (= 0 1)
actual: (not (= 0 1))
where i would the test to pass because i set 1 to 1? Is there anything i have to do beyond saving the file before calling cider-test-run-ns-tests#2016-07-1614:50Drew Verleeit seems calling cider-refersh causes this to work#2016-07-1614:51Drew Verleewhich i find odd, now its not clear to be when i have to call cider refresh.#2016-07-1614:53malabarbaAny evaluation command would have done the trick #2016-07-1614:54malabarbaI usually load-file or eval-defun #2016-07-1614:54malabarbaCider never cares about your file contents #2016-07-1614:55malabarbaThe JVM only knows about things you've evaluated #2016-07-1614:56Drew Verleeah, that actual connects a few dots for me#2016-07-1615:12dpsuttonanybody ever see anything like this when running make test? Basically all tests fail#2016-07-1616:04malabarba@dpsutton TBH I don't use cask to run the tests #2016-07-1616:05malabarbaI just install the deps from the package menu and run the tests from emacs #2016-07-1616:05malabarbaBut I'm sure someone can help you with that. #2016-07-1616:06malabarbaMaybe @bozhidar #2016-07-1616:06Drew Verleeany obvious starting points for what would cause error while handling the debug message: (not a nrepl dict) to occur while evaluating a function after running cider-defun-debug-at-point.#2016-07-1616:07dpsuttonah ok. thanks#2016-07-1616:07dpsuttonhow do you run the tests from inside emacs?#2016-07-1616:07dpsuttonobviously with ert, but how do you reliably run them all?#2016-07-1616:09malabarbaI load the tests file(s), and then M-x ert #2016-07-1616:09dpsuttonso no good way to make sure that you run them all?#2016-07-1616:10malabarbaWhat do you mean? M-x ert should run them all #2016-07-1616:10dpsuttoni mean having to load all the files#2016-07-1616:11dpsuttonmaking sure you found all test files in the project#2016-07-1616:13malabarbaAh yes #2016-07-1616:14malabarbaNo easy way to load all the files in general 😕 #2016-07-1616:18dpsuttonDo you know of a good guide of how to setup local copies of the cider middleware so that i can send pull requests? I'm not sure how to make that stuff load local copies versus whatever it normally does#2016-07-1616:19dpsuttontrying to make some changes to the clojure middleware#2016-07-1616:39dpsuttonhmm, i'm unable to use cider to run individual cider-nrepl tests since they use test fixtures. Cider doesn't know to use the test fixture#2016-07-1617:00Drew Verleeudpate: I changed my ~/.lein/profiles.clj to not be utterly wrong and everything seems to be working#2016-07-1617:20dpsuttonwhen running cider-nrepl tests, both from cider's test runner and from lein, i'm getting only 2 tests with 16 assertions#2016-07-1617:31dpsuttonah ok. so its nested under a profile :test-clj#2016-07-1618:19malabarba@dpsutton as for your first question, it should be as simple as cloning cider and doing jack-in on the repository. If you explicitly want to test its behaviour on another project you can do lein install to install your local clone. #2016-07-1618:19dpsuttonah ok. thanks#2016-07-1618:19dpsuttoni've already sent a simple pull request#2016-07-1618:20malabarbaThen, when you jack-in on some other project it should catch the just-installed version #2016-07-1618:20dpsuttoni'm looking into the consistent test names functionality#2016-07-1618:20dpsuttonso lein install puts it in the m2 directory so that other projects use that version?#2016-07-1618:21radonAssuming that your project.clj specifies the version that you lein-installed, yes.#2016-07-1618:22radonYou may want to bump the version number before lein-installing, so that you can easily switch back to the official version by changing the dependency vector in your project.clj.#2016-07-1618:31malabarbaYes, what @radon said. Lein install puts it in the m2 directory. Your project will use that version if it matches the version of cider.el you have. #2016-07-1618:33radonI should clarify my statement. If you’re working with things like CIDER that expect a particular dependency number, then bumping the version number is probably a bad idea. Only do that if you’re working with dependencies amongst your own projects.#2016-07-1618:36malabarba@dpsutton and thanks for the PR 😃 #2016-07-1709:45luxbock@magnars: I remember seeing you using a mode/function in PotD where it narrowed your buffer to display just the functions that were using the defun in which the point was currently in, but I think it wasn't something you had released yet back then#2016-07-1709:45luxbockhas that changed, or is it still just a part of your own configuration?#2016-07-1710:27magnars@luxbock: not released, but available here: https://github.com/magnars/.emacs.d/blob/master/site-lisp/symbol-focus.el#2016-07-1710:27luxbock@magnars: thanks#2016-07-1710:28luxbockare you planning on officially releasing it? it seems like a very useful feature#2016-07-1710:28luxbockI was thinking of wrapping it up as a Spacemacs layer#2016-07-1720:30magnars@luxbock: I already have too many badly maintained OS repos, so probably no. I'd be happy to donate the code to someone willing to maintain it tho. #2016-07-1722:13malabarba> I already have too many badly maintained OS repos, so probably no.
@magnars: we should start a club 😛 #2016-07-1807:35cycle337hello guys, I'm new to cider and boot, and I want to configure it to work in emacs (got it from elpa) not inject it in my project#2016-07-1807:36cycle337thing is, whenever I start cider-jack-in it wants to open an nREPL with lein#2016-07-1807:36cycle337tried to search for tutorials or manuals on this but no success#2016-07-1809:39delaguardoMy customizations:
in ~/.boot/profiles.boot
(deftask cider "CIDER profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.13.0-SNAPSHOT"]
[refactor-nrepl "2.3.0-SNAPSHOT"]
[alembic "0.3.2"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
And in emacs customizations for cider-mode:
"Cider Preffered Build Tool" => "boot"
and "Cider Boot Parameters" => "cider repl -s wait"#2016-07-1809:42delaguardoget it from this tutorial - https://github.com/boot-clj/boot/wiki/Cider-REPL#a-better-way#2016-07-1810:14cycle337thank you @delaguardo I'll check this out give it a swirl#2016-07-1812:58malabarba@avabinary:
> thing is, whenever I start cider-jack-in it wants to open an nREPL with lein
If you have a build.boot file in your project, cider should either give you the option of using boot or just use boot automatically. #2016-07-1812:58malabarbaI.e., it should just work #2016-07-1813:00malabarbaI would recommend against using a special cider task unless you really know what you're doing. #2016-07-1813:02malabarbaCider already injects the right version for you, and using a self defined task is going to give you headaches if you forget to update the version #2016-07-1917:35voxdoloanyone know if there's a way to have the cider repl preserve history between sessions?#2016-07-2014:14kasuko@voxdolo: There is this bit in the documentation that shows you how to configure the history to store in a file. I haven’t tested it yet though myself but it may be what you’re looking for. https://cider.readthedocs.io/en/latest/using_the_repl/#repl-history#2016-07-2016:10voxdoloThank you @kasuko! I missed that when I looked through the docs 😐#2016-07-2016:10kasukoThey are pretty expansive 😛#2016-07-2100:48jaermeHi everyone. New to the channel. For some reason, I am now getting a java.lang.ArrayIndexOutOfBoundsException whenever I try to jack-in. It has worked for me in the past. I am running on Arch. Can anyone help?#2016-07-2102:27jaermeAdditional info... Exception thrown at clojure.lang.LispReader, at clojure.lang.Compiler, subprocess failed#2016-07-2104:17richiardiandrea@jaerme: maybe some residual in the profile config? #2016-07-2113:23artemyarulinHi, can anybody help: I have a nREPL with figwheel connected to cider, works just fine. Whenever I’m in in CLJS file and evaluate s-expression - it works, it returns, everything is great. But when I’m in CLJC file I cannot do anything - cider always says
cider-eval-last-sexp needs a Clojure REPL.
If you don’t know what that means, you probably need to jack-in (C-c M-j)
same happens when I’m in CLJ file, so is there any way how to tell cider to use the existing CLJS connection? I don’t have anything else and I’ve checked already that it’s a default one#2016-07-2113:56artemyarulinOpps, sorry, never mind - for some reason compiled JS file wasn’t loaded by figwheel that’s why cider wasn’t able to eval on it#2016-07-2114:17artemyarulinNope, even more weird - when I type a function name I have a hint on the bottom about function arguments, etc., so it looks like it got it right. But still once I try to eval it - cider-eval-last-sexp needs a Clojure REPL.#2016-07-2114:19artemyarulinOH, I’ve activated clojurescript-mode and regardless of a warning that the mode is wrong the whole thing works!#2016-07-2123:12blueberry@bozhidar: I have just watched your Clojure/West 2016 presentation. It's probably THE most entertaining tech talk I've ever watched! I'm proud to be from the Balkans 🙂 Благодаря!#2016-07-2212:29sundbpif I add test.check to a project where i use cider-nrepl/cider i seem to bomb out when i try to fire up a REPL. I can post a stack trade - wanted to check if anyone uses test.check and cider successfully first?#2016-07-2212:37malabarbaYep. I use them just fine. @sundbp #2016-07-2212:39sundbpah, interesting.#2016-07-2213:45anmonteiroPSA: if anyone regularly installs emacs from the git HEAD, the following commit breaks cider-jack-in with error in process filter: [nREPL] Direct connection failed
https://github.com/emacs-mirror/emacs/commit/a066fb1ceee373c982214c28206108c5fba01bf7#2016-07-2216:29malabarbaThat sounds bad #2016-07-2216:29malabarba😕 #2016-07-2216:30malabarbaI'll try to reproduce #2016-07-2217:30jaermeseeing this error when trying to jack in... error in process sentinel: Could not start nREPL server: Could not find artifact cider:cider-nrepl:jar:0.13.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact cider:cider-nrepl:jar:0.13.0 in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.#2016-07-2217:44sundbpfor my project, which jack’s in just fine with cider before adding a dependency on test.check 0.9.0, I see this exception which stops the REPL from starting (on cider-jack-in):#2016-07-2217:46sundbpthat’s using latest MELPA#2016-07-2218:27dpsuttonare you able to tart up a regular repl without cider?#2016-07-2300:19jaerme@dpsutton: I was unable to, so I guess there was an issue with the project I was in. Tried it in a different project and it worked fine. Thanks for the suggestion.#2016-07-2300:20dpsuttonno problem. always nice to find out if its a cider issue or a clojure/project issue#2016-07-2302:23malabarba@sundbp: it kinda looks like a dep conflict #2016-07-2302:23malabarbaMaybe test.check is pulling in an older version of tools.nrepl? #2016-07-2302:24malabarbaYou could try explicitly specifying the latest tools.nrepl #2016-07-2307:10bozhidar@blueberry: thanks 🙂#2016-07-2318:59ericnormandhello!#2016-07-2319:00ericnormandIn several screecasts I've seen people have the output of compiling an expression more permanently added (and updated?) in the buffer#2016-07-2319:00ericnormandmy vanilla cider install will display the result in the buffer, but any editing or moving the cursor will make it disappear#2016-07-2319:00ericnormandhow can I make it stick around?#2016-07-2319:14malabarbaThere are a couple ways to do that #2016-07-2319:14malabarbaI think if you just browse the CIDER Eval menu bar you should find all of the options #2016-07-2400:44kgzmFor some reason recent versions of cider no longer font-lock/highlight qualified functions from other namespaces. clojure.core gets highlighted and referred functions get highlighted but not qualified functions. some-namespace/wonderful-fn will not be highlighted. Is there a setting to control this or is this feature not working or is it my setup?#2016-07-2401:10kgzmHrm, sometimes it doesn't even highlight clojure.core, very strange.#2016-07-2422:02sundbp@malabarba: ok, I’ll check that.#2016-07-2422:56akivaOy. I’ve run into and solved these sorts of errors before but I now for the life of me cannot remember what it was I did to correct them. The situation is me running lein trampoline ring server-headless. Running merely lein trampoline repl :headless presents no difficulty.
WARNING: CIDER's version (0.13.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
and
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.3.0-SNAPSHOT (package: 20160621.902) and n/a, respectively.
Everything looks fine in ~/.lein/profiles and such. I’ve also checked my settings against the documentation provided at but with no luck.#2016-07-2422:58radonHm. Maybe you have things nested incorrectly in your profiles.clj? Mine looks like {:user {:plugins [[cider/cider-nrepl "0.12.0"]
;; Linters
[jonase/eastwood "0.2.3"]
[lein-ancient "0.6.10"]
[lein-bikeshed "0.3.0"]
[lein-cljfmt "0.5.3"]
[lein-kibit "0.1.2"]
[venantius/yagni "0.1.4"]
;; Documentation generators
[lein-codox "0.9.5"]]}}#2016-07-2422:58radonOtherwise I think it must be some configuration overriding the profiles.clj somehow.#2016-07-2422:59akivaHm. The Cider docs specifically say the cider-nrepl plug-in should be in {:repl … } rather than :user...#2016-07-2422:59akivaMaybe I should roll back to non-snapshot versions.#2016-07-2422:59radonI’ve never seen that before… but what do I know?#2016-07-2422:59radonI’ve used 0.13.0-SNAPSHOT before and that works fine too.#2016-07-2422:59radon(Well, depending on which Emacs setup I’m on. Different ones seem to want different versions.)#2016-07-2423:00akivaWorse comes to worse, I can just launch the ring server separately from a REPL. I was just trying to conserve memory usage by having them all in one go.#2016-07-2423:00radonI think it’s probably safer to put it in :user, in general.#2016-07-2423:00radonBut I don’t know the mechanics of all this.#2016-07-2423:01akiva'Be careful not to place this in the :user profile, as this way CIDER's middleware will always get loaded, causing lein to start slower. You really need it just for lein repl and this is what the :repl profile is for.'#2016-07-2423:01akivaAccording to the CIDER docs at any rate.#2016-07-2423:05dpsuttondoes anyone know how to load cider with a profile? Most tests don't run under the default profile and I would like to be able to run tests individually with cider, but i'm unsure how to load the correct profile#2016-07-2423:06akivaFrom the command-line, you can do stuff like lein with-profile [profile1, profile2] *task*.#2016-07-2423:14dpsuttoncorrect. Just wondering if there was a way to put cider into this mode, so that when running tests i could get the same results#2016-07-2423:19akivaOh, yeah, I dunno. I do everything via the command line and then cider-connect.#2016-07-2423:23radonOh… yeah, my lein is probably just starting slowly. Oops.#2016-07-2423:23radonI’ll put it on my list of things to look into.#2016-07-2423:42malabarba@dpsutton: cider-lein-params should let you specify profiles#2016-07-2423:42malabarbaand any other lein options#2016-07-2423:43dpsuttonah ok#2016-07-2423:43dpsuttoni'll try that#2016-07-2423:43dpsuttoni'm working on the nrepl stripping out \r characters#2016-07-2423:43malabarba@akiva: That warning could mean a number of different things. There's a section on the manual explaining all of the possibilities#2016-07-2423:43dpsuttonit looks like you set a bunch of middleware and pass that into core's version of nrepl#2016-07-2423:44dpsuttonjust trying to figure out where to start looking#2016-07-2423:44malabarba@akiva https://cider.readthedocs.io/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version#2016-07-2423:45malabarba@dpsutton: I'm confused, what are we talking about now? 🙂#2016-07-2423:45dpsuttonhaha. cider nrepl#2016-07-2423:45dpsuttonhttps://github.com/clojure-emacs/cider/issues/1677#issuecomment-234792487#2016-07-2423:46dpsuttonlein repl prints this as two lines, whereas cider leaves it as one#2016-07-2423:46dpsuttoni'm gonna try to resolve this one, and it makes it easier if i can run tests inside cider#2016-07-2423:46dpsuttonbut only 2 tests run in the default profile. Whereas 1100 or so run with the +test-clj profile#2016-07-2423:48malabarbaHm#2016-07-2423:48malabarbayes#2016-07-2423:48malabarbaIt should be enough to do something like: (setq cider-lein-parameters (concat "+test-clj " cider-lein-parameters))#2016-07-2423:50akiva@malabarba, yep, I read that. My ~/.lein/profiles.clj was already configured to match.#2016-07-2423:54dpsuttongot any suggestions on where to start looking? Where does the chain start when you evaluate (print "foo\rbar\n")#2016-07-2423:58malabarba@dpsutton: I would look into where Emacs receives the stdout message#2016-07-2423:58malabarbaSee if it gets a foo\rbar\n or a foobar\n#2016-07-2423:58malabarbaIf Emacs is receiving a foo\rbar\n then it's up to cider.el to print that properly#2016-07-2423:59dpsuttoni looked into (defun cider-repl--emit-output-at-pos (buffer string output-face position &optional bol) and it's already a foobar\n#2016-07-2500:00malabarbahm#2016-07-2500:01malabarbathen the \r is probably getting swallowed on the cider-nrpel side#2016-07-2500:01malabarbayep#2016-07-2500:01malabarbait definitel is#2016-07-2500:01dpsuttonyeah i'm digging around in the nrepl side and i'm kinda lost#2016-07-2500:01malabarbaThat's super weird#2016-07-2500:02malabarbacould be a tolls.nrepl bug#2016-07-2500:02dpsuttontolls?#2016-07-2500:02malabarbatools.nrepl 🙂#2016-07-2500:02dpsuttonah#2016-07-2500:02dpsuttonso in core?#2016-07-2500:02malabarbayeah#2016-07-2500:03malabarbatools.nrepl is part of clojure, but it's not technically clojure.core#2016-07-2500:03malabarbait gets separate releases#2016-07-2500:03dpsuttonwell, the tough thing is that from a lein repl this works correctly#2016-07-2500:03dpsuttonso that's what makes me suspect that this is inside of a middleware somewhere#2016-07-2500:04malabarbaYou can try disabling some of cider's middlewares#2016-07-2500:04malabarbaThe first suspect would be the out middleware#2016-07-2500:04dpsuttonok#2016-07-2500:05dpsuttonand to do this, i'll run lein install to install nrepl into the m2 directory and then jack in should see it?#2016-07-2500:05malabarbaThey aare listed in src/cider/nrepl.clj#2016-07-2500:05malabarbaI'm not sure if you need to lein install#2016-07-2500:05malabarbaMaybe you wont' need to if you're running the cider-nrepl project directly#2016-07-2500:05dpsuttonok#2016-07-2500:06dpsuttoni'll try it now#2016-07-2500:06dpsuttonas always thanks for your thoughts#2016-07-2500:06malabarbaYou're threading mildly explored territory there#2016-07-2500:06malabarbaso your guess is as good as mine 🙂#2016-07-2500:06dpsuttonhaha#2016-07-2508:52bozhidarCIDER 0.13 (California) is out! The details are here https://github.com/clojure-emacs/cider/releases/tag/v0.13.0#2016-07-2509:21sundbp@malabarba: afraid no dependency diffs caused by incl test.check other than test.check.#2016-07-2509:25sundbp@malabarba: however, updating my cider version from melpa just now and i’m good again..#2016-07-2509:25sundbp🙂#2016-07-2509:34sundbphowever, if i do insturment a NS and try to run tests from cider I get errors:#2016-07-2509:54sundbpfiled an issue for cider-nrepl on this as well#2016-07-2515:18tcrawleyI just upgraded to cider 0.13.0 (from 0.8.2), and no longer get a repl buffer when I jack-in#2016-07-2515:18tcrawleyI see: Starting nREPL server via /Users/tcrawley/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.2.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.13.0\"\] -- repl :headless...
nREPL server started on 62182
[nREPL] Establishing direct connection to localhost:62182 ...
[nREPL] Direct connection established
Connected. Code long and prosper!
#2016-07-2515:18tcrawleyin *Messages*#2016-07-2515:18tcrawleywith no errors#2016-07-2515:19tcrawleyany tips on how to debug this?#2016-07-2516:21seancorfield@bozhidar: Great to see a new CIDER version! Thank you! Will Prelude get an update soon to select the new CIDER version on jack in?#2016-07-2516:28dpsuttoni looked and prelude only requires CIDER, not a particular version#2016-07-2516:28dpsuttonso it will grab the most up to date one, in this case, the california release#2016-07-2517:35seancorfield@dpsutton: It seems to be pulling in the 0.13.0-SNAPSHOT when starting a REPL via Boot, which is why I asked.#2016-07-2517:36dpsuttonAh. I know that melpa has a delay so its possible that it's not there yet. But it should take a bit but it's coming#2016-07-2517:41seancorfieldYeah, looks like 20160629.946 is the version I have in the elpa folder...#2016-07-2517:42seancorfieldI probably just need to kill emacs and restart it from scratch to see if it’ll update stuff 🙂#2016-07-2517:44seancorfieldWell, it didn’t just now so I’ll try it again tomorrow...#2016-07-2518:29malabarba@tcrawley: that's a pretty long upgrade. It's probably best to delete cider, restart emacs, and install again. #2016-07-2518:31malabarba@sundbp: thanks for the report #2016-07-2518:31malabarbaIt's probably a genuine bug, so hopefully we'll have time to look at it. ☺️#2016-07-2519:11richiardiandreammm I receive a error: Required feature cider-eldoc' was not provided` after the upgrade`...I am installing cider manually, is (require 'cider) the only thing I need to do?#2016-07-2519:17richiardiandreaoh it is trying to compile it sorry: Compiling file /.../lib/cider/cider.el at Mon Jul 25 12:15:59 2016#2016-07-2519:21richiardiandreawith ~ 5 warnings (Malabarba do you want me to open an issue?) but a byte recompile solved#2016-07-2519:40tcrawley@malabarba: that did the trick, thanks!#2016-07-2520:29malabarba@richiardiandrea: what did you do to install?#2016-07-2520:39richiardiandreaI usually clone and require, but I got it working no probs..my emacs also compiles automatically but you need to do it in order#2016-07-2521:10jsa-aerialI'm on 0.12. Is there any gotcha going from this to 0.13? Along those lines, does the new 'evaluation map' mean that things like C-xC-e no longer work??#2016-07-2521:21dpsuttonThe new evaluation map is kinda internal. It took everything that was mapped to C-c C-v ... and put them on the same map so that you could nest them together somewhere else easier#2016-07-2521:21dpsuttonbut it should only affect you if you remapped a bunch of things from C-c C-v#2016-07-2521:23dpsuttonyou can see what was changed in this commit#2016-07-2521:23dpsuttonhttps://github.com/clojure-emacs/cider/commit/20ac45c04007414dd76d302d36e1a9d030076bf2#2016-07-2521:30jsa-aerialHmm, in 0.12, I get C-c C-v is undefined. Obviously not something I ever used...#2016-07-2521:38dpsuttonall of the following are nested under C-c C-v now#2016-07-2521:40dpsuttonand if you use which-key, you should get a menu that pops up to describe them for you#2016-07-2603:06dpsuttondoes anyone have any examples of refresh hook functions they use?#2016-07-2605:09richiardiandrea@dsutton you mean a function that calls tools..../refresh :after ..)?#2016-07-2612:19dpsuttonyes#2016-07-2612:19dpsuttonor, really, an example of what an after cider refresh function would do#2016-07-2613:50malabarba@jsa-aerial: no, it doesn't mess with C-x C-e #2016-07-2614:16dhruv1I am inside a clojurescript project and I’m using emacs and nRepl and cider for development.
I am also using figwheel (server?).
I start the lein server from my terminal lein repl :headless and use cider-connect C-c M-c to connect to the lein server
after i start figwheel and run this command (figwheel-sidecar.repl-api/cljs-repl)
i can no longer compile code from a file.
i.e. running C-c C-k doesn’t work and i get this message in my *Messages* buffer.#2016-07-2614:17dhruv1user-error: `cider-eval-defun-at-point' needs a Clojure REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-j').
Mark set
#2016-07-2614:21dhruv1Update: I just tried using the cider-jack-in command to start and connect to a repl from emacs.
I get the same error#2016-07-2614:21richiardiandrea@dpsutton: mine is pretty simple but configurable through .dir-locals.el: https://github.com/arichiardi/ar-emacs-pack/blob/master/config/cider-conf.el#L87#2016-07-2615:14dpsuttonlot of good stuff in there. I'll be taking many cues from that. Thanks for sharing that @richiardiandrea#2016-07-2615:16richiardiandreaah ah no problem feel free 😉#2016-07-2616:45malabarba@dhruv1 is that a Clojure file you're working on? Or a Clojurescript file? #2016-07-2617:16dhruv1clj file#2016-07-2617:17dhruv1@malabarba: it also doesn’t work for a cljs file#2016-07-2617:49dhruv1realized the problem was here:
(defun cider-connection-type-for-buffer ()
"Return the matching connection type (clj or cljs) for the current buffer."
(cond
((derived-mode-p 'clojurescript-mode) "cljs")
((derived-mode-p 'clojure-mode) "clj")
(cider-repl-type)
(t "clj")))
for my cljs file the major-mode isn’t clojurescript-mode.
therefore, it (`cider-connection-type-for-buffer`) defaults to clj type.
my current cider-connection-type-for-buffer is cljs and therefore it wasn’t working.
tldr;
after setting the major-mode in a cljs file to clojurescript-mode i can compile the file using C-c C-k without getting an error,.#2016-07-2618:10aganyone has problems with connecting to repl from CIDER?
nrepl--direct-connect: [nREPL] Direct connection failed
#2016-07-2618:12agjacking-in not working as well#2016-07-2619:10dhruv1@ag: you can toggle-edebug-on-error to narrow it down further.
but to answer your question, I didn’t have a problem with cider-jack-in#2016-07-2619:53ag@dhruv1: I rolled back to Emacs 24 and now it works. I tried installing Emacs 25, apparently something broke.#2016-07-2619:54dhruv1oh ok.#2016-07-2620:14malabarba@dhruv1 👍 #2016-07-2620:14malabarba@ag: yes, someone else reported that here recently #2016-07-2620:15malabarbaI said I'd try to reproduce and forgot about it #2016-07-2620:15malabarbasimple_smile #2016-07-2620:15malabarbaSomething changed in the interaction with the subprocess which broke jack-in #2016-07-2705:58yuris@ag, @malabarba - just wanted to ask about the same problem, and saw your messages. I've just updated CIDER to 20160725.136, and bumped up Emacs, and got exactly the same problem. Emacs 25.1.50.5, latest from master, commit 682fdae. The previous version of Emacs was older by just a few weeks, about 130-140 commits, and it was fine. Maybe it will help you to narrow it down.#2016-07-2706:13yuris@malabarba: just checked out Emacs 25 from 4 weeks back, a randomly chosen commit 0644e6f - CIDER is fine. So there you have it - something got broken between 0644e6f and 682fdae. Hope it helps. Let me know if you need any additional info or help in recreating it. Cheers!#2016-07-2715:00PBIs anyone developing in a docker container using emacs and cider? If so, are you able to jump to fn definitions in a different ns? I keep getting no source locations and https://github.com/clojure-emacs/cider/issues/589 doesnt' seem to address it for me#2016-07-2715:25gtrak@petr: I'm using docker-compose and I get around this by mounting my home directories, source, and .m2 so paths line up.#2016-07-2715:25gtrakIt feels like overkill to relativize eg resource paths, if cider goes down that route.#2016-07-2715:27gtrakit might be nice to expose some vars or regexes for this just on the client code#2016-07-2715:29gtrakbut you will want to mount your source dirs inside the container to enable things like tools.namespace to watch files#2016-07-2715:31PB@gtrak: That is kinda nasty, but I'll take it if it allows me to jump to the location#2016-07-2715:32PBSomthing like this?
volumes:
- "~/.m2/.:/.m2"#2016-07-2715:32gtrakyea but no tilde on the right side#2016-07-2715:33gtraknot sure about the expansion rules but this has been working for me: - ~/dev/mycode:/home/gary/dev/mycode
- ~/.m2:/home/gary/.m2
- ~/.boot:/home/gary/.boot
#2016-07-2715:34PBThat's really interesting#2016-07-2715:34gtrakthe absolute paths are what need to line up#2016-07-2715:34PBThat's fair#2016-07-2715:34gtrakalso have to tell it to use /home/gary/.m2#2016-07-2715:34PBThat also means I have to run lein deps on the host machien#2016-07-2715:35gtrakenvironment:
BOOT_LOCAL_REPO: /home/gary/.m2/repository
BOOT_HOME: /home/gary/.boot
#2016-07-2715:35gtrakso, you don't have to run lein deps on the host#2016-07-2715:35gtrakadditionally, I run it as my user 🙂#2016-07-2715:35gtrakhacks upon hacks#2016-07-2715:35PBI see that#2016-07-2715:35PBI appreciate the help:)#2016-07-2715:35gtrakhappens to be 1000: user: 1000:1000
#2016-07-2715:36gtrakotherwise when docker writes files it'll be as root, and that can cause problems later#2016-07-2715:36PBWhere did you set that?#2016-07-2715:36PBI.e. the user#2016-07-2715:36gtrakin docker-compose.yml service block per service#2016-07-2715:37PBI meant more that I didn't know you could set the user like that#2016-07-2715:37gtrak1000 comes from your host#2016-07-2715:38gtrakso if I cat /etc/group, there is a line: gary:x:1000:
#2016-07-2715:38PBDamn, that's great! Thank you! I'm going to give this a try#2016-07-2715:39gtrak'id -u' also gives it to you#2016-07-2715:39gtrakgood luck!#2016-07-2720:53bjaerr, is anyone else's cider trying to inject to "0.14.0-SNAPSHOT"?#2016-07-2720:57bjaooh, this seems to be because I haven't pinned a particular version.#2016-07-2801:49seancorfield@bja: Yeah, that happened to me today after I rather foolishly updated all my Emacs packages… How did you solve that?#2016-07-2802:03danielsz@seancorfield: I just change my config to the snapshot versions.#2016-07-2802:03danielszcider and cider-nrepl both point to the snapshot version. No mismatch.#2016-07-2802:04seancorfield@danielsz: Not quite sure what you mean...#2016-07-2802:05danielszMaybe I didn't understand the problem.#2016-07-2802:06seancorfieldWhen I try to jack in, cider.el tries to specify a (Boot) dependency of cider-nrepl 0.14.0-SNAPSHOT but no such version exists.#2016-07-2802:07seancorfieldI installed Prelude a while back and everything was working fine. Today I decided to update the packages in Emacs (to get the latest version of cider primarily), and since then, it tries to inject cider-nrepl 0.14.0-SNAPSHOT.#2016-07-2802:07seancorfieldIn addition to the problem that Prelude doesn’t seem to fully start up (it didn’t load my prelude-modules.el file nor my personal/custom.el file).#2016-07-2802:08seancorfieldI even blew away .emacs.d completely and re-cloned the latest Prelude but that’s still broken (so it’s got to be something in one of the later elpa packages it relies on I guess?)#2016-07-2802:10danielsz@seancorfield: Ah, I see. In that case, if you're interested, I can tell you how I avoid those problems, but I don't think you'll like it. 🙂#2016-07-2802:10seancorfieldDon’t use Prelude? 🙂#2016-07-2802:10danielszBingo! 🙂#2016-07-2802:11seancorfieldIt’s been working fine for ages… but of course I figured a package update would be a good idea 😐#2016-07-2802:11danielszAnd another thing: don't jack in neither.#2016-07-2802:11danielszPackage update is a good idea.#2016-07-2802:12danielszI always update my packages.#2016-07-2802:12danielszBut I launch my nrepl externally, not from emacs.#2016-07-2802:12seancorfieldYeah, well, that is what broke my Emacs setup so I’m not sure I’m finding your advice very helpful right now 🙂#2016-07-2802:12seancorfieldI always launch my nrepl via Emacs. Always have done.#2016-07-2802:13danielszI knew you wouldn't like it.#2016-07-2802:16danielszIf you launch the nrepl externally, you avoid the problem of injecting a non-existent Cider-nrepl.#2016-07-2802:17danielszAlso, your Java process is independent from the Emacs session. Big win!#2016-07-2802:19seancorfieldWhat I want right now, is some insight into getting Prelude working properly after the package update… based on the error messages I’ve managed to find, it’s a problem with projectile...#2016-07-2802:21seancorfieldprojectile-go-function seems to be the problematic symbol...#2016-07-2802:21richiardiandreauhm I have not updated projectile so maybe that's what saved me#2016-07-2802:22richiardiandreaI can give you the commit I am at..#2016-07-2802:26seancorfieldYup, definitely a bug in projectile… they reference a Go-related function that isn’t defined and that stops the compile of everything downstream...#2016-07-2802:27danielsz3 minutes ago on github: https://github.com/bbatsov/projectile/issues/1036#2016-07-2802:27danielsz🙂#2016-07-2802:28richiardiandreaoh#2016-07-2802:28seancorfieldhttps://github.com/bbatsov/projectile/commit/62760044e860d7be23c125a4d4e51976bde47e73#2016-07-2802:30richiardiandreacool that you solved it then#2016-07-2802:31seancorfieldNow I still have to solve the 0.14.0-SNAPSHOT injection 🙂#2016-07-2802:38danielszboot repl etc. in the terminal + cider-connect is one way to solve it.#2016-07-2802:39danielszI'm not trying to preach, though.#2016-07-2802:42seancorfield@danielsz: please stop suggesting that.#2016-07-2802:42danielsz@seancorfield: Please ignore my suggestions.#2016-07-2802:51seancorfieldWell, I "solved" the CIDER version injection by editing cider.el and changing the defconst cider-version but it looks like it ought to be able to deduce it from somewhere but it’s not clear to me how/where it figured that out.#2016-07-2803:04dpsuttonhmm. looking at what's on melpa, somehow a version was released specifying the new development version#2016-07-2803:07dpsuttoni don't konw what triggers updates on melpa#2016-07-2803:07dpsuttonbut that's definitely a problem#2016-07-2803:16seancorfieldI wonder if @bozhidar just forgot to release 0.14.0-SNAPSHOT to Clojars along the way? That would also solve the problem 🙂#2016-07-2812:32skaHi. Has anyone ever encountered issues with the mouse after running cider-jack-in?#2016-07-2812:33skaWhen I open a clojure buffer, everything works fine. I can also M-x cider-mode and all is well. But after jacking into a project I can not select text reliably with the mouse anymore.#2016-07-2812:35skaDoubleclicking works, but dragging only works when start and end are either at eol or bol#2016-07-2812:35skaTotally weird :thinking_face:#2016-07-2812:41skaOh, when I set cider-use-tooltips to nil, all is well.#2016-07-2812:41skaI can probably live with that.#2016-07-2813:06malabarba@ska please report that as a bug 😉 #2016-07-2813:10malabarba> I wonder if @bozhidar just forgot to release 0.14.0-SNAPSHOT to Clojars along the way? That would also solve the problem 🙂
@seancorfield probably. Just report it and we'll fix it ASAP 😉 #2016-07-2816:28benedek@seancorfield: as @malabarba said. it is basically an error in our part (eg not releasing middleware snapshot together with cider emacs package release)#2016-07-2816:29benedekalternatively you can stop cider autoinjecting with cider-inject-dependencies-at-jack-in to nil#2016-07-2816:30benedekand then you need to specify the deps the old way (in your profiles.clj or boot equivalent)#2016-07-2816:31benedeksuppose if you use the 0.13 middleware cider will complain but mostly work. (have not tested)#2016-07-2816:37dpsuttonI mentioned to Malabarba that perhaps we could switch over to a git flow style development, and he brought up a good point that that would be duplicated the functionality that melpa-stable offers over melpa. Which is to say, running cider from melpa is necessarily a preview build#2016-07-2816:37dpsuttonI didn't know that and I suspect that most people didn't know either.#2016-07-2816:37dpsuttonI kinda wish that rather than melpa and melpa-stable it was melpa-snapshot and mela (stable being the default)#2016-07-2816:38dpsuttonbut malabarba had pretty good argument that if you want stability and pure releases, that is already available#2016-07-2816:39benedekwell, yeah, that is why our sample config uses melpa-stable#2016-07-2816:39benedekhttps://github.com/clojure-emacs/example-config#2016-07-2817:40anmonteiro@bozhidar: updated cider from Melpa and it’s complaining about a missing cider-nrepl 0.14.0-SNAPSHOT on clojars#2016-07-2817:58seancorfieldYup, see https://clojurians.slack.com/archives/cider/p1469674290000362#2016-07-2817:59seancorfield@benedek: It just caught me out because I rely on Prelude and I decided to update all my packages (which Prelude’s docs encourage you to do! 🙂 )#2016-07-2818:01seancorfieldI spent more time tracking down and fixing the Projectile issue than the CIDER one, to be honest. I was just hoping there was a way to "encourage" CIDER to use the latest stable release rather than modify the code (I suspect it can’t figure things out from our Boot file since pretty much everything is computed dynamically depending on which task is being run).#2016-07-2818:01seancorfieldIf Prelude used melpa-stable by default, I suspect I would have been fine?#2016-07-2818:03benedektbh we (meaning the cojure-emacs team) should release a snapshot of both cider client code and middleware as part of the release cycle. but i am also not doing the releases so that is up to @bozhidar and @malabarba I guess and they tend to be pretty busy nowadays#2016-07-2818:03benedekmelpa-stable: indeed you would#2016-07-2818:04benedekbut the above workaround should do the trick too#2016-07-2818:04benedekuntil the 0.14-snapshot is out for the middleware#2016-07-2818:06seancorfieldWell, we no longer specify the middleware in our Boot config for the REPL task (because CIDER auto-injects it) so it would be more disruptive to change that across the team than to just patch cider.el 🙂#2016-07-2818:06seancorfieldAnd right now, no one else was adventurous enough to update their Emacs packages...#2016-07-2818:07seancorfieldAlthough modifying Prelude to use melpa-stable locally sounds like a good idea...#2016-07-2818:08benedekfair enough. perhaps forcing a certain version (eg making you quick fix a config feature) may make sense… not sure tho...#2016-07-2818:09benedekfeel free to record an issue on github with this proposal if you think it worths it to see what the team thinks...#2016-07-2916:45voxdoloSo for a poor, dumb spacemacs user... anyone know how to get it to pick up on the edit I made to cider.el, as was recommended above?#2016-07-2916:46voxdoloI'm dead in the water ATM and pretty sad 😕#2016-07-2916:51dpsuttonshould be a notion of eval-buffer. If you eval the buffer then the newly evaluated code overwrites any previously evaluated code#2016-07-2916:55voxdolodpsutton: that did it. thanks 🙂#2016-07-2916:56dpsuttonno problem. glad it worked out#2016-07-2918:58ccannAnyone know how to jump the cursor to the next (defn form in the buffer?#2016-07-2919:05shaderI don't think there is one... there are forward-sexp and forward-paragraph#2016-07-2919:06shaderyou could roll your own pretty easily#2016-07-2919:07radon@voxdolo: If you’re making edits to package code, you also want to be sure to delete the .elc version of the file you edited, since that will override the .el version (I think).#2016-07-2919:19shader@ccann you can just eval that in scratch and bind it to a key#2016-07-2920:11voxdolo@radon: cool, thanks for the heads-up#2016-08-0114:24ccann@shader thanks! this is what I came up with (defun ccann/forward-clj-def nil
(interactive)
(search-forward-regexp "\n([s/]*def[n]*")
(recenter)
(move-beginning-of-line 1))
(defun ccann/backward-clj-def nil
(interactive)
(search-backward-regexp "\n([s/]*def[n]*" nil 'noerror)
(recenter)
(next-line))
#2016-08-0114:24ccannbound to C-S-n and C-S-p respectively#2016-08-0115:45shader@ccann: thanks for sharing!#2016-08-0115:46radonPersonally I would just use C-M-f and C-M-b, which jump between top-level forms (presuming that you’re at the top level; you can iterate C-M-u or C-M-n to get there).#2016-08-0115:46radonThese are built in to Paredit.#2016-08-0115:47ccanngood to know! I’m using smartparens, maybe there are similar bindings there#2016-08-0115:48radonThere almost assuredly are; I can’t imagine a paren-managing plugin without structural navigation keybindings.#2016-08-0115:48ccannjust tried em, awesome#2016-08-0115:48radonI reference http://danmidwood.com/content/2014/11/21/animated-paredit.html for Paredit.#2016-08-0115:48ccannthanks @radon!#2016-08-0116:56danmidwoodNice link 😆#2016-08-0117:11otfromhmm... anyone know how to run expectations test in latest stable cider?#2016-08-0117:12otfrom(googling didn't find me anything solid)#2016-08-0117:12otfroms/test/tests/#2016-08-0118:01shaderany ideas why we might be seeing "error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: The system cannot find the path specified."?#2016-08-0118:01shaderthis is on windows#2016-08-0118:01shaderemacs 24.3.1#2016-08-0121:08shaderwhat's the right way to load a new file into an nrepl session?#2016-08-0121:21seancorfield@otfrom: I have a key binding that dumps (expectations/run-tests [*ns*]) into the REPL for that.#2016-08-0122:35malabarba@otfrom there's an open issue for that. Clojure.test exposes a pretty generic API (which Cider fully supports), but expectations simply don't use it. #2016-08-0122:36malabarbaIf someone added support for that in expectations, it would immediately work with the cider commands. #2016-08-0122:37malabarbaUntil then, we're limited to solutions like @seancorfield's#2016-08-0122:38malabarba@shader: C-c C-k loads a file. There's a menu bar listing most eval commands and the or keybinds. #2016-08-0122:38radon@shader: You may find https://github.com/clojure-emacs/cider/blob/master/doc/cider-refcard.pdf illuminating.#2016-08-0123:37seancorfield@malabarba: Where would I go (in the CIDER code) to find the clojure.test API elements that CIDER leverages? I’d be happy to submit a PR to Jay for Expectations to expose appropriate functionality.#2016-08-0123:38seancorfieldJust bear in mind that Expectations gensyms the function names so you can’t just run a single test function 🙂#2016-08-0200:59escherizeyou guys probably know already, but cider-jack-in requires [cider "0.13.0-SNAPSHOT"] instead of [cider "0.13.0"]. This results in an error message when connecting to the repl using cider-jack-in on cider 13. I was able to change it by editing cider-version from "0.13.0-SNAPSHOT" to "0.13.0".#2016-08-0201:05bja@seancorfield: I also just redef cider-version and the function that depends on it:
;; hack to pin the injected version of cider-nrepl
(defconst cider-version "0.13.0")
(defvar cider-jack-in-lein-plugins nil
"List of Leiningen plugins where elements are lists of artifact name and version.")
(put 'cider-jack-in-lein-plugins 'risky-local-variable t)
(cider-add-to-alist 'cider-jack-in-lein-plugins
"cider/cider-nrepl" (upcase cider-version))
#2016-08-0201:06bjaerr, sorry about that mention, just realized I was responding to something from 8 hours ago#2016-08-0208:08otfromseancorfield & malabarba I'm just going to port them to clojure.test (there aren't many and some are broken anyway)#2016-08-0208:08otfrombut thx!#2016-08-0212:28malabarba@seancorfield: here's the cider issue comment describing what needs to be done https://github.com/clojure-emacs/cider/issues/1606#issuecomment-198631786#2016-08-0212:30malabarbaApparently @bozhidar even opened an issue on the expectations repo, and Jay seems to be in favour (though I'd check again before diving in). https://github.com/jaycfields/expectations/issues/70#2016-08-0212:34radon@escherize: I just added (setq package-pinned-packages
'((cider . "melpa-stable")))
to my init.el, which ensures that I get CIDER from melpa-stable rather from melpa. Then [cider/cider-nrepl “0.13.0”] works fine. You can see the rest of my init.el and profiles.clj at https://github.com/raxod502/dotfiles.#2016-08-0213:34seancorfield@malabarba: I'll take a look and see if I can figure out how to make Expectations more clojure.test-compliant, but looking at test.check's compatibility layer it looks like you'd have to define Expectations a different way (with a new macro to create a named var) and I don't think that's worth the effort#2016-08-0213:35seancorfieldExpectations automatically clean up when you run them so the whole workflow is different#2016-08-0213:36seancorfieldYou eval an (expect ...) form, run tests via the key binding, rinse and repeat. As you run each test it disappears, so you only run the tests that you've eval'd each time. #2016-08-0214:43malabarbaYeah, that's why I didn't fix it myself when I was working with expectations a while back. 😕 #2016-08-0214:43malabarbaThe workflow is quite different #2016-08-0302:21seancorfieldAnswer: it’s painful… https://github.com/jaycfields/expectations/issues/70#issuecomment-237113313#2016-08-0302:24seancorfieldI love how terse Expectations is but the lack of fixed symbol names causes all sorts of problems that the other test libraries just don’t have. In addition, Expectations does a fair bit of "magic" for its fixtures support (it loads a fixed namespace automatically behind the scenes) and when it does a test run — over one or more namespaces — it also does a fair bit of setup and teardown which makes it even harder to shoehorn into the model of pulling a bunch of :test metadata and just running functions...#2016-08-0302:25seancorfieldI’ll probably have another run at it, but maybe not until next week (perhaps after I’ve gotten some feedback from folks on that ticket).#2016-08-0307:22yusupWARNING: CIDER's version (0.14.0-snapshot) does not match cider-nrepl's version (nil). Things will break!#2016-08-0307:22yusupI have [cider/cider-nrepl "0.14.0-SNAPSHOT”] in the plugin deps list.#2016-08-0307:23yusupis this warning caused by string mismatch ? does it affect usage ?#2016-08-0314:17akiva@yusup, I was encountering this error in Spacemacs and updating the CIDER package seems to have fixed that for me.#2016-08-0407:39yusupI downgraded everything to stable.#2016-08-0407:39yusupversion#2016-08-0407:40yusupnow all good.#2016-08-0407:40yusup(add-to-list 'package-archives '("melpa" . "") t)#2016-08-0407:40yusupstable melpa repo and stable cider-nrepl version#2016-08-0412:37pyrIf you're interested in handling dependencies in a way that allows you to prefer melpa-stable over melpa, I wrote a tool specifically for it: https://github.com/pyr/emenv and exemple Emenv file which pulls-in cider from melpa-stable: https://github.com/pyr/dot.emacs/blob/master/Emenv#2016-08-0416:07fentonanyone have issues with getting cider debug working?#2016-08-0416:09radonIf you don’t want to add an extra library, putting (setq package-pinned-packages
'((cider . "melpa-stable"))) in your init.el will suffice to prefer melpa-stable over melpa for any particular package.#2016-08-0418:19borkdudenext to print-length is there a way to control the amount of lines printed in a text?#2016-08-0418:19borkdudefor example: (print (apply str (repeat 100 "hoi\n")))) only prints 3 lines instead of 100?#2016-08-0700:45malabarbaNot that I know of #2016-08-0700:45malabarbaPrint-length only limits the number of elements printed. Not the actual size #2016-08-0717:19radon@borkdude: You could of course do something like (defn print-lines [lines obj] (->> obj str (clojure.string/split-lines) (take lines) (clojure.string/join \newline) println)
(disclaimer: written in Slack, not tested)#2016-08-0717:23radonI’m not getting company completion suggestions for the . namespace, in CIDER. Any other namespace is fine—as long as my.ns is loaded, I can type my.ns/ and be rewarded with a pop-up list of vars from my.ns. But not so with ./. I am sure the namespace is loaded, since I can call functions from it, e.g. (./doc clojure.string/split-lines) since I have injected my utility functions into ., but the cider/company integration doesn’t seem to work. I have also tried company-manual-begin, but no luck.#2016-08-0717:24radonDoes anyone have insight on this? I was thinking it might be because the CIDER backend is limiting completion options to Java method calls since the symbol begins with ....#2016-08-0717:36dpsuttonthere's a compnay minumum prefix length to prevent it from autocompleting when the suggestion space is too large. I think it defaults to 3. maybe kick this down to 2?#2016-08-0717:37dpsuttonbut this would only be if no suggestions are shown.#2016-08-0717:37radonYes, no suggestions are shown.#2016-08-0717:38dpsuttonah then try that#2016-08-0717:38radonNo luck, I already have that set to 1.#2016-08-0717:38dpsuttonoh ok#2016-08-0717:39radonThis actually is not a cider/company thing, or indeed a cider thing. I think the problem is in cider-nrepl.#2016-08-0717:39radonThat’s where the completion list really comes from.#2016-08-0717:39radonFWIW, tab completion works as expected with the . namespace in a regular lein repl—just not from emacs, through cider-nrepl.#2016-08-0718:07radonOK, I’ve been doing some heavy code tracing, and this actually goes all the way back to https://github.com/alexander-yakushev/compliment!#2016-08-0718:07radonI had never even heard of this library, but apparently it powers all the completions in cider and vim-fireplace!#2016-08-0718:12radonBoom! https://github.com/alexander-yakushev/compliment/blob/master/src/compliment/sources/ns_mappings.clj#L8#2016-08-0719:22radonFixed and pull request submitted. https://github.com/alexander-yakushev/compliment/pull/40#2016-08-0719:24radonI’ll still need to figure out how to inject the fix into my current setup, though, because I anticipate it will take a long time before this percolates all the way up into CIDER.#2016-08-0720:36malabarbaNice simple_smile 🍻 #2016-08-0721:41radonAdding the following code to the :injections vector of my profiles.clj resolves the problem for me without need for any changes upstream. Be warned, this is a very ugly hack! (alter-var-root
#'cider.inlined-deps.compliment.v0v3v0.compliment.sources.ns-mappings/var-symbol?
(constantly (constantly true)))
#2016-08-0815:04radonThe fix in https://github.com/alexander-yakushev/compliment/pull/40 has been cherry-picked onto master. 😄#2016-08-0921:45echristophersonI forced cider to be installed from melpa-stable, but it's still telling me cider-nrepl's version is nil. What can I do?#2016-08-0921:48akiva@echristopherson, check out http://cider.readthedocs.io/en/latest/troubleshooting/#missing-nrepl-messages-buffer and scroll down to 'CIDER complains of the cider-nrepl version’.#2016-08-0921:48echristophersonthanks#2016-08-0921:50echristophersonspecifically I have 20160806.2354 -- which I think is what I had in melpa-unstable too, come to think of it.#2016-08-0921:51akivaHeh, yeah, that’s the same one I have.#2016-08-0921:53echristophersonI don't understand the statement "Note, that running cider-jack-in from outside the scope of a project will result in the older (0.2.6) nREPL dependency being used (at least on Leiningen 2.5.1). This is likely a Leiningen bug."#2016-08-0921:54echristopherson-- I infer from it that the 'scope of a project' (does that mean the CWD Emacs is running in? Or the CWD as set from within Emacs by M-x cd?) determines specifics of CIDER/nrepl...#2016-08-0921:55echristophersonbut if I put 0.2.12 in ~/.lein/profiles.clj, shouldn't it always use that unless told otherwise?#2016-08-0921:55akivaUsing cider-jack-in, based on what I understand, does some kind of dependency injection which is why I suppose it defaults to 0.2.6 if it can’t infer from the project what it should be using.#2016-08-0921:56akivaI use cider-connect so I’m not 100% certain how that side of it works.#2016-08-0921:57echristophersonhmm#2016-08-0921:58echristophersonso you also don't know how it determines the "scope of a project" with c-j-i?#2016-08-0921:58radon@echristopherson: You need to uninstall the previously installed version for your “pinned repository” setting to take effect.#2016-08-0921:59radonI presume that cider just walks upward through the directory tree until it finds a project.clj (in which case it’s in a project) or not.#2016-08-0921:59echristophersonI did that also#2016-08-0921:59radonDo you have melpa-stable in your repositories alist?#2016-08-0922:00echristopherson@radon yes, but through which directory tree? Is it one of Emacs's CWDs?#2016-08-0922:00echristophersonyeah#2016-08-0922:00radonIt’s the directory for the current file, I think.#2016-08-0922:01radonThis is my package management code: https://github.com/raxod502/dotfiles/blob/master/init.el#L144#2016-08-0922:01echristophersonOh, OK#2016-08-0922:01radonPerhaps you mis-spelled a symbol.#2016-08-0922:02radonYeah, I just checked. If I select a file outside a project, even if I started Emacs inside a project, I get the “vanilla” REPL not linked to a project.#2016-08-0922:02echristophersonshould I uninstall any other cider- packages?#2016-08-0922:02echristophersonthanks for checking#2016-08-0922:02radonWhat other packages? I only have cider.#2016-08-0922:02radon(Personally, I prefer to have my packages load automatically on startup, so whenever I have a problem with them I just wipe ~/.emacs.d/elpa and relaunch Emacs.)#2016-08-0922:04echristophersonI was wrong#2016-08-0922:04echristophersonI have other cider pkgs available but not installed. But I do have clojure-mode and clojure-mode-extra-font-locking#2016-08-0922:05echristophersonI'm using flyingmachine/emacs-for-clojure#2016-08-0922:05echristophersonIt specifies the packages manually in init.el#2016-08-0922:07echristophersona ha! I accidentally put melpa-unstable in.#2016-08-0922:07radonIn the case of using a prebuilt Emacs setup there could be any number of reasons setting the pinned repository doesn’t take effect. But you should be able to uninstall cider from M-x package-list-packages, then go to the stable version (find something like Other versions: 0.13.0) and install that.#2016-08-0922:08echristophersonoh, I didn't know about the "Other versions"#2016-08-0922:08radonYes, you can install from any repository using package.el’s package-list-packages.#2016-08-0922:09radonThe pinned repositories simply allow you to automate this process.#2016-08-0922:09echristophersonIs there a good way to just record in version control the actual versions of packages, so at any moment you can roll back to those versions (without storing the actual packages in the version control)?#2016-08-0922:10radonI don’t think so. AFAIK there’s no way (yet) to download an old version of a package using package.el.#2016-08-0922:10echristophersonOh#2016-08-0922:10radonThe only thing you can do is add them as submodules, which gives you some separation and additional convenience, at least.#2016-08-0922:11echristophersonIn list-packages it says one package can be upgraded. How do I see which one?#2016-08-0922:12echristophersonI wrestled with submodules in my Vim setup... I was always tearing my hair out.#2016-08-0922:14echristophersonmy init.el has http://melpa.milkbox.net/packages/ as melpa URL#2016-08-0922:14echristophersonis that equivalent to https://melpa.org/packages/?#2016-08-0922:15echristophersonseems to be, if the browser page is any indication#2016-08-0922:18echristophersonah, now I finally got plain old 0.13.0 installed#2016-08-0922:19echristophersonWhere does Emacs get the information it needs to present the statement Available as a package in and melpa.milkbox.net. in the window that pops up when you hit ? on a package line?#2016-08-0922:19echristophersonI'm not understanding why it lists unstable melpa there but not stable (I have it installed from stable now)#2016-08-0922:20echristophersonoh, I'm guessing now that's actually part of the actual package description/metadata#2016-08-0922:20echristophersonother packages don't have it#2016-08-0922:24echristophersonargh, I'm still getting the complaint. WARNING: CIDER's version (0.13.0) does not match cider-nrepl's version (nil). Things will break!#2016-08-0922:27echristophersonand http://cider.readthedocs.io/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version isn't helping me#2016-08-0922:28echristophersoncider-inject-dependencies-at-jack-in is t#2016-08-0922:28echristophersonI'm not in a project, so depending on clojure 1.7.0 isn't relevant#2016-08-0922:28echristophersonmy lein --version is 2.6.1#2016-08-0922:31echristophersoncider-boot-parameters is repl -s wait#2016-08-0922:32echristophersonI also cloned cider-nrepl, as advised in http://cider.readthedocs.io/en/latest/installation/#ciders-nrepl-middleware#2016-08-0922:32echristophersonbut does it need to be cloned inside a project? I just put it in a toplevel directory and ran lein install within in, which seems to have put it in my local dependency repo#2016-08-0922:39echristophersonI get the same from cider-connect (in a newly minted project dir)#2016-08-0922:46echristophersonok, working now from the new project (after adding the plugin to project.clj)#2016-08-0922:46radonYou can I-search (`C-s`) in the package listing, to find something like available for upgrade.#2016-08-0922:47radonYou need to check the whole flyingmachine Emacs setup to make sure melpa (non-stable) is not added anywhere. Presumably it is, because otherwise you shouldn’t be seeing packages from it.#2016-08-0922:48radonI can’t say how this would (or not) work with boot, since I use lein.#2016-08-0922:48radonIt works by default with lein.#2016-08-0922:49radonI turned off cider-inject-dependencies-at-jack-in, though, and put cider-nrepl in my profiles.clj.#2016-08-0922:50radonCIDER config: https://github.com/raxod502/dotfiles/blob/master/init.el#L478#2016-08-0922:50radonprofiles.clj: https://github.com/raxod502/dotfiles/blob/master/profiles.clj#2016-08-0922:50echristophersonah, finally! I feel so stupid#2016-08-0922:51echristophersonbut I'm understanding more of how things fit together#2016-08-0922:51echristophersonit turns out... and here's the stupid part... I had left a really old cider-nrepl plugin vector in ~/.lein/profiles.clj#2016-08-0922:52echristophersonto make matters worse, I had it in :user instead of :repl#2016-08-0922:52radonQuestion—does boot read profiles.clj?#2016-08-0922:55echristophersonI don't use boot either, that I know of.#2016-08-0922:55radonOh. I had assumed you were since you cited your cider-boot-parameters.#2016-08-0922:56radonYou want cider-lein-parameters for Leiningen.#2016-08-0922:56echristophersonNo, I was listing it since it was one thing to pay attention to according to the page linked by @akiva#2016-08-0922:57radonah, ok.#2016-08-1001:22echristophersonhow do I make the current function's signature show up in a cljs repl?#2016-08-1001:22echristophersonit does show up when editing cljs files#2016-08-1001:34echristophersonalso, it keeps wrongly setting clojure-mode for .cljs files: Something in your configuration activated `clojure-mode'#2016-08-1003:26radonYou’ll probably have to look through your Emacs config.#2016-08-1003:26radonThe correct mode should be set automatically, but your setup might be doing some kind of manual override.#2016-08-1010:14pesterhazyWhen I run (cider-connect) it asks me to confirm the nrepl host/port (which I guess it gets from .nrepl-port)#2016-08-1010:14pesterhazyin fact I always want to use the default choice (I press enter twice)#2016-08-1010:15pesterhazyany way to get around those two keypresses?#2016-08-1010:17pesterhazyhmm I don't see a reference to .nrepl-port#2016-08-1010:25pesterhazyah it's in nrepl-client.el#2016-08-1010:33pesterhazythis is what I came up with:#2016-08-1010:33pesterhazy(defun cider-force-connect ()
(interactive)
(cider--quit-connection (cider-current-connection))
(cider-connect "localhost" (second (first (cider-locate-running-nrepl-ports)))))
#2016-08-1010:34pesterhazyelisp is fun 🙂#2016-08-1010:47pesterhazyeven better: (defun cider-reset-dev ()
(interactive)
(when (not (cider-current-connection))
(cider-connect "localhost" (second (first (cider-locate-running-nrepl-ports)))))
(cider-eval-buffer)
(cider-interactive-eval
"(when-let [r (resolve 'my.project.repl/reset-dev)] (r))"))#2016-08-1021:45danielcomptonI’ve just started with Spacemacs, and I'm trying to jack in with cider. I get this error when I do: https://www.refheap.com/122096
Caused by: java.lang.SecurityException: Cannot locate policy or framework files!
I have no issue launching repls in Cursive or lein in the terminal, and I get this on multiple projects, even after moving my profile.clj. Does anyone have any ideas?#2016-08-1022:52danielcomptonSeems to be related to refactor-nrepl and cider-nrepl#2016-08-1022:52danielcomptonThis works:
lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- repl
this doesn’t
lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.14.0-SNAPSHOT\"\] -- repl
#2016-08-1023:27echristophersonhi guys#2016-08-1023:27danielcomptonLooks like rolling back to a stable version of cider is probably the best course here#2016-08-1100:34danielcomptonHmm, seems like it was related to a caskroom update I did last night#2016-08-1116:46echristophersonI wish I knew whether my Chrome extensions are frozen because they're all being updated or what the reason is#2016-08-1116:46echristophersonThanks, Chrome 52#2016-08-1116:54echristophersonGuess I needed to restart the whole browser. Restarted Slack too just in case (since it seems to use Chrome underneath)#2016-08-1116:55echristophersonSorry, should be in #C03RZGPG3#2016-08-1117:27joshmillerIs there a way to have the Cider test commands use my test profile instead the dev profile?#2016-08-1117:28radonOffhand, I would say no. C-c C-t C-t and friends use the currently running REPL, and you can’t change profiles for a running REPL (without hackery).#2016-08-1117:29radonYou might be able lein with-profile test repl :headless and use that REPL for your test stuff, though.#2016-08-1117:30joshmiller@radon: Cool, thanks. Couldn’t tell if I was just unable to google the terms cider, test, and profile because they’re so common, or if it was a more intractable problem. I might try to work with that second option and see how it goes.#2016-08-1117:31radonYou may want to take a look at cider-lein-parameters (and where it is used).#2016-08-1117:31joshmillerThanks for the pointer.#2016-08-1208:01hkjelsHow do I eval code in an org-mode document in my clojurescript-REPL instead of clojure-REPL#2016-08-1215:02shaun-mahoodI'm thinking of diving back into the emacs/cider pool - any opinions on the best getting started guide or bundle for CLJS development?#2016-08-1215:03radon@shaun-mahood: To minimize your pain with setting up a project.clj correctly, you may want to try https://github.com/raxod502/minimal-webapp. It should work completely out-of-the-box (see the README).#2016-08-1215:03radon(Disclaimer: I’m the author.)#2016-08-1215:09shaun-mahood@radon: Oh that looks great - I will definitely use that as a reference once I get emacs set up. It looks like you are running the REPLs from terminal - does it still work nicely if running the REPLs from cider?#2016-08-1215:10radonThe first section is for running from CIDER: https://github.com/raxod502/minimal-webapp#using-cider-preferred#2016-08-1215:11shaun-mahoodOh wow I have no idea how I missed that 🙂#2016-08-1215:11radon😉#2016-08-1215:13shaun-mahoodAny opinions on getting Emacs going? The 3 guides I know of are the one from Brave Clojure, Prelude, and Emacs Live - last time I got emacs working for clojure development was a couple years ago and I want to get started from scratch again with something simple for a non-emacs user.#2016-08-1215:14radonHmmm… well, obviously I am biased toward my own setup: https://github.com/raxod502/dotfiles/blob/master/init.el#2016-08-1215:14radonIt’s extremely well documented, so it probably wouldn’t be too hard to pick out the parts that are relevant to you.#2016-08-1215:15radonI use https://emacsformacosx.com/ but this obviously only works if you are on a Mac.#2016-08-1215:15radonI’ve heard good things about Spacemacs but never tried it. It does change a lot of default functionality, though.#2016-08-1215:16radonI actually started out with https://github.com/RallySoftware/rally-emacs, but it was kind of decrepit and bloated, so I basically reimplemented the best parts from scratch, hence https://github.com/raxod502/dotfiles.#2016-08-1215:16radonFor getting started with basics, C-h t for the tutorial is nice.#2016-08-1215:18shaun-mahoodGoing to be putting it on a mac to start, then replacing the config on my windows machine once I get it working nicely. Pretty much will only be used for Clojure.#2016-08-1215:19radonWell, I do have a setup script https://github.com/raxod502/dotfiles/blob/master/scripts/setup.sh for Macs, but I haven’t gotten to making it modular (i.e. you can just install Emacs dotfiles) yet.#2016-08-1215:21shaun-mahoodThanks, I'll take a look at those as I'm figuring all this out.#2016-08-1215:38richiardiandrea@shaun-mahood: if you are keen on premade packages and modular things, Emacs Live is good. There are submodules for all the dependency so that you can decide (manually) the commit you want to be at#2016-08-1215:38richiardiandreaI found this an interesting way of staying out of melpa breaking updates#2016-08-1215:39richiardiandreaThe downside is that I have to maintain my own fork, but I got used to it now#2016-08-1215:48shaun-mahood@richardiandrea: Thanks, I really like the idea of avoiding breaking updates - what have you had to do as far as maintaining your own fork?#2016-08-1215:58richiardiandreawell, I forked 😄 https://github.com/arichiardi/emacs-live/tree/ar-stable#2016-08-1216:03richiardiandreaif you want I can make it a proper master branch and you can fork from mine, I have upgraded most of the packages to latest stable#2016-08-1216:03robertonice#2016-08-1216:04richiardiandreatogether with this Emacs Live provides a way to specify custom packages, which I keep in another repo so that from time to time I can PR to Emacs Live something#2016-08-1216:04richiardiandreahttps://github.com/arichiardi/ar-emacs-pack#2016-08-1216:05richiardiandreabut the above is more of a "custom" packaging#2016-08-1216:06shaun-mahood@richiardiandrea: Don't do any extra work on my account, I'm still investigating options - I find emacs pretty daunting still and am not sure exactly how deep I want to go down the rabbit hole.#2016-08-1216:07richiardiandreaahah no problem, I actually had in mind at some point of coming out with an Emacs Live "official" fork...but Sam Aaron is still doing a pretty good job at keeping it updated#2016-08-1216:09richiardiandreaas many people may have told you, once you get used to all the shortcuts, you won't go back to "normal" editors 😄#2016-08-1216:12shaun-mahoodLast time I was using emacs I had to buy a new keyboard to prevent carpal tunnel, I've since built an ergodox with the idea that I can customize it specifically for emacs and clojure shortcuts 🙂#2016-08-1216:13radonYou could also try something like evil-mode or ergoemacs.#2016-08-1216:14radonI don’t have any experience with them, though.#2016-08-1300:13echristophersonI still go back and forth between Emacs and Vim#2016-08-1300:15echristophersonI haven't yet tried vim-fireplace... will try to learn the language itself more first#2016-08-1300:24akiva[whispering]
Spacemacs.#2016-08-1301:02shaun-mahoodI feel like I’ve opened quite the can of worms here. Thanks for all the recommendations!#2016-08-1301:10akiva@shaun-mahood, there’s no real right answer here. Everyone naturally gravitates toward the tool that fits their hands the best and sometimes that tool changes over time.#2016-08-1304:12seancorfield@shaun-mahood: Just to add another voice on the curated packages... At World Singles, we initially standardized on Emacs Live for the team but we found the customized "pack" approach a little restricting and the pace of maintenance slowed down for a long time (it's picked up again recently). So we switched to Prelude instead and we really like that. It feels more Emacs-y and it is easy to keep all the (standard!) packages updated. It also has the benefit of being maintained by one of the CIDER team so it tends to stay very close to the leading edge in terms of releases and features.#2016-08-1304:17shaun-mahood@seancorfield: when I first looked at prelude it seemed pretty daunting - how is it for beginners?#2016-08-1304:24echristophersonnice#2016-08-1304:56richiardiandrea@shaun-mahood: also if I can add one more thing, all if the emacs packages are daunting, there is no way out imho. Prelude might be a good choice for beginners because well maintained, however Emacs Live has several packages for several other languages backed in (cool if you are doing html/json/ruby/Erlang/whatever)..so yeah...well...again not a conclusive answer I know..#2016-08-1305:09seancorfield@shaun-mahood: I don't know that it's any more or less daunting than just using Emacs in the first place -- but the Prelude documentation seems good (all those key bindings). Re: other languages -- Prelude has a good long list of language packages easily selectable.#2016-08-1305:10seancorfieldFor me, not having to put together and maintain my own personal Emacs configuration from scratch is the big win with both Emacs Live and Prelude. That's what makes them both "beginner friendly" to some extent.#2016-08-1312:53akiva@seancorfield, you’re requiring devs to use Emacs Prelude?#2016-08-1414:01dpsutton@kingoftheknoll: you eval'd the last sexp, which was not (add2 2) but add2, so it returned the closure which takes a param and tries to add 2 to it.#2016-08-1414:20malabarbaIndeed. Try evaluating add2 on the repl. You'll see the same thing. #2016-08-1418:05kingoftheknoll@dpsutton: and @malabarba ah I see it now. My cursor wasn’t at the end of the expression.#2016-08-1419:38seancorfield@akiva: not "requiring", just suggesting it as a "standard" — makes life easier when remote pairing if the Emacs setup is similar.#2016-08-1419:47seancorfield(no requirement to use Emacs either — it’s just a good "standard" tool in our opinion; we used both LightTable and Emacs for a while but the devs preferred Emacs)#2016-08-1419:56akivaRight on. I was just curious. I’m clearly a huge Spacemacs proponent and I have my config there pretty much locked up tight. I can’t imagine going into a job having to learn Emacs’ default chords.#2016-08-1420:15radon@kingoftheknoll: It’s worth noting that C-M-x will eval the top-level form, as opposed to C-x C-e which will eval the previous form.#2016-08-1423:52seancorfield@akiva: I tried Spacemacs but just couldn't get on with it. Probably because I'd first used Emacs back in the 17.x days and so the "standard" Emacs keys seem normal -- even tho' I took a 20 year break between early releases of 19.x and early releases of 24.x 😸 #2016-08-1423:54akiva@seancorfield, I’ve been a vi/vim user since the dawn of time so Spacemacs was a natural draw for me. It was a bit of a bear early on but it’s really stable and good now. And you can use it with traditional Emacs keybindings.#2016-08-1501:06robertoI was a vim user before I learned clojure. I picked up Emacs while learning clojure. Decided to use vanilla Emacs and configure as needed (much the same way I learned vim back in the 90s). I didn’t really miss the vim keybindings, so never installed evil-mode. When I use vim these days, I keep defaulting to the Emacs keybindings. But it doesn’t take that long to switch context after the first couple mistakes.#2016-08-1502:50seancorfieldHeh, yeah, I work on a couple of servers occasionally that don't have Emacs so I have to use vim and I make that same mistake @roberto#2016-08-1502:58robertoyep, it is also the reason why I don’t modify my vim nor Emacs settings too much#2016-08-1502:59robertoif I need to work on a different machine, I won’t always have a customized setup. So I just make myself use the vanilla vims and Emacs. I use to pimp my vim settings a lot when I was just starting. Don’t do that anymore.#2016-08-1503:10lvh@seancorfield: Cool to hear someone else doing that. I deleted like 40 MB worth of .emacs.d and replaced it with prelude and also got rid of zsh in favor of fish because it made it easier for junior folks to use my setup#2016-08-1503:12lvhprevious interactions:
1. struggle with $editor
2. pair with me, compare my emacs setup to their default editor, compare my zsh setup to usually the crappy bash 3.2 that comes with OS X
3. “OMG EMACS/ZSH IS THE BEST” “well, uh, …”
4. massive disillusionment#2016-08-1503:13lvhnow 1-3 is the same, 4. is replaced by slowly learning emacs and fish 🙂#2016-08-1510:09malabarba@seancorfield: have you tried tramp? #2016-08-1513:35akiva@lvh, interesting. I’ve never heard of fish; I’ve been using zsh at maybe 1% of its power for decades now.#2016-08-1513:36lvhIt’s pretty cool in that the default config is already 95% of what you want#2016-08-1513:36lvhThe extra stuff I have is pretty exotic stuff like “ssh but with a smartcard” &c#2016-08-1513:52akivaYeah. Just poking around with it before I get started coding today and seems most of the defaults seem sane to my regular, non-power usage. I think I might just throw it in all of my tmux windows and see how it goes or the day.#2016-08-1514:34radonAntigen [1] makes Zsh customization pretty easy. Just e.g. antigen bundle zsh-users/zsh-autosuggestions and now you have fish-style autosuggestions. You don’t even have to start a new shell! You can see the package-related part of my .zshrc [2] is quite small and easy to manage. Plus, the only dependency is cloning the Antigen repo; everything else is downloaded automagically if necessary.
[1]: https://github.com/zsh-users/antigen
[2]: https://github.com/raxod502/dotfiles/blob/master/.zshrc#2016-08-1516:27seancorfield@malabarba: Only as part of Emacs’ process of connecting to REPL servers over SSH (Tramp).#2016-08-1516:29seancorfield@lvh: We just run the default bash here I think...#2016-08-1517:03brian_mingusi would like to disable to cider behavior where it turns an entire block of code pink and moves your cursor when it detects a syntax error#2016-08-1518:17radon@brian_mingus: M-x customize-group cider -> C-s error -> cider-error-highlight-face Hide Cider Error Highlight Face:[sample]
[ State ]: STANDARD.
Face used to highlight compilation errors in Clojure buffers.
[X] Underline: [Value Menu] On:
Color: [Value Menu] Foreground Color
Style: [Value Menu] Line
[X] Inherit:
[INS] [DEL] Face: (sample) font-lock-warning-face
[INS]
Show All Attributes
#2016-08-1518:19radonThat wouldn’t disable moving your cursor. I don’t understand why jumping to the error is not desired behavior, though…?#2016-08-1520:05brian_mingusi didn't ask it to move my cursor#2016-08-1520:07brian_mingusanyways there is a setting for it#2016-08-1520:07brian_mingusCider Auto Jump To Error#2016-08-1602:28danielcompton@kingoftheknoll: does it need to be required first?#2016-08-1602:29kingoftheknoll@danielcompton: (require ‘divvy-accounts.db) will throw the same exception#2016-08-1602:31kingoftheknollinterestingly enough if I try to require another namespace say divvy-accounts.core it will throw the same error that it can’t find the db namespace#2016-08-1602:31kingoftheknollAt first I thought it was an artifact or something but after doing lein clean the problem persisted#2016-08-1602:33danielcomptonhmm, not familiar enough with CLJS emacs tooling#2016-08-1602:33kingoftheknollme either lol just getting started#2016-08-1617:10fenton@kingoftheknoll: I do C-u C-c A-z in my source file. That loads the file, changes the REPL namespace to it and puts my cursor in the REPL.#2016-08-1717:14radonWould it be possible to make it so that when I C-c M-j or C-c M-J, the newly created *nrepl-server* buffers are popped instantly, and then when the *cider-repl* buffers are ready, they replace the *nrepl-server* buffers?#2016-08-1811:29sebastianpoeplauis there a way to have cider display the failing input when using test.check?#2016-08-1811:31sebastianpoeplaufor example, when I define the following property:
(defspec whatever
(prop/for-all [x gen/int]
(= 0 x)))
cider can run it just fine, but when it fails I get only a moderately helpful message:
Fail in whatever
expected: result
actual: false
#2016-08-1811:37sebastianpoeplauI believe that test.check stores additional information, such as the minimal failing input, in its results, but cider-nrepl doesn't seem to extract it. Has anyone tried to do so? Is it something that people would be interested in?#2016-08-1815:18richiardiandreaI would definitely be interested as I am now checking those errors in the terminal only @sebastianpoeplau #2016-08-1815:26sebastianpoeplau@richiardiandrea I'll try to hack something together 🙂#2016-08-1815:27richiardiandreaLet me know if you want me to try it out!#2016-08-1823:10sebastianpoeplau@richiardiandrea I've created https://github.com/clojure-emacs/cider/issues/1825 - will have a try at the implementation...#2016-08-1909:07rickmoynihanis it possible to setup cider-find-var to jump to java sources for arbitrary maven java dependencies? It will jump into jdk sources.... Do I need to set a classifier or something in my project.clj to download source jars in the dev profile?#2016-08-1909:08rickmoynihanI don't necessarily need this to work for arbitrary jars... just one in particular#2016-08-2011:36blueberryWhat is today's recommended workflow for using Clojure code in Org mode files? I am using Prelude, Cider, and Leiningen on Linux. I've found some posts online, but they are either old or are using many custom settings that may not be needed (or might even brake something). I do not need full-blown literate programming. I just need to make writing Clojure snippets in Org-mode as easy as possible when writing docs, presentations, blog posts, etc...#2016-08-2011:37blueberry@bozhidar Is there any plan for including Org-mode and Cider integration in Prelude?#2016-08-2015:28bozhidarno, I don't have this on my roadmap, but I'm guessing that anyone can quickly add org-babel and whatever the matching clojure package is#2016-08-2016:29plexusI can confirm Clojure works fine with org-mode. If you need specific dependencies then put a project.clj in the same dir as your org file and cider-jack-in from there#2016-08-2017:29bozHope you don’t mind me asking on this channel. … I’m trying out clj-refactor and C-c RET seems to conflict between cljr and cider-macroexpand-1. Any pointers on how to get around this?#2016-08-2019:31lvhplexus: Do you use babel for that?#2016-08-2019:32plexusyes, org-babel, I guess the package is ob-clojure#2016-08-2019:39plexus@boz this is a know issue, this is why the README now suggest C-c C-m instead of C-c RET#2016-08-2019:39plexusif you want to use C-c RET anyway I guess you can unbind the key binding for cider-macroexpand-1#2016-08-2021:14bozthanks @plexus#2016-08-2305:29shaun-mahoodSo I’m biting the bullet and going to try using emacs prelude for everything on my mac laptop, but the scrolling is driving me crazy. Is there an easy way to get it to scroll smoothly like it does for the native mac apps?#2016-08-2306:46slipset@shaun-mahood: there goes my morning...#2016-08-2306:46slipsetFound https://www.emacswiki.org/emacs/SmoothScrolling but haven’t tried any of it yet.#2016-08-2306:51slipsethttps://www.reddit.com/r/emacs/comments/41vicb/emacs_os_x_smooth_scroll/#2016-08-2309:41joost-diepenmaathmm http://melpa-stable.milkbox.net/ => No such site at :80#2016-08-2309:42joost-diepenmaat😕#2016-08-2311:58anmonteiro@joost-diepenmaat try using http://stable.melpa.org/packages/ ?#2016-08-2312:02joost-diepenmaatseems to work again, now#2016-08-2312:03joost-diepenmaatoh wait now I see that the URL is different 🙂#2016-08-2317:03bvulpesshaun-mahood: "emacs-mac"#2016-08-2317:04bvulpeshttps://github.com/railwaycat/homebrew-emacsmacport << this is the emacs i install on all of my collaborators machines#2016-08-2317:04bvulpesand then either pare the whole thing down for people who i can trust to customize and write their own elisp, or prelude for those who just want to hit the ground running.#2016-08-2317:21shaun-mahood@bvulpes @slipset : Thanks, I installed that homebrew port and it worked great (and I didn't actually need to learn anything) 🙂#2016-08-2317:22bvulpesglad it worked for you!#2016-08-2317:23bvulpes(i also suggest the sanityinc solarized theme. a++)#2016-08-2317:23bvulpes(great attention to detail)#2016-08-2414:32benedekre. emacs-port: with that you can use ligatures as well#2016-08-2415:09benedekTake a look at @AnnaPawlicka's Tweet: https://twitter.com/AnnaPawlicka/status/768143289006559232?s=09#2016-08-2415:16jcsimsdoesn’t that break indentation? i.e. off by one space now?#2016-08-2415:27robert-stuttafordnope. spaces are the same#2016-08-2415:31jcsimsI do that already with a couple single-space characters (mostly for anonymous fn literals and sets). Might have to try that out#2016-08-2416:49benedeki am happy user of this font after I gave up the fight with prettify symbols for this reason @jcsims#2016-08-2416:51benedeki only prettify (fn into lambda fixing the indent with the trick recommended by @malabarba#2016-08-2416:52jcsims@benedek which trick?#2016-08-2416:54benedekhttp://endlessparentheses.com/using-prettify-symbols-in-clojure-and-elisp-without-breaking-indentation.html#2016-08-2416:56jcsimsawesome, thanks for the link#2016-08-2416:57benedekno worries. essential blog if you are into emacs#2016-08-2416:57jcsimsoh yeah, I’ve read several of his posts, really good stuff 👍#2016-08-2417:00bvulpesligatures are pretty but i stopped using them after hitting some editing use cases#2016-08-2417:13benedeklike @bvulpes ?#2016-08-2417:21bvulpesgot gc'd#2016-08-2417:22bvulpesi don't store the why and wherefore of each decision to eliminate complexity or pain in my toolchain.#2016-08-2417:23bvulpesthis was probably the era of getting my erc buffers to use kerned text and my programming buffers to use monospace#2016-08-2417:24bvulpesoh and they confused people on my team#2016-08-2417:24bvulpes"what the fuck you how is that an actual lambda?!"#2016-08-2417:24benedekhaha, prettify symbols did that big time with my team 😉#2016-08-2417:24benedekhold on, you are talking about prettify symbols then#2016-08-2417:25bvulpesah yes#2016-08-2417:25benedekeg: ligatures won’t do a lambda for you out of thin air, will it?#2016-08-2417:25bvulpessorry.#2016-08-2417:25bvulpeswell i dunno that post goes on to talk about doing all sorts of strange to buffers!#2016-08-2417:25bvulpesi may have conflated things.#2016-08-2417:26benedekyou mean @malabarba ’s post. it does. i shyed away from prettify symbols too (see above)#2016-08-2417:26benedekafter confusing my team for while that is 😉#2016-08-2417:26benedekbut then actually clj-refactor was having a bad time too with the messed up columns#2016-08-2417:33joshmillerAnyone else still getting that error in process filter: Attempt to shape unibyte text with the suggested setup? Weirdly just seems to be happening to me when requiring/refreshing source files, not actually stopping me from working.#2016-08-2417:34jcsimsif you look at Anna’s setup, she’s got a note about that: https://github.com/annapawlicka/org-emacs/blob/master/org/config.org#fira-code#2016-08-2417:35annapawlickayeah, i commented it out and it works fine now. previously it would keep on showing that error and cider was basically unusable#2016-08-2417:38joshmillerYeah, I have that line commented out as well, but I’m still seeing the error occasionally. Definitely not as frequently as to make it unusable though.#2016-08-2417:46joshmillerUncommenting that line does make it unusable. So it’s responding, but apparently besides that particular very broken one, there’s another less-broken one lurking in the list.#2016-08-2420:41jasonjckni upgraded spacemacs/cider and am getting Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
Please install figwheel-sidecar.repl/eval23535/fn--23536 (repl.clj:167)
user>
on jack-in#2016-08-2420:41jasonjcknany else getting this / know the solution?#2016-08-2420:41jasonjckni was on 0.13-SNAPSHOT before, then upgraded to 0.14-SNAPSHOT#2016-08-2422:46jasonjcknnevermind#2016-08-2422:46jasonjcknseems to be caused by something else than the upgrade#2016-08-2512:54yendaIs it expected behavior that cider removes all instrumentation in test namespaces whenever you run a test ?#2016-08-2512:57yendasimplest reproduction of what I mean is just C-u C-M-x in a fresh lein new app project test and run the test#2016-08-2512:58yendaacording to this issue I thought it was solved https://github.com/clojure-emacs/cider/issues/1251#2016-08-2513:35yendaI am running cider-test-run-focused-test btw, when I use (test-var) in the repl instrumentation works#2016-08-2518:40jsa-aerialDoes cider use clojure-complete or something else altogether??#2016-08-2521:21gtrakit uses compliment and a separate backend for cljs#2016-08-2521:42aghey guys, I have a figwheel config similar to what’s described here: https://github.com/bhauman/lein-figwheel/wiki/SASS-watcher
meaning that I have to jack-in and then run (start) - to build clojurescript, then if I’d like I can jump into clojurescript repl by running (repl).
With CIDER though I have an option to jack-in straight to Clojurescript repl, in that case I would have 2 buffers (for CLJ and CLJS) repls). But then from clojurescript repl figweel doesn’t seem to be responding. So how can I run both repl with my setup?#2016-08-2522:11richiardiandrea@ag maybe there is a problem with the function jack-in-clojurescript, it looks like the same commands are called: https://github.com/clojure-emacs/cider/blob/2bfa9da8b4cb3b8787abb6d10cf862410b54c17c/cider.el#L369#2016-08-2522:12richiardiandreaunless they changed in the new figwheel versions#2016-08-2522:12jasonjckni haven't had any issues#2016-08-2522:13jasonjckncider-lein-parameters "do clean, repl :headless"
cider-cljs-lein-repl "(use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl)")
#2016-08-2522:21ag@jasonjckn I don’t have cider-lein-parameters. I have cider-lein-jack-in-dependencies though#2016-08-2522:21jasonjcknit's optional#2016-08-2522:21jasonjckncider-lein-jack-in-dependencies should be t#2016-08-2522:22agI don’t have cider-cljs-lein-repl either#2016-08-2522:22jasonjcknthat one is important#2016-08-2522:22agI’m not not using boot#2016-08-2522:22agit’s a lein project#2016-08-2522:22jasonjckntry my value out that's all I can suggest#2016-08-2522:23jasonjcknmy environment works great#2016-08-2522:23agoh wait… these are vars, I thought they are functions#2016-08-2522:24agok I set these vars and then jack-in to Clojurescript repl or Clj repl?#2016-08-2522:24jasonjcknclojurescript jack in only#2016-08-2522:24jasonjcknyou get 2 repls#2016-08-2522:25agyeah. ok lemme try#2016-08-2522:25jasonjcknyou need to load your browser afterwards to point to figwheel server#2016-08-2522:26jasonjcknonly once your page loads with figwheel will CLJS repl work#2016-08-2522:26jasonjckn:figwheel {:css-dirs ["resources/public/css"]
:server-port 3448
:server-ip "0.0.0.0"
:server-logfile "target/figwheel.log"
:open-file-command "emacsclient"}
#2016-08-2522:26jasonjcknthat's in my project.clj file#2016-08-2522:34agI think this works, only minor thing cider-repl-switch-to-other now doesn’t switch to CLJS repl#2016-08-2522:36jasonjcknyah i had issues with that#2016-08-2601:59preIn 0.13.0, how do you turn off the automatic truncation of results during debugging? Currently I get …. type M-x cider-inspect-result.#2016-08-2602:00preit doesn’t seem to work properly and I’d prefer the 0.12.0 default of showing results#2016-08-2716:28tianshuin cljs REPL(boot project), start via adzerk.boot-cljs-repl/start-repl, when I use a exists var, it will print a warning message for Use of undeclared var. at this moment, the auto complete for CLJS is not work. If I reload the buffer with C-c C-k, everything goes well.#2016-08-2716:46lvhI’m using prelude. Recently, autocomplete has stopped working well for me; specifically it completes with symbols it has seen before, but I can’t get it to try and complete new symbols. Also matching input is required womp 😕#2016-08-2720:33robert-stuttafordfwiw, clj-refactor is pretty close to @stuartsierra's https://stuartsierra.com/2016/clojure-how-to-ns.html#2016-08-2720:46akivaOnly thing I do differently is I separate by a blank line references to namespaces within the project and namespaces from dependencies. Just looks nicer to me.#2016-08-2818:35dpsuttonis there an easy way to jump to a test file for a particular clojure file? I want to say that i remember there being one but i'm not thinking of it right now#2016-08-2818:48bvulpesdpsutton: cider-test-jump#2016-08-2818:48dpsuttonah thanks#2016-08-2821:16benedek@robert-stuttaford: I think if you have cljr-favor-prefix-notation set to nil it is the same#2016-08-2914:52radon@lvh: That seems like the kind of thing that happens when you don’t have a REPL running, or you haven’t evaluated the ns declaration in the namespace you are working on, or you haven’t evaluated the forms you want to be autosuggested, or they are not required…#2016-08-2914:56radonI don’t know about matching input is required though.#2016-08-2915:41lvh@radon: Yeah; REPL is running and ns is eval’d, though#2016-08-2915:42lvhAlso, sometimes some-ns-alias/x<BACKSPACE><TAB> works even wieh some-ns-alias/<TAB> doesn't#2016-08-2915:45radonOh… that sounds really bad. I’ve been having some trouble as well with Company sometimes refusing to give me completions unless I company-manual-begin. I can’t consistently reproduce it, though.#2016-08-2915:48lvhin-repl it works consistently#2016-08-3002:57normanIf I’ve found an interesting value in a cider inspect window is there any way I can get that value in the repl? (perhaps in *1)#2016-08-3003:01normangot it… (:value cider.nrepl.middleware.inspect/inspector)#2016-08-3104:24bvulpesanyone taken much of a crack at integrating spectrum into cider? any thoughts on that direction?#2016-08-3108:05otfrombvulpes spectrum?#2016-08-3114:20bvulpescompile time spec checking: https://github.com/arohner/spectrum#2016-08-3114:21otfrombvulpes: thx!#2016-08-3114:22bvulpesmhm#2016-09-0209:55borkdudeI just upgraded prelude and running boot 2.6.0. I’m connecting to a boot nrepl process with cider-connect. I’m getting this warning:
WARNING: CIDER's version (0.14.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.#2016-09-0209:55borkdudewhere should I look to solve it#2016-09-0210:01borkdudeAdding to ~/.boot/profile.boot should solve it I guess#2016-09-0210:11benedekwhat is your clojure version?#2016-09-0210:12benedekha, you are connecting to a boot process, not jacking in with boot!#2016-09-0210:13benedeksorry missed that. if that is the case you need to add the appropriate cider dependencies to your profile boot#2016-09-0210:13benedekif you jack in that is not necessary#2016-09-0210:20borkdudeclojure version is 1.8.0#2016-09-0210:38benedekyeah, not really important here, sorry. point is: if you connect to an existing, running repl you need to edit your profile.boot if you jack in you don’t need to#2016-09-0214:00dhruv1I am using lein droid doall to build and deploy a project to my android device for APP development.
I keep running into this error:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
More information.
WARNING: CIDER's version (0.13.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.3.0-SNAPSHOT (package: 20160621.902) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
Here is what my profiles.clj file looks like:
{:repl {:dependencies [[org.clojure/tools.nrepl "0.2.12"]]
:plugins [[cider/cider-nrepl "0.13.0"]]
}}
Cider version: "CIDER 0.13.0snapshot (package: 20160623.12)"#2016-09-0214:04dhruv1i am not sure how to get around this, can anyone help#2016-09-0214:04dhruv1?#2016-09-0214:24benedekhow do you get your repl in emacs? do you jack-in or connect to an already running repl?#2016-09-0214:26launchpad99% of the time i jack in#2016-09-0214:26benedekremove the cider related stuff from your profiles.clj and try again pls#2016-09-0214:26launchpadi don’t have any cider stuff in profiles#2016-09-0214:26launchpadbut i’m also not using boot#2016-09-0214:27launchpadoh, you’re not talking to me lol#2016-09-0214:27benedekyup, sorry#2016-09-0214:27launchpaddo you have any issues with the inspector?#2016-09-0214:28benedekme? nope, trying to help to @dhruv1 😉#2016-09-0214:28dhruv1@benedek i use cider connect#2016-09-0214:28launchpadyea lately it’s been giving me nulls 😞#2016-09-0214:28dhruv1also i am using lein droid#2016-09-0214:29dhruv1a lein plugin for building android apps#2016-09-0214:29benedeki have not worked with lein droid tbh#2016-09-0214:29benedekcan you try to jack in tho?#2016-09-0214:30benedeksry @launchpad not much experience with the inspector#2016-09-0214:30launchpadyou should be able to add the correct versions to your profiles that cider is expecting and connect to the repl that lein droid starts, no?#2016-09-0214:34dhruv1@launchpad yes, i should be able to.
I have the correct versions (atleast i think)
i think they were not being picked up.
I am removing them from my profiles.clj file and directly adding it into my project.clj and see how that does#2016-09-0214:35benedekif you jack in they are autoinjected#2016-09-0214:36launchpadah, yea now that i think more about it there were a few times that my profiles.clj didn’t seem to be pulling the dependencies correctly. there were issues with pulling the dependencies. one time it was that the jar didn’t exist on clojars yet and another was that my company was blocking the ssl connections#2016-09-0214:36launchpad@benedek, i think the jack in isn’t going to give him the tasks that lein droid doall is running so he would be missing things 😕#2016-09-0214:36benedekah right, ok#2016-09-0214:37dhruv1at what @launchpad said.
🙂#2016-09-0214:37launchpadmaybe you can modify the lein droid task to not start the repl and you can run it and then do a jack in? not sure that will be a great solution though#2016-09-0214:38dhruv1so adding it to my project.clj file, it doesn’t build#2016-09-0214:38launchpad(i have no idea what lein droid is doing)#2016-09-0214:38dhruv1Compiling cider.inlined-deps.fipp.v0v6v4.fipp.ednize
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: clojure.instant/thread-local-utc-date-format in this context, compiling:(cider/inlined_deps/fipp/v0v6v4/fipp/ednize.clj:58:13)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6740)
#2016-09-0214:38launchpadwhat’s your project.clj look like?#2016-09-0214:39dhruv1instead of polluting this thread, can i message it to you seperately#2016-09-0214:39launchpadyea#2016-09-0214:39dhruv1privately*#2016-09-0509:17tianshuusing cider for a boot cljs project.
when i access something, there's a warning.
without loading ns manually, the autocomplete won't work.
hello.core> say-hello
WARNING: Use of undeclared Var hello.core/say-hello at line 1 <cljs repl>
#object[hello$core$say_hello "function hello$core$say_hello(){
return cljs.core.println.call(null,"Hello World!");
}"]
when the weasel connected, a directory out will be made in project root. I thinks It should use the out that locate in the boot temp fileset. I have no idea where's the problem.
appreciate for any help and guide to solve this.#2016-09-0509:26tianshuhere's my build.boot#2016-09-0509:27tianshulaunched with boot cider dev, then cider-connect.#2016-09-0509:27tianshucider is the task I found in the wiki of boot.#2016-09-0713:06jonpitherIs it possible to do a find-usages on a unique arity of a fn?#2016-09-0713:06jonpitheri.e. (foo ([]) ([bar])) - > I want to do a find-usages on just the first?#2016-09-0713:06jonpitherJust wondering#2016-09-0713:28benedekdon't think so#2016-09-0713:28benedekfind usages just looks for the symbol occurrences#2016-09-0713:30benedekshould be possible with some extra logic I suppose but not sure really worth the effort...#2016-09-0714:01jonpitheryup#2016-09-0714:43jonpitheris there a way to search for symbols?#2016-09-0714:43benedekfind usages does that#2016-09-0714:43jonpitheri.e. I want to know any time there's a symbol call foo in the codebase#2016-09-0714:43jonpitherhmm#2016-09-0714:44benedekwhat do you mean by ‘symbol call’?#2016-09-0714:44benedeksimply (foo “bar” “baz”)?#2016-09-0714:44jonpitheryou actually know the codebase in question @benedek 🙂#2016-09-0714:45jonpitherThere's a map we pass around, and people get a key called geo out of it#2016-09-0714:45jonpitherplaying with the idea of renaming/removing/deriving this#2016-09-0714:45jonpitherbut if I search the entire codebase for the word 'geo' it gets painful#2016-09-0714:46benedekah you mean a keyword then?#2016-09-0714:46jonpitherso what I really want is to know all the places in the codebase where the symbol 'geo' is defined in code, i.e. as a destructured paramerer#2016-09-0714:46benedekah right. i see#2016-09-0714:46jonpitheri.e. (defn foo [{:keys [geo]}]#2016-09-0714:46jonpitheror (-> a-map :geo)#2016-09-0714:46benedeknope, unfortunately that does not work i think#2016-09-0714:47jonpitherk#2016-09-0714:47benedekif i remember right desctructuring in a defn is macro magic#2016-09-0714:47benedekand we fail on that particular case i think#2016-09-0715:08malabarbaYeah, all destructuring is macro Magic, I think. Both in fn and let. #2016-09-0715:13benedekno idea if rename symbol works on the local level with destructuring even tbh — i mean inside a defn/fn#2016-09-0715:16benedekyou might want to try cursive @jonpither for this particular issue. there I said it 😉 let me know if that works (that might make me have an other look on this :D)#2016-09-0715:23benedekok. so it absolutely works on the local level for both let destructuring and param destructuring#2016-09-0715:24benedekwhat does not work is searching for the same symbols (representing keys in maps) globally#2016-09-0814:07borkdudeHow do you deal with multiple REPLs in cider?#2016-09-0814:07borkdudeHow do you select the one you want to evaluate code against?#2016-09-0814:10borkdudeIf I understand correctly, CIDER figures it out, nice#2016-09-0814:20normantry M-x cider-connection-browser to see which nrepl is the default one#2016-09-0814:21normanYou can switch connections there if cider isn’t picking the right one#2016-09-0814:21normanIt got a little smarter a few releases ago so you normally shouldn’t need to do that#2016-09-0814:22normanif you have multiple projects#2016-09-0814:23normanif you are trying to, for example, talk to nrepls for two different instances of one project, then you’ll need to do the manual nrepl switching.#2016-09-0814:24normanI sometimes do that when talking to the staging machines and want to check something on all N of our servers…. Launch a bunch of ssh sessions with ports forwarded to the nrepl port. M-x cider connect to them all and toggle through.#2016-09-0814:48borkdudeok thanks @norman#2016-09-0818:40borkdudeHow can you cancel the evaluation of C-x C-e when it takes too long?#2016-09-0818:45seancorfieldC-c C-c should cancel it I think (but it may depend on exactly what the code is doing).#2016-09-0818:46borkdudeI think I lost my REPL by evaluating something huuuge#2016-09-0818:47borkdudeit’s back#2016-09-0906:06wagjo@borkdude @seancorfield I think it's C-c C-b#2016-09-0913:17macI am using boot, cider, cider-nrepl [0.14.0-SNAPSHOT] - what could cause No such namespace for javascript libs included via foreign-libs in boot.build, when trying to cider-eval-ns-form - file compiles and runs fine.#2016-09-0921:13noogaI just checked out 0.13.0 and things broke, I get "error in process filter: Symbol's function definition is void: cider-turn-on-eldoc-mode” when jacking in#2016-09-0921:13noogawhat’s process filter?#2016-09-0921:45dpsuttonwere you running cider before?#2016-09-0921:46dpsuttonand had you restarted emacs? I'm wondering if you reloaded some of cider but not all of the associated files so you have a weird mismash of versions of cider#2016-09-0922:29aaelonyhow do I prevent cider from hijacking my window and taking me somewhere new when I get an error?#2016-09-0923:01tanzoniteblackif you don’t want the error buffer at all: (setq cider-show-error-buffer nil)
if you want the error buffer, but don’t want it to be popped to the foreground: (setq cider-auto-select-error-buffer nil)
#2016-09-0923:02aaelonythe latter looks great! many thanks 🙂#2016-09-0923:18nooga@dpsutton yeah it turned out my cider config was seriously outdated#2016-09-0923:19dpsuttonDoes that mean you got it working for you again then?#2016-09-0923:33noogayeah, I just commented out the stuff it was complaining about#2016-09-0923:33noogaand now it seems to work#2016-09-1115:30jfntnI’m having issues with cider-find-* commands when connecting to a remote (VM) repl as opposed to jacking-in. I can verify that the nrepl plugins are properly loaded but all the cider-find-* commands are unable to resolve symbols.#2016-09-1115:31jfntnNot sure if there’s some extra setup required to enable the functionality or if that’s a bug?#2016-09-1117:06macAny help to be had on this one? I am using boot, cider, cider-nrepl [0.14.0-SNAPSHOT] - what could cause No such namespace for javascript libs included via foreign-libs in boot.build, when trying to cider-eval-ns-form - file compiles and runs fine.#2016-09-1213:12otfromhas anyone combined using clojure.spec, generative testing and deftest (or even running the tests) using C-c C-t n ?#2016-09-1213:12otfromI'm flailing around for a good workflow and I presume I'm missing something obvious#2016-09-1219:31PBSo I posted in here a while ago regarding getting cider to play nicely with docker. Does anyone here have their emacs cider repl playing nicely with the repl session inside a docker container?#2016-09-1219:31PBI’m currently experiencing issues when doing thigns like jump to file definition#2016-09-1308:31chrisblomi have done this in the past, you need to make sure the paths in the docker container match those on your host machine#2016-09-1318:14dpsuttonany cider devs gonna be at strangeloop by any chance?#2016-09-1319:04gtrakI'll be there, but i haven't hacked on cider in a while#2016-09-1319:04gtrakjust been a happy user#2016-09-1319:07dpsuttonsounds good to me#2016-09-1320:31jaymartinafter jacking-in I get prompted for a lisp expression:
in the minibuffer. I put in an empty list ()
and everything seems okay, but this just started happening today. Any ideas?#2016-09-1320:36jaymartinI see Cider Github issue 615 is related but that looks old.#2016-09-1320:38dpsuttonwhat version of cider are you running? I don't see any changes to github today, so you shouldn't have had any changes to cider#2016-09-1320:49jaymartin@dpsutton CIDER 0.14.0snapshot#2016-09-1320:51jaymartinNot a huge deal because everything is working, was just curious.#2016-09-1321:41jaymartinwhatever the cause, upgrading CIDER fixed my problem. Thanks for the help.#2016-09-1321:44dpsuttonhaha i did nothing. but i'm glad it's working for you#2016-09-1503:35jaermehow do i enable paredit-mode in cider? i tried M-x paredit-mode in the cider repl, but to no avail.#2016-09-1508:52bozhidarwell, that’s exactly what you need to do (provided paredit is installed)#2016-09-1508:54bozhidarand you can always add this to your config#2016-09-1508:54bozhidar(add-hook ‘cider-repl-mode ‘paredit-mode)#2016-09-1512:59jaermethank you#2016-09-1513:40borkdudedoes navigating to a function work in cljs in cider?#2016-09-1513:40borkdudefor some definition of work 🙂#2016-09-1513:41borkdude@bozhidar doesn’t CIDER come with smart-parens by default?#2016-09-1513:43bozhidarit comes with nothing by default 🙂#2016-09-1513:44bozhidaryes, navigating to a definition works with cljs#2016-09-1513:46borkdude@bozhidar I have a boot project and I’m connect to the nrepl session. What should I do in order to navigate in cljs? I get: not resolved.#2016-09-1515:38bozhidardid you load the namespace first?#2016-09-1516:58borkdude@bozhidar what does loading mean when I’m in emacs and the clojurescript is running in the browser?#2016-09-1516:59borkdudeaaah#2016-09-1516:59borkdudeso I need to be connected to a cljs repl#2016-09-1516:59borkdudeprobably#2016-09-1519:48mitchelkuijpers@borkdude you need to run (start-repl) with boot for example#2016-09-1519:48mitchelkuijpersthen it will detect that it is a clojure repl#2016-09-1519:50mitchelkuijpersor you could set a setting in cider and use cider-create-sibling-cljs-repl when you are connected to nrepl that way you’ll always have two repls one for clojure and one for clojurescript#2016-09-1519:53borkdude@mitchelkuijpers cool, thanks!#2016-09-1519:57borkdudecider-create-sibling-cljs-repl seemed to work… amazing 🙂#2016-09-1520:01mitchelkuijpersCool, I love that command makes starting everything way easier#2016-09-1520:05borkdudeI don’t know why it started a Rhino repl though 🙂#2016-09-1520:05borkdudebut for navigation it works#2016-09-1520:06dpsuttonRhino repl is the default. When cider launches a clojure script repl, if it doesn't know which one it defaults to rhino#2016-09-1520:08borkdudeso I guess boot’s (start-repl) is preferable if you also want to interact with the browser#2016-09-1520:11dpsuttonnot necessarily#2016-09-1520:11dpsuttoncider starts it for you automatically#2016-09-1520:13dpsuttoni set this and cider starts up the correct repl for me. Each repl has different incantations to get i tup and running. this one work sfor me. I'm new to cljs side though and don't have much boot experience#2016-09-1520:15mitchelkuijpersI have this Cider Cljs Lein Repl: Value Menu Custom: (start-repl)#2016-09-1520:15mitchelkuijpersthis works for boot even though it states Lein it has nothing todo with that#2016-09-1520:16dpsuttonsounds like some documentation needs to be cleaned up#2016-09-1520:17dpsutton@borkdude it sounds like just set cider-cljs-lein-repl to whichever value it needs to be and then not worry about it#2016-09-1520:19mitchelkuijpersAs long as it gets you a cljs repl you are fine 🙂#2016-09-1520:29borkdude🙂#2016-09-1520:40borkdudeI’ve put this in my init.el:
(setq cider-cljs-lein-repl "(do (ns boot.user) (start-repl))”)#2016-09-1520:41borkdudeand this works for me#2016-09-1520:57borkdude@bozhidar ah, I meant prelude when I mentioned smartparens 😃#2016-09-1606:20bozhidaryeah, prelude defaults to smartparens indeed#2016-09-1817:54adamfreyIn clojure-mode is there a way for me to set one specific form to have an indentation where the args are vertically aligned? I want the arguments to be aligned just for and and or.#2016-09-1819:02jfntn@adamfrey you can probably do that with define-clojure-indent#2016-09-1819:03adamfreythat’s what I want but I only see examples define-clojure-indent taking an int number of spaces to ident#2016-09-1819:03adamfreyis there an option like :align or something?#2016-09-1819:04jfntnI don’t understand what you want, have an example?#2016-09-1819:13richiardiandrea@adamfrey there is clojure-align in clojure-mode#2016-09-1819:15adamfrey@richiardiandrea what is clojure-align?#2016-09-1819:15richiardiandrea(if I understood your request correctly) it aligns forms vertically#2016-09-1819:16adamfreyyes, but I don’t want to align all forms vertically by default. I want all my function parameters to indent two spaces by default (which I already have set up and working). I only want to override that setting for two forms: and and or#2016-09-1819:17adamfreyI feel like I should be able to do that with define-clojure-indent, but I can’t find an example of overriding just one form to make the params align.#2016-09-1819:18richiardiandreaoh so I think definitely define-clojure-indent should help#2016-09-1819:18richiardiandreaI found a link: http://jbm.io/2013/11/custom-indentation-in-clojure-mode/#2016-09-1819:23adamfrey@richiardiandrea thanks for the link! it made me realize that I misunderstood what the integer in define-clojure-indent meant. I thought it was the number of spaces to indent, but actually it is the amount of parameters to treat as “special”. So to get what I want I added this: (define-clojure-indent
(or 0)
(and 0))
#2016-09-1819:24richiardiandreaglad it helped!#2016-09-1919:09jasonjckncljr magic requires is happening even while typing out arguments to a macro that I wrote#2016-09-1919:09jasonjcknbut the macro doesn't treat the symbols as clojure treats them#2016-09-1919:09jasonjcknso I wrote ui/foobar and it tries to require 'ui' but there's no foobar symbol in ui#2016-09-1919:10jasonjcknbecause my macro uses 'ui/foobar in a totally different way#2016-09-1919:10jasonjcknany solution?#2016-09-1919:10jasonjcknbesides disabling magic requires#2016-09-1919:10jasonjcknalso I tried :prompt and it didn't work#2016-09-1919:10jasonjcknit didn't prompt, it still automatically added the NS#2016-09-1920:05agwhen I jack-in I want cider to jumpt to *nrepl-server my-project* buffer… how can I do that?#2016-09-2012:21borkdudewhat’s the cider command for selecting the appropriate nrepl buffer?#2016-09-2012:21borkdudefrom a library that’s shared between two running applications, it’s ambiguous 🙂#2016-09-2014:26benedekif you are on a project file you C-c C-z if you use the same combo from the REPL it puts you back to source file.#2016-09-2014:27benedekif you use a prefix eg. C-u C-c C-z then the namespace is switched to the namespace of the file you are coming from too. can be pretty handy#2016-09-2014:28benedekfor your border case just use the M-x cider-connection-browser#2016-09-2021:27aengelbergIs there a way to configure clojure-mode (perhaps through define-clojure-indent) so that all list forms beginning with a symbol followed by a line-break are indented with 1 space instead of 0?#2016-09-2109:23bozhidarI don’t think so#2016-09-2109:24bozhidarpretty sure we didn’t make it possible to specify indentation in such generic terms - you need concrete names for the indentation spec#2016-09-2113:26macIs there a way to tell cider to use a specific cljs repl ? I am getting user-error: ‘cider-eval-last-sexp’ needs a ClojureScript REPL. even though I have a working cljs repl open.#2016-09-2113:39macAh, the cider-repl-type is clj - is there a way to override that?#2016-09-2113:40michieljorisYou can set the mode of the source buffer to clojure-mode instead of clojurescript mode.#2016-09-2113:43michieljorisI've got a cljs repl using dirac, had the same problem, and setting clj-mode lets me eval from the source buffer. However doesn't seem totally functional still.#2016-09-2113:46mac@michieljoris I get some error re hash values, when I try that.#2016-09-2118:33jfntnDoes anyone know why the debugger doesn’t work in clojurec-mode with a clj repl?#2016-09-2220:10jasonjcknsome of my clojure :variables in my spacemacs config layer are ignored after I upgraded to latest emacs and latest spacemacs#2016-09-2310:00borkdudeWhen you’re in a .cljc buffer, can you re-evaluate a conditional expression against a cljs repl? it doesn’t seem to work at my side#2016-09-2311:37borkdudeAh, there is a closed cider issue about this#2016-09-2311:37borkdudehttps://github.com/clojure-emacs/cider/issues/1120#2016-09-2315:59plexuswhen the whitespace in error messages gets all messed up, is that CIDER's fault, or nREPL?#2016-09-2316:55jfntnUsing lein I’ve added a git repo for one of my deps to ./checkouts, it gets resolved properly and Cider navigates to those files#2016-09-2316:56jfntnBut the debugger doesn’t work from the checkouts repo, #dbg doesn’t stop execution and the keybinding that turns on debugging for a defn doesn’t highlight it#2016-09-2401:32bvulpeshow common is it for cider-test-run-project-tests to not return after the first time it’s called for a given project ?#2016-09-2617:20borkdudeWhat do people here use to highlight symbols, e.g. when you put point at an argument, it is highlighted in the body#2016-09-2618:02bvulpes@borkdude C-s#2016-09-2619:08borkdude@bvulpes search? yeah.. 😉#2016-09-2619:08bvulpes@borkdude it even works independently of programming mode 😛#2016-09-2700:28ag@borkdude you can also use auto-highlight-symbol-mode. turn on and off whenever you want#2016-09-2700:31agand you can set the range with ahs-change-range and it would highlight only inside current function#2016-09-2700:32agseems like close to what you want#2016-09-2705:08grounded_sageI'm having trouble getting a repl up and running. I use cider-jack-in-clojurescript and then I get nothing....#2016-09-2705:39grounded_sageI am completely stuck here..... I use cider-jack-in and then nothing....#2016-09-2705:47grounded_sagewhen I follow what is says I get this boot repl -c
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_74-b02
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from : [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=> (start-repl)
<< started Weasel server on ws://127.0.0.1:52649 >>
<< waiting for client to connect ... java.lang.NullPointerException
at $make_parents.invokeStatic(io.clj:443)
at $make_parents.doInvoke(io.clj:438)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at adzerk.boot_cljs_repl$make_repl_connect_file.invokeStatic(boot_cljs_repl.clj:43)
at adzerk.boot_cljs_repl$make_repl_connect_file.invoke(boot_cljs_repl.clj:41)
at adzerk.boot_cljs_repl$write_repl_connect_file.invokeStatic(boot_cljs_repl.clj:59)
at adzerk.boot_cljs_repl$write_repl_connect_file.invoke(boot_cljs_repl.clj:54)
at adzerk.boot_cljs_repl$repl_env$fn__513.invoke(boot_cljs_repl.clj:104)
at weasel.repl.websocket$websocket_setup_env.invokeStatic(websocket.clj:72)
at weasel.repl.websocket$websocket_setup_env.invoke(websocket.clj:60)
at weasel.repl.websocket.WebsocketEnv._setup(websocket.clj:27)#2016-09-2705:57grounded_sageOk so I managed to get things working it seems. However it is still confusing on how it actually works.#2016-09-2713:55borkdude@ag good suggestion. I hadn’t installed that package yet, but now I have#2016-09-2722:03jfntnAnyone else have their cursor disappear after closing a *cider-error* buffer?#2016-09-2913:04mpenetI am getting Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.debug/wrap-debug in this context today, not sure what's happening#2016-09-2913:04mpeneti am on the SNAPSHOTS#2016-09-2913:06mpenetoh, it works with clj 1.8.0, if I update my project to 1.9 it breaks#2016-09-3002:14radon@ag: Regarding auto-highlight-symbol-mode, is there an option to highlight all occurrences of the current symbol except the one point is on? (as per http://emacs.stackexchange.com/q/24859/12534)#2016-09-3002:14radon(doesn’t seem to be an option with highlight-symbol-mode, but it seems that auto-highlight-symbol-mode is actually completely different)#2016-09-3002:21ag¯\(ツ)/¯#2016-09-3002:21radonOK 🙂#2016-09-3002:21radonI’ll have to look into it later.#2016-09-3017:49adamfreyin a cider repl, if I’m running a boot task that blocks (prints "Starting file watcher (CTRL-C to quit)…” and I enter C-c C-c which is cider-interrupt my boot task doesn’t get killed, it’s still running. The only way to truly stop my task is to kill the cider repl buffer completely. Does anyone know a way I can send CTRL-C to my boot task in a cider repl?#2016-09-3020:21lvhI’m getting the dreaded:
WARNING: CIDER's version (0.14.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
I’ve followed the instructions at: https://cider.readthedocs.io/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version including manually adding cider-nrepl, but I haven’t been able to resolve the issue. It only happens with one particular project; but specifying it there in project.clj or in my profiles.clj doesn’t resolve the issue. How can I debug this?#2016-09-3020:21lvh(I previously had ultra which I thought was maybe the issue, but turns out it’s not that; also that wouldn’t explain why a different project works fine)#2016-09-3021:54bja@lvh when you jack-in, so you get a message about running lein update-in :dependencies .... with some [cider/cider-nrepl ...] version?#2016-09-3021:54lvhwell, that’s the command I see in the minibuffer; and then in the repl buffer I see the aforementioned error#2016-09-3021:54lvhI’ve managed to bisect it down to upgrading core.typed, of all things#2016-09-3021:56bja@lvh what's the dependency vector for that core.typed that seems to break?#2016-09-3021:56lvhstill working on figuring that out#2016-09-3021:56lvh(starting nrepls takes a while)#2016-09-3021:56lvhyep, it’s definitely core typed#2016-09-3021:57lvhhm, I have a lein-typed...#2016-09-3021:58lvhthat ostensibly doesn’t do anything exciting#2016-09-3021:59lvh[org.clojure/core.typed "0.3.28"]
[org.clojure/core.cache "0.6.4"]
[org.clojure/data.priority-map "0.0.4"]
[org.clojure/core.typed.rt "0.3.28"]
[org.clojure/math.combinatorics "0.1.3" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.analyzer.jvm "0.6.8"]
[org.clojure/core.memoize "0.5.7"]
[org.clojure/tools.analyzer "0.6.7"]
[org.ow2.asm/asm-all "4.2"]
[org.clojure/tools.namespace "0.3.0-alpha3"]
[org.clojure/java.classpath "0.2.3”]
#2016-09-3021:59lvhaccording to lein deps :tree#2016-09-3021:59lvhthere’s some dependency conflicts there#2016-10-0520:20slipsetI’m sorry if this is a faq, but I have this web-app which, when run from lein repl prints log4j messages to stdout. When running the same app from inside Cider, the log-messages are nowhere to be seen. Is there a setting I’m missing here? https://github.com/clojure-emacs/cider/issues/524 suggests that the logging can be found in the nrepl buffer, but I cannot find any logs there either (and no, the buffer is not called nrepl anymore, but rather nrepl-messages foo)#2016-10-0521:53bvulpes@slipset: checked *cider-server* yet?#2016-10-0605:17slipsetThere is no *cider-server* buffer#2016-10-0606:37slipsetOne workaround is to do M-x cider-connect and connect to a repl started outside Cider. This gives me logs in a terminal, and a repl in Emacs. Problem is, when doing so, Cider doesn’t get to inject its middleware:#2016-10-0606:37slipsetWARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
More information.
WARNING: CIDER's version (0.14.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.3.0-SNAPSHOT (package: 20160621.902) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
#2016-10-0606:39slipsetI guess I might have to add the middlewares to my .lein/profiles.clj#2016-10-0608:15slipsetyes, setting up the middelwares the old way was the way to go.#2016-10-0612:40gregnwosui know of cider-test-jump
is there a command that will create a test skeleton if there is no test defined?#2016-10-0614:43jfntnIs there a way to pprint or inspect the current value in the debugger?#2016-10-0614:44jfntnThe inspect keybinding asks for a symbol but when stepping I often don’t have one, would like to have something like *1 in the repl#2016-10-0614:45jfntnDamn it was right under my nose, cider-inspect-last-result#2016-10-0614:46jfntnUnfortunately getting Sync nREPL timed out errors#2016-10-0706:27escherizeHey guys, could use some feedback on this library: https://github.com/escherize/tracks#2016-10-0708:27reefersleepImmediate reaction: that's pretty cool 🙂 Nice alternative way of expressing stuff.#2016-10-0708:59slipsetIs there a shortcut to jump from anywhere in my source-ns to my test-ns?#2016-10-0714:08gtrakprojectile-mode does that#2016-10-0714:08gtrakC-c p t#2016-10-0714:09gtrakprojectile-mode and helm-projectile has been a huge timesaver when working across projects#2016-10-0718:38gregnwosu#2016-10-0718:55mahinshaw@gregnwosu cider-jack-in-clojurescript#2016-10-0718:55gregnwosuthanks#2016-10-0719:12mahinshaw@gregnwosu There is a var (defcustom) cider-cljs-lein-repl that will let you change what kind of repl you are running, and for that matter, what function you call to start the repl. Just in case you don’t want a rhino repl.#2016-10-0719:14gregnwosuoh cool, im just getting my feet wet here, quite easy to switch between repls in emacs , so i dont think i will lock it down with a variable atm#2016-10-0907:25bozhidarafter a few quiet months I’ve been trying clean up CIDER’s issue tracker a bit#2016-10-0907:25bozhidarmaybe I’ll even do a small release soon#2016-10-0907:25bozhidarif someone is interested in helping out - there’s plenty of tasks here https://github.com/clojure-emacs/cider/issues#2016-10-0907:25bozhidar🙂#2016-10-0907:26bozhidarI’d be happy to help everyone interested in contributing#2016-10-0915:11tianshu😞 the indent-spec is hard to understand, what does :form mean?#2016-10-0915:12tianshuand I think
[2 :form :form [1]] = [2 :form :form 1] ?#2016-10-0915:13tianshuIs :form a default indent rule, so when only have one special argument and this argument has no special internal indent,
[1 :form :form] = [1] = 1?#2016-10-0916:15jcsimsHey @bozhidar what's the best way to get a version of CIDER running to hack on? make run-cider?. I haven't done much directly with elisp yet#2016-10-0916:18bozhidarI just install CIDER from MELPA and start updating parts of it by changing and evaluating the Elisp source code#2016-10-0916:18bozhidarnothing fancy#2016-10-0916:19jcsimsah, right - you should be able to M-. into something and play with it.#2016-10-0916:19bozhidar@doglooksgood it’s mentioned in the spec - The keyword :form, meaning “every arg indents like a function form”.#2016-10-0916:20jcsimsIt's been on my list for a long time to contribute back to CIDER 😬 - maybe Hacktober will finally be my motivator#2016-10-0916:20bozhidar@jcsims I actually play with a cloned version of the source code; the effect is pretty much the same#2016-10-0916:21bozhidarcan’t really M-. into something before evaluating it from the cloned source, but it’s not a big deal idea (grepping gets the job done 🙂 )#2016-10-0917:01dpsutton@jcsims if you are working with the MELPA version, updates can nuke your local changes, and you may not have easy access to git, if its inside of another repository#2016-10-0917:02dpsuttonthat's in my personal.el and i can track master, work on my own fork, etc#2016-10-0917:20jcsims@dpsutton thanks, that’s really helpful#2016-10-1003:32dpsuttonam i crazy or am i missing the cider messages buffer with all of the traffic between nrepl and cider?#2016-10-1003:33dpsuttonaha. https://github.com/clojure-emacs/cider/commit/360daba09dc32d9f6208fac105285f5c8f3aed6c#2016-10-1003:33dpsuttonif anyone is interested, its now a toggle-able feature#2016-10-1005:24bozhidaryeah, it was recently disabled by default as some people were reporting that logging was slowing down CIDER for them#2016-10-1005:26bozhidaras for the previous conversation - it might be good to add a section “Hacking on CIDER” or something like this to the manual#2016-10-1014:06codemartinCIDER already highlights calls to functions marked as ^:deprecated which is very nice. I wonder how to make it mark any arbitrary metadata? In my case, we have a lot of functions marked with ^:io and it would be great to have them be highlighted in CIDER.#2016-10-1015:06jcsims@bozhidar I added a placeholder issue about adding hacking to the cider docs: https://github.com/clojure-emacs/cider/issues/1862#2016-10-1015:09bozhidar@codemartin It’s doable, but might require some changes to the code, to be extensible#2016-10-1015:10bozhidarnot sure if we didn’t hardcore the supported metadata in the middleware or something like this#2016-10-1015:10bozhidarit’d be best to file a ticket for this#2016-10-1015:10bozhidar@jcsims thanks 🙂#2016-10-1015:17codemartin@bozhidar That might just be my first code contribution to CIDER. Thanks!#2016-10-1107:06xiongtxHow do you run all tests in cider-nrepl?#2016-10-1107:06xiongtxlein test :all runs only a few tests:
lein test cider-nrepl.plugin-test
lein test cider.nrepl.test-session
lein test cider.nrepl.test-transport
lein test cider.test-ns.first-test-ns
lein test cider.test-ns.second-test-ns
lein test cider.test-ns.third-test-ns
Ran 2 tests containing 16 assertions.
0 failures, 0 errors.
#2016-10-1107:28codemartin@xiongtx Are you sure your test files are formatted correctly? If you publish one here I can help you#2016-10-1107:29xiongtxI just cloned the repo and ran lein test :all in the project dir#2016-10-1107:33codemartinOh my bad#2016-10-1113:51dpsutton@xiongtx lein test with-profile +test-clj#2016-10-1113:51dpsuttonlook in the project.clj file and you'll see a bunch of different profiles and they all extend their notion of the test directories#2016-10-1113:52dpsuttoni've taken to running the individual file's tests since things get weird in cider when you load nrepl in a running copy of nrepl#2016-10-1114:10dpsuttonand since cider doesn't really support testing with profiles#2016-10-1116:52xiongtx@dpsutton Thanks, I’ll take a look later#2016-10-1120:29noprompthow do i get C-c C-l to work with conditional reading?#2016-10-1204:30xiongtx@dpsutton It's actually lein with-profile +test-clj test, but thanks for getting me 90% of the way there!#2016-10-1209:34NiclasWhat’s the status on using cider-find-var in ClojureScript projects? It works as expected in .clj files but always returns Symbol … not resolved in cljs files#2016-10-1215:39bozhidarit should work just as in .clj#2016-10-1215:40bozhidarprovided there’s active cljs connection and the current namespace has been evaluated#2016-10-1218:10tianshuwhy auto completion in cider doesn't support for stuffs in goog?#2016-10-1218:10tianshuand js/#2016-10-1218:25richiardiandrea@doglooksgood I have recently looked at it and the completion for cljs is really basic at the moment#2016-10-1218:26richiardiandreadirac has much more powerful completion and I was kind of thinking of a way of combining, together with darwin, cider and dirac maybe through a dirac middleware#2016-10-1218:29richiardiandreacode is here: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/complete.clj and it is using [cljs-tooling](https://github.com/clojure-emacs/cljs-tooling)#2016-10-1218:29richiardiandreathe other solution is to import dirac additions to cljs-tooling of course#2016-10-1219:40nopromptwell i figured it out. the file i was trying to load was a clj file not a cljc file.#2016-10-1219:40nopromptnot that it's cider's fault but, eesh, what a terrible error message.#2016-10-1219:43dpsutton@noprompt what was the circumstance and error message? I'm not seeing your inital message#2016-10-1219:48nopromptusing C-c C-l to load (mistakenly) a clj file with reader conditionals in it resulting in CompilerException java.lang.RuntimeException: Conditional read not allowed, compiling:(blah/blah/blah).#2016-10-1219:49noprompti could probably look into it. the message should be a little bit better and try to offer some advice.#2016-10-1219:49noprompte.g. Check the file extension#2016-10-1300:24tianshu@richiardiandrea good job :thumbsup:#2016-10-1300:25richiardiandreaah ah did nothing yet, just talking 😄#2016-10-1309:10borkdudeSometimes when I navigate to a definition (M-.) I end up in the boot cache. What could be wrong here?#2016-10-1316:04tomjkiddHey, does anyone know how to inspect the current form? I am trying to look at keys in a hashmap that is truncated with …#2016-10-1316:04tomjkidd*for debugging within cider#2016-10-1316:28dpsuttondoes clicking it expand it?#2016-10-1316:30tomjkiddNah, I tried clicking every nook and cranny#2016-10-1316:30dpsuttonhighlight and press enter?#2016-10-1316:30tomjkiddI can’t actually highlight the debugger blue text#2016-10-1316:31tomjkiddI thought just hitting a blind enter might do it, but nope for that either.#2016-10-1316:31tomjkidd*after hitting p for inspect#2016-10-1316:35tomjkiddAfter inspecting locals, at least in one instance, there is an _ defined that had it#2016-10-1316:37tomjkiddBut that is not always available...#2016-10-1320:27bozhidarToday is my birthday, but you'll get a small gift from me#2016-10-1320:28bozhidarCIDER 0.14 (Berlin) is out https://github.com/clojure-emacs/cider/releases/tag/v0.14.0#2016-10-1320:28bozhidarEnjoy!#2016-10-1320:47arrdemhbd @bozhidar!#2016-10-1320:56aghey guys… anyone had problems with boot’s output not redirected correctly? I can’t seem to make boot-cljs compiler-options {:verbose true} to work#2016-10-1321:02agit’s redirecting log messages to nrepl-server buffer I don’t like that… is there a way to see it right there in cider-repl?#2016-10-1321:52tomjkidd@bozhidar happy birthday!#2016-10-1322:58arrdem@ag this is probably a control flow issue of when boot captures the out printwriter from *out*.#2016-10-1322:59arrdemI'd bet that if you're running a repl through boot that boot is grabbing *out* farther up the call stack before CIDER installs its network PrintWriter thing that actually gets read into emacs.#2016-10-1323:00agyeah, I’ve created this: https://github.com/adzerk-oss/boot-cljs/issues/138 not sure if that belongs to that project though#2016-10-1323:03arrdemI'm gonna guess it's a bug in clojure-emacs/cider-nrepl#2016-10-1323:03arrdemLooks like this is where all that gets dealt with...#2016-10-1323:03arrdemhttps://github.com/clojure-emacs/cider-nrepl/blob/6a3872564d20c54adbf0396f86a67975f019f2fe/src/cider/nrepl/middleware/out.clj#2016-10-1323:06ag@arrdem the lein cljsbuild though outputs to the right buffer#2016-10-1323:06ag¯\(ツ)/¯#2016-10-1400:02arrdemweird#2016-10-1400:42mnewhookI’m trying to get cider-jack-in to work with a ring app… cider-jack-in works but the ring app isn’t started.#2016-10-1401:04mnewhookErg, even worse. I just updated cider in spacemacs and now I get Could not find artifact cider:cider-nrepl:jar:0.15.0-SNAPSHOT in clojars ()#2016-10-1402:17iku000888@mnewhook For the second issue, seems like that version of cider-nrepl is not up on clojars yet.#2016-10-1407:16bozhidarhmm, guess I forgot to deploy cider-nrepl again#2016-10-1407:16bozhidarhad a busy day yesterday#2016-10-1407:16bozhidarfixed#2016-10-1407:18bozhidar@ag never had time to properly investigate this, but it’s definitely something to do with how tools like lein and boot bind the stdout when they start#2016-10-1407:18bozhidaras @arrdem said we tried to implement some logic to forward all the console process’s output to the repl using middleware, but I’m not sure whether this works or not#2016-10-1407:19bozhidarI have very little time for CIDER and can’t really get into more complex issues properly#2016-10-1414:34joost-diepenmaatis there a good way to start a repl (using cider-jack-in or cider-jack-in-clojurescript) and then execute some clojure code from emacs lisp ?#2016-10-1414:35joost-diepenmaat(cider-jack-in)
(cider-insert-in-repl "(start)" t)#2016-10-1414:35joost-diepenmaatdoes not seem to work (looks like cider-jack-in is asynchronous#2016-10-1414:36joost-diepenmaatI think I need/want a callback when the cider-jack-in repl has started#2016-10-1414:47dpsuttonyou can set the var cider-refresh-before-fn. This function is called when the repl is refreshed#2016-10-1414:48dpsuttonI'm not positive that this would be called at initial jack in#2016-10-1414:48dpsuttonbut you could then issue ,refresh and it would call your function#2016-10-1414:48dpsuttonor cider-refresh-after-fn#2016-10-1414:48dpsuttonnote that these functions must have a zero-arity version#2016-10-1414:49dpsuttonYou can check cider-refresh-log (sp? a buffer) for results of refreshing, etc#2016-10-1414:49dpsutton@joost-diepenmaat ^#2016-10-1414:57dpsuttonAlso, its possible that what you want is to launch your clojurescript apparatus after jacking in. This should happen for you#2016-10-1415:00joost-diepenmaathmm#2016-10-1415:06joost-diepenmaatthanks dpsutton I will give it a try#2016-10-1415:41jcsimsI'm trying to debug a cljr-clean-ns call that hangs emacs for me. I've gotten as far as I can in Emacs (I think), as it's called nrepl-sync-request with the clean-ns op. What's the best way to start debugging this in refactor-nrepl?#2016-10-1417:07tomjkiddI am trying to debug a project using clojurescript as a dependency. I am getting unexpected behavior when I try to step into sub-dependencies. For example, I am in cljs.closure/compile-file, which calls cljs.compiler/compile-file within it. I have tried using C-u C-M-x to mark both functions, but when I try to use the i command, it does not go into cljs.compiler/compile-file. Any advice?#2016-10-1417:35arrdem@ag if you can post repro instructions forget minimal ones on the cider-nrepl bug tracker I can try to dig into it. I suspect this is gonna be an issue with *out* binding and the fact that we can't/don't set a root binding for dynamic vars most of the time.#2016-10-1417:45ag@arrdem should I expand into this one? https://github.com/adzerk-oss/boot-cljs/issues/138#2016-10-1417:47arrdem@ag right sorry forgot about that one. If there's other detail you can provide about the specific task you're running that would help.#2016-10-1417:49arrdem@bozhidar when you get a sec, can I get assign access in cider-nrepl so I can mark #381 as mine?#2016-10-1417:52ag@arrdem I have added example of a task#2016-10-1417:52arrdem@ag great thanks.#2016-10-1417:57agyeah, no problem. thanks for looking into that#2016-10-1417:58arrdemSure. I think it's a super simple problem to explain, not sure there's a fix tho. Will update the CIDER ticket.#2016-10-1423:47mnewhookAnyone got any thoughts on:
https://clojurians.slack.com/archives/cider/p1476405752000410#2016-10-1423:48mnewhookwhat do most people do? Run lein ring server and then cider-connect? Run the ring app manually from the repl?#2016-10-1423:57mnewhookI just tried using cider-connect and I get in the repl output:
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.3.0-SNAPSHOT (package: 20161005.344) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
#2016-10-1505:42bozhidar@arrdem sure#2016-10-1509:23bozhidardone 🙂#2016-10-1519:25benedek@mnewhook pls see the documentation. if you are using cider connect you have to make sure the middleware(s) are configured manually most likely in your`~/.lein/profiles.clj` (in case you are using leiningen). that is not the case if you jack-in#2016-10-1519:29benedek@jcsims i would M-. to the refactor-nrepl namespaces in the project. change the ns to the that refactor-nrepl ns in the repl and start redefining functions to emit some debug info.
but before that you can always M-x cljr-toggle-debug-mode and check if that is giving you anything helpful. also check your nrepl messages perhaps#2016-10-1520:17arrdemThanks! I guess I'm on the hook for nrepl now tho 😛#2016-10-1608:42trisshey all. so if I want pretty printing all the time what's the best way to get it? is there a way to add fipp to every session?#2016-10-1611:32ziltiIs there some way I can get cider to inject dependencies despite the "cider boot parameters" setting not being the default?#2016-10-1612:19richiardiandrea@zilti can you give an example of the boot command that you have and dependency you want to inject?#2016-10-1612:20richiardiandreaI worked on a PR (still needs approval) to have a custom task doing the injection for boot versions > 2.7.0 so maybe I can help you with that#2016-10-1612:54zilti@richiardiandrea I want to change it from "repl -s wait" to "dev" (I have a "dev" task that simply "comp"s a couple tasks together), and I want cider to still inject the dependencies it normally injects for a jack-in.#2016-10-1613:44richiardiandrea@zilti I usually have a cider task in my profile boot and I chain boot cider dev for that#2016-10-1613:45richiardiandrea(deftask cider
"Add CIDER support:
"
[]
(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
concat '[[cider/cider-nrepl "0.14.0"]
[venantius/ultra "0.4.1"]
[org.clojure/tools.nrepl "0.2.12"]
[refactor-nrepl "2.2.0"]])
(swap! boot.repl/*default-middleware*
concat '[refactor-nrepl.middleware/wrap-refactor
cider.nrepl/cider-middleware])
identity)
#2016-10-1614:21zilti@richiardiandrea hmm. So pretty much like putting it into the "global" boot file? How does cider determine if the "cider boot parameters" variable is good enough for it to inject the dependencies?#2016-10-1616:24tylerIs there a way to turn off automatically injecting refactor-nrepl?#2016-10-1616:26benedekyup#2016-10-1616:27benedek(setq cljr-inject-dependencies-at-jack-in nil)#2016-10-1616:27tylerWhere is that configured? I can't seem to find it in the rtd#2016-10-1616:27tylerah thank you#2016-10-1616:28benedekcider has a similar defcustom#2016-10-1616:29tylerDo I also have to set the cider defcustom?#2016-10-1616:29benedeknope. just bit of extra info to confuse you. sry 😉#2016-10-1616:30tylernp thanks again#2016-10-1616:30benedekno worries#2016-10-1616:34tylerSo I added that line and eval'ed it but when I run cider-jack-in-cljs it still shows that its injecting refactor-nrepl in the minibuffer#2016-10-1616:39benedekhm.. strange#2016-10-1616:45benedekwell tbh not that strange. what cljr does is to add its own middlewares to a list in cider. this addition happens after cider is loaded#2016-10-1616:45benedekso if it was added already in your emacs/cider session it is there for that session.#2016-10-1616:46benedekin short easiest if you restart your emacs, set the variable to nil and jack in#2016-10-1617:49richiardiandrea@zilti mmm, I don't understand the question maybe, but you add a custom command line for boot and then the cider task injects the middleware, you are in control of both parts and you can decide where to apply it (with .dir-locals.el for instance)#2016-10-1619:52josh.freckletonIs there a way to have a CLJ and separate CLJS repl when I'm jacked in to CIDER?
Ex, I'd love if when I request an http route on my server, if I can see a debugging printout in that backend repl. And then the same for CLJS.#2016-10-1620:15hansI've got trouble with cider after upgrading to 0.14.0:
ELISP> (when-let ((a 1)) a)
*** Eval error *** Wrong number of arguments: when-let, 1
#2016-10-1620:16hansthis when-let syntax is used in cider everywhere, but for some reason, emacs' cl package does not grok it in my install (emacs 25.1.1 on OSX)#2016-10-1620:20hansI seem to be able to work around the issue by unconditionally defining when-let in cider-compat.el, but that seems not to be the right thing to do.#2016-10-1621:58jcsims@benedek awesome, thanks for the pointers. I did not know about cljr-toggle-debug-mode#2016-10-1704:26bozhidar@hans this is part of Emacs's subr-x.el package#2016-10-1704:27bozhidarit has nothing to do with cl.el#2016-10-1704:51hans@bozhidar What's a good fix then?#2016-10-1716:16bozhidar@hans the funny thing is that we have been using when-let for a long time#2016-10-1716:17bozhidarso I really can’t see how CIDER 0.14 exposed this problem for you#2016-10-1716:17bozhidarI’m guessing you can check whether the definition in subr-x.el and the one in CIDER are the same#2016-10-1716:17bozhidarbut I’m using 25.1 and it works for me just fine#2016-10-1716:19hansThanks, I will check. It is probably some other library that defines the macro in an incompatible way.#2016-10-1717:44josh.freckletonis there a way to use figwheel + cider in emacs, and have requests to the attached server print to the REPL in emacs? (IE the CLJS repl prints logs from cljs files, but not clj files to the CLJ REPL...)#2016-10-1814:42rymndhngIs there a way to pretty print the exception from cider-test failures? For example, I have a schema validation error, but it barfs the clojure.lang.ExceptionInfo data structure as a single line, instead of pretty printed (I have pretty printing enabled).#2016-10-1816:25richiardiandrea@rymndhng it might be worth opening an issue on gh 😉 #2016-10-1817:07josh.freckletonIs there a way, upon C-c M-J, to have CIDER not jump straight to the REPL buffers, but to instead leave me on my original buffers?#2016-10-1817:11josh.freckleton(ah, i just found (setq cider-repl-pop-to-buffer-on-connect nil), that works)#2016-10-1817:12josh.freckleton(goes in emacs init.el, of course)#2016-10-1817:17bozhidar🙂#2016-10-1817:17bozhidarcider is quite flexible when it comes to configuration#2016-10-1901:54herbmWhen Cider "Debug Top Level form" throws " Method code too large!" is it (more likely) too many forms, too many characters, or some other error? (It passes regular eval without debug.)#2016-10-1903:25radon@bozhidar Hmmm… I’d like to configure CIDER to pop open the buffer, but not move my cursor. Any way to do that? (Currently I’m adding an advice to the function that’s called when it connects.)#2016-10-1904:54zilti@richiardiandrea well, the problem is that as soon as cider-boot-parameters isn't exactly repl -s wait, cider won't inject the middleware on jack-in anymore.#2016-10-1908:06richiardiandrea@zilti if you have a cider task that does it for you, then you're good anyways right?#2016-10-1908:08zilti@richiardiandrea well, then I can just put it into the global boot settings, but I was wondering why cider refuses to inject the dependencies when that variable is modified.#2016-10-1908:42benedekhappy to look at this @zilti if you file an issue on github...#2016-10-1911:10herbmDo any of you know if Cider "Method code too large!" (when debugging) is only helped by reducing forms or if character count matters?
My function was larger than I would have preferred, since it was a 4clojure solution best submitted as a single function, but still just 20 moderately dense lines with none over 80 characters.#2016-10-1911:11herbmLove Cider BTW!!!❤️ It definitely ROCKS! Thanks Bug and everyone who helps improve it.#2016-10-1912:59bozhidarthere’s some issue report for this on github, @malabarba was looking into the problem but couldn’t come up with a solution as far as I remember#2016-10-1913:00bozhidar@radon file some issue for this; I don’t recall if we had support for this or not#2016-10-1913:00bozhidartoo many config options 🙂#2016-10-1913:10malabarbaYep. That's about the whole story 😞 #2016-10-1913:10malabarbaHaven't figured out a way around it yet #2016-10-1913:10malabarbaThe simple issue is that instrumenting code makes it much larger. #2016-10-1913:11malabarbaI think there are some optimizations that might improve this situation, but I haven't been able to explore the possibility #2016-10-1914:40herbm@bozhidar & @malabarba are you refering to my "Method code too large!"??? I wasn't really reporting a problem or complaining -- just asking what it takes to work around what seemed to be a limitation. If you want me to submit a function that causes it that would be easy since I still have it (and the slightly smaller version that doesn't cause the issue to manifest.)#2016-10-1914:44dpsuttonI'm sure an issue in the tracker along with the code to reproduce would be immensely helpful#2016-10-1914:47malabarbaThe only workaround I know of is to refactor the code that's of most interest to you into a separate function. #2016-10-1914:48malabarbaAnd yes, issues are helpful #2016-10-1914:48malabarbaBut I think there's already an issue about that, so it's best to add your feedback to the existing issue #2016-10-1915:04radon@bozhidar: issue filed at https://github.com/clojure-emacs/cider/issues/1872#2016-10-1919:40jcsimsI felt like we were missing a cider emoji#2016-10-1919:45dpsuttonvery nice#2016-10-2006:07bozhidarnice indeed 🙂#2016-10-2006:07bozhidarCheers! cider#2016-10-2118:30agigaoIs here anyone? I’m annoyingly stuck with breakpoints. Seems I’m locked in into infinite debugging loop :D#2016-10-2118:32agigaohelp 😅#2016-10-2119:51rmuslimovjust reeval buffer or project = C-c C-k or C-c C-x#2016-10-2119:53herbmYou probably have tried the obvious: Cider Eval -> Interupt evalutation or C-c C-b (M-x cider-interupt)#2016-10-2223:12jfntnHaving an issue where cider-load-buffer works fine, but cider-eval-defun-at-point says “Namespace not found"#2016-10-2301:53herbmjfntn, had that earlier and believe that I hacked around re-evalling the ns form or injecting it -- sorry can' t remember which step actually fixed it -- think it was from the menu but might have been as simple as re-eval'ing whole buffer once#2016-10-2301:54jfntn@herbm thanks, managed to get it to work doing a bunch of random actions too 😕#2016-10-2301:55jfntnI believe it had something to do with the repl ns not being the same as the ns in question, though if that’s the case it’d be a regression since that used to be no problem#2016-10-2310:08herbm@jfntn, could be - I was also working 4Clojure problems and when my current file would grow large enough to slow Emacs down I would open a new file/buffer name and keep coding with the same REPL -- mostly that worked. My issue happened after some sort of significant compile or stack overflow error I believe also.#2016-10-2318:27neurogooI have project where I have used lein reagent template to make stub project. I have added one new clj file to the project. With lein figwheel I have no problems, but when trying cider-jack-in-clojurescript cider complains that it can't find the namespace of the new file. Has anyone had similar problems?#2016-10-2318:38neurogooAnd I finally seem to have solved my problem ^^' You needed to really start cider on clojurescript file on the project, clojure file in the project was not enough#2016-10-2401:48radonIn my experience, you shouldn’t even have to be in a Clojure file for M-x cider-jack-in-clojurescript to work properly. (This is the template I test these sorts of things on: https://github.com/raxod502/minimal-webapp)#2016-10-2402:13lvhIs there a way to tell CIDER that the thing I’m connecting to is already a ClojureScript REPL? I’m getting it through figwheel; and compiling a cljs buffer never seems to work anymore#2016-10-2408:30bozhidar@jfntn this code hasn’t been changed for ages#2016-10-2408:31bozhidardon’t recall what the exact logic for dealing with missing namespaces was, though - I think we evaluated the ns form automatically#2016-10-2408:31bozhidaroriginally we did nothing and one had to remember to re-eval the ns form#2016-10-2408:31bozhidarwhich might be the better default, as it’s also what I’d normally expect#2016-10-2408:31bozhidarthere’s obviously some room for improvement#2016-10-2513:04dpsuttonI'm cloning a clojurescript project and trying to clojure script jack in, but i'm getting that it can't find the figwheel api init class. Which it can't, as its not on the classpath. However, this is certainly listed as a plugin in the project file and lein figwheel correctly cranks up the clojurescript repl#2016-10-2513:04dpsuttonanyone have any ideas?#2016-10-2513:12dpsuttonIf anyone is wondering, the answer apparently seems to be that figwheel needs to be declared as both a plugin and a dev dependency for cider, but not for lein figwheel#2016-10-2513:13dpsuttonas i'm guessing lein figwheel includes this as a dev dependency#2016-10-2611:08naomarik@lvh did you start figwheel like this? https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#start-figwheel-repl-within-nrepl and also is emacs in clojurescript-mode?#2016-10-2612:50lvh@naomarik: didn't know about clojurescript-mode#2016-10-2612:51lvhThanks!#2016-10-2612:59nhaI ahve been using cider for quite some time but always locally. Now I am coming to a Clojure project where te environment is dockerized, and I can’t seem to use cider-connect:
[nREPL] Establishing direct connection to 192.168.99.100:7889 ...
[nREPL] Direct connection failed
[nREPL] Establishing SSH tunneled connection ...
Quit [2 times]
What would be the first step to debug?#2016-10-2613:00nha(Note: the people in this project were not using the cider repl. I also tried with this sample: https://github.com/tcsavage/nrepl-docker - same result.#2016-10-2613:23naomarik@nha is your docker image exposing the 7889 port?#2016-10-2613:24naomarikhttps://github.com/wsargent/docker-cheat-sheet#exposing-ports#2016-10-2613:32naomarik@lvh ya - should happen automatically on cljs files but on cljc if you want to eval anything as cljs you just switch to clojurescript mode and it works#2016-10-2613:36lvhYeah, we mostly have cljc :)#2016-10-2613:37nha@naomarik it is (in the docker-compose file). And even in the sample github repo which exposes port 5000 (https://github.com/tcsavage/nrepl-docker) I am not able to connect. Works fine locally otherwise#2016-10-2613:44nhawe also have a bunch of machine in an integration environnment that people connect to - can’t access those so I am tempted to think something is wrong with my setup.#2016-10-2613:54nhaActually scrap the last comment - I can connect fine to these machines. Not to the docker one though.#2016-10-2614:00nha…so I am now tempted to think the problem is in the docker env.. I haven’t got a lot of exp. with that though#2016-10-2711:29nha(Quick follow-up: It was a docker/docker-compose problem)#2016-10-3117:53slipsetIt’s probably me, my project, or my emacs, but when pressing M-. on a symbol in a cljs file I would expect to be taken to the definition of said symbol, as I do in a .clj file, but Cider just tells me, by the way of Messages user-error: Symbol big-value-widget/big-value-config not resolved. The *nrepl-messages* tells me:#2016-10-3117:54slipset(-->
op "info"
session "5014a49d-8aa2-439c-8ccc-ef8b552ab078"
ns “myns"
symbol "big-value-widget/big-value-config"
id "13"
)
(<--
id "13"
session "5014a49d-8aa2-439c-8ccc-ef8b552ab078"
status ("done" "no-info")
)
#2016-10-3117:55slipsetWhat am I doing wrong?#2016-10-3117:56slipsetM-. is bound to cider-find-var btw#2016-11-0112:26bozhidarI’m guessing you haven’t evaluated the namespace in question or something like that#2016-11-0116:01slipsetYes, but more worriesome is that there's something wrong with my project, since this works flawlessly on a fresh project created with lein figwheel new whatever. #2016-11-0116:01slipsetBut as for now, I'm grepping :(#2016-11-0118:23aengelbergHow can I change ; indenting behavior to be similar to ;;? I never want to indent way over to the right when I have a ; comment on its own line.#2016-11-0118:26dpsuttonis there a reason you want to defy the convention that ; is indented to the right and ;; stays at the left? I think this is a standard lisp convention#2016-11-0118:27dpsuttonI can search through the code base tonight to find out how it does the indenting, although i'm not sure which mode will do this#2016-11-0118:30dpsuttonie, clojure mode, some base lisp mode, something to do with cider, etc#2016-11-0118:40aengelberg@dpsutton I personally don't intend to defy the convention, but at work I'm dealing with code written in different IDEs that don't necessarily support the same conventions.#2016-11-0118:40dpsuttonahh, yeah that's annoying#2016-11-0118:40dpsuttonis it formatting other people's code and adding useless changes to the diffs?#2016-11-0118:41aengelbergbasically, yeah.#2016-11-0118:41aengelbergAlso I don't really get why this is the default behavior:
(defn f
; abc
def)
If I put ; abc on its own line, I think it's reasonable to assume that I meant to defy the convention and indent that as the same level as def. Or at least, reasonable enough that I should be able to customize some setting to do that. 🙂#2016-11-0118:42dpsutton> reasonable to assume that I meant to defy the convention#2016-11-0118:42dpsuttonBut weakens the convention 🙂#2016-11-0118:42dpsuttonare you super against putting two ;; there?#2016-11-0118:42dpsuttonI just can't imagine going against standard indentation with a lisp#2016-11-0118:42aengelbergIf I were writing the code from scratch, I would indeed put ;; there 🙂#2016-11-0118:43dpsuttoncan you do a code cleanup commit?#2016-11-0118:43dpsuttonfar afield of your question now#2016-11-0118:43dpsuttonbut i work in C# at work#2016-11-0118:43dpsuttonif there was code that didn't follow convention I would bring it inline with convention#2016-11-0118:43dpsuttonvariable names, private injected dependency named conventions, alignment, etc#2016-11-0118:43dpsuttonbut that's certainly not part of a solution to your question#2016-11-0118:43aengelbergI could, but people would continue to put commit incorrect formatting.#2016-11-0118:46aengelbergAlso, what exactly is the "convention" for a single-semicolon comment on its own line? I still can't find that.#2016-11-0118:47chrisblomi'd also like to know how to format ; as ;;#2016-11-0118:49dpsuttonhttps://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html#2016-11-0118:49dpsuttonand this will come from conventions from back in the day, i would assume#2016-11-0118:50dpsuttonhttps://github.com/bbatsov/clojure-style-guide#comments#2016-11-0118:50aengelbergif clojure-mode really followed the single-semicolon convention, shouldn't it re-indent inline comments too?
(form) ; inline comment
[TAB] should produce
(form) ; inline comment
#2016-11-0118:50aengelbergcurrently doesn't do that#2016-11-0118:51dpsuttonyou are correct#2016-11-0118:53aengelbergis there a way to turn off semi-colon auto-indenting entirely? that would probably also solve my problem#2016-11-0118:54dpsuttoni've been looking in clojure-mode#2016-11-0118:54dpsuttoni see options to adjust macro indentations#2016-11-0119:00dpsuttonhttp://stackoverflow.com/questions/14190488/set-comments-at-the-same-indentation-level-as-all-forms#2016-11-0119:00dpsutton> I don't think that you would want to do that. It would make your code indent differently from all other elisp code... Anyway, this is hardcoded into lisp-indent-line, so you would have to modify it (perhaps using defadvice). – Lindydancer Jan 7 '13 at 9:29#2016-11-0119:00dpsuttonThis may be emacs indenting, and it looks like the indentation is hardcoded into lisp-indent-line#2016-11-0119:01dpsuttonha we discovered the same thing at the same time#2016-11-0119:01chrisblomgreat minds....#2016-11-0119:01dpsuttonwell, my great mind was looking on stack overflow 🙂#2016-11-0119:01dpsuttonyou identified the code and modified it ....#2016-11-0219:39echristophersonI can't seem to make CIDER 0.14.0 run with cider-jack-in on Windows. I can run lein repl from a project and cider-connect to it, but it complains that "`CIDER's version (0.14.0) does not match cider-nrepl's version (nil). Things will break!`"#2016-11-0219:40echristophersonI have in my .lein/profiles.clj:
{:user {}
:repl {:plugins [[cider/cider-nrepl "0.14.0"]]}}
#2016-11-0219:40echristophersonlein repl's versions are shown as
nREPL server started on port 50500 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) Client VM 1.8.0_51-b16
#2016-11-0219:41echristophersonthe error message when I try cider-jack-in is: error in process sentinel: Could not start nREPL server: The system cannot find the path specified.#2016-11-0219:43echristophersonMessages upon running cider-jack-in shows:
Are you sure you want to run `cider-jack-in' without a Clojure project? (y or n) y
Making nrepl-create-client-buffer-function local to *nrepl-server* while let-bound!
Making nrepl-use-this-as-repl-buffer local to *nrepl-server* while let-bound!
Starting nREPL server via "x:/Leiningen/lein.bat" update-in :dependencies conj ^"[org.clojure/tools.nrepl \^"0.2.12\^" :exclusions [org.clojure/clojure]]^" -- update-in :plugins conj ^"[cider/cider-nrepl \^"0.14.0\^"]^" -- repl :headless...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: The system cannot find the path specified.
error in process sentinel: Could not start nREPL server: The system cannot find the path specified.
Updating buffer list...
Formats have changed, recompiling...done
Updating buffer list...done
Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help
#2016-11-0219:50dpsuttoni thought using profiles was not recommended now#2016-11-0219:50dpsuttonbut also, maybe try "0.14.0-SNAPSHOT"#2016-11-0219:50dpsuttonwhere is your cider from?#2016-11-0219:51dpsuttonmelpa or melpa-stable?#2016-11-0219:55echristophersonHmm. Not sure of that; but I just discovered I have my .lein in the wrong place.#2016-11-0219:56echristophersonYes, that fixed it.#2016-11-0219:57echristophersonWhat do you mean using profiles isn't recommended? You mean using .lein/profiles.clj at all isn't recommended?#2016-11-0220:11echristophersonI'm not sure where mine is from actually. package-list-packages shows it as:
cider is an installed package.
Status: Installed in `x:/.emacs.d/elpa/cider-0.14.0/' (unsigned).
Archive: n/a
Version: 0.14.0
Requires: emacs-24.3, clojure-mode-5.5.2, pkg-info-0.4, queue-0.1.1, spinner-1.7, seq-2.16
Summary: Clojure Interactive Development Environment that Rocks
Homepage:
Keywords: languages clojure cider
Other versions: 0.14.0 (melpa-stable).
Provides a Clojure IDE and REPL for Emacs, built on top of nREPL.
Installation:
Available as a package in and .
(add-to-list 'package-archives
'("marmalade" . ""))
or
(add-to-list 'package-archives
'("melpa" . "") t)
M-x package-install cider
#2016-11-0220:11echristophersonI guess since melpa-stable is "other versions" it's from melpa or marmalade or something#2016-11-0220:15echristophersonDoes Archive: n/a necessarily mean melpa?#2016-11-0220:23dpsuttonyeah the .lein/profiles. I thought i remember that being used on older versions of cider#2016-11-0220:23dpsuttonnot totally sure though#2016-11-0307:32benedekyou don't need your lein profiles for cider anymore if you cider-jack-in#2016-11-0307:32benedekcider injects its own deps via the cli when the repl starts up#2016-11-0307:33benedekyou still need the profiles or similar if you cider-connect tho#2016-11-0315:42echristophersonI fixed my problems by updating to Emacs 25 and updating my packages#2016-11-0315:42echristopherson@benedek yeah, I was using cider-connect because cider-jack-in wasn't working#2016-11-0315:44benedekany particulars why jack-in was/is not working @echristopherson ?#2016-11-0315:44echristophersonit was giving me error in process sentinel: Could not start nREPL server: The system cannot find the path specified.#2016-11-0315:44echristophersonI tried setting an edebug breakpoint on cider-jack-in but emacs gave me some sort of error there too#2016-11-0315:44echristophersonso I just upgraded emacs#2016-11-0315:50echristophersonis there something like the debugger, but where instead of showing the actual expressions in the code and then => value off at the end, it actually substitutes the value where the original function call is?#2016-11-0315:50echristophersonkind of like macro-expand-1 except for functions#2016-11-0316:07malabarbaNope. Though it wouldn't be too hard to add to the debugger. #2016-11-0316:36echristophersonI suppose not#2016-11-0317:35echristophersonis there some sort of binding for the value that the debugger shows after =>?#2016-11-0317:36echristophersonI was trying to see a truncated thing using cider-inspect-last-result, but apparently that can't be used while something is being debugged#2016-11-0322:28rickmoynihan> is there something like the debugger, but where instead of showing the actual expressions in the code and then => value off at the end, it actually substitutes the value where the original function call is?
echristopherson: you mean like beta reduction? That’d be quite a neat idea, as you wouldn’t need to remember the values for previously evaluated function arguments.#2016-11-0323:40echristopherson@rickmoynihan yeah, that's what it's called! I had forgotten that.#2016-11-0400:17echristophersonI forget -- what's that emacs command that just gives a short summary (or maybe it's just a function name) of the next keybind you enter?#2016-11-0400:20echristophersonoh, C-h c#2016-11-0403:17echristophersonOK, new problem: I'm running a command-line app in the REPL. When I cancel it with C-c C-b or C-c C-c, and then run it again, I can't get into the minibuffer to enter input to the app.#2016-11-0403:18echristophersonI did get error in process filter: cider-need-input: Command attempted to use minibuffer while in minibuffer#2016-11-0403:19echristophersonoh, this time I got the Stdin: prompt in the minibuffer, but it seems my input was not accepted (the program just stalls)#2016-11-0403:28echristophersonof course now I'm at home on emacs 24, so I guess I'll upgrade it here too#2016-11-0403:41echristophersonnope, didn't help. Also, hitting ESC ESC ESC in the minibuffer before killing the process didn't help the next invocation either#2016-11-0403:43echristophersonC-x k ENT in minibuffer doesn't work#2016-11-0502:13echristopherson@kingoftheknoll I just ran into that. http://stackoverflow.com/questions/8332611/how-to-use-clojure-doc-function#2016-11-0714:48practicalli-john@kingoftheknoll @echristopherson To call the doc function you can use (clojure.repl/doc map) without a require or use function to include the clojure.repl namespace. However, if you do not include the clojure.repl namespace then doc or source will return nil on those functions that are part of clojure.repl. All other functions should work if you use the fully qualified namespace name for doc or source#2016-11-0714:50practicalli-johnYou can use C-c C-p to show the resulting output of doc or source in a new buffer, or just open the cider-repl buffer#2016-11-0818:56rmuslimovdump question: does cider supports test-selectors feature from leiningen#2016-11-0910:35danielstocktonCurrently, the conditions are aligned with the clauses if they're on separate lines...#2016-11-1017:49gregnwosuhow can i enable completion in the repl?#2016-11-1019:32aengelbergdo define-clojure-indent indent specs have a maximum depth?#2016-11-1019:33aengelbergMy desired style convention is for all lists to (by default) indent as a macro with 0 special forms. So I put in:
(define-clojure-indent
(defn '(1 nil (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0 (0))))))))))))))))))))))
#2016-11-1019:34aengelbergbut it only worked for about three levels deep.
(defn f
[]
(a
(b
(c
(d
(e
(f)))))))
#2016-11-1021:51chadhsis there a way to customize the cider modeline?
didn’t see anything in the manual
as an example i’d like to maybe set it
from cider[clj:namespace@:port] to [clj:namespace]#2016-11-1022:00chadhs☕[clj:namespace] would be cool lol#2016-11-1023:51richiardiandreahas someone already worked on a way to switch clojure(script) buffer from clojure-mode to inf-clojure-mode by any chance?#2016-11-1100:22richiardiandreasorry, I have just discovered that I actually don't need that, as cider is only activate when you jack-in#2016-11-1110:58danielstocktonI found https://github.com/clojure-emacs/clojure-mode/issues/337 which had a solution to my specific issue from above ^^#2016-11-1117:55dangit@chadhs Did you try M-x customize-variable cider-mode-line?#2016-11-1117:57chadhs@dangit i have not but i did see where it’s defined and modified it slightly. i didn’t want to rewrite a new function to tweak it further.#2016-11-1117:57chadhs(setq cider-mode-line '(:eval (format " [%s]" (cider--modeline-info))))
#2016-11-1117:58chadhsi’ll give you suggestion a shot as well thnx#2016-11-1119:08pandeirois there a way i could piggyback on clojure-mode's font lock setting without deriving my mode from clojure-mode?#2016-11-1119:08pandeiroHmm, I suppose I should look at how the cider repl does it#2016-11-1318:38zaneAnyone here use Cider with Boot and clojure.tools.namespace.repl/refresh?#2016-11-1412:16mitchelkuijpers@zane yes#2016-11-1415:00zane@mitchelkuijpers: Was experiencing a weird issue with Cider's support for it and was wondering if it was a known issue. Turns out it is: https://github.com/boot-clj/boot/issues/524#issuecomment-260211223#2016-11-1415:01mitchelkuijpers@zane I don’t have this issue. But i type (refresh) in the repl with danielsz/system#2016-11-1415:05zaneYes, per the discussion in that issue calling clojure.tools.namespace.repl/refresh directly works just fine, but cider-refresh (along with any keys that are bound to it) is broken.#2016-11-1415:08danielsz@zane Yes. like @mitchelkuijpers said, system has specific integrations with boot, and could give you a nice interactive experience.#2016-11-1415:41zaneI'm not looking to fix this by changing my component library, but thanks.#2016-11-1417:02danielsz@zane What is your component library?#2016-11-1417:03danielsz@zane system is built on top of Stuart Sierra's component library. It doesn't replace it.#2016-11-1417:04zaneI'm aware of that.#2016-11-1417:04zaneThis project uses Mount.#2016-11-1417:05zaneMy point is that System is irrelevant to my issue. My issue is an incompatibility between cider and boot-clj.#2016-11-1418:10echristophersonIs it normal that I can use cider-find-var to locate a symbol when I'm in the repl or the file that defines it, but not when I'm in another file.#2016-12-0212:51juhoteperiPRs to the libraries would also be good solution in long term#2016-12-0212:53danielstocktonThere was already a PR about this (om.dom) and it was rejected by the library author. I can understand why tbh, I'm not sure metadata is the right approach. Ideally you want to leave this stuff to each individual and their editor and keep the code clean.#2016-12-0306:33jfntnhttps://www.youtube.com/watch?v=buPPGxOnBnk&feature=youtu.be&t=17m15s#2016-12-0306:33jfntnKinda blown away by the part I linked to#2016-12-0306:34jfntnWondering what it’d take to get something like this in the cider debugger#2016-12-0309:22jasongilmanI was talking with @cfleming last night about some alternatives that might work for emacs and Cursive. I think the original approach I used with using the browser outside the editor would work but with prepackaged visualizations. #2016-12-0309:24jasongilmanThat wouldn't do everything like inline displays but you could probably show those details in a buffer in emacs. #2016-12-0313:29jfntnHi @jasongilman, congrats on the talk and release, very impressive stuff! Though I really like to UI work you’ve done in proto-repl I was most impressed with the rebinding locals trick you showed in that part of the talk. I’d love to hear more about how that works#2016-12-0314:03jasongilmanThanks! Rebinding locals is just using def to set them as vars. That could potentially be problematic but in practice people have different names for locals and vars and clojure.tools.namespace reloading undoes that. #2016-12-0314:14jfntnoh interesting, I haven’t tried that part of the demo myself, but am I correct in assuming that you’re able to suspend execution at the expression level and then redefine/eval the next form while maintaining the evaluation context of the parent exprs up to that point?#2016-12-0314:39richiardiandreaI second, the talk was super awesome and the editor has grown to be a cider competitor (which is a big deal indeed!). This is so so good for the Clojure ecosystem :)#2016-12-0314:40jasongilmanNo it's much less clever than that. I would categorize the save feature as fancy defs. It's evaluating exactly what you ask it to evaluate. #2016-12-0314:40jasongilmanThanks @richiardiandrea #2016-12-0314:42jasongilmanIf you take local binding values and make vars of the same name and value then evaluating the expressions just works. #2016-12-0315:26naomarikthat's super useful, i've been doing this manually lately by inserting a def inside my code and rerunning the function with the def as an argument#2016-12-0315:26naomarikpretty awesome that you streamlined it like that#2016-12-0614:08rovanionCan CIDER show all uses of a keyword like GNU Global does with C?#2016-12-0614:25igrishaev@rovanion I think either rgrep or occur may do this#2016-12-0615:13rovanionigrishaev: rgrep is the closest match#2016-12-0615:13rovanionThank you#2016-12-0615:21benedek@rovanion I guess this a more involved use case of what you are looking for: https://github.com/clojure-emacs/clj-refactor.el/issues/343#2016-12-0615:24rovanion@benedek Yeah, I was only looking for "Where is function X called".#2016-12-0615:27benedeki thought you were looking for searching for :keyword style keywords#2016-12-0615:27benedekclj-refactor can find symbols for you#2016-12-0615:27benedekand rename them...#2016-12-0615:27benedekso defs defns etc#2016-12-0617:19rovanionbenedek: Sadly it doesn't work for cljs.#2016-12-0617:19benedekyup that is true 😕#2016-12-0620:25zalkyHi all: so I recently upgraded cider (10 -> 14) and I'm trying to figure out how to turn off what seems to be a new feature, which is the automatic namespacing of maps:
#:db{:id 10,
:ident :db/ident,
:valueType #:db{:id 21},
:cardinality #:db{:id 35},
:unique #:db{:id 38},
:doc "Attribute used to uniquely name an entity."}
Thing is I can't seem to find any mention of this in the cider changelog or, well, anywhere. Was this even a cider thing?#2016-12-0620:25dpsuttonwhat version of clojure are you running?#2016-12-0620:26dpsuttonmy guess is you are running 1.9.x and you are seeing a clojure feature#2016-12-0620:27dpsuttoncan you try it from lein repl from a command line without CIDER at all#2016-12-0620:33zalkyAh, yes indeed, by unfortunate coincidence, the version of clojure got bumped at the same time. Appreciate the pointer.#2016-12-0620:36dpsuttonno prob#2016-12-0714:12nonrecursivehey yall, has anyone else gotten this message when trying to use cider-jack-in with boot?
Starting nREPL server via /usr/local/bin/boot -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.14.0 repl -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware -s wait...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at Boot.main(Boot.java:258)
Caused by: java.lang.IllegalArgumentException: Bad artifact coordinates org.clojure:clojure:jar:, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
#2016-12-0714:13dpsuttonand it works correctly with lein?#2016-12-0714:14dpsuttonlike the jars in your ~/.m2 directory aren't bad?#2016-12-0714:14nonrecursiveworks ok with lein#2016-12-0714:14nonrecursivei tried running /usr/local/bin/boot -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.14.0 repl -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware -s fromt he command line and that works fine too#2016-12-0714:14dpsuttoncan you crank up a lein repl in the same directory?#2016-12-0714:14dpsuttonah#2016-12-0714:15dpsuttonsorry, not a lein repl, but exactly what you did#2016-12-0714:15dpsuttonthat's the verbatim string that CIDER does?#2016-12-0714:17nonrecursiveyeah#2016-12-0714:17dpsuttoncheck this out https://clojurians-log.clojureverse.org/clojure-dev/2015-07-09.html#2016-12-0714:17dpsuttonshe had the wrong version of clojure specified in her project or boot file#2016-12-0714:18dpsuttonalso, from your message, Bad artifact coordinates org.clojure:clojure:jar:, that looks a little malformed#2016-12-0714:18dpsuttonis it missing a version?#2016-12-0714:18dpsuttonthe colon then comma makes me think some config is off#2016-12-0714:20nonrecursivehmmm yeah, I just can’t figure out where that might be coming from#2016-12-0714:20dpsuttonis it possible to post your build.boot file here if its not too sensitive?#2016-12-0714:21dpsuttonalso, do you have any profile files lying around? ~/.boot or whatever boots config file is?#2016-12-0714:21nonrecursivesure#2016-12-0714:21nonrecursive(set-env!
:source-paths #{"src"}
:resource-paths #{}
:target-path "target/build"
:dependencies '[[org.clojure/clojure "1.9.0-alpha14" :scope "provided"]
[boot/core "2.5.5" :scope "provided"]
[adzerk/boot-test "1.1.1" :scope "test"]
[adzerk/bootlaces "0.1.13" :scope "test"]
[org.clojure/test.check "0.9.0" :scope "test"]
[org.clojure/tools.namespace "0.2.11" :scope "test"]
[aysylu/loom "0.6.0"]
[medley "0.8.3"]])
(require '[adzerk.bootlaces :refer :all]
'[adzerk.boot-test :refer :all])
(def +version+ "0.1.0")
(bootlaces! +version+)
#2016-12-0714:21dpsuttonalso, is this a project that has been working and recently stopped? is it a new project from a template or cloned from someone?#2016-12-0714:22nonrecursiveit hasn’t worked, and it seems I can’t boot jack in with other projects where I was able to previously#2016-12-0714:22dpsuttonoh#2016-12-0714:23dpsuttonso we definitely have a regression#2016-12-0714:23dpsuttondo you use spec in this project?#2016-12-0714:23dpsuttonwondering if dropping down to 1.8.0 fixes this#2016-12-0714:23nonrecursiveit might be something I changed in one of my .boot files#2016-12-0714:24dpsuttonand 1.9.0-alpha14 definitely exists#2016-12-0714:28nonrecursiveit’s looking like it has to do with the boot.properties file#2016-12-0714:29dpsuttonthat's a global boot file?#2016-12-0714:29dpsuttoncan you post here?#2016-12-0714:31nonrecursiveok I think I figured it out#2016-12-0714:33nonrecursivemy emacs config was set to copy BOOT_CLOJURE_VERSION from the environment, but that wasn’t actually set in my environment, so in the emacs environment I essentially had BOOT_CLOJURE_VERSION=””#2016-12-0714:33nonrecursivethat’s why the artifact was coordinates were bad, because the clojure version was missing#2016-12-0714:34nonrecursivethanks for helping me figure it out 🙂 🙂 🙂#2016-12-0714:34dpsuttonhmm, maybe CIDER should default to 1.7 (its minimum supported version) if this is the case#2016-12-0714:34dpsuttonha i think i was a rubber duck. but glad it got worked out#2016-12-0714:35nonrecursiveit seems like a weird edge case, I wonder if it might be better have some kind of error message. or maybe print a message and default to 1.7#2016-12-0715:35benedekthis may be useful too?! https://github.com/clojure-emacs/cider/blob/master/cider.el#L268-L284#2016-12-0723:21parkeristypingWhen I use cider-jack-in, eldoc works (i.e. shows me function info in the minibuffer), but when I cider-connect to a repl started with clojure.tools.nrepl.server/start-server, I don’t see anything in the minibuffer#2016-12-0723:22parkeristypingany ideas why? or can anyone point me in the right direction?#2016-12-0723:29parkeristypingoh. passing the handler here as an option worked: https://github.com/clojure-emacs/cider-nrepl
(clojure.tools.nrepl.server/start-server :handler cider.nrepl/cider-nrepl-handler)
#2016-12-0816:19neupshhi, i am running gorilla-repl inside a boot-clj pod (without a project) i can pass in cider-nrepl dependencies in the pod, is there a way to make nrepl started by gorilla-repl to find the cider nrepl middleware and use it inside the pod?#2016-12-0816:19neupshbasically, gorilla-repl starts an nrepl inside the pod in a boot task and i want it to start with cider nrepl middle ware#2016-12-0816:20neupshthis is what i have so far: https://gist.github.com/neupsh/0f2448719e7cc3de71461ae6b66f284c#2016-12-0817:39richiardiandrea@nux I think you also need to tell nrepl which middleware to use...#2016-12-0817:43neupsh@richiardiandrea nrepl is started by gorilla-repl#2016-12-0817:43neupshhttps://github.com/JonyEpsilon/gorilla-repl/blob/develop/src/gorilla_repl/nrepl.clj#2016-12-0817:44neupshit looks like it resolves cider-middleware#2016-12-0817:44neupshthat means it should get loaded no?#2016-12-0817:45neupsh@richiardiandrea when i connect from emacs with cider-connect, it says nrepl version is nil#2016-12-0817:46neupshi think somehow, the middlewares are not loaded.. i would really love to pass in custom middlewares in gorilla,#2016-12-0817:47richiardiandrea@nux I don't remember by heart how to do it, let me check#2016-12-0817:54richiardiandrea@nux https://github.com/clojure/tools.nrepl#middleware#2016-12-0817:56neupsh@richiardiandrea i have read (have been reading) a lots of documents/source for nrepl, gorilla and cider, but still not able to figure it out.. gorilla does try to load cider middleware if it exists but somehow it is not happening.. to insert other custom middlewares, i think it will need modification of the gorilla code to support it#2016-12-0817:57richiardiandreaoh ok sorry I thought it was a different kind of problem, I would then make sure that you see the deps in env inside the pod...maybe they are not added there?#2016-12-0817:59neupsh@richiardiandrea i see them loaded, i can evaluate something like this:#2016-12-0818:00neupshcider.nrepl/cider-middleware#2016-12-0820:16richiardiandreaUhm, that's weird then, maybe look in gorilla's innards, the pod is just a custom class loader so it should definitely be same as inserting stuff in a normal nrepl#2016-12-1121:32radonI’m getting Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
when I cider-jack-in outside a Clojure project, as described at https://github.com/clojure-emacs/cider-nrepl/issues/384. Does anyone know offhand how to fix that?#2016-12-1123:04benedekwhat is your leiningen version @radon?#2016-12-1123:04radonOne sec.#2016-12-1123:05radonLeiningen 2.6.1 on Java 1.8.0_31 Java HotSpot(TM) 64-Bit Server VM
#2016-12-1123:13benedekanything in your ~/.lein/profiles.clj ?#2016-12-1123:13radonLots, but the problem reproduces even after I rm ~/.lein/profiles.clj.#2016-12-1123:14benedekhaha ok. strange. i can jack in noprobs outside a project...#2016-12-1123:14radonHmmm…#2016-12-1123:15radonWhat if you just run /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.15.0-SNAPSHOT\"\] -- repl :headless
in a terminal?#2016-12-1123:16radonThis is what I get… % /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.15.0-SNAPSHOT\"\] -- repl
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
nREPL server started on port 51941 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=>#2016-12-1123:17radonWow, when I wiped my .m2 it’s still downloading all the dependencies from my profiles.clj, even though I deleted that file. This probably has something to do with the problem.#2016-12-1123:18benedekstrangely i get the same when running from cli#2016-12-1123:19radongasp#2016-12-1123:19radonWhen you M-x cider-jack-in, what is the command that CIDER uses to launch the REPL? It shows up in *Messages*.#2016-12-1123:20benedekyou can try to set cider-jack-in-auto-inject-clojure as a workaround?!#2016-12-1123:21benedeklein or boot depending on the project#2016-12-1123:26radonWell, that fixes it. But I’m still rather disturbed by the error.#2016-12-1123:27benedeksomething pulls in a wrong clojure version most likely#2016-12-1123:27radonWell, it still launches a Clojure 1.8 REPL.#2016-12-1221:16clarkoutside of the hack that generates a project.clj for every run of boot, does anyone know where I could look to see if boot support is in the works?#2016-12-1221:17dpsuttonwhat's missing?#2016-12-1221:17dpsuttoni know that cljs support isn't super great#2016-12-1221:17dpsuttonbut i think you can call whatever tasks you want after jacking in#2016-12-1221:28clarkahh omg, posted this in the wrong room#2016-12-1221:28clark😛#2016-12-1221:28clarksorry folks#2016-12-1400:21mikerodMaybe I’m being dumb, but is there a way to jump to Java source with Cider in Emacs?#2016-12-1400:21mikerodI don’t see anything in the docs I’ve been able to find via searching#2016-12-1400:27rmuslimovI beliebe M-. should work, no?#2016-12-1400:29mikerod@rmuslimov “wrong type argument: stringp, nil” is what I most commonly get#2016-12-1400:29mikerodSometimes I do get the “Member in prompt:” minibuffer message#2016-12-1400:29mikerodbut it is not the correct classes and none work. hmmm#2016-12-1400:30rmuslimovweird, it works well in my cider#2016-12-1407:13agile_geek@mikerod I sometimes find I have to eval the buffer before M-. works. Try C-c C-k first.#2016-12-1413:35mikerod@agile_geek interesting. I’ll have to look into this more. I was specifically trying to navigate to a Java method definition from the REPL buffer, so maybe that is the issue#2016-12-1413:37mikerodHere is another Cider question: are there any debugger sort of features that would allow break points to be in Java code that is executed from a Clojure callstack? I’m thinking that is a no, but just seeing if there is anything to look into in that area.#2016-12-1413:37mikerod@agile_geek I still get the same "wrong type argument: stringp, nil” or I get “Symbol XXXX not resolvable"#2016-12-1413:38agile_geekNot sure about Java code ...obviously there are for Clojure code. I would think not.#2016-12-1413:38mikerodI’m not sure what I have setup wrong to get this working. I’ll have to dig through the client/middleware to probably understand what it is doing#2016-12-1413:38mikerodmaybe my source jars aren’t found or something#2016-12-1413:38agile_geekI think your problem is you're try to jump to Java source and not sure CIDER supports that#2016-12-1413:38mikerodYeah, I know there is the Clojure code debugger. I just wondered if anyone ever tried to cross over into Java land with a debugger as well.#2016-12-1413:38mikerodYes, I’m trying to jump to Java source#2016-12-1413:39mikerodCurrently, when I work with Java interop often, I end up just using Eclipse to navigate Java files#2016-12-1413:39mikerodso I was trying to decide how hard it would be to get Emacs to let me do this all there#2016-12-1413:39mikerodAlso, to debug Java code (yuck), that I’m calling from Clojure, I have to use Eclipse CounterClockwise plugin#2016-12-1413:40mikerodit actually does have the feature of letting you use the REPL but have breakpoints in Java code you are calling and it pauses and everything like yoi’d expect in a Java debugger. That is one of the only features of CCW that I’m actually pretty happy about. However, I’m much more a fan of Cider/Emacs - it’s just the interop features I’m wishing were there.#2016-12-1413:41mikerodI guess it doesn’t matter to many clj people if interop is relatively rare#2016-12-1413:42agile_geekYou could use IntelliJ and Cursive which is much more sane than Counterclockwise but there's a cost#2016-12-1413:42mikerodyeah, it’s just the cost there#2016-12-1413:43mikerodI rarely have to resort to debugging Java code#2016-12-1413:43mikerodso for the most part it doesn’t get in my way#2016-12-1413:43mikerodI do read a lot of the Java code and navigate around, but that tends to be enough#2016-12-1413:44mikerodHowever, some Java lib code can be hard to just read and figure out. I really don’t like debugging step-by-step, but sometimes that’s what I have to resort to understand a bunch of stateful objects acting as a “machine” in some Java libs.#2016-12-1413:44agile_geekYou could try an Emacs package for Java#2016-12-1413:46mikerodYeah, I thought I might look into that some. Last I looked I thought it didn’t seem to be used much, but I’ll revisit it out of curiousity#2016-12-1413:54agile_geek@mikerod I've been meaning to try this but haven't yet https://github.com/mopemope/meghanada-emacs#2016-12-1414:39mikerod@agile_geek interesting, I will check this one out#2016-12-1415:13agile_geek@mikerod another option that uses Eclipse in the background - https://github.com/senny/emacs-eclim#2016-12-1415:14mikerod@agile_geek another interesting one#2016-12-1415:17agile_geekthen there' s good old jdee of course#2016-12-1416:37richiardiandreaAbout Java, some people had a very good idea, jdee folks started to implement an nrepl middleware#2016-12-1416:38richiardiandreaSame as cider, it could provide all the jdk-related functionalities, some of them could be grabbed from cider itself #2016-12-1416:40richiardiandreahttps://github.com/jdee-emacs/jdee/issues/51#issuecomment-263678135#2016-12-1419:26mikerod@richiardiandrea some more stuff to read through#2016-12-1419:26mikerodI would be surprised if people weren’t regularly doing at leasts some level of Java interop in Clojure.#2016-12-1419:26mikerodif you use existing libraries, I’d think you’re boudn to hit some#2016-12-1419:27richiardiandreayes, there is no pre-made option for Java now, that is why it is important to build it ourselves 🙂#2016-12-1419:30mlevWhen I run cider-jack-in on a new lein new APPNAME project utilizing selmer in APPNAME.core as in
(ns APPNAME.core
(:require [selmer.parser :as selmer]))
it defaults to a buffer cider-repl APPNAME with a prompt of user>. However, when I try to run (selmer/render "Hello, {{name}}" {:name "World"}) in the repl, I get the following error message: CompilerException java.lang.RuntimeException: No such namespace: selmer, compiling:(*cider-repl APPNAME*:43:7). I have already restarted Emacs and the CIDER repl several times. Does anyone know what I can do to fix this issue?#2016-12-1419:36mlevDoes it have to do with the fact that the CIDER repl is not defaulting to the APPNAME.core> prompt, so perhaps its in the wrong namespace?#2016-12-1419:40mlevCuriously, though, it does produce "Hello, World" when I put (selmer.parser/render "Hello, {{name}}" {:name "World"}) in the repl...#2016-12-1419:42dpsuttoni think you are absolutely qualifying the call to render whereas selmer/render is using the aliased namespace, which has not been aliased in the current user namespace#2016-12-1419:42dpsuttonyes, if you switch to APPNAME.core you can use the alias#2016-12-1419:42dpsuttonor you can use the fully qualified name in any namespace#2016-12-1419:45mlevThanks @dpsutton . I am trying to switch the namespace in the repl using (in-ns APPNAME.core) but I get the error:
CompilerException java.lang.ClassNotFoundException: APPNAME.core, compiling:(*cider-repl APPNAME*:49:7)#2016-12-1419:46dpsuttoni always use C-u C-c M-z which switches to whatever namespace I'm in and puts point in the repl#2016-12-1419:48dpsuttonwhich sounds like a mouthful but I honestly can't remember the shortcuts to type them out but my hands just spit them out by memory now#2016-12-1419:51mlev@dpsutton , worked like a charm 🙂 Thanks for your help!#2016-12-1422:39chadhsis there a way to prevent cider-repl buffer from changing window sizes when it launches?#2016-12-1422:40chadhsor perhaps a way to constrain it?#2016-12-1511:06chrisblomis it possible to pretty print the ex-data map *cider-errors*?#2016-12-1511:07chrisblomi'm throwing big maps with ex-info, and now they are displayed on one line which makes it hard to read#2016-12-1515:14borkdudeDoes cider/clojure-mode support “navigate to the end of a sexp”?#2016-12-1515:17dpsuttoni think its C-Shift-f, b, etc#2016-12-1515:17dpsuttonah, its meta not control#2016-12-1515:17dpsuttonlet me correct myself one more time#2016-12-1515:17dpsuttonC-M-f, C-M-b#2016-12-1515:18dpsuttonthose are in paredit apparently though#2016-12-1515:19borkdudethanks#2016-12-1523:28bhaumanIn reference to @chrisblom's request the new clojure.core macro spec errors would seriously benefit from pretty printing#2016-12-1523:29bhaumanbut I'm here wondering how I would be able to bind a command to invoke spec/exercise-fn on var at the current point, that would be freaking space age#2016-12-1523:30bhaumanof course I could read the cider code to discover this#2016-12-1523:31radon@borkdude @dpsutton The basic navigation commands C-M-f/b/n/p/a/e are all in Emacs by default. Paredit provides the editing commands M-(/s/S/J/?.#2016-12-1523:31radonThe classics, as always: http://danmidwood.com/content/2014/11/21/animated-paredit.html http://pub.gajendra.net/src/paredit-refcard.pdf#2016-12-1523:42danmidwoodI’m a classic 🤓#2016-12-1913:07trisshow do I trigger the completion/insertion of snippet?#2016-12-1919:19normanusing yasnippet?#2016-12-2019:20borkdudefyi, cljr-clean-ns crashes on [reagent.interop :refer [$ $!]] 🙂#2016-12-2019:21borkdudeI got: cljr--maybe-rethrow-error: Can’t create a fully qualified symbol from: ’reagent.interop’ and ’’#2016-12-2020:09borkdudemaybe I should upgrade though, I’ll check that later#2016-12-2020:30dottedmagMy .clj files are associated with clojure-mode, so I can't use CIDER key bindings until I manually say M-x cider-mode. Is that expected behaviour?#2016-12-2020:30dottedmagI don`t see anything related to clojure-mode in my ~/.emacs.d#2016-12-2020:31dottedmagcider-auto-mode is set to t#2016-12-2020:33dottedmagI see a message in *Messages*`: `error in process filter: pcase--u1: Unknown upattern `(quote display-only)'
-- maybe it causes clojure-jack-in to stop before it applies the necessary configuration?#2016-12-2020:33dottedmagCIDER is fresh git checkout, Emacs is 24.5.1#2016-12-2020:46dottedmagYep, it was a bug. Filed PR1894#2016-12-2110:15benedek@borkdude github issue if upgrade does not help?#2016-12-2112:08borkdudeyes, will do!#2016-12-2115:28paulbis there a way to syntax highlight stuff pretty printed to the repl? e.g. stuff being pretty-printed by clojure.spec.test#2016-12-2203:09sound2gd(.println java.lang.System/out "12345") and don't see the output in repl buffer,did I set something wrong?#2016-12-2203:09sound2gdhelp#2016-12-2210:15agile_geekSomething seems to have changed in the behaviour of my CIDER even though I've not changed any CIDER config or upgraded CIDER. I am guessing something else in my config is overriding something in CIDER.
Anyway the issue is when I had multiple windows open and eval'ed something that caused a CIDER popup (like a stack trace or calling CIDER doc) the pop up window used to appear on top of one of the other windows which I preferred. Now the popup appears to split one of the existing windows. Any idea how I change this behaviour back?#2016-12-2214:02dpsuttoni'm looking in the changelog and not seeing anything relevant to that, sorry#2016-12-2214:26dpsuttonso it looks like at the bottom of a lot of stuff, cider is calling display-buffer in window.el, which has one of the gnarliest doc strings I've ever read#2016-12-2214:26dpsuttonThis gets called in cider-popup-buffer-display in cider-popup.el#2016-12-2219:19radonI feel like I’ve seen both behaviors, with no apparent pattern.#2016-12-2322:22benedek@agile_geek just a stab in the dark but may have to do with different size of the main emacs window? (meaning that you use a different size and see different behaviour than before)#2016-12-2322:23benedekif so you might want to have a look on split-width-threshold and split-height-threshold#2016-12-2408:01agile_geek@benedek thanks but I think I found problem. The infamous unbalanced parens! Despite editing with Smart Parens on. Must have been kill and yank mess up! That's what I get for keeping a literate init in org mode!#2016-12-2521:49benedek@richiardiandrea trying to follow up on https://github.com/clojure-emacs/cider/pull/1844 for boot. as i was waiting to -E to be added to boot. looking at it tho me thinks that global exclusions is not really what we need in cider. we would rather need an option to exclude something for given dependency on the CLI. can you pls confirm or enlighten me how i am an idiot this time#2016-12-2523:53richiardiandrea@benedek mmm no idiots of course here 😀 are you talking about my other PR ?#2016-12-2523:54richiardiandreaAbout what my patch does: basically there will be no more need for the repl task on the boot command line but there will be a dependency (`-d`) to cider.nrepl and a call to some code with -i (new option in 2.7.X).#2016-12-2604:39vinnyataidehey, is there any way to search the latest version inside a project.clj file? It bums me up to always try to search, what about autocompleting a lib by searching in clojars? is there a way?#2016-12-2607:03benedek@vinnyataide clj-refactor does that. see the wiki https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-update-project-dependencies#2016-12-2611:06benedek@richiardiandrea nope, i meant this https://github.com/boot-clj/boot/issues/472#2016-12-2611:07benedekcider for lein injects tools-nrepl but excludes its clojure dependency. guessing i can not really do that with -E, right?#2016-12-2616:47vinnyataide@benedek oh my god this is the hottest thing ever! all the commands are what I've been looking for. If I knew this before I wouldn't had chosen boot as my main tool#2016-12-2616:49vinnyataide@benedek what about if autocomplete could search for all my libs before making me import a lib like https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency#2016-12-2618:06richiardiandrea@benedek yes the option excludes the deps globally, doesn't it work with clojure? It can be that either they disabled the exclusion for it as it is of course a requirement or there is some bug. Also, the option IIRC just add an entry to the :exclusions clause of each dep. I am not 100% sure because micha beat me on that and implemented it 😀#2016-12-2618:07benedekthis is related to cider handling deps for jacking in#2016-12-2618:08benedekso all deps related stuff should be dealt with via the CLI#2016-12-2618:09benedekglobal exclusions is not good for that. do you reckon it worths to bring this up in a github issue on boot#2016-12-2701:42richiardiandrea@benedek no my PR was merely to add a clause for coherence to allow dep global exclusion, I was not thinking about cider for that one#2016-12-2708:23benedeki get that @richiardiandrea just wonder how I could pull this off#2016-12-2708:25benedek@vinnyataide clj-refactor: enjoy! 🙂
re. all your libs: you mean libs not on clojars? but some local stuff?#2016-12-2708:57benedek@vinnyataide there was such an issue https://github.com/clojure-emacs/clj-refactor.el/issues/303 but we never received a PR. happy to review one from you tho 😉 let me know if you need any help#2016-12-2711:14vinnyataide@benedek libs on clojars, ok happy to look around#2016-12-2711:29benedeklibs on clojars work out of the box#2016-12-2714:21vinnyataide@benedek what about local libs that I have already imported but I'm not using in my ns, is there an autocomplete that imports/require automatically the function? thanks for all the answers#2016-12-2714:36benedekadd missing libspec should do that, yes#2016-12-2714:37benedekhttps://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-missing-libspec#2016-12-2714:50vinnyataide@benedek the example doesn't show autocomplete, is that in?#2016-12-2714:51benedekclj-refactor does not do autocomplete. but cider has that with company I think#2016-12-2714:52benedekso if you use cljr (clj-refactor) add require and cider autocomplete is configured correctly you get autocompletion#2016-12-2714:56benedekworth watching parens of the dead to see what emacs/cider/clj-refactor can do#2016-12-2714:56benedeklook for it on youtube but it also has its own site#2016-12-2715:41vinnyataide@benedek all right man! that's all I've been looking for#2016-12-2716:35benedekhaha enjoy #2016-12-2718:18richiardiandrea@benedek ok now it is clear, sorry, holidays and all and maybe I did not interpret the signal in the right way 🙂#2016-12-2718:19richiardiandreaso basically you probably need another option right? some map maybe from symbol to target to symbol to exclude (or set of symbols to exclude) ? Am I getting it right this time?#2016-12-2718:20richiardiandreait is tough though because what if you have a cli option that collides with a manual set-env!#2016-12-2718:21richiardiandreaprobably you need validity checks around the cli option as well as the set-env!#2016-12-2806:09benedek@richiardiandrea yup you are getting it now ;) CLI usually has the higher precedence I guess... does not mean validation is a bad idea...#2016-12-2815:44bhaumanso this has probably been asked and answered a bunch of times:
how do I get an eval on a cljc file to dispatch to the cljs repl?#2016-12-2815:52dpsuttonah!#2016-12-2815:52dpsuttoni just recently fixed this issue#2016-12-2815:52dpsuttonor at least the load-buffer issue#2016-12-2815:52dpsuttonbut an easy hack if you ever run into an issue is to change your mode to clojurescript-mode#2016-12-2815:53dpsuttonbut CIDER has deeply ingrained assumptions that there is a single connection for each buffer#2016-12-2815:53dpsuttonso it feels free to reach out to the "current connection" in lots of places#2016-12-2815:53dpsuttonbut I'm working on fixing that soon#2016-12-2815:53dpsuttonbut if you are in a cljc file and you M-x load-buffer it should send to both repls just fine#2016-12-2815:53dpsuttonassuming you are running CIDER from melpa and not melpa stable#2016-12-2815:54dpsuttonhttps://github.com/clojure-emacs/cider/commit/d12ba39b7ea2fb229a9f227b7775750a5aae5f42#2016-12-2815:55dpsuttonthis commit is an explanation of the fix#2016-12-2815:56dpsuttonand the issue that was raised about it here#2016-12-2815:56dpsuttonhttps://github.com/clojure-emacs/cider/issues/1875#2016-12-2815:58dpsutton@bhauman if eval is not dispatching to both repls, can you lodge an issue and I'll tackle it soon?#2016-12-2815:58bhaumansweet, changing to clojurescript mode#2016-12-2815:58bhaumandid the trick#2016-12-2815:58dpsuttonawesome#2016-12-2815:59dpsuttonbut it should load in both buffers#2016-12-2815:59dpsuttonI'd like to get cljs support better in CIDER. But I don't use it enough#2016-12-2815:59bhaumanI'm was trying to fix ctrl-x e#2016-12-2815:59dpsuttoncljs experience is greatly needed in CIDER right now#2016-12-2815:59bhaumanctrl-c l isn't working as you are suggesting#2016-12-2816:00dpsuttonif you trace what ctrl-x e does, you eventually find a call to cider-map-connections and is passed a function that takes a connection#2016-12-2816:00bhauman"ctrl-c l"#2016-12-2816:00bhaumangotcha#2016-12-2816:00dpsuttonand that function feels free to reach out for any connection (technically session id) rather than the session id for the connection you gave it#2016-12-2816:00bhaumanI'm glad you are working on this#2016-12-2816:00dpsuttonso load buffer didn't work?#2016-12-2816:00dpsuttonie, send to both repls?#2016-12-2816:00bhaumanI'm in an older version of cider#2016-12-2816:00bhauman13#2016-12-2816:00dpsuttonah#2016-12-2816:00dpsuttonyeah#2016-12-2816:01dpsuttonmy fix is in 15-snapshot#2016-12-2816:01dpsuttonbut clojurescript mode is a fix if you don't feel like updating#2016-12-2816:01bhaumanI'm going to update, I just do it slowly#2016-12-2816:01dpsuttoni hear you#2016-12-2816:01dpsuttonnothing worse than a broken package written in a dynamically scoped lisp#2016-12-2816:01dpsuttonhaha#2016-12-2816:02bhaumanbut this meets my needs for now#2016-12-2816:02bhaumandon't know why I didn't try the clojurescript mode thing#2016-12-2902:17qqqin cider, when I get an error, it shows "Show: Clojure Java Repl Tooling Duplicates All" -- with Clojure/Java/Repl selected by default. I want only Clojure to be selected by default. Is there a way to configure this in Emacs?#2016-12-2903:52dpsutton(defcustom cider-stacktrace-default-filters '(tooling dup)
"Frame types to omit from initial stacktrace display."
:type 'list
:group 'cider-stacktrace
:package-version '(cider . "0.6.0"))
#2016-12-2903:52dpsuttonI think you can edit this var to filter out what you don't want#2016-12-2903:55dpsuttonand these look like your options#2016-12-2903:55dpsutton5 matches for "cider-stacktrace-toggle '" in buffer: cider-stacktrace.el
439: (cider-stacktrace-toggle 'java))
444: (cider-stacktrace-toggle 'clj))
449: (cider-stacktrace-toggle 'repl))
454: (cider-stacktrace-toggle 'tooling))
459: (cider-stacktrace-toggle 'dup))#2016-12-2903:57dpsuttonso if you did (setq cider-stacktrace-default-filters (append cider-stacktrace-default-filters '(java repl tooling))) you should be good to go#2016-12-2903:57dpsuttonbut i can look into it further later#2016-12-2903:57dpsutton@qqq ^#2016-12-2903:57qqq@dpsutton : trying this now#2016-12-2903:57dpsuttoncool#2016-12-2903:57qqqif it works; I'll also have to ask how you figired this out#2016-12-2903:57dpsuttoni'm not sure if filters filter things out or filter down to those though#2016-12-3118:59dpsuttonand it would be totally hacky if cider knew to reorder things unless it was for the registering out step#2016-12-3119:03bhaganyI don't think I understand what you mean#2016-12-3119:04dpsuttonso cider reorders some stuff coming back if id coming back < id working on now#2016-12-3119:05dpsuttonand it would be gross to change that less than sign to a function that returns (if (= id cider-setup-out-id)....)#2016-12-3119:06bhaganyAh, yes, I agree. That was the first thing I thought of, and, ew. #2016-12-3119:22bhaganyokay, I’m back home and I just updated my branch#2016-12-3119:23bhaganyit works as it is now, but I’d like to abstract out-stream and err-stream into a single function#2016-12-3119:24bhaganyprint-stream is my attempt at that, but it doesn’t work, and I don’t understand why.#2016-12-3119:24bhaganyto break it, you can comment (out-stream) and (err-stream) on these two lines, and uncomment the calls to print-stream. https://github.com/bhagany/cider-nrepl/blob/repl-err/src/cider/nrepl/middleware/out.clj#L132-L133#2016-12-3119:28richiardiandreaGuys, just thanks! very good job!#2016-12-3119:30bhaganygosh, I’m not sure I’ve actually done anything yet 🙂#2016-12-3119:36richiardiandreayou've done the most tiring part of any OSS contribution 🙂#2016-12-3119:36richiardiandreait would be awesome to just dump this conversations in a wiki page 😄#2016-12-3119:37dpsuttonoh for sure#2016-12-3119:38bhaganyI’ll take your word for it. From my point of view, it’s been quite refreshing to work things out with others like this#2016-12-3119:57featheredtoastcan cider load a lein project into an existing repl?#2016-12-3119:58bhagany@dpsutton okay, I got it. I’m still not sure why it needed this, but I added a bit of indirection and now print-stream works#2016-12-3119:59dpsuttonwith the correct id's in the response?#2016-12-3119:59bhaganyyes#2016-12-3119:59dpsuttonweird#2016-12-3119:59dpsuttongot it on github? can i pull and check it out?#2016-12-3119:59bhaganyyep, it’s there, go ahead and pull#2016-12-3119:59bhaganyI’ll give people a chance to check it out - I’m off to see Rogue One with my son 🙂#2016-12-3120:00bhaganyif everything looks okay, I’ll submit a PR when I get back#2016-12-3120:00dpsuttonits good#2016-12-3120:00dpsuttonenjoy it#2016-12-3120:00bhaganywill do!#2016-12-3123:43qqqI have defined my own pattern matching macro called mm. Is there a way to tell emacs to indent "mm" in the same awy as "case"? The answer is yes, unfortunately, I don't know what's the right layer to provide this information.#2016-12-3123:48richiardiandrea@qqq here you go, I hope it solves! http://jbm.io/2013/11/custom-indentation-in-clojure-mode/#2016-12-3123:50qqq@richiardiandrea : that solved it; thanks!#2017-01-0100:10bhaganyalright, here’s the PR for the output channel problem we’ve been discussing: https://github.com/clojure-emacs/cider-nrepl/pull/387#2017-01-0100:18bhaganyhrm, Travis encountered a failure, only on one build, but I don’t understand it… there’s a long stacktrace about not being able to find tools.namespace, but I don’t think that’s the actual problem.#2017-01-0100:18bhaganyAny help understanding that appreciated#2017-01-0100:19bhaganylink to the failure: https://travis-ci.org/clojure-emacs/cider-nrepl/jobs/187977586#2017-01-0100:21bhaganyrunning the failing command locally fails with a different stacktrace about not finding fipp#2017-01-0100:21richiardiandrea@bhagany it looks like a mranderson failure#2017-01-0100:21bhaganyI really wish I understood what that means 🙂#2017-01-0100:22richiardiandreano clue here too 😉#2017-01-0100:23richiardiandreait seems the packaging of tools.namespace did not go well 😄#2017-01-0100:24bhaganyyeah… really unsure how those changes would have caused that#2017-01-0100:25bhaganyor why I get a different error locally#2017-01-0100:26richiardiandreait looks like the previous were failing as well: https://travis-ci.org/clojure-emacs/cider-nrepl/pull_requests#2017-01-0100:27richiardiandreasame error here: https://travis-ci.org/clojure-emacs/cider-nrepl/jobs/182729609#2017-01-0100:27bhaganywow, okay#2017-01-0100:27bhaganyphew#2017-01-0100:27richiardiandrealol#2017-01-0117:27bhaganysigh. I failed to think enough about character encoding. so… happy new year#2017-01-0119:51bhaganyalright, there’s definitely something I don’t understand here:#2017-01-0119:51bhaganyuser> (.getBytes "テhi" "UTF-8")
#object["[B" 0x581670b3 "[B@581670b3"]
user> (.getBytes "テhi" "UTF-8")
#object["[B" 0x647b5edc “[B@647b5edc”]
#2017-01-0119:52bhaganyI really don’t expect to get different answers to the same call like that. anyone have any insight?#2017-01-0119:57bhaganyit happens with any string, I believe#2017-01-0201:21seancorfieldIt returns a new Byte[] on each call.#2017-01-0201:22seancorfieldIf you look at the actual byte values, they’ll be the same.#2017-01-0201:23seancorfield(seq (.getBytes "テhi" “UTF-8”))
;;=> (-29 -125 -122 104 105)
(seq (.getBytes "テhi" “UTF-8”))
;;=> (-29 -125 -122 104 105)
So that’s the underlying Java method on String returning a new byte array each time.#2017-01-0201:24seancorfield^ @bhagany#2017-01-0201:24bhaganyAha, thank you @seancorfield #2017-01-0216:28bhaganyalright, good news. it wasn’t actually an encoding issue, I had just written the code as though byte offsets/lengths are the same as string offsets/lengths. Fixed now.#2017-01-0217:36borkdudeI wish cljr-clean-ns didn’t change the formatting of my import clauses#2017-01-0217:36borkdudecan this be turned off?#2017-01-0219:48benedekthere is an option to turn off prefixing for requires not sure that has an effect on imports#2017-01-0219:48benedekcheck defcustoms tho#2017-01-0219:49benedekthere might be something for it#2017-01-0220:51bhagany@dpsutton that PR you helped me with was merged - just wanted to say thank you so much for your assistance. It was great to have someone to talk to about it, and you helped clarify things for me a lot.#2017-01-0300:23dpsuttoni'm really glad. I saw there was a lot of activity#2017-01-0300:23dpsuttonlooks like your patch has fixed quite a bit 🙂#2017-01-0301:33bhaganyHeh, just the same bug, reported lots of different ways :)#2017-01-0304:36qqqUsing cider, can I get something like "neotree", but instead of showing all files in a directory, it shows me def/defmacro/defns within a single *.cljc file ?#2017-01-0304:38dpsuttoncheck out imenu#2017-01-0304:38dpsuttoni think it similar to what you are thinking#2017-01-0304:40qqqI was just looking at speedbar (which works on .el files), but it does not work on clj files yet; will look into imenyu now; thanks!#2017-01-0304:41dpsuttonyou could also use occur and loccur#2017-01-0304:42dpsuttonloccur collapses the current buffer down to whatever matches the pattern you gave it#2017-01-0304:42dpsuttonso its easy to browse the defn's and the press enter on the one you like#2017-01-0316:14benedekanybody knows how to start a cider repl for a cljs/node project? is a there an up to date howto, guide etc?#2017-01-0316:14benedeki was trying various things and always ended up at weird places 😉#2017-01-0316:15dpsutton"should be" automatic#2017-01-0316:15dpsuttonassuming its a lein project#2017-01-0316:15dpsuttonthere's a defcustom called lein-cljs-repl-type or something similar#2017-01-0316:16dpsuttonbasically this holds a sequence of commands that are run after jacking in#2017-01-0316:16dpsuttonand there are several options that should cover most use cases#2017-01-0316:16dpsuttondo you know what connector they are using?#2017-01-0316:17dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L394#2017-01-0316:19benedekpiggyback i think#2017-01-0316:20dpsuttonhmm, well that's the default value#2017-01-0316:20dpsuttoncan you tell me the value of cider-cljs-lein-repl#2017-01-0316:21benedek"(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))”#2017-01-0316:22benedekbut for node i need this one?:
("(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
"Node" " (requires NodeJS to be installed)”)
#2017-01-0316:22benedeksry bit confused here i guess...#2017-01-0316:22dpsuttonhonestly i'm not too sure#2017-01-0316:22benedekhaha, how do i switch to that one?#2017-01-0316:23dpsuttonyou can do it through the customize-group menu#2017-01-0316:23dpsuttonor if you just want it local to this project, set a dir-local variable#2017-01-0316:23benedekah yeah of course, sry just set the value of cider-cljs-lein-repl#2017-01-0316:23benedeki see...#2017-01-0316:24benedekwill try. thx @dpsutton#2017-01-0316:24dpsutton👍#2017-01-0316:28dpsuttonlet me know if it works out for you#2017-01-0316:41chris_johnsonYou might also be looking for cider-jack-in-clojurescript and not cider-jack-in, depending on how your project is set up#2017-01-0316:42chris_johnsonthe former starts a Clojure REPL and then bootstraps a CLJS REPL, the latter just starts a Clojure REPL and then you can start a CLJS environment however you like with e.g. (boot “repl”) or start some Component#2017-01-0317:18ustunozgurIn cider, let's say I'm in a (comment) block. Is there a builtin way to make C-M-x work there, but one level below the comment?#2017-01-0317:19ustunozgurCurrently, I need to go to the end of the form I want, and do C-x C-e, but outside (comment) forms, C-M-x work anywhere.#2017-01-0317:29dpsuttonC-M-x works anywhere, including comment blocks#2017-01-0317:30dpsuttonits just the form returns nil#2017-01-0317:30dpsuttonyou're asking if there's a way to recognize that you're in a comment block and eval the form underneath it?#2017-01-0317:32ustunozguryes.#2017-01-0317:32dpsuttonI like that idea but i'm not sure there is a way to do it#2017-01-0317:32dpsuttonby that i mean it hasn't been implemented#2017-01-0317:32ustunozgurjust to see the result.#2017-01-0317:32dpsuttoni'm sure there's a way to do it#2017-01-0317:33ustunozgurOK, nice. I'll try to see if I can implement and then contribute.#2017-01-0317:33dpsuttonawesome#2017-01-0317:41richiardiandrea@ustunozgur I am totally with you I have been wanting to implement that myself for a long time#2017-01-0318:31qqqwhat's a good guide on using cider for debugging?#2017-01-0318:31qqqI'm reaching the point where pprint is no longer cutting it#2017-01-0318:40qqqah; it's working now, apparently my main problem was evil vs cider battling for keys#2017-01-0318:50qqq(defn make-handler [nm]
(fn [o]
#break 2
#_ (throw (ex-info nm o))))
(defn f2 [x]
#break (+ x 2))
(f2 4)
((make-handler "foo") {:a 2})
does #break only work in defns, and refuse to work inside anonymous functions?#2017-01-0319:26practicalli-john@qqq @dpsutton have you tried M-x cider-browse-ns to view the def/defn in a namespace? Once a REPL is running you can browse the contents of any namespace loaded into the REPL#2017-01-0319:27benedek@dpsutton setting this as a dir local:
((nil
(cider-cljs-lein-repl . "(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))")))
worked for a node.js cljs repl. ta!#2017-01-0319:31dpsuttonthanks for letting me know benedek. glad it worked#2017-01-0319:31dpsuttoni'm keeping an eye out for cljs interaction as i think it is weaker than clj support#2017-01-0319:32dpsutton@jr0cket i always forget about that one. thanks for reminding me#2017-01-0319:44ustunozgurIs there a way to clean up the whitespace near the closing parantheses automatically? For example, say I have the following:
(defn foo []
(bar x)
)
Is there a way to move the last paren to the end of the last line?
(defn foo []
(bar x))#2017-01-0319:45ustunozgurCurrently, I go to the end of the bar line, and keep hitting C-k until it deletes everything.#2017-01-0319:46ustunozgurI guess paredit should have something builtin for this.#2017-01-0319:59qqqI use evil. I put cursor anywhere on the (bar x) line, and hit shift-J#2017-01-0322:57geoffs@ustunozgur if you're using paredit, you can just type the closing paren anywhere between the end-paren of (bar x) and the next paren. Actually, I think it works anywhere between the open and close paren of the pair surrounding the defn as long as you're not inside a nested set of delimiters.#2017-01-0401:02richiardiandreahow was the trick to make my buffer a clojurescript one?#2017-01-0401:03richiardiandreaI get the dreaded ...needs a ClojureScript REPL. If you don't know.... on cider 0.14.0#2017-01-0404:29chris_johnson@richiardiandrea That means you’re trying to evaluate a Clojurescript statement in the Clojure REPL - you need to start a CLJS REPL, either with M-x cider-jack-in-clojurescript or by e.g. (cljs.repl/repl (cljs.repl.node/repl-env)) in your Clojure REPL#2017-01-0404:31richiardiandreaYep I have done the second, but in boot, I thought there was a way to mark it 😁#2017-01-0404:37chris_johnsoncider just knows hehe#2017-01-0404:56richiardiandreaI tried clojurescript-mode with no luck ..Anyway thanks#2017-01-0412:55dpsuttoncider "knows" because the repl receives stuff back from a cljs backend. when status comes back, it mentions cljs#2017-01-0412:55dpsuttonas far as I'm aware, you evaluate things in "java" clojure code that invokes clojurescript middleware#2017-01-0412:56dpsuttonfor lein, this is done automatically and configured by you#2017-01-0412:56dpsuttonbut in boot, you have to setup your own task that does this#2017-01-0412:56dpsuttonand the easiest that i've seen is this https://github.com/adzerk-oss/boot-cljs-repl#2017-01-0412:57dpsutton(deftask dev []
(comp (watch)
(cljs-repl) ; order is important!!
(cljs)))
#2017-01-0415:18mitchelkuijpers@richiardiandrea there is also cider-create-sibling-cljs-repl which you can configure yourself to run the command you would like, I use this to run (start-repl) with boot after I started my dev task in my clojure-repl#2017-01-0415:21mitchelkuijpersif you also use projectile you can even vary this command per project with a .dir-locals.el file per project#2017-01-0416:29richiardiandrea@dpsutton yep I do that already, still you need to call start-repl...Even after that I cannot evaluate code in the buffer#2017-01-0416:29dpsuttonyou invoked your task that invokes (cljs-repl)?#2017-01-0416:29richiardiandreaI will try to investigate today #2017-01-0416:29richiardiandreaYep#2017-01-0416:29dpsuttonand what happens after you do that?#2017-01-0416:30richiardiandreaYou need task + invoke a function#2017-01-0416:30richiardiandreaAfter that I get to the cljs.user prompd#2017-01-0416:30dpsuttonturn on toggling of the messaging#2017-01-0416:30richiardiandreaBut every eval command gives me that error#2017-01-0416:30dpsuttonnrepl-toggle...#2017-01-0416:31dpsuttonand see if it sent back a status of "done" that also includes a repl type of "cljs"#2017-01-0416:31richiardiandreaOh OK cool#2017-01-0416:31dpsuttonyou should see a session id of your clojure repl and then hopefully see a new session id for the clojurescript backend#2017-01-0416:31dpsutton> but every eval command gives me that error
which error?#2017-01-0416:32richiardiandreaOk thanks for the details I will check in a bit (on the bus to work now)#2017-01-0416:32dpsuttoncool#2017-01-0416:32dpsuttonis this by chance a cljc buffer?#2017-01-0416:32richiardiandreaIt is: https://clojurians.slack.com/archives/cider/p1483491821001249#2017-01-0416:32richiardiandreaNo cljc#2017-01-0416:32dpsuttonok#2017-01-0416:33dpsuttonif you want to send me a link to a repo that can easily demonstrate the bug i'll look at it tonight#2017-01-0416:35richiardiandreaOk Yes I have a repo, it is a bit hacky as I am porting figwheel to boot but it should work anyways#2017-01-0416:36richiardiandreaTo be in the same situation you should grab the fighweel branch here: https://github.com/boot-clj/boot-figreload#2017-01-0416:37richiardiandreaAnd use the sample project here: https://github.com/arichiardi/fig-boot-reload#2017-01-0416:38richiardiandreaIf it's too much work don't worry I will be checking that during the day#2017-01-0416:38richiardiandreaOne thing is that if I copy and paste the form the repl (of course) works#2017-01-0417:36richiardiandrea@dpsutton it looks ok in the project above so I might actually need to try another demo project#2017-01-0417:36dpsuttonso its working for you now?#2017-01-0417:36dpsuttonyeah, see that "repl-type" "cljs"#2017-01-0417:36dpsuttonthat's what cider remembers and when its looking for a clojure script repl it goes on that value#2017-01-0417:36dpsuttonso if you see that you should be good#2017-01-0417:37richiardiandreammm I don't know yet, let me try the other prj, but thanks I did not know that and now my debug can be more focused 😉#2017-01-0417:37dpsutton👍#2017-01-0417:37dpsuttonhahaa didn'tknow there was a CIDER emoji#2017-01-0417:37dpsuttoni like it#2017-01-0417:38richiardiandreajust found it 🙂#2017-01-0418:09richiardiandrea@dpsutton the problem solved by itself, magically#2017-01-0420:35richiardiandreaby the way it has to do with the execution/connection order#2017-01-0420:36richiardiandreaI have to launch boot, then connect to nrepl, then ((eval 'adzerk.boot-cljs-repl/start-repl)) in the repl buffer, then connect the browser to localhost:PORT#2017-01-0420:45bhaganythat… nearly makes sense to me#2017-01-0420:46richiardiandreano yeah definitely makes sense 😧#2017-01-0420:47richiardiandreajust that after a couple of months of not using it, I probably forgot 😄#2017-01-0422:00clodeindustriehi there#2017-01-0422:00dpsuttonhi#2017-01-0422:00clodeindustrieI’m trying to debug a web app but I’m not sure how to go about connecting to the running webserver#2017-01-0422:01clodeindustrieI usually run it with a boot task, I thought I would be able to connect to it through cider-jack-in#2017-01-0422:01clodeindustriebut it spins up its own nrepl#2017-01-0422:02clodeindustrieis cider-connect and loading the app env myself my only option ?#2017-01-0422:02seancorfieldIf your web app starts its own nREPL server, then you can cider-connect to it and it will have the app env already set up.#2017-01-0422:14clodeindustrieoh right I thought I would have to load the env myself#2017-01-0422:14clodeindustriethanks#2017-01-0500:27clodeindustrie@seancorfield mm, not sure what I’m doing wrong, I’m connected using cider-connect but I can’t debug my code because it’s not loaded in the repl,#2017-01-0500:39clodeindustriethat’s alright I loaded the env myself#2017-01-0501:00seancorfieldWhat do you mean by “loaded the env”? You’ll still have to require things into the user namespace that your REPL will start in.#2017-01-0501:00seancorfieldBut the application state — what I assumed you meant by “env” — is already in memory.#2017-01-0502:13chris_johnsonbah, why do I always have to spend a bunch of cycles puttering with my tools before I can settle down to work 😐#2017-01-0502:14chris_johnsonso what I’m trying to do right now is get, essentially, a cider-jack-in session working with a Node CLJS env#2017-01-0502:15chris_johnsonso something like (cljs.repl/repl (cljs.repl.node/repl-env)) - which command works in that I get a REPL inside my jacked-in Clojure REPL, but the input is in the minibuffer like Stdin: and has no multi-line capability and so on#2017-01-0502:16chris_johnsonand of course there seems to be just no way whatever to get Boot’s cljs-repl-env to do anything but launch a Websocket server and wait for me to load a served up index.html, which I don’t actually want to do for this project#2017-01-0502:17chris_johnsonanyone had any good, bad, or indifferent experiences running a Node-backed CLJS REPL in CIDER?#2017-01-0502:17dpsuttonfrom earlier today#2017-01-0502:19chris_johnsonthat was it! Specifically, running (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)) instead of (cljs.repl/repl (cljs.repl.node/repl-env))#2017-01-0502:20dpsuttonhaha you responded to that person as well 🙂#2017-01-0502:20dpsuttonnoticed you in the conversation when i was scrolling up#2017-01-0502:30chris_johnsonha what’s really funny is that he posted that critical piece of info before he came back in asking about the problem I thought he had. Well, either way I’m very happy to be educated#2017-01-0502:34dpsuttonhappy coding#2017-01-0503:43clodeindustrie@seancorfield ok I think I was missing the require part I thought by "loading the env” the doc meant everything was required, I still can’t debug though, my assumption of how it works, is that I can instrument a function and then load a page and when that page calls the function, it would stop in Emacs and let me go step by step. Is this it?#2017-01-0504:00seancorfieldNever used step debugging myself, never needed it.#2017-01-0504:02clodeindustriecool, thanks for your help, I’ll keep playing around#2017-01-0508:02qqqI've recently fallen in love with (for elisp) C-h f .... function name ... click on source. Wth cider + projectile, can I get something similar? where I hit a hot key, helm starts completing function names for me, and then shows me doc string + jumps me to the source (it doesnt' have to devl into libraries, even if it only prolvides functions in my project -- as defined by projectile -- I'd be happy).#2017-01-0508:13seancorfieldM-. jumps to the definition (source) of a var doesn't?#2017-01-0508:49qqq@seancorfield : what's the function name? for me, it's evil-repeat-pop-next, whatever that's supposed to do#2017-01-0508:52seancorfieldEvil mode? Vim? Never used that. #2017-01-0508:52qqq@seancorfield: I'm using evil mode in emacs, which overwrote the cider key bindings.#2017-01-0508:52qqq@seancorfield : I have the cider function installed; but I don't know the name of it. What do you Get when you press C-h k M-. ?#2017-01-0508:52qqqI just need to know what function M-. is calling for you to jump to definition#2017-01-0509:05clodeindustrieyou can restart emacs without loading Evil and then check#2017-01-0510:22qqqthere's an emacs option for disabling init.el, but disabling every part that uses evil is going to be quite messy#2017-01-0510:22qqqis there an implicit hatred here of people who use evil mode with cider?#2017-01-0510:44clodeindustriecan’t you just comment the require?#2017-01-0510:49qqq@clodeindustrie : have you ever used evil / setup config files / init.els that depend heavily on evil ?#2017-01-0510:50clodeindustrieI use https://github.com/jwiegley/use-package I’ve got almost everything related to evil in one file#2017-01-0510:52qqqit appears the real problem is that my init.el is poorly organized#2017-01-0510:52clodeindustrielol#2017-01-0510:52qqqI have heard of use-package, but never used it, and at the moment, my entire config is one init.el file that I have not split at all#2017-01-0510:52clodeindustriefair enough#2017-01-0510:52qqqIt appears M-. is xref-find-definitions ,#2017-01-0510:53qqqbut that does not seem very useful#2017-01-0510:53qqqEither that, or I'm mis-using xref-find-definitions too.#2017-01-0510:53clodeindustrieit’s cider-find-var what you are looking for#2017-01-0510:53clodeindustriehttps://github.com/clojure-emacs/cider/search?utf8=✓&q=M-.#2017-01-0510:54clodeindustrieat least it appears so 😄#2017-01-0510:54qqqerror: Wrong type argument: stringp, nil -- lol, looks like something else is broken#2017-01-0510:54qqqthe xref-find-definitions turns up aftedr "turn-off-evil-mode"#2017-01-0510:59clodeindustrieI don’t have that function in my current environment#2017-01-0511:02clodeindustrieoh that’s an emacs 25 thing#2017-01-0512:02dpsuttonyeah that's a new and really really nice feature#2017-01-0512:02dpsuttonin CIDER you can use C-c C-d d to load up some documentation#2017-01-0512:02dpsuttonwhich would be similar to C-h f from emacs#2017-01-0512:02dpsuttonand then there are the grimoire, javadoc, and other ones as well#2017-01-0517:44richiardiandreais anybody here using some function for def-ing let bindings (like protorepl) ?#2017-01-0517:48benedeknot sure i follow...#2017-01-0517:50richiardiandreafor example, at the repl I would like to def the let bindings, like (let [a "string" ...] ...) would become (def a "string")#2017-01-0517:50richiardiandreafor debugging purposes and to inspect data#2017-01-0517:51benedekah i see#2017-01-0619:59dorianc.bHello everyone, I’m new to emacs and cider and after the initial setup I’m actually liking it much better than atom. The only issue I’m having is with pretty print. When I print a large map it doesn’t have a new line between keys which makes it a pain to read. I wanted to try puget or fipp but I’m not understanding how to change the configuration.#2017-01-0619:59dorianc.bI have read the docs here: http://cider.readthedocs.io/en/latest/configuration/#2017-01-0620:00dpsuttonhave you toggled pretty printing?#2017-01-0620:00dpsuttonalso, you can set the width to print if you like#2017-01-0620:00dorianc.byes that works but I have’t figured how to change it from the built in pprint#2017-01-0620:01dorianc.bThis is what my output looks like ' {:arglists ([xs]),
:doc "Casts to bytes[]",
:added "1.1",
:line 5149,
:column 1,
:file "clojure/core.clj",
:name bytes,
:ns #namespace[clojure.core],
:inline #function[clojure.core/bytes--5400]},
refer-clojure
{:arglists ([& filters]),
:doc "Same as (refer 'clojure.core <filters>)",
:added "1.0",
:line 5611,
:column 1,
:file "clojure/core.clj",
:name refer-clojure,
:ns #namespace[clojure.core],
:macro true},
escape-class-name
{:private true,
:arglists ([c]),
:line 64,
:column 1,
:file "clojure/genclass.clj",
:name escape-class-name,
:ns #namespace[clojure.core]}}'#2017-01-0620:02dpsuttonand you don't want it to put each key on a new line?#2017-01-0620:03dorianc.bI want it to look like ` :inline #function[clojure.core/bytes--5400]},
refer-clojure
{:arglists ([& filters]),
:doc "Same as (refer 'clojure.core <filters>)",
:added "1.0",
:line 5611,
:column 1,
:file "clojure/core.clj",
:name refer-clojure,
:ns #namespace[clojure.core],
:macro true},
escape-class-name
{:private true,
:arglists ([c]),
:line 64,
:column 1,
:file "clojure/genclass.clj",
:name escape-class-name,
:ns #namespace[clojure.core]}`#2017-01-0620:04dorianc.bsorry I mean a new line separating the keys#2017-01-0620:04dorianc.bIn that example a new line before the escape-class-name keyword#2017-01-0620:06dpsuttonyou want key newline value ?#2017-01-0620:06dpsuttoni really don't follow what you want sorry#2017-01-0620:08dorianc.brefer-clojure
{:arglists ([& filters]),
:doc "Same as (refer 'clojure.core <filters>)",
:added "1.0",
:line 5611,
:column 1,
:file "clojure/core.clj",
:name refer-clojure,
:ns #namespace[clojure.core],
:macro true},
escape-class-name
{:private true,
:arglists ([c]),
:line 64,
:column 1,
:file "clojure/genclass.clj",
:name escape-class-name,
:ns #namespace[clojure.core]}}#2017-01-0620:08dorianc.bSorry I had to figure out the slack keybindings#2017-01-0620:10dorianc.bthat is what I’m trying to achieve but right now it looks like this
refer-clojure
{:arglists ([& filters]),
:doc "Same as (refer 'clojure.core <filters>)",
:added "1.0",
:line 5611,
:column 1,
:file "clojure/core.clj",
:name refer-clojure,
:ns #namespace[clojure.core],
:macro true},
escape-class-name
{:private true,
:arglists ([c]),
:line 64,
:column 1,
:file "clojure/genclass.clj",
:name escape-class-name,
:ns #namespace[clojure.core]}}’#2017-01-0620:12dpsuttonhttps://cider.readthedocs.io/en/latest/configuration/#pretty-printing#2017-01-0620:12dpsuttontry your luck with fipp#2017-01-0620:18dorianc.bYea i couldn’t figure out where to put `
(setq cider-pprint-fn “fipp”)` but I figured it out. It goes in /.spacemacs under user/init right#2017-01-0620:19dpsuttonwherever you like to keep you config stuff#2017-01-0620:19dpsuttoni don't know where spacemacs puts that#2017-01-0620:19dpsuttonbut that sounds right#2017-01-0620:25agile_geek~/.spacemacs is the default directory for Spacemacs, it's the equivalent of .emacs.d in emacs.#2017-01-0701:27dorianc.bok after much searching I finally figured out the pretty printing thing#2017-01-0701:30dorianc.bDoes anyone know how to rebind the cider repl so using the arrow keys will scroll through the history. I tried doing
(define-key 'cider-repl-mode-map (kbd "<up>") 'cider-repl-previous-input)
(define-key 'cider-repl-mode-map (kbd "<down>") ‘cider-repl-next-input))
However I keep getting this error
Error in dotspacemacs/user-config: Wrong type argument: keymapp, cider-repl-mode-map#2017-01-0701:45practicalli-john@dorianc.b I'd suggest putting (setq cider-pprint-fn “fipp”) under dotspacemacs/user-config in ~/.spacemacs. This should avoid the posibility of the cider package over-riding this setting. The configuration file ~/.spacemacs is equivalent to ~/.emacs.d/init.el. Alternatively, you can also use .spacemacs.d/init.el assuming you do not use ~/.spacemacs, but this is typically only used if you have other local configuration files (and you want to version control them)#2017-01-0702:18practicalli-john@dorianc.b for the keybindings I suggest using a hook, as I believe the cider-repl-mode-map is only available once you run the repl. So a hook will pull in the config when cider-repl-mode is activated. So you would use something like
(add-hook 'cider-repl-mode-hook
'(lambda ()
(define-key cider-repl-mode-map (kbd "<up>") 'cider-repl-previous-input)
(define-key cider-repl-mode-map (kbd "<down>") 'cider-repl-next-input)))
#2017-01-0702:40dorianc.b@jr0cket Thank you so much. Also your blog posts were really helpful in setting up spacemacs#2017-01-0707:46stanislavHi everyone. I'd like to setup Emacs to be able to run Clojure repl, but I'm having an issue, and cannot figure it out, since I'm new to Emacs as well. 😐#2017-01-0707:48stanislavWhen I create a new project with Leiningen, and open the core.clj file in Emacs, when I try to run cider-jack-in, I'm getting the message "Symbol's function definition is void: nil"#2017-01-0707:49stanislavI have the Emacs version 24.5.1, Leiningen 2.7.1, Cider 0.15.0snapshot (20170104.1330)#2017-01-0707:49stanislavNot sure if anything else is relevant for the issue#2017-01-0707:50stanislavI have also asked a question on Stackoverflow, where more details can be found: http://stackoverflow.com/questions/41508593/running-cider-jack-in-in-emacs#2017-01-0707:50stanislavAny help is highly appreciated! 🙂#2017-01-0709:40benedektry to update (remove and reinstall) clojure mode#2017-01-0714:02stanislavUnfortunately, that didn't help (I removed clojure-mode manually from elpa folder, and then did package-install in emacs)...#2017-01-0715:22dpsutton@stanislav can you check cider-client.el for me at line 102?#2017-01-0715:23stanislavSure#2017-01-0715:23dpsuttonyou can just navigate to the function cider-repl-buffers and see if it looks like this#2017-01-0715:23stanislavgive me just a second#2017-01-0715:24dpsuttonof course#2017-01-0715:24dpsuttonit should look like this
(defun cider-repl-buffers ()
"Return the list of REPL buffers."
(seq-filter
(lambda (buffer)
(with-current-buffer buffer (derived-mode-p 'cider-repl-mode)))
(buffer-list)))
#2017-01-0715:25stanislavit looks exactly the same#2017-01-0715:25dpsuttonok#2017-01-0715:26dpsuttonone sec#2017-01-0715:26dpsuttonlet me think#2017-01-0715:27dpsuttonah, do you see any .elc files in there?#2017-01-0715:28dpsuttonand we can confirm that this function is the problem#2017-01-0715:28dpsuttoncan you evaluate (cider-repl-buffers) from somewhere?#2017-01-0715:29dpsuttonlet's see if that's what's throwing the error#2017-01-0715:29stanislavFor each .el file I see the matching .elc.#2017-01-0715:29dpsuttonwe'll come back to that#2017-01-0715:29stanislav🙂#2017-01-0715:29dpsuttondo you know how to evaluate lisp code?#2017-01-0715:29dpsuttonlike from the minibuffer or maybe in the scratch buffer?#2017-01-0715:29stanislavnot really 😞#2017-01-3017:35dpsuttoni remember that working for me#2017-01-3017:35richiardiandreammm if I require it I don't even have it in my emacs packages...ok#2017-01-3017:35dpsuttonits brought in transitively i think#2017-01-3017:35richiardiandreaI will format manually, I want to try that problem above#2017-01-3017:35dpsuttonoh you mean in your elpa directory?#2017-01-3017:35richiardiandreayeah#2017-01-3017:35richiardiandreaI don't use elpa#2017-01-3017:36richiardiandreabut that's another story 😄#2017-01-3017:39richiardiandreauhm, the test succeeds#2017-01-3017:40richiardiandreanot a very big elisp user here but:
(describe "cider-cljs-repl-form"
(before-each
(setq-local cider-cljs-lein-repl "(do (load-file \"script/dev.cljc\"))"))
(describe "when there overriding cider-cljs-lein-repl"
(it "returns the overridden form not the default"
(expect (cider-cljs-repl-form "lein") :to-equal "(do (load-file \"script/dev.cljc\"))"))))
#2017-01-3017:47richiardiandreauhm scratch that there is indeed a problem#2017-01-3017:52jfntn@richiardiandrea ok cider-cljs-repl-form works as expected with a cl-cases instead of a pcase#2017-01-3017:52richiardiandreauhm#2017-01-3017:53richiardiandreait is weird, I have a successful test#2017-01-3017:53richiardiandreawhat is the difference if I may ask? not a big elisp user#2017-01-3017:55jfntnnot sure to be honest, I don’t understand pcase#2017-01-3017:56jfntnHmm actually it might need more debugging because eventhough it says “starting a custom repl” nrepl doesn’t actually run my script#2017-01-3018:03jfntnwhat’s the testing library?#2017-01-3018:03richiardiandrea@jfntn did you try to ielm on your buffer#2017-01-3018:03richiardiandreabuttercup#2017-01-3018:03richiardiandreain cider you just make clean test#2017-01-3018:12jfntnit seemed to work once, but now I get a make test error running the test suite#2017-01-3018:13jfntnwill need to investigate later#2017-01-3018:13richiardiandreaok, whenever you have time, I will open a PR with the tests, we can talk there as well#2017-01-3018:13richiardiandreaRan 254 specs, 0 failed, in 2.3 seconds.#2017-01-3018:14jfntnoh I do get 1 failure though for something unrelated#2017-01-3018:14jfntnCould be an emacs version thing, I built from master recently#2017-01-3018:14richiardiandreaah, then it could be#2017-01-3018:33richiardiandrea@jfntn PR opened, thanks for reporting, you pushed me to add tests 😄#2017-01-3019:52dpsutton@jfntn is the failure related to the new clj/cljs reader font lock thing?#2017-01-3019:52dpsuttonthe test failure I mean#2017-01-3020:06jfntn@dpsutton the test was reader conditional font-lock when cider is connected uses cider-reader-conditional-face#2017-01-3020:06dpsuttonyup#2017-01-3020:06dpsuttonthat one fails on my machine but not the CIDER build tooling#2017-01-3020:06dpsuttonits confusing to me#2017-01-3020:07jfntndifference in emacs versions maybe?#2017-01-3020:07dpsuttoni'm building off of master#2017-01-3020:07dpsuttonis that what you are doing as well?#2017-01-3020:07jfntnyes#2017-01-3020:07dpsuttonwell there we go#2017-01-3020:07dpsuttoni'm on probably a 2month old commit or something#2017-01-3020:08jfntnI have a more recent build `GNU Emacs 26.0.50.2 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G1004)) of 2017-01-15
`#2017-01-3020:09richiardiandreawow that's good that you guys try already against that#2017-01-3021:42agis cider-jack-in got broken, or I am missing something?#2017-01-3021:46dpsuttonwhat issues are you seeing?#2017-01-3021:57dpsutton@ag i just jacked in from the latest 0.15 snapshot on windows#2017-01-3022:07dpsuttonwhat version are you on?#2017-01-3022:14agCIDER 0.15.0snapshot emacs 25.1.1#2017-01-3022:15agI have rebooted, trying again#2017-01-3022:16dpsuttonplease let me know#2017-01-3022:16dpsuttonhope it works for ya#2017-01-3022:19agok, it seems cider-jack-in works, cider-jack-in-clojurescript is broken though#2017-01-3022:19dpsuttonah, I think @richiardiandrea is working on that#2017-01-3022:20richiardiandrea@ag what do you see?#2017-01-3022:21agis there an issue where I can follow up?#2017-01-3022:21richiardiandreaAll the tests pass here, do you have a dir-locals.el?#2017-01-3022:21ag@richiardiandrea null pointer exception and long stacktrace related to weasel#2017-01-3022:22agyes, and my dir-locals.el ((nil . ((cider-boot-parameters . "repl -s wait")
(cider-cljs-lein-repl . "(boot (start))"))))
#2017-01-3022:22agit was working yesterday#2017-01-3022:22richiardiandreaOk @ag for your case you need to change to boot-cljs-boot-repl#2017-01-3022:25agtrying that#2017-01-3022:28agsame thing 😞#2017-01-3022:29richiardiandreaare you using boot-repl-cljs?#2017-01-3022:29richiardiandreaah yes it is written there#2017-01-3022:29richiardiandreaI wonder what (boot (start)) is doing#2017-01-3022:30richiardiandreaanother thing is, you could try to remove the dir local#2017-01-3022:30richiardiandreabecause the default is to launch boot-cljs-repl/start-repl#2017-01-3022:30ag(deftask start []
(future (boot (dev)))
identity)
it just wraps main task into a future, so it wouldn’t block the repl#2017-01-3022:30richiardiandreaoh no ok#2017-01-3022:31richiardiandreaso basically you are launching two repls it seems#2017-01-3022:31agright#2017-01-3022:31agso it was working, nothing has changed except cider#2017-01-3022:32richiardiandreaI would actually try this in your case:
((nil . ((cider-boot-parameters . "start")))))
#2017-01-3022:32richiardiandreaand you start will become#2017-01-3022:32richiardiandrea(deftask start []
(future (boot (dev)))
(comp (repl :server true) (wait))
#2017-01-3022:33aglet me try that, because removing dir-locals didn’t help#2017-01-3022:34richiardiandreawhen you jack in, at the bottom you should see the task called that is matching your start#2017-01-3022:35richiardiandreait is basically same as my setup#2017-01-3022:36agcan you paste exact content of .dir-locals.el please#2017-01-3022:37richiardiandrea((nil . (cider-boot-parameters . "dev-web"))))#2017-01-3022:37richiardiandreawhich you will replace with start#2017-01-3022:37richiardiandreayes there was one parent more up there#2017-01-3022:38agproblem not in parens, I spotted that, something else not right#2017-01-3022:39agsomething wrong with deftask I think#2017-01-3022:39agit’s not working in terminal either#2017-01-3022:39richiardiandreauhm, I did not try, let me see#2017-01-3022:40agoh, hold on… I think I missed paren there 🙂#2017-01-3022:40richiardiandreamissing paren yeah#2017-01-3022:41ag"try Lisps" they say, "parentheses not a problem” they say.#2017-01-3022:41richiardiandreaah ah, I should have add highlight maybe#2017-01-3022:41richiardiandreatest
clojure
(deftask start []
(future (boot (dev)))
(comp (repl :server true) (wait))
#2017-01-3022:42richiardiandreano it does not work like this 😄#2017-01-3022:43dpsuttonis it working now?#2017-01-3022:43richiardiandreaof course 😄#2017-01-3022:47ag@richiardiandrea Holy shit!!! that worked… this is so cool. I can’t thank you enough… this been killing me for the past couple of hours#2017-01-3022:47richiardiandreano problem, that's good that it is solved!#2017-01-3022:48agyou didn’t just fixed it, I couldn’t find a way to automatically start the cljs-repl, it would still have 2 separate clojure repls until I type in one of them (start-repl)#2017-01-3022:48agyooohooo!#2017-01-3022:48richiardiandreayeah your setup was a bit weird 😄#2017-01-3022:49richiardiandreaby the way, I think you could get rid of repl :server wait even#2017-01-3022:49richiardiandreabecause cider will always launch two repls#2017-01-3022:49richiardiandreathe second one is reduntant (unless you use it with another classpath)#2017-01-3022:50agwell, to paraphrase Tolstoy: “All Sublime Text configs are alike; each Emacs config is weird and awesome in its own way"#2017-01-3022:51richiardiandreaoh yeah Tolstoy for sure was using emacs 😄#2017-01-3022:52agyou bet he did. that’s why he rejected orthodox church. he found better one#2017-01-3022:52richiardiandreaah ah ha#2017-01-3022:53richiardiandreathat might actually be true, we should check the dates 😄#2017-01-3022:56dpsutton@ag do you like having two repls open?#2017-01-3022:56dpsuttoni was always confused why emacs would launch two clojure repls and then make one a cljs repl#2017-01-3022:56dpsuttonand i wanted to do away with that#2017-01-3022:56dpsutton(in the future)#2017-01-3022:57dpsuttonjust getting ideas/opionions#2017-01-3022:58ag@dpsutton absolutely, two separate clojure and clojurescript repls are amazing. Something I believe Cursive can’t do. Well it can’t do a lot more, to be honest#2017-01-3022:59dpsuttoni wouldn't preclude that#2017-01-3022:59dpsuttonbut when you jack in clojurescript, you get a single clojure script repl#2017-01-3022:59dpsuttonand if you like, you could jack in to get a clojure repl#2017-01-3022:59dpsuttoni just don't get why it tries to do both automatically#2017-01-3023:04ag@dpsutton I don’t get what you’re saying. They are both indeed clojure repls (until one of them starts cljs-repl), and even after one becomes cljs-repl there’s always way to do :cljs.quit and go back to clj repl#2017-01-3023:05agbut why would you need 2 clojure repls? is that what you’re talking about#2017-01-3023:05dpsuttonthat's my point, ag#2017-01-3023:06dpsuttonwhen you jack-in-clojurescript you get two repls#2017-01-3023:06dpsuttonbut its actually a clojure repl, and a clojure repl that just invoked whatever you invoke to get a cljs repl#2017-01-3023:06dpsuttonso why not just make one?#2017-01-3023:06dpsuttoni don't understand why there are wto#2017-01-3023:06dpsuttonor why there are always two#2017-01-3023:08agwhen you do clojure-jack-in, you get one repl#2017-01-3023:08dpsuttoncorrect#2017-01-3023:08dpsuttonso why when you do clojurescript-jack-in do you get two?#2017-01-3023:09agbecause then you can evaluate clojure code in one and clojurescript code in another, without having to run :cljs.quit and (start-repl) back and forth#2017-01-3023:09dpsuttonis that a common use case in clojurescript projects?#2017-01-3023:10dpsuttoni'm not familiar with clojurescript, but it seems like they don't require a jvm at al#2017-01-3023:10agin my case it is#2017-01-3023:10dpsuttonah ok#2017-01-3023:10dpsuttonthen i'm glad i talked to you then 🙂#2017-01-3023:11agthis is really cool, so you can go to clojure file, evaluate piece of code and see the results, and then you can go to clojurescript file and evaluate piece of clojurescript code and see the results.#2017-01-3023:12agreally nice#2017-01-3104:04practicalli-johnI've always used the chestnut template for Clojurescript projectS that I wan to run from Emacs. There is a little bit of elisp in the readme that ensures the browser repl is used rather than the rhino repl in the JVM.#2017-02-0111:57zakI've got an issue in a cider cljs repl where figwheel tries to reload a changed file from the wrong path (omitting js/compiled/out)#2017-02-0111:57zakDoesn't seem to be an issue running lein figwheel <build>, just from emacs M-x cider-jack-in-clojurescript#2017-02-0117:16benedekoi @plexus re. https://github.com/clojure-emacs/refactor-nrepl/issues/190 i don’t fully agree with Lars on this. i have not commented on the issue as i don’t really have time atm to look at this. but if you think there is a chance for a PR here I am happy to and support that PR.#2017-02-0119:10ag@richiardiandrea that way you showed me to get correct cljs-repl buffer. I just noticed. For some reason it creates two cljs buffers. and another clojure repl buffer.#2017-02-0119:10richiardiandreait creates one here...did you remove the entry repl -s wait#2017-02-0119:11ag@jr0cket chestnut is Lein based, I’m using boot#2017-02-0119:12ag@richiardiandrea from dir-locals? I did#2017-02-0119:12richiardiandreano prom the task itself#2017-02-0119:14agyeah, I guess something not quite right with the task itself. can you please share the task again?#2017-02-0119:16agthis is my “main” task:
(deftask dev []
(comp
(dev-env)
(serve :reload true)
(watch)
(reload)
(notify :audible true :theme "woodblock"
:visual true :title "finops-admin")
(npm-install)
(sassc)
(cljs-repl)
(cljs)
(target)))
but to run it I have another task, called start, which is noted in dir-locals, right?
I made it exactly how you showed me:
(deftask start []
(future (boot (dev)))
(comp (repl :server true) (wait)))
#2017-02-0119:16richiardiandreayeah you can remove (comp (repl :server true) (wait))#2017-02-0119:16richiardiandreabut in any case it should not matter, as it is a terminal repl#2017-02-0119:20agin that case it doesn’t run it at all:
error in process sentinel: Could not start nREPL server:
#2017-02-0119:26richiardiandreauhm#2017-02-0119:26ag@richiardiandrea oh, seems if I do it this way:
(deftask start []
(comp
(repl :server true)
(boot (dev))
(wait)))
it works#2017-02-0119:26agno future needed and both repls seems to be operational#2017-02-0119:26richiardiandreaok so they are not blocking good#2017-02-0119:27agin this case I may not need to wrap dev into boot either#2017-02-0119:27aglet me try#2017-02-0119:27richiardiandreayes you don't#2017-02-0119:33agwow, when I don’t, it creates 4 repls - couple for each. clj and cljs#2017-02-0119:33ag¯\(ツ)/¯#2017-02-0119:36richiardiandrealol#2017-02-0205:13adamfreyDoes anyone else experience the issue where you leave a Clojure buffer open with a connected cider repl for a while, and then come back to your laptop and try to do anything which pins Emacs at 99.9% CPU for like, 30 seconds?#2017-02-0206:09bhagany@adamfrey I used to experience something like that. I narrowed it down to some interaction between an active cider and aggressive-indent-mode. I just decided to do without aggressive-indent-mode rather than exploring further.#2017-02-0211:04luxbockI'm trying to embed the CIDER nREPL in an applicatin that I distribute as a JAR so that I can do some debugging inside of it if need be#2017-02-0211:05luxbockhere's simplified setup I use: https://gist.github.com/luxbock/5d7d2a098fd96862f7955faf9b554dec#2017-02-0211:05luxbockI can start the REPL server fine via command line#2017-02-0211:05luxbockbut I'm having trouble connecting to it from Emacs#2017-02-0211:07luxbockwhen I call cider-connect I've tried both 0.0.0.0 and localhost as the address, and then after that I am not sure what I'm supposed to insert next, I've tried foo:7888, 7888, foo.repl:7888 but nothing seems to work#2017-02-0211:11luxbockI'm able to connect to the running process with lein :connect 7888#2017-02-0214:08pesterhazy7888 should work#2017-02-0214:09pesterhazydoes telnet localhost 7888 work?#2017-02-0214:43luxbock@pesterhazy: like I said I was able to connect via lein :connect 7888, but I am not sure which parameters I have to use with cider-connect#2017-02-0214:44pesterhazytry describe-function cider-connect#2017-02-0306:19bozhidar@luxbock Doesn't it just prompt you for the host and the port? What exactly is your issue?#2017-02-0306:21bozhidar@dpsutton re the cljs repl - as we're using nREPL for it we can use the self-hosted cljs anyways, that's the reason why we end up with two repls#2017-02-0306:21bozhidarwe can probably hide one of them, but nobody's going to gain anything from this#2017-02-0306:22bozhidarthat's less than ideal, but without either an nREPL server that works on cljs or adding support for the built-in socket repl that's the best we can do for now#2017-02-0306:31luxbock@bozhidar yes, I've tried entering "localhost" and "0.0.0.0" for host, and calling (cider-connect "localhost" "7888") directly but I get "[nREPL] Direct connection failed", yet lein :connect 7888 works and I confirmed that I'm connecting to the process started by invoking the jar file#2017-02-0306:35luxbockah, think I just figured out what was wrong, I was trying to call the command from a buffer associated with a file which was not in the same directory as for where I invoked the jar file from#2017-02-0306:35richiardiandrea@luxbock I guess Bozhidar was saying that it should prompt when you call it with M-x (no params)#2017-02-0306:36luxbock@richiardiandrea yeah, I tried as many combinations for host and port I could think of but I didn't realize the directory needed to match as well#2017-02-0306:36luxbocksorry for the confusion#2017-02-0306:37richiardiandreaWhat happens when you just call cider-connect?#2017-02-0306:38richiardiandreaIt is C-c M-c iirc#2017-02-0306:40luxbock@richiardiandrea I get prompted for host and port, for which I tried a number of combinations but it always failed to connect, but as I said the issue was stemming from calling the command from a buffer which was associated with a different directory from where I had invoked the JAR from#2017-02-0306:43richiardiandreaHm it is weird because I do what you say all the time, say I have a repl on a project going and I want to debug lein-figwheel: I open the project with projectile in another frame and cider-connect to the running thing #2017-02-0306:44luxbock@richiardiandrea I assume you start the REPL via lein figwheel in the project root?#2017-02-0306:44richiardiandreaBut OK, it is good that it works now :)#2017-02-0306:44richiardiandreaNo, via cider and boot#2017-02-0306:44luxbockI had moved my JAR file into a ./release directory and invoked it from there#2017-02-0307:09bozhidarI'm a bit confused by your explanations, but I'm happy you got it working 🙂#2017-02-0318:08richiardiandreais there a way for avoiding the prompt when the project contains both build.boot and project.clj?#2017-02-0319:00christianromneyis there a preferred way to run figwheel from cider? i've seen the instructions on the figwheel wiki, just wondering if there's a nicer way. i was considering setting cider-cljs-lein-repl via .dir-locals.el but would greatly appreciate any hard-won advice TIA#2017-02-0319:08dpsutton@richiardiandrea
(defcustom cider-preferred-build-tool
nil
"Allow choosing a build system when there are many.
When there are artifacts from multiple build systems (\"lein\", \"boot\",
\"gradle\") the user is prompted to select one of them. When non-nil, this
variable will suppress this behavior and will select whatever build system
is indicated by the variable if present. Note, this is only when CIDER
cannot decide which of many build systems to use and will never override a
command when there is no ambiguity."
:type '(choice (const "lein")
(const "boot")
(const "gradle")
(const :tag "Always ask" nil))
:group 'cider
:package-version '(cider . "0.13.0"))
#2017-02-0319:09richiardiandrea@dpsutton life saver!#2017-02-0319:09dpsutton👍#2017-02-0320:17zlrthi have an external service printing lots of logging through the buffer cider-repl my-project, so i set nrepl-log-messages to t, thinking that all logging would be redirected to nrepl-messages my-project. but all logging is now being printed to both cider-repl my-project and nrepl-messages my-project. can i suppress logging in cider-repl my-project?#2017-02-0320:17dpsuttonthis is an issue that has been debated recently due to a bug fix#2017-02-0320:17zlrthemacs (spacemacs) crawls when printing all that logging; that’s why i’m interested in this#2017-02-0320:18dpsuttonCIDER had in the past erroneously not passed writing to standard out back to the cider repl. This was fixed and is the behavior you are seeing#2017-02-0320:18dpsuttonat some place in your code you are writing to System/out, which only makes sense that it gets redirected to your repl#2017-02-0320:20zlrthinteresting. thanks.#2017-02-0320:21dpsuttonthe idea is that you turned on console logging and attached a console#2017-02-0320:24zlrthfor me to fix this, i should change the code in the external service to print to something other than System/out?#2017-02-0320:24dpsuttonwell your current logging strategy is to print to interested parties. This seems like a shortlived and bad logging strategy. would you prefer to write to a log file?#2017-02-0320:24dpsuttonalso, your logging solution should have some idea of granularity, right?#2017-02-0320:25dpsuttonlike info, debug, warning, error, fatal, etc#2017-02-0320:25dpsuttoncan you raise the threshold?#2017-02-0320:25dpsuttonmaybe you still want to see warnings but not info or debug so just raise the threshold?#2017-02-0320:28zlrthi would much prefer to log to a file infos and debugs, and see warnings and errors. i’m pretty new as regards clojure. should i configure how i log things in clojure? all i know so far is the external service (java fwiw, EmbeddedSolrSolver) is printing everything#2017-02-0320:30dpsutton@mfm that sounds like a good strategy but I don't have much experience in java#2017-02-0320:32zlrthi’m worried that, i call basically (.doThing EmbeddedSolrServer), then EmbeddedSolrServer just System.out.printlns whatever it wants. i’m hoping that clojure logging can ingest those messages and filter them.#2017-02-0320:33zlrthhaven’t looked into how EmbeddedSolrServer does anything, though. nor do i know anything about clojure logging.#2017-02-0320:33zlrththanks very much dpsutton#2017-02-0320:35dpsuttonno problem#2017-02-0320:35dpsuttonbut how would you distinguish which writing to system out are important or not?#2017-02-0320:36dpsuttonhttps://cwiki.apache.org/confluence/display/solr/Configuring+Logging#2017-02-0320:37dpsuttonPermanent Logging Settings
Solr uses Log4J version 1.2 for logging and is configured using server/resources/log4j.properties. Take a moment to inspect the contents of the log4j.properties file so that you are familiar with its structure. By default, Solr log messages will be written to SOLR_LOGS_DIR/solr.log.
When you're ready to deploy Solr in production, set the variable SOLR_LOGS_DIR to the location where you want Solr to write log files, such as /var/solr/logs. You may also want to tweak log4j.properties. Note that if you installed Solr as a service using the instructions provided at Taking Solr to Production, then see /var/solr/log4j.properties instead of the default server/resources version.
When starting Solr in the foreground (-f option), all logs will be sent to the console, in addition to solr.log. When starting Solr in the background, it will write all stdout and stderr output to a log file in solr-<port>-console.log, and automatically disable the CONSOLE logger configured in log4j.properties, having the same effect as if you removed the CONSOLE appender from the rootLogger manually.
Also, in log4j.properties the default log rotation size threshold of 4MB is most likely too small for production servers and should be increased to a larger value (such as 100MB or more).
#2017-02-0322:27hansHi, is there a quick way to switch off cider's changing of font faces? I'm in a terminal and the faces are fine in clojure mode, but cider messes everything up with reverse and stuff.#2017-02-0322:30dpsuttoncider-font-lock-dynamically#2017-02-0322:30dpsuttonmight be the ticket#2017-02-0322:30dpsuttonset that to nil#2017-02-0322:30dpsutton> with reverse and stuff
do you mean reverse from clojure.core?#2017-02-0322:30dpsuttonits font-locking all the clojure stuff?#2017-02-0322:39hansit is (apparently) font-locking the functions it knows.#2017-02-0322:39hansbut setting c-f-l-d to nil helps, thanks a lot!#2017-02-0322:40dpsuttonyeah it asks the backend the core, macros, deprecated, etc and then font-locks them#2017-02-0322:40dpsuttonif you look at that var, you can set it to a few different values#2017-02-0322:41hansit is nicely documented, yes. but i don't want to spend time on figuring out face configuration in this chain of terminal emulator and emacs, so nill will do 🙂#2017-02-0322:41dpsuttonhaha sounds good. happy coding#2017-02-0415:01cskkscClojure is participating in GSoC this year. I guess we should add some CIDER specific proposals there. Check out http://clojure-gsoc.org/ and the #gsoc channel#2017-02-0501:08dpsuttondamn, the connection stuff is a mess#2017-02-0501:08dpsuttoncljc support i don't think is reliable#2017-02-0501:11dpsuttonthere are so many things that just help themselves to the current connection regardless of what you may intend to do in a cljc buffer#2017-02-0501:12dpsuttonns, info, var info, stacktraces, they all help htmesleves to info from the backend without specifying what connection they should use. The result is that the single connection assumption is really really baked into CIDER#2017-02-0501:38dpsuttonhaha#2017-02-0612:09borkdudecljr-clean-ns sometimes removes namespaces that are there just for the side effect of loading them, like [cljsjs.bootstrap], because it isn’t explicitly used in the code. Is there a way to prevent this?#2017-02-0612:12benedekyup#2017-02-0612:13benedekyou can define a list of ‘do not touch these’ ns-es i think#2017-02-0612:13benedekfor this very reason#2017-02-0612:14benedek(defcustom cljr-libspec-whitelist
'("^cljsns" "^slingshot.test" "^monger.joda-time" "^monger.json")
"List of regexes to match against libspec names which shouldn't be pruned.
This is useful when `clean-ns' should leave a libspec alone even
if it appears to be unused."
:group 'cljr
:type '(repeat string))
#2017-02-0613:59borkdudeah nice, thanks#2017-02-0614:04borkdudeI have ’(^cljsjs\.bootstrap”) and tried other things, but it still removes [cljsjs.bootstrap]. I evaluated the defcustom form with C-x C-e. Should that work?#2017-02-0614:05borkdudeMaybe I should upgrade#2017-02-0614:18borkdudeI upgraded, but still doesn’t work (cc @benedek )#2017-02-0614:31benedektry to use the customize interface#2017-02-0614:32benedekM-x customize-variable#2017-02-0614:33benedekand the thing you posted here in slack missing a ”, perhaps that?!#2017-02-0614:34benedekyou deffo need latest version too: https://github.com/clojure-emacs/clj-refactor.el/blob/master/CHANGELOG.md#2017-02-0723:25jasonjcknif the remote closes a cider connection, any way to automatically clean-up the cider buffer?#2017-02-0723:25jasonjckni still have manually quit the connection#2017-02-0806:47benedekI assume you made it work @borkdude ?!#2017-02-1018:19jfntn@richiardiandrea sorry for not following up the lein-cljs-repl issue, someone else dug in a little bit, and there’s more context here: https://github.com/clojure-emacs/cider/issues/1938#2017-02-1018:39richiardiandreathanks, I commented there 😄#2017-02-1019:16richiardiandrea@dpsutton just because you are probably on the topic, why don't we have/add a simple function like this in cider?
(defun cider--get-repl-buffer ()
(-when-let (repl-buffers (cider-repl-buffers))
(if (= (length repl-buffers) 1)
(car repl-buffers)
(completing-read "Choose REPL buffer: "
(mapcar #'buffer-name repl-buffers)
nil t))))
#2017-02-1019:17dpsuttoni thought this basically exists#2017-02-1019:17dpsuttoni think there's a notion of "cider go to repl buffer"#2017-02-1019:18richiardiandreayeah I thought the same, but I could not find it and all the functions in cider-interaction.el are actually taking the connection directly#2017-02-1019:18dpsuttonits oddly namedc#2017-02-1019:18dpsuttonbut if i remember right, it normally visits the code#2017-02-1019:18dpsuttonbut if in code it visits the repl#2017-02-1019:19richiardiandreaI have a simple:
(defun cider-eval-sexp-at-point-in-repl ()
(interactive)
(let ((form (cider-sexp-at-point)))
;; Strip excess whitespace
(while (string-match "\\`\s+\\|\n+\\'" form)
(setq form (replace-match "" t t form)))
(set-buffer (cider--get-repl-buffer))
(goto-char (point-max))
(insert form)
(cider-repl-return)))
#2017-02-1019:19dpsuttoncider--switch-to-repl-buffer#2017-02-1019:19agile_geekwas about to say that#2017-02-1019:19richiardiandreaand all of a sudden it was broken becasue cider-get-repl-buffer got removed#2017-02-1019:19agile_geekusually bound to C-c C-z#2017-02-1019:20richiardiandreaoh ok, so I might have missed that one#2017-02-1019:20dpsuttonwait, is something broken?#2017-02-1019:20richiardiandreano no#2017-02-1019:20dpsuttonor the way you want to do something no longer works#2017-02-1019:20richiardiandreadon't worry 😄#2017-02-1019:20dpsuttonah ok#2017-02-1019:20dpsutton🙂#2017-02-1019:20richiardiandreait's a custom function#2017-02-1019:20dpsuttonjust making sure. it's very easy to break corners of CIDER you don't often use#2017-02-1019:20dpsuttonand i was worried I clobbered something#2017-02-1019:21richiardiandreatell me about it 😄#2017-02-1023:39onetomhi!
im just trying to install cider as recommended on https://github.com/clojure-emacs/cider/ and http://www.braveclojure.com/basic-emacs/
M-x package-install [RET] cider [RET]
but i only see the following packages:
{cider-decompile | cider-profile | cider-spy | ac-cider | ac-cider-compliment}
what am i missing?
i've got some SSL error message for , so i guess i dont have a complete latest package list?
i've installed my emacs from https://emacsformacosx.com and added the configuration recommended by the mentioned braveclojure chapter.#2017-02-1023:41dpsuttontry M-x list-packages ret#2017-02-1023:41dpsuttonthis should update the packages list#2017-02-1023:41dpsuttonsearch through with C-s cider#2017-02-1023:42dpsuttoni would say no#2017-02-1023:42dpsuttoni think marmalade has been disfavored#2017-02-1023:42dpsuttongo with melpa#2017-02-1023:43dpsuttonhttps://melpa.org/#/cider#2017-02-1023:43onetomdamn, ive accidentally pressed A i think...#2017-02-1023:43arrdemEh you probably won’t get owned this way. But yeah you can use melpa-stable#2017-02-1023:43dpsuttonno big deal#2017-02-1023:44dpsuttonmelpa-stable is a good recommendation#2017-02-1023:44dpsuttonit runs "releases", whereas melpa tracks the current state#2017-02-1023:44arrdemI have melpa and melpa-stable in my package config#2017-02-1023:44dpsuttonwhich has been known to break#2017-02-1023:44onetominterestingly i can find cider in the list now, but if i say M-x package-install, then i cant see just cider#2017-02-1023:44arrdem;; 00-packages.el
(require 'package)
(require 'cl)
(add-to-list 'load-path "~/.emacs.d/local")
(setq package-archives
'(
("gnu" . "")
("marmalade" . "")
("melpa-stable" . "")
("melpa" . "")
; ("org" . "")
))
(package-initialize)
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
(add-to-list 'package-pinned-packages '(clj-refactor . "melpa-stable") t)
(defun arrdem:require (req &optional pkg)
"A wrapper for ensuring that a package is installed, and requiring it.
Enables me to modularize the previously monolithic installation
of packages."
(let ((pkg (or pkg req)))
(package-install pkg)
(require req)))
#2017-02-1023:45arrdemI may not need that (require ‘cl)...#2017-02-1023:46arrdemonetom: you’ll need to refresh the package list#2017-02-1023:47onetom@arrdem with M-x list-packages as mentioned above?#2017-02-1023:47onetomor u mean after i changed the config?#2017-02-1023:48arrdemif you’ve changed package-archives you’ll want to list-packages, and maybe press g in the package list buffer.#2017-02-1023:48onetominteresting, in the braveclojure's example config init.el looks like this:
;; Define package repositories
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "") t)
(add-to-list 'package-archives
'("tromey" . "") t)
(add-to-list 'package-archives
'("melpa" . "") t)
;; (setq package-archives '(("gnu" . "")
;; ("marmalade" . "")
;; ("melpa" . "")))
#2017-02-1023:48onetombut anyway, thanks for putting me on the right track!#2017-02-1023:49onetomi will nag the author to remedy this situation.
i feel a bit embarrassed because im recommending the braveclojure book usually as a good starting point... 😕#2017-02-1023:51dpsuttonits a great book#2017-02-1023:52dpsuttoni'm not a fan of its cider setup#2017-02-1023:52dpsuttonit's a repo with byte compiled cider 0.8#2017-02-1023:52dpsuttonand updating is weird#2017-02-1023:52dpsuttonand i think there's been a change in the byte code#2017-02-1023:52dpsuttoni don't know why that way is recommended any longer#2017-02-1023:53richiardiandreatalking about setup, I found emacs-live's approach the best, packages organized with git submodule#2017-02-1023:53richiardiandreaactually the git submodule part is something I would like to improve#2017-02-1023:53richiardiandreabut I can go in any subfolder and checkout a specific commit#2017-02-1023:54richiardiandreaor work on the fix that break and use it right away#2017-02-1023:54richiardiandreaneedless to say that I have a fork of emacs live#2017-02-1023:54onetomjust to double confirm, u r talking about this?#2017-02-1023:55onetomhttps://github.com/overtone/emacs-live#2017-02-1023:55dpsutton@onetom if you're looking for an up-to-date emacs config, checkout https://github.com/bbatsov/prelude#2017-02-1023:55dpsuttonits from the maintainer of cider as well#2017-02-1023:55dpsuttonit's very nice, no fuss, works, etc#2017-02-1023:55onetomthanks, i will give these a try#2017-02-1023:55dpsutton👍#2017-02-1023:55dpsuttonhappy coding#2017-02-1023:56dpsuttoncider#2017-02-1023:57onetombtw, i started clojure with sublime text ~2.5 yrs ago, tried light table, emacs 24, atom, vs code, night code and ended up using cursive, but i would like to keep an eye on the alternatives...#2017-02-1023:57richiardiandrea@onetom yes, I keep my branch super up to date and don't follow emacs-live too much anymore apart from merging upstream every now and then#2017-02-1023:57richiardiandreahttps://github.com/overtone/emacs-live/network#2017-02-1023:58onetomwe just had a poll at the clojure remote 2017 conference yesterday and emacs was still the number one editor#2017-02-1023:59arrdememacs was also like a 50% mindshare in the “state of clojure” survey iirc#2017-02-1023:59richiardiandrea@onetom just to show you some magic, today I was working on this, I hope it is pretty readable):
(defun cider--eval-bindings (bindings)
"Sends a (def bound-name expr) form to the cider repl for each
binding in bindings."
(let ((bound-name (pop bindings))
(init-expr (pop bindings)))
(when bound-name
(let ((form (concat "(def " bound-name " " init-expr ")")))
(set-buffer (cider--get-repl-buffer))
(insert form)
(cider-repl-return)
(cider--eval-bindings bindings)))))
#2017-02-1023:59richiardiandreait deffes all the let bindings#2017-02-1100:00richiardiandreavery experimental but these are the things you can achieve in emacs thanks to code you can find in cider clojure-mode or clj-refactor#2017-02-1100:01onetomactually i was envying the capabilities of clj-refactor and the clj formatter libraries.
it's a pity u cant rely on these when using intellij...#2017-02-1100:06richiardiandreayes they are fundamentally two ways of thinking about editors#2017-02-1100:34dpsuttoni know just about nothing about recognizing security certs#2017-02-1100:35dpsuttonbut i would accept that#2017-02-1100:35dpsuttonmelpa is fine#2017-02-1100:35onetomi was just wondering if it's expected or there is something im missing#2017-02-1100:35dpsuttoni've never seen it before#2017-02-1100:35dpsuttondoesn't pop up fo rme#2017-02-1100:35onetombecause it feels like this can't be the default...#2017-02-1100:35dpsuttonpossible the NSA is investigating you?#2017-02-1100:35tanzoniteblack@onetom what's the emacs version?#2017-02-1100:35dpsutton^ more likely#2017-02-1100:36tanzoniteblackM-x emacs-version will give you that from within emacs, in case you weren't aware of that#2017-02-1100:37dpsuttoni was just kidding about the NSA, of course#2017-02-1100:38dpsuttonbut is it possible you're on a network or you have yourself accepted or rejected the certificate issuing authorities?#2017-02-1100:38dpsuttoni think i've heard you can add and remove those yourself#2017-02-1100:38dpsuttonit sounds like you don't recognize the authority of let's encrypt#2017-02-1100:40dpsutton> The gnutls-trustfiles variable is a list of trustfiles (certificates for the issuing authorities). This is global, not per host name (although gnutls-negotiate supports a trustfile per connection so it could be done if needed). The trustfiles can be in PEM or DER format and examples can be found in most Unix distributions. By default the following locations are tried in this order: /etc/ssl/certs/ca-certificates.crt for Debian, Ubuntu, Gentoo and Arch Linux; /etc/pki/tls/certs/ca-bundle.crt for Fedora and RHEL; /etc/ssl/ca-bundle.pem for Suse; /usr/ssl/certs/ca-bundle.crt for Cygwin; /usr/local/share/certs/ca-root-nss.crt for FreeBSD. You can easily customize gnutls-trustfiles to be something else, but let us know if you do, so we can make the change to benefit the other users of that platform.#2017-02-1100:45onetom@tanzoniteblack 25.1.1#2017-02-1100:47dpsuttonbut you can accept that key and continue on, correct?#2017-02-1100:47dpsuttonor do you want to diagnose this more fully before doing anything else?#2017-02-1100:47onetomim on regular macOS installations. browsers didnt complain about anything, though i cant remember any letsencrypt protected site now to doublecheck#2017-02-1100:48onetomit just feels abnormal#2017-02-1100:48onetomand if i were to recommend this setup to friends they would have the same questions and i wouldnt know what to answer#2017-02-1100:49dpsuttonhttps://lists.gnu.org/archive/html/bug-gnu-emacs/2016-09/msg00272.html#2017-02-1100:49dpsuttonseems relevant.
I guess OS X uses some system keychain for SSL certs that is opaque to Emacs.
Perhaps it should learn to understand it, if that's even possible.
There's a suggested workaround related to libressl there.#2017-02-1100:50dpsuttonhttp://emacs.stackexchange.com/questions/18045/how-can-i-retrieve-an-https-url-on-mac-os-x-without-warnings-about-an-untrusted#2017-02-1100:50dpsuttonthat's exactly your issue#2017-02-1100:50dpsuttonand i think they are saying that os x is being a little secretive with its accepted certs#2017-02-1100:51dpsuttonso that emacs can't see if the os uses them#2017-02-1100:51dpsuttonbut there's a way to access it#2017-02-1100:51onetomthanks#2017-02-1100:51onetommy googling havent yielded this result...#2017-02-1100:52dpsuttoni googled "emacs and let's encrypt"#2017-02-1100:52dpsuttonfirst result was a gnu bug report about this#2017-02-1100:52dpsuttoni'm not good but google is outstanding 🙂#2017-02-1100:58onetomi just googled for emacs letsencrypt ...#2017-02-1109:40sylvainI have the vague recollection of running into the same issue some time ago. I think I just switched to accessing MELPA via http instead of https#2017-02-1109:41sylvain(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
;; ("tromey" . "http://tromey.com/elpa/")
("melpa" . "http://melpa.milkbox.net/packages/")
("melpa-stable" . "http://stable.melpa.org/packages/")
("org" . "http://orgmode.org/elpa/")))#2017-02-1111:56donavanHi, sorry for the newb question but does cider/nrepl get the same log messages as lein repl does?#2017-02-1114:44bhagany@donavan if I understand you correctly, the answer depends on what version of cider you're using. A bug was recently fixed that caused messages logged to stdout or stderr to get put in the server process buffer instead of the repl buffer.#2017-02-1114:44bhaganyso, if that's the behavior you want, you'll want to use 0.15.0-SNAPSHOT#2017-02-1114:45bhaganywhere "that behavior" means - log messages going to the repl buffer#2017-02-1114:45donavanby server process buffer you mean the nrepl-messages {ID} buffer?#2017-02-1114:46donavanYeah, my verison is 0.14#2017-02-1114:46bhaganyhmm, my installation names it *nrepl-server {ID}*, but I'm not sure if that's configurable#2017-02-1114:47donavanit contains messages like:
(<--
id "237"
session "881875ca-f549-4d02-8778-f15514c7e38c"
status ("done")
)
#2017-02-1114:48bhaganyah, yes, so logging stuff would show up there, I think, but it would be within those message blocks#2017-02-1114:48donavanMaybe this is all academic till I use v0.15... I'm currently using lein repl and cider-connect#2017-02-1114:48bhaganyah, yes, that changes thigns#2017-02-1114:48donavanthanks for the tip about he bug#2017-02-1114:49bhaganyin the cider-connect case, your log messages will end up in your lein repl#2017-02-1114:49donavanYeah, I'm using it as a workaround#2017-02-1114:49donavanThe original quiestion refered to the cider-jack-in case#2017-02-1114:49bhaganyokay, I see. 0.15.0-SNAPSHOT should do what you want then, if you'd rather be jacking in#2017-02-1114:50donavanHaving used lein repl and cider-connect I'm now thinking it's better to split your repl (emacs) and just have logs in terminal... though it stumped me for a while! Thanks again for the help#2017-02-1114:51bhaganysure, no problem#2017-02-1423:13darnokI have a problem with "WARNING: CIDER's version (0.14.0) does not match cider-nrepl's version (nil). Things will break!”. I tried sending (nrepl-send-sync-request '("op" "describe") (current-buffer)) and it doesn’t return aux dictionary. I have leiningen 2.7.1 and I use cider-stable. I’ve tried 0.15.0-SNAPSHOT version but it doesn’t work as well. What can be wrong? I’ve tried with deleting .emacs.d/elpa.#2017-02-1506:42benedek@darnok anything cider related in your ~/.leiningen/profiles.clj? if so remove it and try again#2017-02-1507:32darnokI don’t even have profiles.clj 🙂.#2017-02-1507:56benedekhaha ok, i should have asked first if you use cider-jack-in or cider-connect?#2017-02-1508:17darnokI use cider-jack-in (C-c M-j).#2017-02-1508:18darnokThis is how cider calls leiningen:
/usr/local/bin/lein update-in :dependencies conj [acyclic/squiggly-clojure "0.1.7"] -- update-in :dependencies conj [org.clojure/tools.nrepl "0.2.12" :exclusions [org.clojure/clojure]] -- update-in :plugins conj [refactor-nrepl "2.3.0-SNAPSHOT"] -- update-in :plugins conj [cider/cider-nrepl "0.15.0-SNAPSHOT"] -- repl :headless#2017-02-1508:18darnokI took it from ps ax.#2017-02-1508:19darnokI switched to cider-0.15.0-SNAPSHOT, that’s why there is [cider/cider-nrepl “0.15.0-SNAPSHOT”] in the command.#2017-02-1508:39kurt-o-sysinjecting cider middleware using boot... Well, I used to have a profile.boot file that looked like:
(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
concat '[[cider/cider-nrepl "0.13.0"]])
(swap! boot.repl/*default-middleware*
conj 'cider.nrepl/cider-middleware))
Following the instructions https://github.com/clojure-emacs/cider-nrepl#via-boot , this should work as well:
(set-env! :dependencies '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.14.0"]])
(require '[cider.tasks :refer [add-middleware]])
(task-options! add-middleware {:middleware '[cider.nrepl.middleware.apropos/wrap-apropos
cider.nrepl.middleware.version/wrap-version]})
Well, it doesn't 🙂. This is the result if I want to start my application with the latter profile.boot:
$ boot run
Retrieving cider-nrepl-0.14.0.pom from
Retrieving cider-nrepl-0.14.0.jar from (331k)
clojure.lang.ExceptionInfo: Could not locate cider/tasks__init.class or cider/tasks.clj on classpath.
data: {:file "/tmp/boot.user4842850808872874474.clj", :line 7}
java.io.FileNotFoundException: Could not locate cider/tasks__init.class or cider/tasks.clj on classpath.
...
Where did I go wrong?#2017-02-1510:02benedek@darnok looks right to me 😕 can you try removing flycheck-clojure?!#2017-02-1510:03darnokok#2017-02-1510:08darnok@benedek wow. it’s ok now 🙂. how are they related?#2017-02-1510:08darnokoh, ok. I know now. it’s because of squiggly.#2017-02-1510:09darnokshould I report it as a bug to squiggly?#2017-02-1510:43benedek@darnok report to squiggly: yes, pls. is just a guess but there could be some kind of dependency clash… both cider-nrepl and refactor-nrepl use source inlining to avoid dependency clashes but it seems that squiggly does not...#2017-02-1510:43benedekjust a guess really tho...#2017-02-1510:47darnokok, I’ll create a ticket. what is source inlining?#2017-02-1510:48benedekhttps://github.com/benedekfazekas/mranderson#2017-02-1510:50benedekbasically prefixing all the dependencies recursively so you can use multiple versions of the same thing. and your deps won’t interfere with other dependencies.. kinda important for leiningen plugins as they can easily clash with the project dependencies...#2017-02-1510:50benedekhope that makes sense...#2017-02-1510:55darnokyes. thanks 🙂.#2017-02-1515:10richiardiandrea@kurt-o-sys the patch for add-middleware is available only in 0.15.0-SNAPSHOT#2017-02-1515:10kurt-o-sys@richiardiandrea oh... ok, thanks!#2017-02-1516:21featalionhi all. I have a problem with buffer loading / evaluation and multimethods. For example, I have
(defmulti my-multi (fn [switcher _] switcher))
(defmethod my-multi :first
[_ arg1]
(do-something-first arg1))
(defmethod my-multy :second
[_ arg1]
(do-something-second arg1))
I update it to
(defmulti my-multi (fn [switcher _ _] switcher))
(defmethod my-multi :first
[_ arg1 arg2]
(do-something-first arg1 arg2))
(defmethod my-multy :second
[_ arg1 arg2]
(do-something-second arg1 arg2))
then I load / eval buffer with C-c C-k (`cider-load-buffer`), or with cider-eval-buffer. But when method is called, I get clojure.lang.ArityException. The code lays in one file (and namespace), but is called from another. I tried to load / evaluate both buffers, but it doesn't help. Also, code is called from core.async if it matters.#2017-02-1516:23featalionit is pretty uncomfortable to restart Clojure REPL each time I change arity of multimethod...#2017-02-1516:24dpsuttonask in the clojure channel#2017-02-1516:25dpsuttoni think this is just one of the pain points of multimethods but i'm not positive#2017-02-1516:25featalionok, I will ask#2017-02-1516:26residentsummerhad the same experience with mmetods long ago - I believe it’s how they are implemented in clojure#2017-02-1516:27featalion) :#2017-02-1517:07austinbirchHi all,
Does anybody know if an equivalent to this is expected to work in cider when using company-mode? I can only get completions for the rest of the path (e.g. java.io.FileN offers -> java.io.FileNotFoundException completion, but FileN results in no candidates)
http://bytopia.org/2015/03/06/smart-classname-completion-for/#2017-02-1606:51sooheonaustinbirch AFAIK company does not support completing from the middle of candidates.#2017-02-1606:55sooheonActually scratch that, this discussion may help: https://github.com/company-mode/company-mode/issues/296 the relevant part being customizing completion-styles#2017-02-1606:56sooheonthe substring style seems to be what you’re looking for#2017-02-1607:48qqqwhen using eamcs+boot, do I want to use cider + cider-nrepl 0.15.0-snapshot or 0.14.0 ?#2017-02-1608:13residentsummer@qqq my cider injects required deps on cider-jack-in (not on cider-connect, though). so to be sure you can inspect deps in cider’s repl#2017-02-1608:20qqqI don't understand what that means#2017-02-1608:21qqqeither way, I got cider working, though refactor-nrepl now gives me:
no clojure project detected. The refacotr-nrepl middleware won't work and has been disabled
#2017-02-1609:09austinbirchsooheon thanks for the pointer. Reading related links got me back here: https://github.com/clojure-emacs/cider/blob/master/doc/code_completion.md#fuzzy-candidate-matching, which seems to be getting me what I wanted.#2017-02-1609:12austinbirchAnd for extra context: I’m happy with the non-fuzzy matching normally, but fuzzy matching is really helpful when adding imports for Java-interop code.#2017-02-1609:20sooheonaustinbirch Great, that resource is a really good explanation of company mode in general. I'm curious though it doesn't quite have the use case you asked for, which is matching from an internal substring, no? It seems the very first letter needs to match still#2017-02-1609:20austinbirchI thought that too, but tried it and it seems to be working!#2017-02-1609:20austinbirchI’ll try in a fresh REPL session a bit later, in case there’s something weird going on. I’ll report back here if it stops working.#2017-02-1609:31austinbirchJust restarted REPL & emacs to test: Not entirely sure what’s going on now. It seems like it might be treating the import case differently (which is all I care about – I don’t really want fuzzy matching elsewhere).#2017-02-1609:32qqqokay, got that working 🙂#2017-02-1610:52Ben Haltonhi so we have recently split one large cljs app into multiple builds, and this all seems to work pretty well apart from one thing.#2017-02-1610:52Ben HaltonIn my cljs repl I can play with namespaces in the default build but not others (so far so good)#2017-02-1610:52Ben HaltonThen I want to play with namespaces in another build so I do#2017-02-1610:52Ben Halton(switch-to-build :build2)
Figwheel: Stopped watching build - build1
Figwheel: Watching build - build2
Compiling "resources/public/js/build2.js" from ["src/cljs"]...
Successfully compiled "resources/public/js/cms.js" in 3.759 seconds
#2017-02-1610:53Ben Haltonso that seems to have worked - but I am still only able to see namespaces in build1 in my repl.#2017-02-1610:53Ben Haltonwhat am I missing?#2017-02-1702:54renewdoitBug report : from clojurescript 1.9.456 onward, the destructure of map malfunctioned just in cider REPL, like this:
(let [{a :a} {:a 3}] a in REPL, it returns nil
in 1.9.229 it works as expected#2017-02-1707:50hansHi! I keep seeing
error in process filter: [nREPL] Direct connection failed
when using M-x cider-jack-in. I've always had this problem, but most of the times it just went away when I try to jack in once more. On the machine I'm working on now, though, it takes many attempts until I get a repl running. It seems that there is a lingering bug somewhere deep down, what can I do to help tracking it down?#2017-02-1709:30rmuslimovQ: I have both repls in project (CLJ and CLJS). Where is the setting which will force using CLJS repl for .cljc files? Or it is not configurable now?#2017-02-1709:45rmuslimovOk hacking cider internals helped.
+++ (setq cider-use-clj-repl-for-cljs nil)
(defun cider-connection-type-for-buffer ()
"Return the matching connection type (clj or cljs) for the current buffer.”
(cond
+++ ((derived-mode-p 'clojurec-mode) (if cider-use-clj-repl-for-cljs "clj" “cljs”))
((derived-mode-p 'clojurescript-mode) “cljs”)
((derived-mode-p 'clojure-mode) “clj”)
(cider-repl-type)
(t "clj")))
If anyone know better way to same thing, please share#2017-02-1711:51pesterhazy@hans, much better to open the repl in a separate terminal window, then cider-connect#2017-02-1711:51pesterhazythen you see all the problems pop up in the terminal window#2017-02-1711:52pesterhazyplus it's always a good idea to check the *cider nrep... buffer#2017-02-1713:53hans@pesterhazy I like to see problems pop up in the *cider-nrepl* buffer, and I like to work from within emacs rather than having a separate terminal window open.#2017-02-1713:53hans@pesterhazy Like, I would like to help fixing this bug rather than changing how I work to work around it.#2017-02-1714:19pesterhazyand that's a good idea. To debug, I would run the repl in a separate terminal window and see if that works 🙂#2017-02-1714:52hansthat works.#2017-02-1714:53pesterhazyand you can connect from cider?#2017-02-1714:54hansyes.#2017-02-1714:55pesterhazyok so in all probability there's a difference between the way cider starts lein/boot and the way you start it manually#2017-02-1714:55pesterhazyor maybe it just takes too long and cider gives up?#2017-02-1714:55hansThere are no error messages in the nrepl buffer. And if I repeat the attempt often enough, it succeeds. It has been a problem for years, really.#2017-02-1714:57pesterhazyif you suspect something is wrong with your cider, you could try deleting all cider related packages from ~/.emacs.d/elpa and restart#2017-02-1714:57hansIt has been a problem on all kinds of different systems.#2017-02-1714:57pesterhazyit could also be about the cider middleware used#2017-02-1714:58pesterhazyperhaps related to your lein profile#2017-02-1715:02hansRight. What I would really like is advice how I can find out what actually happens.#2017-02-1801:16arrdem@hans: So before the timeout occurs C-g and check *nrepl-server <whatever>*, paste that here#2017-02-1801:17arrdemI was seeing a (potentially similar) failure to connect last night#2017-02-1805:02hans@arrdem the nrepl-server buffer contains nothing but nREPL server started on port 45287 on host 127.0.0.1 - #2017-02-1811:49qqqis cider and dirac incompatible? cider wants its middleware; dirac seemsto want NO OTHER middleware#2017-02-1821:35andrea.crottiis restarting cider when used with figwheel and clojurescript supposed to work out of the box with cider-restart ?#2017-02-1821:36andrea.crottiI mean I do a cider-jack-in-clojurescript, then I update the dependencies and want to get it updated, so I do cider-restart but it restarts only the JVM repl#2017-02-1821:36andrea.crottinot the clojurescript one#2017-02-1821:36andrea.crottior there is another magic solution?#2017-02-1821:38andrea.crottialso there is no integration for running clojurescript tests with lein doo phantomjs right?#2017-02-1821:38andrea.crottiI can probably do something easily anyway to just have the running process in Emacs, but I was wondering if there was already#2017-02-1821:55richiardiandrea@andrea.crotti no, the restart only takes care of namespace/vars reloading. If you want to add deps dynamically you need to use something specific for classloader hotload. Also another thing you can check if you use boot is https://github.com/danielsz/system#2017-02-1821:56richiardiandreaIt tries to reload namespaces when necessary as well as restart the repl when you need to.#2017-02-1821:57richiardiandreaAlso, hotload dependencies in boot is only a call to boot.aether/add-dependency if I recall correctly#2017-02-1822:00dpsuttonrestart should restart all repls. unfortunately, cljs repls are started by a callback and this callback isn't maintained. so restart doesn't know to call that clojurescript invocation#2017-02-1822:07andrea.crottiAh ok makes sense #2017-02-1822:08andrea.crottiBut it could just kill all the Clojurescript repls easily I think #2017-02-1822:08andrea.crottiEven just by killing buffers that match a regexp#2017-02-1822:09andrea.crottiI can't really use a Clojurescript repl after I change dependencies and restarted anyway right? #2017-02-1822:10andrea.crottiJust a bit of elisp that kills everything and does the jack in again might do the trick already #2017-02-1822:11andrea.crottiBut if a new dependency added is only used by Clojure and not Clojurescript then I don't have to restart the Clojurescript repl right? #2017-02-1822:14dpsuttonyeah. to get deps in you need to crank it up again anew#2017-02-1822:15dpsuttonalthough possibly clojure refactor can handle this#2017-02-1822:15dpsuttoni think your last statement is correct#2017-02-1822:15dpsuttonif its not a new dep for cljs#2017-02-1822:15dpsuttonan easy way to kill things is C-c C-q#2017-02-1822:16dpsuttonwhich is cider-quit and then cider-jack-in again#2017-02-2121:10dottedmagIs there a way to kill the beginning of cider-repl buffer? I accidentally printed a huge string and now my REPL is unusably slow.#2017-02-2121:11hansC-c M-o#2017-02-2121:13dottedmagcider-repl-switch-to-other?#2017-02-2121:14dottedmagAh, manually killing the huge line helped 🙂#2017-02-2121:21dpsutton,clear#2017-02-2121:21dpsutton,clear#2017-02-2121:21dpsuttonthere are some functions that are specified with a leading comma#2017-02-2121:21dpsuttonand you should have autocomplete on them#2017-02-2121:39dottedmagThanks#2017-02-2317:42practicalli-johnWhats the command / keybinding for printing the result of an expression as a comment after the expression you are evaluating?
I use to do this all the time, but I have gone blank on the name & binding... cant find this in the docs...#2017-02-2317:44dpsuttoncider-eval-defun-to-comment i believe#2017-02-2317:44dpsuttonit says defun but it seems to really just mean top level#2017-02-2413:40practicalli-john@dpsutton ah, that was the one C-c M-;#2017-02-2413:40dpsutton👍#2017-02-2417:14pandeiroone of the problems I often have when doing interop with a java lib for the first time is that documentation for the lib will often not fully qualify the classes used in example snippets. Is there anything built-in to Cider that would help me discover where these classes live so I can properly import them?#2017-02-2510:58hansI found the issue: The nrepl server is not listening on ipv6's localhost address ::1, but cider seems to connect to localhost which may or may not default to ipv6 depending on how the system resolves host names. I am on Linux and by commenting out the ipv6 localhost entry in /etc/hosts, I could get cider-jack-in to work.#2017-02-2607:58bozhidar@hans that's quite curious, you might want to file a ticket about it#2017-02-2608:39bozhidarseems to me we could have made the problem easier to spot if the message included some details about the connection endpoint#2017-02-2610:06hans@bozhidar Done: https://github.com/clojure-emacs/cider/issues/1945#2017-02-2613:26pesterhazy@bozhidar or just use 127.0.0.1?#2017-02-2615:02hans@pesterhazy that'll break systems which don't have ipv4#2017-02-2615:03pesterhazyis that a practical possibility?#2017-02-2615:03pesterhazyI've never heard of such a desktop system#2017-02-2615:04hansi'm not using any linux desktop systems at all, and i've seen servers without ipv4 in the real world.#2017-02-2615:04hansi'm not saying that using 127.0.0.1 is not a practical solution, but it is not a good solution in the longer run.#2017-02-2615:05pesterhazythe proper solution seems for the nREPL server to listen to ::1 as well as 127.0.0.1#2017-02-2615:07hansi agree. it should try to listen to both, if supported by the system#2017-02-2615:08pesterhazyalso cider could use localhost but prefer ipv4 if available#2017-02-2615:53andrea.crottiwhen I do do a cider-jack-in-clojurescript and I have two repls#2017-02-2615:54andrea.crottiwith C-c C-z I always switch to the clojurescript one#2017-02-2615:54andrea.crottino way to switch to the clojure repl?#2017-02-2615:54andrea.crottiI mean I can just switch buffer of course#2017-02-2616:41richiardiandrea@andrea.crotti iirc it chooses based on the mode, so cljs to cljs repl. Some var controls the behavior of cljc files, but I can't recall which one.#2017-02-2616:41andrea.crottiah yes you're right actually @richiardiandrea#2017-02-2616:42andrea.crottiok fair enough then makes sense#2017-02-2713:07bozhidar@hans @pesterhazy I’ll see what we can do to improve the situation in CIDER, but it seems to me that nREPL will need to be patched as well#2017-02-2713:08bozhidarit listens on localhost, but it probably doesn’t play with IPv6 for some reason#2017-02-2713:08bozhidarhaven’t looked in the code closely, but I assume the fix would be simple enough#2017-02-2716:23plexusI seemed to have really messed up my setup this time... does this sound familiar to anyone? When I cider-jack-in, a prompt pops up in the minibuffer saying Lisp expression:#2017-02-2716:24plexuswhen I enter something there (say (+ 1 1)) I get this:#2017-02-2716:25plexusDebugger entered--Lisp error: (error "Not an nREPL dict object: (+ 1 1)")
signal(error ("Not an nREPL dict object: (+ 1 1)"))
error("Not an nREPL dict object: %s" (+ 1 1))
nrepl-dict-get((+ 1 1) "interns")
cider-resolve-ns-symbols((+ 1 1))
cider-refresh-dynamic-font-lock((+ 1 1))
cider-set-buffer-ns((+ 1 1))
cider-repl-set-initial-ns(#<buffer *cider-repl App*>)
cider-repl-init(#<buffer *cider-repl App*>)
cider--connected-handler()
run-hooks(nrepl-connected-hook)
nrepl-start-client-process(nil 42389 #<process nrepl-server>)
nrepl-server-filter(#<process nrepl-server> "nREPL server started on port 42389 on host 127.0.0.1 - )
#2017-02-2716:25plexusThe *nrepl-server* buffer looks ok#2017-02-2716:25plexusWARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?
nREPL server started on port 42389 on host 127.0.0.1 -
#2017-02-2716:26plexusThe *cider-repl* buffer is empty, but when I press empty I get a prompt saying nil> 😂#2017-02-2716:29plexushmmm this seems relevant#2017-02-2716:29plexus(-->
op "eval"
code "(str *ns*)"
enlighten "true"
session "b72d41fa-6418-441f-bc52-cc8e7138c986"
id "4"
)
(<--
ex "class java.lang.Exception"
id "4"
root-ex "class java.lang.Exception"
session "b72d41fa-6418-441f-bc52-cc8e7138c986"
status ("eval-error")
)
(<--
err "Exception Debugger not initialized user/eval27659/fn--27660 (form-init2222324724219143458.clj:1)
"
id "4"
session "b72d41fa-6418-441f-bc52-cc8e7138c986"
)
#2017-02-2716:50jfntnugh I remember having that issue a while ago but can’t remember how it got resolved… what versions are you using?#2017-02-2716:53plexusVersion: 20170129.1941#2017-02-2716:54plexusI thought it was something with my project, but went back to an older commit that should be good and still getting this. same on a different project... cleaned out all generated files (git clean -xfd), nuked ~/.m2, rebooted emacs...#2017-02-2716:56jfntnThat’s a shot in the dark but did you try reinstalling the emacs packages?#2017-02-2716:56jfntnI’m using the same version btw#2017-02-2716:56plexusyeah that's the latest version on melpa, let me try reinstalling.#2017-02-2717:02plexusreinstall didn't help, I removed .emacs.desktop and that did the trick#2017-02-2717:03plexus(removed desktop file then restarted)#2017-02-2717:03plexusso I guess some emacs variables had gotten out of wack#2017-02-2717:03plexus@bozhidar I kept the desktop file, do you think it's worth it to investigate further?#2017-02-2718:24fentonis there a way to not have two repls start up with a cider-jack-in-clojurescript command. I don't want the clj repl only the cljs repl.#2017-02-2719:04dpsuttoni'm not sure what a desktop file is but i'm willing to take a look#2017-02-2719:04dpsutton@fenton not yet#2017-02-2719:04dpsuttonit's on my radar#2017-02-2719:04dpsuttoni hate that cljs is a callback to creation of clj#2017-02-2719:10dpsutton@plexus if you want to send me the desktop file i'll root around in it#2017-02-2719:15fenton@dpsutton ok cool thanks.#2017-02-2719:15plexus@dpsutton a desktop file is emacs way of storing and restoring state like open buffers between restarts#2017-02-2719:15dpsuttonif you don't mind sharing i'll root around#2017-02-2719:15plexuslooking through it it seems it had cider-enlighten-mode enabled in a bunch of buffers, that's the most likely culprit#2017-02-2719:16dpsuttonah ok#2017-02-2719:16dpsuttoni changed some of the signatures in that code pathway to take connections#2017-02-2719:16dpsuttonso i was wondering if we had an argument out of order somewhere#2017-02-2719:18plexusyup, enabling cider-enlighten-mode before doing cider-jack-in reproduces it#2017-02-2719:19plexusdo you need me to file a ticket or do you know enough?#2017-02-2719:19dpsuttonfor sure file a ticket#2017-02-2719:20dpsuttonbut i'll start chasing down that thread#2017-02-2719:24plexusuuuuggh copying code from Slack removes newlines 😞#2017-02-2719:34mikerodHas anyone tried to do any debugging of breakpoints in Java code that was invoked from Clojure in the REPL when using Emacs/Cider?#2017-02-2719:35mikerodI know Cider has a Clojure-centric (and nice) debugger, however, what about when you are interop’ing with Java libs and want to see what is going on there with a “traditional” style of Java debugging.#2017-02-2720:19hans@bozhidar https://github.com/clojure/tools.nrepl/pull/14#2017-02-2720:22pesterhazy@hans, I don't think contrib projects take PRs, as a rule#2017-02-2804:38hans@pesterhazy I keep forgetting that, because it is so inconvenient and unwelcoming. I've filed a JIRA issue instead.#2017-02-2820:48ccannis CIDER supposed to honor {:dev {:dependencies}} in project.clj?#2017-02-2820:49ccanni.e. when I load a namespace shouldn’t it pick up those deps?#2017-02-2820:51richiardiandrea@ccann it is not really cider's concern, it depends on lein#2017-02-2820:52ccannI guess I’m not clear on whether the :dev profile is active when I’m connected via jack-in from CIDER#2017-02-2820:56richiardiandrea@ccann not using lein myself, but the repl command should include :dev, a nice doc here: https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#2017-02-2821:01ccann@richiardiandrea thanks, appreciate it. I actually got it working with (setq cider-lein-parameters "with-profile +test repl :headless”)#2017-02-2821:03richiardiandrea^ awesome, glad that option works 😉#2017-02-2822:00ccannactually the real issue was my local profiles.clj was overwriting my :dev profile in project.clj… was under the impression these got merged.#2017-03-0215:55jooivindWhen stopping at a breakpoint during debugging#2017-03-0215:55jooivindis there any efficient way of grabbing a local value ?#2017-03-0215:56jooivindso i can play around with the value in the REPL?#2017-03-0216:02mgrbyteI usually hit "e" and type (pprint <val>), then copy into the repl#2017-03-0216:03mgrbytenot sure if that counts as efficient 😛#2017-03-0216:07dpsuttonalso, i think you can hit l to see the local values#2017-03-0216:07dpsuttonbut i'm not sure of an easy way to copy those values#2017-03-0216:07jooivindim experimenting using the trick @mgrbyte mentioned#2017-03-0216:07jooivinddoing (def x <value-im-interested-in)#2017-03-0216:07jooivindhowever it does it’s define in the clojure.core namespace#2017-03-0216:08jooivindIt works though, which is pretty neat#2017-03-0301:26tapI posted once on #spacemacs then figured there’s probably more people here.
Q: Is there a way to choose clojure version to start repl with when starting repl without project file?#2017-03-0308:34benedekthere is an option for that in cider i think#2017-03-0308:41benedekcider-jack-in-auto-inject-clojure defaults to nil.#2017-03-0308:42benedekcheck its documentation for all possible options but essentially you can set it to a specific clj version#2017-03-0718:07samedhiWhen I Ctrl-c-k (compile the whole namespace) in a clojurescript ns I see the following failing (404) GET show up in my browser:#2017-03-0718:07samedhi#2017-03-0718:07samedhiLooking in my target directory (which is what I understand it is reading from), I think it should be reading from:#2017-03-0718:07samedhi#2017-03-0718:08samedhiAny idea why I have a extra /out/ in there?#2017-03-0804:19samedhiShould have mentioned, this is the task I am running to M-x cider-connect to my repl, which I then call (start-repl) from:#2017-03-0804:20samedhi(task-options!
cljs {:compiler-options {:language-in :ecmascript5-strict}}
test-cljs {:js-env :slimer}
reload {:port 7800}
repl {:port 6800, :bind "0.0.0.0"})
(deftask development
"Launch Immediate Feedback Development Environment"
[]
(comp
(serve)
(watch)
(reload)
(cljs-repl) ;; order is important!
(cljs)
(target)))#2017-03-0808:44Yehonathan SharvitHi there#2017-03-0808:44Yehonathan SharvitCider really rocks!!!#2017-03-0808:44Yehonathan SharvitIs there a way to reload cider after updating project.clj?#2017-03-0809:20benedeknot sure what you mean exactly but if you use clj-refactor you can load a new dependency into an existing repl#2017-03-0809:20benedekso you don’t need to restart#2017-03-0809:21benedekhttps://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency#2017-03-0809:24chrisblomdoes cider (or clj-refactor) have a command to refactor fully qualified symbols to a require entry in the ns + an aliased symbol?#2017-03-2813:53bfayThanks for taking a look.
That’s a good point, if those are invalid characters it probably isn’t a very high priority.
I created https://github.com/clojure-emacs/cider/issues/1971#2017-03-2715:21bfayBut that isn’t happening in lein repl or using swank#2017-03-2909:29dominicmIs it possible to launch boot in a "one-off specify the tasks" way?#2017-03-2909:30dominicmOn a training course it's easier to say "Use m-x cider-launch-boot then type 'dev'" than: Go customize vars, tweak this var, then change it back later.#2017-03-2915:54richiardiandrea@dominicm if I understand correctly you can use .dir-locals.el for changing the jack in command#2017-03-2915:55richiardiandrea(or any var)#2017-03-2915:55dominicm@richiardiandrea Do you use one of those Lambda-X? 😄#2017-03-2915:56dominicm(or your boot thing)#2017-03-2915:56richiardiandreaWell, I left lambdax long time ago but yes the boot workflow has not changed, I do not commit it to vcs though #2017-03-2915:57dominicmhttps://github.com/Lambda-X/lambone lambone!#2017-03-2915:57dominicmOh okay. I'm not an emacs/CIDER user, so I have no idea what the .dir-locals.el looks like, so I'm trying to cheat here 😉#2017-03-2915:57richiardiandreaAh ah yes that is still working, ju;St maybe the deps need bumping 😀#2017-03-2915:58dominicmWe used edge for training yesterday. Biggest barrier was the fact cider launches repl -s wait by default#2017-03-2915:58richiardiandreaOh ok yeah I remember you were a vim user 😀 the enemy of some sort lol#2017-03-2915:59richiardiandreaYes so lemme get to work and I will post an example#2017-03-2915:59dominicmThanks, there's no rush. So don't put yourself out.#2017-03-2915:59dominicmBut it would be a HUGE help to me!#2017-03-2916:01dominicmI might try my hand at emacs soon, but I don't see myself actually switching long term, just learning enough to support others.#2017-03-2916:02richiardiandreaOk then I will get a Coffee first 😀#2017-03-2916:05richiardiandreaI 'd suggest also looking at inf-clojure #2017-03-2918:04richiardiandrea@dominicm this what I do in my .dir-locals.el
((nil . ((cider-boot-parameters . "dev")
(eval . (add-hook 'clojure-mode-hook #'cider-mode)))))
#2017-03-2918:05richiardiandreabut you don't need the second line#2017-03-2918:09dominicm@richiardiandrea that's brilliant, thank you!#2017-03-2918:10richiardiandreaalso https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#2017-03-3001:42ccannhi! is there a test output diff-ing feature in the works for CIDER? since pjstadig/humane-test-output no longer works#2017-03-3001:42ccannexpected vs actual doesn’t help much when I have complex maps being compared#2017-03-3021:46vaedasynapseI'm trying to get set up using cider for both clj and cljs development on an om-project that was shared with me https://github.com/thos37/om-tutorial .
I was under the impression that doing cider-clojurescript-jack-in would give me two buffers for both clj and cljs repls. But whenever I do it it always just gives me a single one with just a clj buffer. From there I can run the (start-repl) and get to a browser connected cljs repl that works, but whenever I try to get one for each I get a stack trace saying that the address is already in use.
I have my cider-boot-parameter as 'dev' and I have my cider-cljs-boot-repl set to weasel.
I've banged my head on this too long so I thought I'd throw it out there and see if I could get some help so I can have both repl buffers set up and get back to learning a cider workflow in a cider, boot & om project.
Any help or pointers would be greatly appreciated.#2017-03-3021:55dpsutton@vaedasynapse are you sure that you are performing cider-jack-in-clojurescript? I've always seen it give two repls#2017-03-3022:07vaedasynapseJust ran it again to be sure.#2017-03-3022:07vaedasynapseStill just the one.#2017-03-3022:07xiongtxCheck your buffers list#2017-03-3022:08xiongtxIs there a cljs REPL buffer?#2017-03-3022:08dpsuttonthere's the one but not the cljs buffer which was the original complaint#2017-03-3022:10dpsutton@vaedasynapse you didn't follow the brave clojure setup by any chance did you?#2017-03-3022:11vaedasynapseYes. I did. Is that the source of self-sabotage?#2017-03-3022:14vaedasynapseI guess I should clarify. I tried grabbing many of the packages from the brave clojure set up via my nix emacs config file and then pulled in the additional config from that setup.#2017-03-3022:15vaedasynapseBut I think the end effect is likely the same, or very close.#2017-03-3022:15xiongtx@U0G75ARHC You know anything about this?#2017-03-3022:16vaedasynapseI haven't gone all the way through the book, however. I was more using it for a reference to get myself closer to having a working cider/emacs dev environment#2017-03-3022:19dpsuttondid you clone the repo that they use?#2017-03-3022:20dpsuttonwhich has a compiled version of cider 0.8.2 (from 2014) and tells you to use a lein profiles file?#2017-03-3022:20dpsuttonthat old version of cider may predate cljs support for all i know#2017-03-3022:21dpsuttonbut delete the lein profiles file (or at least remove the hardcoded dependency on 0.8.2) and then delete the cider folders from your ~/.emacs.d/elpa directory#2017-03-3022:21dpsuttonhopefully reinstalling makes it work#2017-03-3023:02vaedasynapseThanks. Will try.#2017-03-3100:52vaedasynapseI don't think that was it. I didn't out and out clone their repo, just grabbed some of it. Additionally when I query my cider version it's coming up as "CIDER 0.15.0snapshot" and I have non cider folders in the elpa directory.#2017-03-3100:53vaedasynapseI tried commenting out the cider specific code I found in the brave clojure emacs configuration files. But that hasn't had any effect.#2017-03-3110:20jumaris there a way to navigate to java source code for classes in clojure.lang, e.g. clojure.lang.PersistentVector? I tried cider-find-var but it gives me "no source location"
Note: I'm using spacemacs and I've already installed eclim as mentioned here: https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/java#eclim#2017-03-3110:37benedekM-. should just work#2017-03-3110:38benedekno idea what that is in spacemacs tho#2017-03-3111:34jumarthe thing is that it works for Java classes like java.util.List but not for "Clojure java classes" like clojure.lang.PersistentVector#2017-03-3115:55cpmcdanielwas there a tremendous increase in the memory footprint of cider-nrepl between 0.10 and 0.15?#2017-03-3115:56cpmcdanielI used to be able to cider-jack-in my project with 128M max heap. Not anymore.#2017-03-3116:01dpsutton@cpmcdaniel this is on the same project that has no changes? ie project under 0.10 is fine and under 0.15 can't start up with no changes?#2017-03-3116:02cpmcdanielyeah, other folks on my project are running an older version of cider without OOMs#2017-03-3116:09cpmcdanieler, at least one other… folk#2017-03-3116:09cpmcdanielbasically, the repl starts up, but once I eval a buffer or expression, it crashes and heap dumps#2017-03-3116:09dpsuttoni'm not sure. if you can hook up a profiler an issue with that info would be very helpful#2017-03-3116:10cpmcdanielI looked at the heapdump with some tools#2017-03-3116:10dpsuttonany indication?#2017-03-3116:11cpmcdanielnothing suspicious looking from our own namespaces, but lots (tons) of Var instances from threads with nrepl-refactor in the stack#2017-03-3116:11cpmcdanielthat was about the only thing I could glean from it#2017-03-3116:11dpsuttonah#2017-03-3116:11dpsuttonyou could raise an issue with nrepl-refactor#2017-03-3116:11dpsuttoni can totally see that growing in size as it grows in features#2017-03-3116:12pesterhazyYou could probably remove nrepl-refactor?#2017-03-3116:34cpmcdaniel@pesterhazy was that directed at me?#2017-03-3116:34cpmcdanielcider now adds the deps inline, correct?#2017-03-3116:34cpmcdanielwith jack-in, anyway#2017-03-3116:35cpmcdaniel(using the clojure layer in spacemacs, fyi)#2017-03-3116:36pesterhazyah. What I do is to start the repl in a terminal and then use cider-connect#2017-03-3116:37pesterhazygives me more of a feeling of control#2017-03-3116:39cpmcdanielyeah, but then don’t you have to put the cider-nrepl plugin version in your lein profile?#2017-03-3116:39cpmcdanielotherwise you don’t get the full functionality of cider#2017-03-3116:40pesterhazyright it's there, but not the refactor one#2017-03-3116:41pesterhazybtw, perhaps someday soon unrepl may offer a lighter weight repl connection#2017-03-3116:41cpmcdanielso cider-jack-in avoids the profile setup by injecting deps right on the lein cli#2017-03-3116:42cpmcdanielwhich I really like#2017-03-3116:42pesterhazyright, that's neat#2017-03-3116:42cpmcdanielmakes it easy to keep the versions in sync when I update cider#2017-03-3116:42pesterhazyunrepl will do that too#2017-03-3116:43pesterhazy"inject" all it needs into the jvm process#2017-03-3116:45dpsuttoni think this actually happens in clj refactor#2017-03-3116:45dpsutton(defun cljr--inject-jack-in-dependencies ()
"Inject the REPL dependencies of clj-refactor at `cider-jack-in'.
If injecting the dependencies is not preferred set `cljr-inject-dependencies-at-jack-in' to nil."
(when (and cljr-inject-dependencies-at-jack-in
(boundp 'cider-jack-in-lein-plugins)
(boundp 'cider-jack-in-nrepl-middlewares))
(add-to-list 'cider-jack-in-lein-plugins `("refactor-nrepl" ,(cljr--version t)))
(add-to-list 'cider-jack-in-nrepl-middlewares "refactor-nrepl.middleware/wrap-refactor")))
#2017-03-3116:46dpsuttonie, i think if you just uninstall clj refactor it will prohibit clj refactor from injecting itself#2017-03-3116:46dpsuttonit seems like it just throws itself in there#2017-03-3116:48dpsuttonso in your dir-locals, maybe set cljr-inject-dep... to nil?#2017-03-3116:54cpmcdanielwell, this is how it actually launches lein...#2017-03-3116:55dpsuttoncorrect#2017-03-3116:56dpsutton;;;###autoload
(defun cljr--inject-jack-in-dependencies ()
"Inject the REPL dependencies of clj-refactor at `cider-jack-in'.
If injecting the dependencies is not preferred set `cljr-inject-dependencies-at-jack-in' to nil."
(when (and cljr-inject-dependencies-at-jack-in
(boundp 'cider-jack-in-lein-plugins)
(boundp 'cider-jack-in-nrepl-middlewares))
(add-to-list 'cider-jack-in-lein-plugins `("refactor-nrepl" ,(cljr--version t)))
(add-to-list 'cider-jack-in-nrepl-middlewares "refactor-nrepl.middleware/wrap-refactor")))
;;;###autoload
(eval-after-load 'cider
'(cljr--inject-jack-in-dependencies))
#2017-03-3116:56dpsuttonthis is from clj-refactor. This looks like if you uninstall it it won't inject itself#2017-03-3116:56dpsuttondoes that make sense?#2017-03-3116:57dpsuttonor, use a dir-locals file to set cljr-inject-dependencies-at-jack-in to nil to prevent this from executing the (add-to-list lein-plugins refactor-nrepl...#2017-03-3117:02dpsuttonand c-h v [ret] cider-jack-in-lein-plugins will show you the current value, which appears to be set by clj refactor#2017-03-3117:03dpsuttoncider-jack-in-lein-plugins is a variable defined in ‘cider.el’.
Its value is (("refactor-nrepl" "2.3.0-SNAPSHOT")
("cider/cider-nrepl" "0.15.0-SNAPSHOT"))
This variable may be risky if used as a file-local variable.
Documentation:
List of Leiningen plugins where elements are lists of artifact name and version.
hmm. ha. "This variable may be risky if used as a file-local variable" that's not good 🙂#2017-03-3117:17cpmcdanielanyone have general thoughts on nrepl-refactor? I can’t even say for sure if I’m using any of it’s features...#2017-03-3117:18dpsuttoni never think to use it, but i'm not full time in clojure. I'll bet that if i was i would use it. That being said, if it's causing problems and you don't use it, toss it#2017-03-3117:18dpsuttonbut you can put a dev profile in there to raise your jvm heap which won't affect production#2017-03-3117:19cpmcdanielwell, I bumped my heap to 256M, which is still reasonably small, and all is well#2017-03-3117:19dpsuttonsounds good#2017-03-3117:19cpmcdanielalso, confirmed another co-worker of mine ran into the same problem#2017-03-3117:19cpmcdanielwe were probably near the 128M ceiling before nrepl-refactor was a thing#2017-03-3117:20cpmcdanielor at least in the ~100M ballpark#2017-03-3117:23cpmcdaniellooks like nrepl-refactor does some useful things#2017-03-3117:23cpmcdanielI will keep it for now and try some of its features#2017-03-3117:23cpmcdaniellike cleaning up ns clauses#2017-04-0201:04qqqI'm using cider / emacs. I'm also using outline mode, which changes the following into 'headings'
;;; level1
;;;; level2
;;;;; level3
etc ...
problem is: emacs font locking show them as comments, rather than as headings; is there a way I can disable all comement font faces in cider ?#2017-04-0202:11mikebHello a new spacemacs/cider user here with a question. Is it possible to keep repl result overlays shown at the end of lines from disappearing immediately when moving cursor, or making changes to areas in other parts of the buffer?#2017-04-0203:46vaedasynapseStill having issues with this "I'm trying to get set up using cider for both clj and cljs development on an om-project that was shared with me https://github.com/thos37/om-tutorial .
I was under the impression that doing cider-clojurescript-jack-in would give me two buffers for both clj and cljs repls. But whenever I do it it always just gives me a single one with just a clj buffer. From there I can run the (start-repl) and get to a browser connected cljs repl that works, but whenever I try to get one for each I get a stack trace saying that the address is already in use.
I have my cider-boot-parameter as 'dev' and I have my cider-cljs-boot-repl set to weasel.
I've banged my head on this too long so I thought I'd throw it out there and see if I could get some help so I can have both repl buffers set up and get back to learning a cider workflow in a cider, boot & om project.
Any help or pointers would be greatly appreciated.""#2017-04-0303:54qqqcider-error buffer seems to be hiding some of my stack freames with a "..."#2017-04-0303:54qqqhow do I tell cider to show me all stack frames?#2017-04-0306:54benedek@cpmcdaniel @dpsutton bit late to the party but clj-refactor maintainer and the guy who implemented the injecting in cider here 😉#2017-04-0306:55benedekso injecting is implemented in cider but in a way that “plugins” can hook in to it as well and that is what clj-refactor does#2017-04-0306:55benedekand also some other plugins as well afaik#2017-04-0306:56benedekre. what nrepl-refactor does: it generates ASTs for your namespaces and supports those features with the AST that need such a thing#2017-04-0306:57benedekhave a look on the wiki https://github.com/clojure-emacs/clj-refactor.el/wiki these features needing the middleware are marked with *#2017-04-0307:00benedekhope that is a bit a clarification although things are a bit of a mess atm as some of the refactor features got migrated over directly to clojure mode. for these you don’t need a middleware. see details here: https://github.com/clojure-emacs/clojure-mode#refactoring-support#2017-04-0311:50dpsuttonthanks for the info, benedek!#2017-04-0313:20cpmcdanielalways cool to talk to the maintainer. Thanks for your contributions!#2017-04-0314:34benedekhope it makes sense ;)#2017-04-0318:16macrobartfastI'm not getting what seems like the right result using
C-c C-v v for cider-eval-sexp-at-point
for example, with my point on the 4 in (* 10 (+ 7 (- 4 6))) I get 4, not the expected -2
am I not understanding how this should work?#2017-04-0318:19dpsutton4 is a sexp#2017-04-0318:19dpsuttonput it at the close parens for (- 4 6)#2017-04-0318:20macrobartfastah, ok...#2017-04-0318:33macrobartfastis there any way to have cider eval the code within the nearest enclosing parens when the point is on anything within those parens, not at the end of it?#2017-04-0318:36macrobartfastrelatedly, I'm getting 'Wrong type argument: integer-or-marker-p, nil' when putting the point on the closing paren of (- 4 6) or on the position after it and invoking cider-eval-sexp-at-point; what am I doing wrong?#2017-04-0318:36macrobartfastC-c C-e works for (- 4 6) if I put the point on the position after that closing paren.#2017-04-0318:41macrobartfastthis looks like what I'm after more or less (currently seeing if it's in my version of cider):
https://github.com/clojure-emacs/cider/commit/26bb28226136145e41e2eed65d33ed2772b4c5a3?diff=split#diff-e39c33031dc8d3e78b32ebee83293cd6#2017-04-0318:43macrobartfasthowever, the title of that 'Add a command to evaluate the form around point', doesn't seem to be what the function does 'cider-eval-current-sexp' which you pointed out above is just to evaluate the 4 itself as a sexp.#2017-04-0318:46macrobartfastah, ok, the following discussion reveals it was not what was intended:
https://github.com/clojure-emacs/cider/commit/2207619121c8d8616cd262774ec276dca04c449a#comments#2017-04-0411:45dpsuttoninspect that variable exec-path. If your install of lein can be located here you've got a problem, but otherwise add it with (add-to-list exec-path "my/path\to\lein.bat")#2017-04-0417:02jjttjj@dpsutton yeah the directory was there but not the .bat file, but even after I added it I'm still getting the same error. Same with trying the previous two release versions of cider-nrepl#2017-04-0417:04dpsuttoncan you verify that c:\Users/justin/.lein/bin/lein.bat exists?#2017-04-0417:05jjttjjyes it's there and works from the emacs shell#2017-04-0417:07dpsuttoncan you M-x toggle-debug-on-error and then try again#2017-04-0417:07dpsuttonshould give a stack trace so we can investigate a little more#2017-04-0417:07dpsuttoni don't think this is related to a particular version of cider but is local to you#2017-04-0417:09jjttjjHmm doesn't seem to give much more info: Debugger entered--Lisp error: (error "Could not start nREPL server: The system cannot find the path specified.
")
signal(error ("Could not start nREPL server: The system cannot find the path specified.
\n"))
error("Could not start nREPL server: %s" "The system cannot find the path specified.
\n")
nrepl-server-sentinel(#<process nrepl-server> "exited abnormally with code 1\n")
#2017-04-0417:10dpsuttonlet me run to lunch and i'll look into this later.#2017-04-0417:11dpsuttoncan you run lein repl from the cmd line and verify that it starts up in this project?#2017-04-0417:11jjttjjthanks for the help in advanced! Yeah I've been doing lein repl and then cider-connect to get around this#2017-04-0417:12jjttjjso it's not incredibly high priority. I've mostly been using boot for a year which works fine with cider and have just done this workaround whenever working with lein, so it's not an incredibly high priority, just figured i'd get to the bottom of it#2017-04-0417:12dpsuttonwow. that's a long time to work around#2017-04-0417:13dpsuttonsorry about that#2017-04-0417:14dpsutton;; On Windows, a failed start sends the "finished" event. On Linux it sends
;; "exited abnormally with code 1".
#2017-04-0417:14jjttjjHmm, strange, I'm on windows#2017-04-0417:15dpsuttonyeah that's super bizarre#2017-04-0417:15jjttjjok it seems that my .lein/profiles.clj isn't being loaded#2017-04-0417:15dpsuttonahh#2017-04-0417:15dpsuttonhow did you figure that out?#2017-04-0417:15jjttjjthe latest cider-nrepl snapshot is used no matter what i specify there#2017-04-0417:15dpsuttonwhat do you prefer?#2017-04-0417:15dpsuttonit's best to let them reference each other unless you have a specific objective#2017-04-0417:16jjttjjoh ok so that's expected behavior then. i'm not picky but the latest if fine i guess, except that I was going to check if the latest version was the issue here#2017-04-0417:16dpsuttonnah#2017-04-0417:16dpsuttonwhat's in your lein profiles ?#2017-04-0417:16dpsuttonand what made you think it wasn't loaded#2017-04-0417:16jjttjjprofile is just {:user {:plugins [[cider/cider-nrepl "0.14.0"]]}}#2017-04-0417:17dpsuttonah, yeah you can get rid of that. cider ensures it's matching version gets installed#2017-04-0417:17jjttjjand the error message references version 15#2017-04-0417:17jjttjjok yup#2017-04-0417:17dpsuttonwhere does the error message reference 15?#2017-04-0417:18jjttjjStarting nREPL server via "c:/Users/justin/.lein/bin/lein.bat" update-in :dependencies conj ^"[org.clojure/tools.nrepl \^"0.2.12\^" :exclusions [org.clojure/clojure]]^" -- update-in :plugins conj ^"[refactor-nrepl \^"2.3.0-SNAPSHOT\^"]^" -- update-in :plugins conj ^"[cider/cider-nrepl \^"0.15.0-SNAPSHOT\^"]^" -- repl :headless :host ::...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: The system cannot find the path specified.
error in process sentinel: Could not start nREPL server: The system cannot find the path specified.
#2017-04-0417:18jjttjjin the plugins there#2017-04-0417:18dpsuttonok. remove that lein profiles file (or rename it so it's not seen for right now) and try to jack in again#2017-04-0417:19dpsuttonmay not be the worst idea to nuke your cider maven directory#2017-04-0417:19dpsutton~/.m2/repository/cider#2017-04-0417:19dpsuttonand if you can do this in a fresh copy of emacs without many buffers open and see if it's leaving any server buffers open with some more info in them#2017-04-0417:21jjttjjhmmm so removing the profiles.clj didn't work#2017-04-0417:21dpsuttonbe nice to know if we could find out what path can't be found#2017-04-0417:21jjttjjnor did nuking the cider repo#2017-04-0417:21dpsuttonhmm. bummer#2017-04-0417:21jjttjjbut when i attempted to jack in after nuking the repo, it didn't fetch the cider-nrepl repo again, shouldn't that have happened?#2017-04-0417:22dpsuttonyeah absolutely#2017-04-0417:22dpsuttonyou're not on windows 10 by any chance are you?#2017-04-0417:23jjttjjyup i am#2017-04-0417:23dpsuttonand my longshot hunch is that it's hitting the linux subsystem which is why we are seeing the "exited abnormally with code1". this is a hail mary#2017-04-0417:24dpsuttonor perhaps lein isn't installed there#2017-04-0417:24dpsuttonso it's confused, as it asks if lein is installed, which it is (in windows) and then tries to run the linux command and it's not there#2017-04-0417:24jjttjjhmmm#2017-04-0417:24dpsuttonno lie, if this is it i'm gonna be pretty stoked at the diagnosis#2017-04-0417:25dpsuttonhow are you running emacs#2017-04-0417:26jjttjja taskbar shortcut that looks like it's just calling emacs.exe#2017-04-0417:26dpsuttonok so you're not running it from the cmd line?#2017-04-0417:26jjttjjnope#2017-04-0417:26jjttjjhmm i could try compatibility mode for windows 8#2017-04-0417:26dpsuttondo you have the linux subsystem enabled or anything?#2017-04-0417:27jjttjjnot that i'm aware#2017-04-0417:27dpsuttonalright#2017-04-0417:27jjttjji have cygwin installed not sure if that could mess with anything#2017-04-0417:27dpsuttonahhh#2017-04-0417:27dpsuttoni think that could be part of our problem#2017-04-0417:28dpsuttonand the thing that makes me suspicious is that we are getting the "linux" exit code#2017-04-0417:28dpsuttoncan you put your exec-path here#2017-04-0417:28dpsuttonmaybe the sentiment was correct but instead of linux subsystem we're hitting cygwin#2017-04-0417:29jjttjjexec-path is a variable defined in `C source code'.
Its value is
("c:/Users/justin/.lein/bin/lein.bat" "c:/Rtools/bin" "c:/Rtools/gcc-4.6.3/bin" "C:/Program Files (x86)/NVIDIA Corporation/PhysX/Common" "C:/tools/ruby215/bin" "C:/ProgramData/Oracle/Java/javapath" "C:/Windows/system32" "C:/Windows" "C:/Windows/System32/Wbem" "C:/Windows/System32/WindowsPowerShell/v1.0/" "C:/ProgramData/chocolatey/bin" "C:/Program Files (x86)/Windows Live/Shared" "C:/Program Files/Java/jdk1.8.0_20/bin" "C:/Program Files (x86)/Plantronics/Spokes3G/" "C:/Program Files (x86)/Heroku/bin" "C:/Program Files (x86)/git/cmd" "C:/Program Files (x86)/GNU/GnuPG/pub" "C:/bin/strawberry/c/bin" "C:/bin/strawberry/perl/site/bin" "C:/bin/strawberry/perl/bin" "C:/Program Files (x86)/nodejs/" "C:/WINDOWS/system32" "C:/WINDOWS" "C:/WINDOWS/System32/Wbem" "C:/WINDOWS/System32/WindowsPowerShell/v1.0/" "C:/Program Files (x86)/Calibre2/" "C:/Program Files (x86)/Skype/Phone/" "C:/Program Files/Git/cmd" "C:/Program Files/TortoiseGit/bin" "C:/Program Files (x86)/Geth" "C:/Users/justin/Anaconda3" "C:/Users/justin/Anaconda3/Scripts" "C:/RailsInstaller/Git/cmd" "C:/RailsInstaller/Ruby2.1.0/bin" "C:/Users/justin/.lein/bin" "C:/Program Files/Java/jre1.8.0_25/bin" "C:/Users/justin/bin" "C:/bin/apache-maven-3.1.1/bin" "C:/Program Files/Boot2Docker for Windows" "C:/Program Files/R/R-3.2.2/bin" "C:/Program Files/R/R-3.2.0/bin/i386" "C:/Users/justin/AppData/Roaming/npm" "C:/Users/justin/AppData/Local/atom/bin" "C:/Program Files/MongoDB/Server/3.0/bin" "C:/Program Files (x86)/Graphviz2.38/bin" "C:/Program Files/Docker Toolbox" "%USERPROFILE%/AppData/Local/Microsoft/WindowsApps" "." "c:/ProgramData/chocolatey/lib/Emacs/tools/libexec/emacs/24.4/i686-pc-mingw32")
Original value was
("." "C:/msys/local/bin" "c:/mingw/bin" "C:/msys/bin" "c:/Windows/system32" "c:/Windows" "c:/Windows/System32/Wbem" "c:/Windows/System32/WindowsPowerShell/v1.0/" "c:/Program Files (x86)/ATI Technologies/ATI.ACE/Core-Static" "C:/msys/home/Dani/bin" "c:/Program Files (x86)/Bazaar" "c:/msys/home/dani/emacs/emacs-24.4-build/lib-src" "%emacs_dir%/libexec/emacs/24.4/i686-pc-mingw32")
#2017-04-0417:29dpsuttonand that would explain why we haven't redownloaded the cider nrepl middleware in maven#2017-04-0417:32dpsuttonalright that may be what's up#2017-04-0417:32dpsuttonthe emacs may be a "cygwin" emacs#2017-04-0417:32dpsuttongo look in programdata/chocolatey/lib/emacs and see if there's a non mingw emacs#2017-04-0417:33dpsuttonrunemacs.exe or just a plain jane emacs.exe#2017-04-0417:33dpsuttonor conversely, try to install lein in cygwin?#2017-04-0417:33dpsuttonhttps://chocolatey.org/packages/Emacs#2017-04-0417:34dpsuttonbased off of this comment from the above link:
> Emacs would play nicer with other cygwin utilities if "~" meant the current user's home directory (Desktop's parent folder), instead of the appdata/roaming folder. Could the next version do this?#2017-04-0417:35jjttjjok sweet! the runemacs.exe seems to not be working but will attempt to install lein in cygwin#2017-04-0417:47jjttjjWooo got it working!#2017-04-0417:47jjttjjI think I just upgraded the chocolatey version and that solved it#2017-04-0417:48jjttjjalternatively programdata/chocolatey/lib/emacs might not have been the correct location and when i ran things from C:\ProgramData\chocolatey\lib\Emacs\tools\bin it just worked. Not sure if this would have worked prior to upgrading#2017-04-0417:48jjttjjbut thanks so much for you help!#2017-04-0417:54dpsuttonI'm really glad it's working#2017-04-0506:40qqqdoes cider provide any naviation commands, like "move to next sexp" "move to previous sexp" ?#2017-04-0507:23pesterhazyforward-sexp backward-sexp#2017-04-0507:23pesterhazybuilt into emacs, not cider#2017-04-0507:24pesterhazythere's also clojure-forward-logical-sexp which takes type hints into account#2017-04-0521:34qqqIs there a way to, in cider-error, click on a file name / line number, and get emacs to jump to the corresponding line#2017-04-0521:36dpsuttondo you mean in the stacktrace buffer?#2017-04-0521:54qqqthere's a buffer named cider-error#2017-04-0521:55qqqit shows a bunch of lines of the form:
[yellow colored: fun name ] [ green colored: file name ] [ green colored: line number ]
^^ many lines of that form
** actual exception
#2017-04-0608:29bozhidarwell, yeah - it’s supposed to work like this#2017-04-0612:23chrisblomis there a way to run cljr-clean-ns on all files in a project?#2017-04-0612:55benedeki think that is what https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-project-clean is for#2017-04-0613:01benedekyou can also configure the list of fns to run#2017-04-0613:02benedekin theory your own function could be included as well#2017-04-0613:11chrisblom@benedek thanks, unfortunately I have some malformed clj files that keep cljr-project-clean from working, so used this snippet instead#2017-04-0613:12benedekfair#2017-04-0613:28chrisblomok, next step. Is it possible to configure the format that cljr-clean-ns returns?#2017-04-0613:31chrisblombasically, i just want a newline after :require#2017-04-0613:31chrisblomthis is very, very important to me#2017-04-0613:33benedekthat is rather clean-ns really i guess. which is very opinionated on formatting. there are few config options but inserting newline after :require is not one of them unfortunately#2017-04-0613:35benedekthis is also controlled by refactor-nrepl not the elisp client#2017-04-0613:38chrisblomah bummer, i'll try with query-replace after running clean-ns#2017-04-0613:38benedeki guess you can put together a bit of elisp to insert that newline#2017-04-0613:38benedekexactly if you wrap it in function you can add it to the list of functions to run when cleaning the project#2017-04-0613:40chrisblomah good idea#2017-04-0613:57chrisblomNot pretty, but i got something working
(defun add-newline-after-require ()
(interactive)
(condition-case ex
(save-excursion
(goto-char 0)
(re-search-forward (rx
"(:require"
(+ (or "\n" space))
"["))
(backward-char)
(just-one-space -1)
(newline)
(indent-region
(save-excursion (cljr--goto-ns) (point))
(save-excursion (cljr--goto-ns) (forward-char) (paredit-close-parenthesis) (point))))
('search-failed nil)))
(advice-add 'cljr-clean-ns :after 'add-newline-after-require)
#2017-04-0614:37benedeknice#2017-04-0623:56qqqusing helm, is there a way to imenu all of src/ ?#2017-04-0701:02xiongtxNAFAIK. helm-imenu-in-all-buffers will imenu all buffers w/ the same major mode#2017-04-0702:54qqqso this is for all buffers which means I need to open all the files in src/ first right ?#2017-04-0706:21xiongtxRight#2017-04-0706:22xiongtxAnd it will also include .clj files not part of your project#2017-04-0623:56qqqright now, imenu only imenus the current .clj or .cljs file I am editing#2017-04-0623:56qqqI want to imenu al .clj .cljc *.cljs files in src/#2017-04-0721:06xiongtxCustomize helm-imenu-all-buffers-assoc:
(add-to-list 'helm-imenu-all-buffer-assoc '(clojure-mode . clojurec-mode))
(add-to-list 'helm-imenu-all-buffer-assoc '(clojure-mode . clojurescript-mode))
#2017-04-0721:57xiongtxIs there anything for CIDER/`cljr` that can highlight unused vars/fns?#2017-04-0721:58xiongtxI don’t see anything…#2017-04-0722:02tanzoniteblack@xiongtx you can try https://github.com/clojure-emacs/squiggly-clojure , and then play with the eastwood settings (like https://github.com/jonase/eastwood#unused-namespaces or https://github.com/jonase/eastwood#unused-private-vars )#2017-04-0722:02tanzoniteblackI haven't used squiggly-clojure in a while, it used to have a lot of issues when I was trying to use it, and all of the linters through a lot of spurious errors if you're using macro heavy code (like core.async)#2017-04-0722:03xiongtxMust…resist…IntelliJ#2017-04-0722:03xiongtxBut thanks, I’ll see what those can do#2017-04-0722:03tanzoniteblackand also...unused fns/vars is really difficult in clojure, since a macro could always use something without it being obvious in the code...or someone could just be using it by passing something in somewhere#2017-04-0722:04agwhat about joker? is that something it could handle?#2017-04-0722:04tanzoniteblackif it's a private function or variable, it's easier since it reduces the scope...but still not easy#2017-04-0722:06tanzoniteblack@ag doesn't look like joker currently supports much past what you're going to get by actually using cider and evaling the code? https://github.com/candid82/SublimeLinter-contrib-joker#reader-errors#2017-04-0722:06tanzoniteblackmight be wrong though, I've never heard of joker until now 🙂 , and also have no idea of how extensible it could be#2017-04-0723:13jfntnWith cider-jack-in-clojurescript is it possible to pass different lein params to the clj and cljs repls? I’d like to use different profiles#2017-04-0723:14jfntnFrom a quick look at the code they seem to be reusing the same var, so maybe will need to rely on an advice for now?#2017-04-0723:33ag@jfntn I think the do use different variables: cider-lein-params and cider-cljs-lein-repl#2017-04-0723:34jfntnHmm I think the latter are just clojure exprs to eval once the cljs repl was started#2017-04-0723:34agoh I see what you mean…#2017-04-0723:36agMaybe theres a way to write a function that does jack-in and then after that, changes cider-lein-params and executes cider-create-sibling-cljs-repl ?#2017-04-0808:15benedek@xiongtx also https://github.com/clojure-emacs/clj-refactor.el/issues/264 basically we have a backend to find unused locals#2017-04-0817:44xiongtxSeems like an unimplemented feature request?#2017-04-0914:22benedekindeed. my point is that we basically have the backend for this. to implement this is just the matter of getting the right response from refactor-NREPL and doing the removing in cljr #2017-04-0914:22benedeksry for the late answer btw. this threading thing tricked me#2017-04-1015:50xiongtxSeems like Joker very recently implemented finding unused fns/vars! https://github.com/candid82/joker/commit/6f73f08660b17adfd2a0d5c3d0c6e8cbb1c560b9#2017-04-1109:28benedekindeed. seen this commit over the weekend. would be awesome to use joker as an analyzer of sorts#2017-04-1109:29benedekonly if i had time… 😉#2017-04-1109:29benedekthere is some work btw around #unrepl as well to do completion and stuff by pesterhazy#2017-04-1109:29benedekproject called unravel#2017-04-1109:30benedekalso pretty interesting#2017-04-0808:15benedekas said above squiggly should already mark/highlight them#2017-04-0810:44puzzlerDoes cider have any capability to auto-complete methods in cljs interop?#2017-04-0811:20pesterhazy@puzzler, can you even auto-complete methods in clj?#2017-04-0811:22pesterhazyI'm working on autocompleting in unravel (https://github.com/pesterhazy/unravel) and auto-completing methods could be super useful#2017-04-0811:23puzzlerI think I've gotten some good auto-complete on methods in Cursive, but I could be misremembering.#2017-04-0811:23pesterhazynot sure how that would work with a termina based repl though, given that the method name precedes the object#2017-04-0811:23puzzlerCursive's completion isn't based off of the REPL.#2017-04-0811:24puzzlerBut that's my question with respect to cider. Is it "aware" of all the methods for the various objects available?#2017-04-0811:24pesterhazyIf I type (.c| co) and tab, how does it know that co is a connection?#2017-04-0811:24puzzlerIt doesn't have to limit to method for the specific object in question.#2017-04-0811:25puzzlerJust all the methods in scope.#2017-04-0811:25pesterhazyahh interesting#2017-04-0811:25pesterhazyalthough more specific might be even better#2017-04-0811:26puzzlerIn theory, . or .. could do better because the object comes first.#2017-04-0811:28pesterhazytrue!#2017-04-0811:28pesterhazyhm in a terminal repl it would probably only work with vars#2017-04-0811:29pesterhazyuser=> (. my-var cl|<TAB>#2017-04-0811:29pesterhazynot with let-bindings, fn args etc#2017-04-0811:44dominicmI think cider does do something like this for java.#2017-04-0811:55benedekhttps://cider.readthedocs.io/en/latest/code_completion/#2017-04-0815:41jfntnWe have a project.clj for a full-stack project where sources and dependencies are split into backend and frontend lein profiles.#2017-04-0815:41jfntnI’d like to have something like cider-jack-in-clojurescript where the clj repl starts with the backend profile, and the cljs one with the frontend profile.#2017-04-0815:42jfntnI’m not sure I understand how the sibling repl is started though, is it correct that it’ll reuse the clj repl’s nrepl process? Meaning that I’d have to start another process in order to do what I want?#2017-04-0902:13dpsutton@jfntn I believe you're correct. The cljs repl is just a call back into the same jvm I think. I've been wanting to separate the two so that you can jack in clojure script separately and this is a good use case#2017-04-0916:22richiardiandrea@pesterhazy great that you are working on auto completion, also have a look at compliment if you haven't already. It is the link which powers Cider's completion#2017-04-0916:23pesterhazy@richiardiandrea thanks for the pointer, I'll check it out!#2017-04-0916:24pesterhazypart of the challenge here for unrepl is to make completion work without compromising other goals#2017-04-0916:25pesterhazy- speed: don't increase the startup time dramatically
- dependencies: don't introduce gratuitous external dependencies#2017-04-0916:27pesterhazylooks like compliment has no transitive deps, so that's great#2017-04-0916:27richiardiandreaYep and I like the fact that it is already battle tested#2017-04-0916:28pesterhazyagree#2017-04-0916:29richiardiandreaAnd the maintainer is actually maintaining it, there was some talk on adding cljs at some point but I don't think it makes sense to do that in there anymore. Cljs completion is drastically different#2017-04-0916:31pesterhazyhave you tried unravel 0.2.0? Tab completion mostly works already, with a super simple approach#2017-04-0916:32richiardiandreaI wanted to fix a bug I added in inf-clojure and then add the unrepl client in it#2017-04-0916:32richiardiandreaSending tab chars is good enough of a solution for now 😀#2017-04-0916:33pesterhazyfor inf-clojure I would really suggest using the unrepl payload directly instead of using unravel as a middleman#2017-04-0916:34richiardiandreaYep but that means that I have to replicate what you did in emacs list, seems a bit more work 😀😀#2017-04-0916:34pesterhazyor maybe that's out of scope for inf-clojure?#2017-04-0916:34pesterhazyyeah it's a bit of work, especially if you want to keep track of 2 tcp connections etc.#2017-04-0916:35richiardiandreaInf-clojure is just talking with a input output console stream, so yeah it might be out of scope#2017-04-0916:35pesterhazybozhidar mentioned to me that there's no EDN parser for elisp yet#2017-04-0916:35pesterhazyso that would need to be written as well#2017-04-0916:36richiardiandreaOh ok#2017-04-0916:36richiardiandreaYeah#2017-04-0916:36richiardiandreaThere is a JSON parser though#2017-04-0916:36pesterhazyreally a "native" unrepl client for emacs would be the endgame though#2017-04-0916:36pesterhazyit's ultimately what we're building unrepl for#2017-04-0916:38richiardiandreaYeah agree, I think it is going to happen, in the meantime inf-clojure -> unravel -> unrepl must be tried 😀#2017-04-0916:40benedekthere is an edn parser for elisp tho#2017-04-0916:41benedekby expez let me get a link#2017-04-0916:42benedekhttps://github.com/expez/edn.el#2017-04-0916:42benedekwe use it in clj-refactor if you need examples#2017-04-0916:43benedekunrepl and unravel are really exciting btw. #2017-04-0917:07pesterhazyFrom edn.el:
>>> Is it any good?
Yes!#2017-04-0917:07pesterhazyawesome! thanks @benedek#2017-04-0917:08pesterhazy@richiardiandrea let me know if you run in any issues with running unravel in "dumb terminal" mode, I haven't tried that too much yet#2017-04-0917:14benedekI am also interested in inf-clojure/unravel/unrepl experiences @richiardiandrea #2017-04-0917:16richiardiandreaI think the integration to inf-clojure is super easy now that we have a repl type in inf-clojure#2017-04-0917:22benedekwill give it a try this evening #2017-04-1003:41qqqholy %*#(; cider-apropos is amazing;#2017-04-1003:42qqqI rejoined this channel just to say helm-cider / cider-apropos is amazing#2017-04-1004:37bozhidar@pesterhazy I mentioned there’s not an EDN parser I’d use#2017-04-1004:37bozhidaredn.el depends on a an unmainted library hosted on EmacsWiki…#2017-04-1004:39bozhidarlast updated about 8 years go https://www.emacswiki.org/emacs/peg.el 🙂#2017-04-1004:39bozhidarperhaps it’s perfect, but I kind of doubt this#2017-04-1007:01bozhidar@qqq Happy to hear you like it!#2017-04-1007:02bozhidarthere’s a version of this that searches in docstrings which is also quite useful#2017-04-1007:11benedekhm.. @bozhidar did not know about your concerns re. edn.el#2017-04-1007:13bozhidarI’ve definitely mentioned this to Lars. I told him I’d never add a dependency to any of my packages to something unmaintained that doesn’t even have an official repo.#2017-04-1007:13bozhidarIf the situation was different maybe CIDER would have used this library as well.#2017-04-1007:14bozhidarOn a related note - this library should probably live in clojure-emacs to raise its visibility and maybe attract more developers.#2017-04-1007:24benedekyou mean edn.el?#2017-04-1007:32pesterhazysearching in docstrings, genius#2017-04-1007:35qqq@bozhidar: I've noticed a few "click here" to find cider links on tthe github and documentation; is there a price at which you would be able to hack on cider full time for a year?#2017-04-1008:14bozhidarThere’s always a price. 🙂 If I could raise something in the vicinity of 100k for a year, I’d definitely consider doing this. At some point I dreamt of some company seeing the benefits of developing a good tooling for Clojure and hiring me to work on it, but several years down the line this doesn’t seem like something that’s ever going to happen.#2017-04-1008:15bozhidar@benedek yes#2017-04-1008:15bozhidar@pesterhazy well, the genius idea was Emacs’s and it was afterwards copied by SLIME and eventually by CIDER#2017-04-1008:18benedek@bozhidar haha i see rewrites all around#2017-04-1008:19bozhidarrewrites of apropos?#2017-04-1008:19bozhidarguess you can say this 🙂#2017-04-1008:29benedekhaha sorry i meant edn.el needs a bit of rewrite to get into clojure-emacs but you are right indeed that conversation is kinda about rewrites too…#2017-04-1009:01bozhidaredn.el can go to clojure-emacs even in its current form, I’d just not advice its usage until it’s clear what to do about peg.el#2017-04-1011:10qqq@bozhidar : 100k / year is low end of SV salary; so completely reasonable for full time cider dev#2017-04-1011:11qqq@bozhidar : is there a price you would consider porting cider to some editor that was clj/cljs all the way down? or are you fundamentally stuck with emacs and unwilling to build the core of it in clj/cljs ?#2017-04-1011:56bozhidarwell, I’m an Emacs user and CIDER started off as a very personal project for me - I planned to start doing Clojure professionally and I needed good support for Clojure in Emacs#2017-04-1011:57bozhidarI’m not opposed to doing something similar for a different editor in principle as I love working on developer tools, but with another editor matching the exact CIDER feature set might be harder (or easier).#2017-04-1011:58bozhidarEven know a lot of the heavy-lifting is done in cider-nrepl which is editor-agnostic and implemented in pure Clojure#2017-04-1012:14qqq@bozhidar : so 200k? 🙂#2017-04-1012:15qqqI think as a community, one of the best investments lcojure devs can make is getting an clojure ide written in clojure#2017-04-1012:17bozhidaron one hand you’re right, on the other - developing an IDE from scratch is a lot of work. It’s much more than just coming up with support for one particular language. It might be fun to work on such a project, I’m just not sure how feasible it would be to build something like this. Most new IDEs/text editors don’t get very far - e.g. NightCode, LightTable, etc.#2017-04-1012:18qqqyeah, there's annoyances on both parts:
every time I try to hack on nightcode/lighttable, it just feels too primitive compared to emacs
every time I write elisp, I curse and wish I was using cljs#2017-04-1012:19qqqIf, hypothetically, we got you 300k, would you be able to hack on it full time for two years?#2017-04-1012:20bozhidarI’m not Elisp’s biggest fan myself, but I prefer an editor extensible in some dialect of Lisp, compared to something else. Plus, I’ve been using Elisp for quite a while and it almost feels like a real programming language.#2017-04-1012:20dpsuttonalmost#2017-04-1012:20bozhidarhypothetically - yes#2017-04-1012:45qqqI am having the following problem with helm-imenu.
I don't want it to use imenu--create-index. I want to create the indev sia:
(imenu--generic-function imenu-generic-expression)
how do I pass this to the (helm :sources ( ... :candidates ... )) call ?#2017-04-1013:48qqqgot it working; it was a regex issue#2017-04-1016:25jfntnIs there a way to get jump to source to work for clojure protocols like clojure.lang.Associative? Suspecting something is wrong with my javadoc setup because the javadoc like in cider doc doesn’t do anything…#2017-04-1017:14jumar@jfntn I think not - at least it doesn't work for me, since it's implemented as a java class. It'd be great if someone more involved like @bozhidar could provide a definitive answer on this, i.e. if it's possible to navigate to the source code of Clojure's java classes like clojure.lang.PersistenceVector or clojure.lang.Associative#2017-04-1018:01bozhidarIt should work provided you have sources in your classpath. Same applies for javadoc.#2017-04-1019:14jumar@bozhidar thanks for the tip - what's the easiest way of adding the Clojure sources to classpath? (I'm using leiningen)#2017-04-1019:18jumarI've found following issue: https://github.com/clojure-emacs/cider-nrepl/issues/64#2017-04-1019:18jumarAnd following seems to work:
:profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0" :classifier "sources"]]}}
#2017-04-1020:44jfntnHa that worked, can now jump to clojure protocol definitions in Java!#2017-04-1021:05bozhidaryeah, probably someone should add this somewhere in the manual#2017-04-1021:05bozhidaror work on this ticket 🙂#2017-04-1021:08qqq1. I have cider-connect working.
2. I can evaluate cider forms in my *.clj file.
3. When I type in M-x cider-apropos <RET> assoc! <RET>, I get:
Wrong type argument: stringp, nil
How do I debug this?#2017-04-1021:09tanzoniteblacktoggle-debug-on-error is always your friend for things like that#2017-04-1021:12qqqusing toggle-debug-on-error, I get:#2017-04-1021:12qqqhttp://imgur.com/a/Rk8M5#2017-04-1021:13dpsuttonit's saying unknown operation#2017-04-1021:14dpsuttoncan you M-x something along the lines of nrepl-toggle?#2017-04-1021:14dpsuttonif we can see what it's sending across to the jvm we can see what it's erroring#2017-04-1021:14dpsuttonbut open a ticket as it sending back bad info shouldjn't error like that#2017-04-1021:14dpsuttonnrepl-toggle-message-logging#2017-04-1021:15qqqI don't have nrepl-toggle . I only have nrepl-toggle-message-logging . Also, I'm cider-connect -ing to a remote nrepl.#2017-04-1021:15dpsuttonyeah that. i meant something along the lines of that. i never remember what it is#2017-04-1021:16dpsuttonturn that on, do the command that you're doing, looks something to do with docs, and paste those messages here#2017-04-1021:17qqqhttp://imgur.com/a/Rk8M5#2017-04-1021:17qqq(updated to include nrepl buffer)#2017-04-1021:19qqq@dpsutton: in the cider repl what am I supposed to type to emulate looking up info on clojure.core/assoc! ?#2017-04-1021:19qqq(info 'clojure.core/assoc!) <-- error about symbol cannot be cast to java.lang.String#2017-04-1021:20qqq(info "clojure.core/assoc!") <-- nil#2017-04-1021:25dpsuttoncan you tell me what has id 14?#2017-04-1021:25dpsuttonsee how they each have an id on them? the error message coming back unknown op is keyed to id 14 which is just out of range in the screenshot you sent#2017-04-1021:26dpsuttonjust turn on the message logging, do whatever you did to trigger the error and let's look at ti#2017-04-1021:27qqqwill you still be around in 5 minutes?#2017-04-1021:27qqqif so, maybe I should just screen cast#2017-04-1021:28dpsuttonare you able to reliably trigger that error?#2017-04-1021:28qqqyes#2017-04-1021:28qqqevery time#2017-04-1021:28dpsuttonand you turned on nrepl logging#2017-04-1021:28qqqyes#2017-04-1021:28dpsuttonnotice the error message that it's saying#2017-04-1021:28qqqlet me get you full error#2017-04-1021:29dpsuttonlet's see if we can see what request is triggering that#2017-04-1021:29dpsuttonso let's trigger the error, go look at the nrepl logs, and see what request triggered it#2017-04-1021:29qqq(-->
op "info"
ns "z.mdb"
symbol "n"
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
id "25"
)
(<--
id "25"
op "info"
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
status ("done" "unknown-op" "error")
)
(-->
op "apropos"
ns "z.mdb"
query ""
filter-regexps ("^cider.nrepl" "^refactor-nrepl" "^clojure.tools.nrepl")
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
id "26"
)
(<--
apropos-matches ((dict "doc" "Returns the product of nums." "name" "clojure.core/*" "type" "function") ...)
id "26"
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
status ("done")
)
(-->
op "info"
ns "z.mdb"
symbol "clojure.core/assoc!"
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
id "27"
)
(<--
id "27"
op "info"
session "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
status ("done" "unknown-op" "error")
)
#2017-04-1021:30dpsuttonwell it certainly doesn't like you asking for info does it#2017-04-1021:30dpsuttonha#2017-04-1021:30dpsuttonweird#2017-04-1021:31dpsuttonwhat command in cider are you using?#2017-04-1021:31qqqyou know what's relaly fucked up? cider-apropos-documentation <- will actually show me the docs for assoc! in the helm window#2017-04-1021:31qqqI was using cider-apropos#2017-04-1021:32qqqcider-apropos + assoc! + RET<-- error we get
cider-apropos-documentation + assoc! (no RET) <-- completion window shows the documentation#2017-04-1021:32dpsuttontry it without the !#2017-04-1021:32dpsuttondoes cider-apropos + assoc work?#2017-04-1021:32dpsuttondamn, it works for me#2017-04-1021:33qqqhmm, I have crashed emacs now#2017-04-1021:33dpsuttonbut i haven't updated on my windows work computer in a while#2017-04-1021:33dpsuttonsomeone recently added support for some datomic stuff and its possible they borked it a little#2017-04-1021:33dpsuttonyeah, assoc! works for me#2017-04-1021:33dpsuttonare you running CIDER from melpa?#2017-04-1021:34qqqemacs: using cider from nrepl; boot: cider/cider-nrepl 0.15.0-snapshot#2017-04-1021:34dpsuttonI think that's melpa then#2017-04-1021:35qqqcider-apropos + assoc + RET <-- same stringp error#2017-04-1021:36qqqso maybe my emacs cider is out of date#2017-04-1021:36dpsuttoncan you eval this? (cider-ensure-op-supported "apropos")#2017-04-1021:37dpsuttoni would nuke your cider and reinstall, yeah#2017-04-1021:37dpsuttonthat dynamic language is so easy to jump to source to look at something and accidentlaly press a key#2017-04-1021:37qqqas an elisp command ?#2017-04-1021:37dpsuttonyeah#2017-04-1021:37qqqnil#2017-04-1021:37qqqokay, time to nuke cider#2017-04-1021:37dpsuttonok that's good#2017-04-1021:37dpsuttonyeah, i borked my copy of CIDER recently by having an a freefloating before a form#2017-04-1021:38dpsuttonhad to find it before i could load the file#2017-04-1021:38qqqoh, you're saying I did C-h f cider-function#2017-04-1021:38qqqclicked on cider.el, looked at some stuff, hit some key, and now cider is borked?#2017-04-1021:38qqqdamn, emacs should make those files read only#2017-04-1021:38dpsuttoni've done that. possible that that has happened here, but not likely#2017-04-1021:38dpsuttonyeah i agree#2017-04-1021:39dpsuttoni had to recompile emacs recently because i did that in a native emacs lisp file#2017-04-1021:39dpsuttonmake bootstrap after that one#2017-04-1021:39qqqfor some stupid reason, I always thought emacs packages were read only in /usr/local/... when they're clearly write-able in ~/.emacs.d/....#2017-04-1021:41qqqnope, still borked#2017-04-1021:41qqqI promise I didn't touch any cider files this time around#2017-04-1021:42qqqwait wait#2017-04-1021:42qqqcider-ensure-op-supported is SUPPOSED to return nil on succees and ERROR on fail#2017-04-1021:42qqqnil = success#2017-04-1021:53dpsuttonyes#2017-04-1021:53dpsuttonerror = bad, nil means continue control flow#2017-04-1023:34jfntn@dpsutton I was trying to write an interactive function to start a standalone cljs repl. However I couldn’t get it to work since I was trying to access the repl buffer right after invoking cider-jack-in and the buffer didn’t exist yet. I took this from the sibling repl implementation so I’m not sure why that happened. Anything comes to mind?#2017-04-1023:36jfntnAssuming cider-jack-in is async while some of the innards are sync, but I’m not familiar enough with cider’s internals to know where to start other than duplicating all of cider-jack-in and hard-wiring the sibling code in there…#2017-04-1102:36dpsuttoni think you're in luck#2017-04-1102:37dpsutton@jfntn because all the jack in clojure script does is set up a new client and then call some piggy back (or whatever inits your cljs repl)#2017-04-1102:37dpsuttonso all you really have to do is just jack in and then invoke whatever you want#2017-04-1102:38dpsuttonthe magic happens inside cider-create-sibling-cljs-repl. All it does is read the info from the clj buffer and then create another client on the same ports#2017-04-1102:39dpsuttonthe magic happens in this line: (cljs-proc (apply #'nrepl-start-client-process client-process-args)) which just creates a new client process on the same stuff. And then there's the comment that should give you the most confidence to just create clj repls and init one for cljs and leave the other alone:#2017-04-1102:39dpsutton;; The new connection has now been bumped to the top, but it's still a
;; Clojure REPL! Additionally, some ClojureScript REPLs can actually take
;; a while to start (some even depend on the user opening a browser).
;; Meanwhile, this REPL will gladly receive requests in place of the
;; original Clojure REPL. Our solution is to bump the original REPL back
;; up the list, so it takes priority on Clojure requests.
#2017-04-1102:42dpsuttonthen, the remaining code is very straight forward. It sets the connection as default (by putting it at the beginning of the connection list, sends a message that the cljs repl is being created, and then the code following that just invokes whatever code is required to get your cljs repl up:
(cider-nrepl-send-request
`("op" "eval"
"ns" ,(cider-current-ns)
"code" ,cljs-repl-form)
(cider-repl-handler (current-buffer)))
(cider--offer-to-open-app-in-browser nrepl-server-buffer)
#2017-04-1102:43dpsuttonso if i remember what you are wanting to do, you want to create a clojure repl under one profile and then a clojurescript repl under another. And all you need to do is jack in with a profile and then jack in with another profile. In the one you want to be cljs, invoke whatever cljs stuff you need. For piggyback this is simply: (cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))#2017-04-1103:38jfntndpsutton that’s really helpful! I’ll have to get back to this tomorrow, but I think I just assumed I didn’t want to create a new client like the sibling code does, which must be why it didn’t block until the buffer was ready and the rest didn’t work. Will report back, thanks for the detailed explanation!#2017-04-1103:38dpsuttonfeel free to message me tomorrow. i'll be at work but i've dug through some of this before#2017-04-1103:41jfntnappreciate it, thanks!#2017-04-1117:01bozhidar@qqq you might also consider filing a ticket - I don’t usually have time to follow discussions here, but I usually read tickets and respond to them#2017-04-1121:03aghas anyone ever had problems of using cider-refresh with .cljc files that have some reader conditionals? code builds, repl starts with no problems, but then if I do cider-refresh - it complains ;(#2017-04-1121:03agthis is probably not a bug in cider. probably I’m doing something wrong, but I can’t figure out the cause#2017-04-1121:08dpsuttonwhat is it complaining about?#2017-04-1121:11dominicm@ag http://dev.clojure.org/jira/browse/TNS-42 could it be this?#2017-04-1121:14dpsuttoncljc support is rather spotty. just wondering#2017-04-1122:36ag@dominicm does that mean that I should also see some problems if I manually try to use clojure.tools.namespace.repl :refer [refresh] ?#2017-04-1122:36agI’m not seeing any#2017-04-1122:43agso I’m trying to run cider-refresh, it complains that it can’t load .cljc namespace. and then apparently repl kinda breaks - I can’t switch namespaces, evaluating anything does not show anything ;(#2017-04-1123:03agit turn out to be cider-refresh problem after all - I can’t replicate it with :relooad-all true#2017-04-1123:04rmuslimov@ag I’m happy with cider-refresh stuff, moreover added stuartsierra/component features there and it works great for reloading. and I believe you should fix that issue with cljc#2017-04-1123:06jfntn@ag looks like you narrowed it down to some elisp issue? The elisp debugger should be able to get some context if you can afford the yak shave!#2017-04-1123:06ag@jfntn it throws java error though#2017-04-1123:07rmuslimovsorry, I missed beginning of conversation#2017-04-1123:08rmuslimov> @ag repl starts with no problems, but then if I do cider-refresh - it complains ;(.
What is the exception you’re seeing there. I’m working with cljc no issue so far#2017-04-1123:09rmuslimovyou’ve tried lein clean already, right? and restarting the repl#2017-04-1123:09agso I have some .cjc files with specs and generators, when I jack-in - everything is fine. If I try to use cider-refresh - it complains “error loading foo namespace” where foo is that .cljc file#2017-04-1123:10rmuslimovand what happens if you go to that file and call C-c C-k there?#2017-04-1123:10agI’m not using lein it’s a boot project - but I don’t think that’s the issue#2017-04-1123:12agit throws
java.lang.AssertionError
Assert failed: Second arg to such-that must be a generator (generator? gen)
generators.cljc: 346 clojure.test.check.generators$such_that/invokeStatic
generators.cljc: 328 clojure.test.check.generators$such_that/invoke
AFn.java: 160 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 646 clojure.core/apply
core.clj: 641 clojure.core/apply
gen.clj: 94 clojure.spec.gen/eval12564/such-that
RestFn.java: 436 clojure.lang.RestFn/invoke
spec.clj: 272 clojure.spec/gensub
spec.clj: 264 clojure.spec/gensub
spec.clj: 288 clojure.spec/gen
spec.clj: 277 clojure.spec/gen
spec.clj: 287 clojure.spec/gen
spec.clj: 277 clojure.spec/gen
AFn.java: 154 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
Compiler.java: 3652 clojure.lang.Compiler$InvokeExpr/eval
Compiler.java: 3651 clojure.lang.Compiler$InvokeExpr/eval
Compiler.java: 3651 clojure.lang.Compiler$InvokeExpr/eval
Compiler.java: 451 clojure.lang.Compiler$DefExpr/eval
Compiler.java: 6932 clojure.lang.Compiler/eval
Compiler.java: 7379 clojure.lang.Compiler/load
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 363 clojure.lang.RT/loadResourceScript
RT.java: 453 clojure.lang.RT/load
RT.java: 419 clojure.lang.RT/load
core.clj: 5893 clojure.core/load/fn
core.clj: 5892 clojure.core/load
core.clj: 5876 clojure.core/load
RestFn.java: 408 clojure.lang.RestFn/invoke
core.clj: 5697 clojure.core/load-one
core.clj: 5692 clojure.core/load-one
core.clj: 5737 clojure.core/load-lib/fn
core.clj: 5736 clojure.core/load-lib
core.clj: 5717 clojure.core/load-lib
RestFn.java: 142 clojure.lang.RestFn/applyTo
core.clj: 648 clojure.core/apply
core.clj: 5774 clojure.core/load-libs
core.clj: 5758 clojure.core/load-libs
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 648 clojure.core/apply
core.clj: 5796 clojure.core/require
core.clj: 5796 clojure.core/require
RestFn.java: 421 clojure.lang.RestFn/invoke
reload.clj: 35 cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.reload/track-reload-one
reload.clj: 21 cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.reload/track-reload-one
reload.clj: 52 cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.reload/track-reload
reload.clj: 43 cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.reload/track-reload
refresh.clj: 155 cider.nrepl.middleware.refresh/refresh-reply/fn
core.clj: 1941 clojure.core/binding-conveyor-fn/fn
AFn.java: 154 clojure.lang.AFn/applyToHelper
RestFn.java: 132 clojure.lang.RestFn/applyTo
Agent.java: 114 clojure.lang.Agent$Action/doRun
Agent.java: 163 clojure.lang.Agent$Action/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 745 java.lang.Thread/run
1. Caused by clojure.lang.Compiler$CompilerException
#2017-04-1123:13aginterestingly there’s nothing wrong with the code, when evaluated the first time (before refresh) it works just fine#2017-04-1123:14rmuslimovmay be it’s just not load when you run the repl?#2017-04-1123:14rmuslimovis test file you working with? if you run tests they work?#2017-04-1123:17agI think this is something to do with com.gfredericks/test.chuck#2017-04-1123:19jfntnI’d make sure there I don’t have a faulty top-level form, but I’ve also ran into situations where some libraries make reloading impossible, seems to happen more often on cljc projects#2017-04-1123:20rmuslimovI don’t think cljc is source of the issue here. seems like mistyping or something similar#2017-04-1123:25agso when I do (require ’[foo :reload-all true]) in the terminal it works just fine. If I try to do the same thing after cider-refresh - it complains ;(#2017-04-1123:25agit breaks, the only way to fix it - to restart the repl#2017-04-1123:26agwhich is quite annoying#2017-04-1123:29jfntnisn’t the difference that when doing it manually you only reload foo, but cider tries to reload all namespaces?#2017-04-1123:30rmuslimovcider just call (require '[clojure.tools.namespace.repl :refer [refresh]) (refresh). Not sure if it may help#2017-04-1123:31rmuslimov> isn’t the difference that when doing it manually you only reload foo, but cider tries to reload all namespaces?
probably, yes#2017-04-1123:38agthat’s the thing - when I call refresh manually - nothing happens, everything works as expected. But when I do cider-refresh, it complains about that single .cljc file#2017-04-1123:38ag¯\(ツ)/¯#2017-04-1123:43rmuslimovmost likely way you do when I call refresh manually is not loading this cljc file. In contrast what cider-refresh do, which is also trivial and calls clojure.tools.namespace.repl :refer [refresh] function#2017-04-1123:50agthat’s what I’m saying - if I execute clojure.tools.namespace.repl/refresh in the repl, it works just fine.#2017-04-1201:25qqqI'm using inf-clojure#2017-04-1201:25qqqsocket repl and nrepl are different things right?#2017-04-1201:26qqqmy boot is on a remote machine; how do I tell my boot on my remote machine to opena socket-repl that I can connect to via inf-clojure-connect which asks me for host and port ?#2017-04-1202:58richiardiandrea@qqq yes#2017-04-1202:59richiardiandrea@qqq do you have any error ?#2017-04-1209:32qqq@richiardiandrea : we're tlaking in all the channels!#2017-04-1209:33qqqgot it working, ended up just copying/pasting from that SO post#2017-04-1209:33qqqI actually find inf-clojure easier to use than cider#2017-04-1210:35dominicm@ag have you tried latest snapshot of CIDER? It has an updated version of refresh.
The version in CIDER doesn't work with boot.#2017-04-1216:31bjais there some way I can make the namespace auto-import functionality register as a different insert step for purposes of undo-tree-undo?#2017-04-1315:08jfntnSo I just read about the test report diff functionality, I thought this was great but I don’t understand how it’s useful in practice given how it’s implemented:#2017-04-1315:11jfntncider-test-ediff will compare the expected line with the actual one, so I’ll get a diff with on one hand: (= (range 0 10) (range 0 15)) and on the other (= (0 1 2 3 4 5 6 7 8 9) (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14))#2017-04-1315:12jfntnBut of course I’d like to diff the values inside the = expr from the right hand side#2017-04-1315:13jfntnAm i missing something here? Are there any test cases where this would do the right thing?#2017-04-1413:35Lambda/SierraHow can I set clojure-indent-style as a file-local variable?#2017-04-1413:41Lambda/SierraTo answer my own question,
;; Local Variables:
;; clojure-indent-style: always-indent
;; End:
#2017-04-1413:42Lambda/Sierra(no leading colon on always-indent)#2017-04-1416:25voxdoloIs there any way to get the debugger to break at exactly the point in the function where you set it at? seems to go through every s-expression prior to it first (or is this just some weirdness with spacemacs?)#2017-04-1416:36tanzoniteblack@voxdolo see https://github.com/clojure-emacs/cider/blob/master/doc/debugging.md for info on #break #dbg#2017-04-1416:43voxdolotanzoniteblack okay, it's definitely spacemacs weirdness (or maybe just missing functionality) then, since there's no equivalent binding for #break... it just binds #dbg on the function you're inside of#2017-04-1416:46tanzoniteblackyou don't need a binding for #break#2017-04-1416:46tanzoniteblackif you have a function like (defn test-fn [x]
(if (even? x)
#break (* 3 x)
(* 2 x)))#2017-04-1416:46tanzoniteblackand then you eval it with cider-eval-defun-at-point (`C-M-x` in normal keybindings)#2017-04-1416:46tanzoniteblackit will open the debugger if you get to the line that has the #break (i.e. pass in an even number)#2017-04-1416:48tanzoniteblack(defn test-fn [x]
(if (even? x)
#dbg (* 3 (inc x))
(* 2 x))) with #dbg works the same, except instead of only showing you the results for the entire sexp (* 3 (inc x)) like #break would, #dbg will let you step through all the sexp inside the fn#2017-04-1416:49tanzoniteblack^^^ @voxdolo#2017-04-1416:58voxdolo@tanzoniteblack I think Spacemacs breaks #dbg and #break. normal function invocation (this happens to be a web app endpoint controller-style function) doesn't pause execution at all and C-M-x isn't really a great option here because there's a rather large and complicated request map required as input.#2017-04-1519:47dominicmDoes https://github.com/clojure-emacs/squiggly-clojure work on the current contents of the buffer, or only work on save?#2017-04-1920:26papachanHi. i dont remember how i print the output in the same file buffer and not the repl buffer with cider.#2017-04-1920:26dpsuttonas a comment?#2017-04-1920:34jumar@papachan did you mean cider-eval-print-last-sexp? Should be available via C-u C-x C-e#2017-04-1921:06papachan@dpsutton yeah as a comment. i have this working with lispxmp under emacs lisp#2017-04-1921:07papachan@jumar should work with cider-eval-print-last-sexp but i dont get it working#2017-04-1921:07dpsuttondo you use helm?#2017-04-1921:07papachanyeah#2017-04-1921:07dpsuttoni do as well. i'm gonna m-x cider eval print and see what i get#2017-04-1921:08dpsuttoni use helm for discoverability quite a bit#2017-04-1921:09papachannow i get it#2017-04-1921:09papachanthanks#2017-04-1921:09dpsuttonyou got it?#2017-04-1921:09dpsuttoni didn't mean to be dismissive but that's what i was gonna do#2017-04-1921:09dpsuttonglad you found it#2017-04-1921:10dpsuttoni think there's an eval map bound to a key which has a lot of these commands#2017-04-1921:10papachancider wasnt running in background :fail:#2017-04-1921:10dpsuttonyou might be able to find it if you use which key#2017-04-1921:10dpsuttoni ran into that myself. had to start a repl as well#2017-04-2018:29jfntnI recently started having issues with the debugger and multifns where I can’t get it to kick in at all, even with the #dbg literal. Anyone else seen this?#2017-04-2020:40agcider-quit doesn’t kill sibling-cljs-repl, maybe it should?#2017-04-2020:46agI have to call cider-quit twice to kill both repls#2017-04-2020:46dpsuttonthat's surprising#2017-04-2020:47dpsuttonare you on a recent CIDER? I thought i remembered working on something like that#2017-04-2020:47dpsuttonnevermind, it was the tooling session#2017-04-2120:21piotr.owsiakhi, I'm trying CIDER's enlighten mode and I'm wondering if there's a way to expand the list of intermediate values displayed by it, i.e. i can see (8 6 4 ...) and I want to see the full list of values#2017-04-2323:26qqqI prefer inf-clojure to cider. Does inf-clojure offer any debugging tools ?#2017-04-2401:16richiardiandrea@qqq only the repl for now#2017-04-2408:28dominicm@qqq Not sure if inf-clojure can support it, but check out https://github.com/gfredericks/debug-repl#2017-04-2408:29dominicmNo reason it shouldn't work in inf-clojure#2017-04-2420:19bfayDoes cider-find-var (`M-.` or , g g in spacemacs) only exclusively work when starting the nrepl from emacs, using cider-jack-in?
I’m connecting to a repl via cider-connect, and when I try cider-find-var it fails, but it’s fine if I use cider-jack-in#2017-04-2420:21bfayWhen it fails (via cider-connect) it gives me the kinda ambiguous message
>cider-find-var requires the nREPL op “info”. Please, install (or update) cider-nrepl 0.15.0-SNAPSHOT and restart CIDER#2017-04-2420:22bfayMaybe that means I need to put some middleware in my ~/.lein/profiles.clj?#2017-04-2420:26dpsuttoncider jack-in sticks its own stuff in there. do you have cider-nrepl as a dependency in your project otherwise?#2017-04-2420:27dpsuttoni think you'll want a dev dependency on it rather than in your ~/.lein/profiles.clj. This is often the source of confusion as it overrides CIDER's own injection, so you'll eventually end up with a stale version#2017-04-2502:50dpsuttonthat glyph should always appear. anything loaded should have it#2017-04-2503:04gonewest818Thanks... any idea what function produces that glyph? #2017-04-2503:25gonewest818Ah. On closer look, the glyph is there but the color is almost indistinguishable from the background. In our office lighting I missed it. I’m trying to figure out what sets the color.#2017-04-2503:25dpsuttonlet me dig. i'm very near there#2017-04-2503:25dpsuttongrep for fringe in cider#2017-04-2503:26dpsutton(defface cider-fringe-good-face
'((((class color) (background light)) :foreground "lightgreen")
(((class color) (background dark)) :foreground "darkgreen"))
"Face used on the fringe indicator for successful evaluation."
:group 'cider)
#2017-04-2503:27dpsuttoni'm not sure how easily changed that is. you could probably put this snippet in your own init file with whatever colors you'd like. moreover, a submitted patch with those colors as a defcustom would most probably be very welcome#2017-04-2503:29dpsutton@gonewest818 ^#2017-04-2503:37gonewest818@dpsutton: thanks much for hunting that down.#2017-04-2503:52dpsuttonno problem. happy to help#2017-04-2504:37gonewest818@dpsutton so it turns out you can call customize-theme-set-faces to override these defaults, and in particular the zenburn theme offers an additional macro zenburn-with-color-variables that provides a table of color names like zenburn-bg as a convenience. So I was able to customize the theme in init.el like this:#2017-04-2504:38gonewest818(defun my-customize-zenburn ()
(zenburn-with-color-variables
(custom-theme-set-faces
'zenburn
`(fringe ((t (:foreground ,zenburn-fg :background ,zenburn-bg))))
`(cider-fringe-good-face ((t (:foreground ,zenburn-green+1))))
)))
(load-theme 'zenburn t)
(my-customize-zenburn)#2017-04-2504:50dpsuttonperfect. glad it worked out for you#2017-04-2504:50dpsuttonthat's really helpful#2017-04-2510:07cddrHas anyone figured out how to run speclj tests using cider-test?#2017-04-2512:59andrea.crottiafter the last upgrade of Cider the repl behaves a bit strangely#2017-04-2513:00andrea.crottipressing TAB for example actually moves the prompt around even if there is nothing#2017-04-2513:00andrea.crottiwhich I don't think was happening before#2017-04-2513:00andrea.crottiand auto completion seems a bit off (not auto completing files for example)#2017-04-2513:01andrea.crottianyone saw similar problems with CIDER 0.15.0snapshot (package: 20170403.402) ?#2017-04-2514:19jsa-aerialcouple questions - when (release) did that fringe thing come in and what is supposed to be for??#2017-04-2514:30dpsuttonit's been out for a while and it marks which forms are loaded in the repl#2017-04-2514:41jsa-aerialThanks. I'm on 12. Wonder how much will break if I upgrade to 14 (which seems to be latest released?)#2017-04-2514:49dpsutton14 is latest on melpa-stable, 15 is on melpa#2017-04-2514:51dpsuttonhopefully nothing will break 🙂#2017-04-2515:45richiardiandrea@gonewest818 nice I am using zenburn and i did not even know about the existence of the fringe there 😀#2017-04-2517:07richiardiandreaso is cider-fringe-good-face the only face the fringe has?#2017-04-2519:08gonewest818Here are all the “defface” that occur in the cider codebase. https://github.com/clojure-emacs/cider/search?utf8=%E2%9C%93&q=defface&type=#2017-04-2517:12richiardiandreaoh wow what is a fragile-button 😄 https://github.com/clojure-emacs/cider/blob/1ce1d9998fc756d3dbbb491cc6f4f0c4c397b450/cider-overlays.el#L281#2017-04-2518:28romain@richiardiandrea yes unfortunately 😞#2017-04-2519:08richiardiandrea@romain was it for me on the #emacs channel 😄 ?#2017-04-2520:17romain@richiardiandrea hehe no, I answered your question about only one font face#2017-04-2520:17romainbut now I see you ask about cider, I meant about clojure-mode :x#2017-04-2520:50richiardiandreaEh eh, proposal, why don't we rename this channel to #clojure-emacs like the GitHub org btw?#2017-04-2605:41benedek+1 @richiardiandrea #2017-04-2617:11richiardiandrea@seancorfield @bozhidar what do you think?#2017-05-0918:13dpsuttoncontrol up might as well?#2017-05-0918:14uvtcAh, heh. Yes, those work too. 🙂 Thatks.#2017-05-0918:16uvtcWow. This is nice! I can also open a separate terminal window, run the emacsclient and switch to that *inf-clojure* buffer and work the repl from there. Whee!#2017-05-0918:22uvtcHm. This is weird: I hit Ctrl-D to exit/end the repl in the other terminal window (where I'd started emacsclient -nw and switched to *inf-clojure* buffer). It ended, but I couldn't do my usual C-# to finish the emacsclient session. I closed the terminal window. I had another file open in Emacs, and now the buffer is completely empty. It appears to be modified, and and tells me "No undo information in this buffer"... I can still see the file on disk, and its "#other-version.txt#" is there also and zero size...#2017-05-0918:24uvtcWell, killed the empty buffer, and the file is fine.#2017-05-0918:25uvtc(type: I meant "C-x #", not "C-#".)#2017-05-0918:26uvtctypo, I meant typo 🙂#2017-05-0918:35uvtcHm. Hitting a snag: I can get everything working with a given library project. But I'd like to then shut down the repl, close the file, and do the same with some other library project. I Ctrl-d to end the repl. I "C-x #" to close the emacsclient. cd to another library project, open a file there, but when I try M-x inf-clojure, it gives me file-not-found error:#2017-05-0918:36uvtcFileNotFoundException Could not locate john/data_util__init.class or john/data_util.clj on classpath. Please check that namespac\es with dashes use underscores in the Clojure file name. clojure.lang.RT.load (RT.java:456)#2017-05-0918:36uvtc(That was after working with inf-clojure repl with john/html-util, then trying to switch to john/data-util.)#2017-05-0918:37richiardiandreauhm, it does not seem an inf-clojure problem#2017-05-0918:37richiardiandreaall inf-clojure does is to launch lein repl#2017-05-0918:37richiardiandrea(btw you can customize what it is that it launches)#2017-05-0918:39uvtcOk, thank you.#2017-05-0918:47uvtcI currently use lein, so lein repl works great.#2017-05-0918:49uvtcThanks for the help! So glad to have this!#2017-05-1008:55jonpitheranyone seen this when running a test:
Exception in thread "nREPL-worker-0" java.lang.NullPointerException
at clojure.lang.Symbol.intern(Symbol.java:59)
at clojure.core$symbol.invokeStatic(core.clj:579)
at clojure.core$symbol.invoke(core.clj:574)
at cider.nrepl.middleware.test$report_fixture_error.invokeStatic(test.clj:134)
at cider.nrepl.middleware.test$report_fixture_error.invoke(test.clj:124)
at cider.nrepl.middleware.test$test_vars.invokeStatic(test.clj:171)#2017-05-1008:59jonpithernm#2017-05-1107:11asolovyovHey all! How do I switch to "cljs" mode in cider? So that in .cljc files :cljs part will be highlighted?#2017-05-1107:11asolovyovbecause right now it looks like a comment 🙂#2017-05-1107:31jumar@asolovyov you can activate clojurescript-mode. But if you want to do anything useful you need to also start clojurescript REPL#2017-05-1107:35asolovyovoh#2017-05-1107:36asolovyovemacs warns me that I can have problems if I'm activating it instead of clojurec-mode 🙂#2017-05-1107:41jumartry cider-jack-in-clojurescript - you should be just fine. Of course, if you rely on some browser stuff (e.g. XMLHttpRequest) then you'll find browser-connected repl#2017-05-1107:41asolovyovyeah, I've connected to my figwheel repl#2017-05-1107:41jumarbtw. you may want to add [com.cemerick/piggieback "0.2.1"] as a dependency#2017-05-1107:42asolovyovbut I don't know how to tell cider about it#2017-05-1107:42jumarah, great#2017-05-1107:42asolovyovso that this part of code will become active 🙂#2017-05-1107:43jumaryou may wanna check https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#integration-with-emacscider#2017-05-1107:44jumarIt's been a while since I was doing the cljs stuff, so I don't have the exact procedure at the top of my head#2017-05-1107:47bozhidarhttps://github.com/clojure-emacs/cider/issues/1967#2017-05-1107:47bozhidarJust keep this in mind 😉#2017-05-1107:48bozhidarAs for the highlighting - it changes by itself when the default connection gets changed from clj to cljs and vise-versa.#2017-05-1120:03ccannis there a way to make CIDER or clojure-mode format docstring-like arguments for macros as comment face not string face? (e.g. schema.core/defn and mount.core/defstate)#2017-05-1200:06escherizeI keep seeing references to the cider and cljfmt compatibility, but I can’t find a feature in cider or anything related to it. Does anyone have a link or a command or something similar?#2017-05-1200:09escherizeexample: https://github.com/weavejester/cljfmt#editor-support#2017-05-1205:03bennyReposting here from #cljsrn in case I have better luck: Trying to get more familiar with REPL in general, but trying to figure out how to get completion to work with Cider when writing my RN app, any tips?#2017-05-1205:13richiardiandrea@benny if you have company installed there should not be any problem#2017-05-1205:13richiardiandreaPlease keep in mind that ClojureScript completion is a bit more basic I think so your mileage may vary#2017-05-1205:17bennynot sure how in the world I missed that, thanks for pointing it out @richiardiandrea#2017-05-1205:17bennyjust missed the auto-completion layer in spacemacs#2017-05-1205:17richiardiandreaAh ah yeah that can be the issue 😀#2017-05-1205:17benny🙈#2017-05-1205:18bennythanks again!#2017-05-1207:42bozhidar@ccann I don't understand what exactly do you mean by this. 🙂#2017-05-1207:44bozhidar@escherize There are a few cider-format commands that would use cljfmt to reformat the code. Unfortunately the resulting formatting might be different from what clojure-mode would produce, I've been wondering for a while whether this feature is useful or pointless and we should remove it.#2017-05-1207:45bozhidarhttps://github.com/weavejester/cljfmt/issues/49#2017-05-1213:34kiemdoderI'm new to CIDER and Emacs and I'm struggling to find a way to move a file in CIDER/Emacs from one directory to another. How are files moved between directories?#2017-05-1213:38escherizethanks @bozhidar#2017-05-1213:48escherizeBut both are configurable, so bending one to work like the other or bending both to work the same should be possible. I’ll have a look.#2017-05-1213:48escherizewould sure be nice to have indentation done right™#2017-05-1214:21ccann@bozhidar for example schema’s defn function has a docstring argument just like clojure’s defn function, except that it gets the string face instead of the comment face applied#2017-05-1214:22ccannI can screenshot if that’s helpful#2017-05-1214:22ccannor open an issue on cider / clojure-mode#2017-05-1214:30dpsuttonwhy would it get a comment face if it's a docstring argument, which I'm assuming means its a string#2017-05-1214:33ccannsorry, I wasn’t totally accurate: clojure.core/defn has a docstring argument and it gets the font-lock-doc-face and schema.core/defn has a docstring argument that has a font-lock-string-face#2017-05-1214:34ccanndoc face helps distinguish a docstring from a string the function cares about, IMO. it also helps visually parse whether you’ve accidentally put the docstring after the argument vector, which I see a lot#2017-05-1215:35bozhidarHmm, I thought we fixed this ages ago. What version of clojure-mode are you using?#2017-05-1215:37bozhidarhttps://github.com/clojure-emacs/clojure-mode/commit/5d2f48b1676b82d8775405a68de50b8f75ffa758#2017-05-1216:44ccann5.7.0-SNAPSHOT#2017-05-1222:38macrobartfastI usually C-c C-k (cider-load-buffer) to evaluate a buffer's forms so that I can use them; my file became unwieldy so I put some functions in another file I :require; how do I 'load' the forms in the :required file so I can use them?#2017-05-1222:39macrobartfastthere may be something deeply wrong with my approach in general, as per usual.#2017-05-1223:15dpsuttonthey should be there loaded for you. Traditionally, in your ns form you have a (:require [my.deps :as alias])) and then in the file you can use those exposed functions and vars by (alias/function-name ...)#2017-05-1223:15dpsuttondoes this not work for you?#2017-05-1223:16macrobartfastit doesn't ;-(#2017-05-1223:17macrobartfastbut I'm trying to duplicate it with a simpler :require'd file to try to isolate the issue.#2017-05-1223:24macrobartfastI'll create a fresh project and see if I can reproduce this there. As I do that, though, I should mention that I'm :require'ing in file A to file B, calling functions from A in B, and evaluating them in B right in the buffer with C-c C-c (cider-eval-defun-at-point)... that should work, right?#2017-05-1223:25macrobartfastit crossed my mind that cider-eval-defun-at-point might not work on functions that have been brought in or something.#2017-05-1223:29macrobartfastok, works fine in the new project I made. so something went wrong in my current project; I'll just create a project from scratch and bring code over. thanks for the help on this!#2017-05-1300:08macrobartfast@dpsutton it's all working beautifully now 😀#2017-05-1300:09dpsuttonGlad it worked out :)#2017-05-1304:15echristophersonI really like the eunuch plugin for vim; you can just type :Rename foo when visiting a buffer and it will take care of everything for you#2017-05-1304:15echristophersonMakes me wish all document-oriented programs worked that way#2017-05-1304:16echristopherson@mchampine Does renaming a file in dired cause the buffer with that file open to update itself?#2017-05-1304:47richiardiandreaI think the rename functionality is in clj-refactor, if dired has a hook in their rename it should be trivial to have that (and I'd be interested as well) 😀#2017-05-1315:34jaermeIs there an equivalent command for M-. and M-, in evil-mode? Thanks in advance.#2017-05-1316:01dpsuttonI don't know what they are bound to but i can help you find out. M-. is bound to cider-find-var and M-, is bound to cider-pop-back. You can find out the binding of these by M-x describe-function [ret] function-name. This screen should display the current key binding#2017-05-1316:29jaermeThanks for responding. So in evil-mode, M-. is bound to evil-repeat-pop-next not cider-find-var. So I guess I need to modify the current key binding?#2017-05-1317:40dpsuttoni'm not sure. i don't know if that's a useful binding for you or not. if you want to preserve it you could bind cider-find-var elsewhere. I don't know how evil works and getting into normal mode, insert, etc. Best I can do is point out the functions you need#2017-05-1319:28xiongtxAnyone encountered this issue before? https://gitter.im/clojure-emacs/cider?at=5916bad500efc2bb3e61d26a
Strangely, `cider-find-var` only seems to work in a Cljs buffer for some vars (e.g. `om/root`), while others (e.g. `om/component`) work in all buffers (e.g. `*scratch*`).
#2017-05-1319:59jumar@jaerme , g g works for me#2017-05-1320:00jumarah sorry, I'm using spacemacs and I'm not sure if that's the same in your case#2017-05-1406:45kiemdoderThank you for your responses @mchampine and @richiardiandrea. I did not know that the dired mode rename behaves like move. I also somehow managed to miss clj-refactor. I think clj-refactor is more suited to what I wanted to do since I wanted to move code to a different namespace.#2017-05-1512:00kiemdoderis there a cider function to dismiss the stack trace?#2017-05-1513:07dpsutton@kiemdoder what do you mean? like to just dismiss the buffer?#2017-05-1513:30kiemdoderhi @dpsutton, sometimes a new window is created for the stack trace and when I kill the stack trace buffer I'm still left with the window#2017-05-1513:31kiemdoderI noticed that when I evaluate some code in a clj file that causes a stack trace the stack trace is dismissed when I fix the code and evaluate it again. That made me think that maybe there is a cider function to dismiss the stack trace. I looked through the cider functions but could not find one yet.#2017-05-1513:34dpsuttonI always hit q in the buffer to bury it.#2017-05-1513:34dpsuttonare you killing the buffer with emacs commands?#2017-05-1513:38dpsuttonthe cider error buffer is a cider ancillary buffer. you can see how these things are created here:#2017-05-1513:38dpsutton(defun cider-make-popup-buffer (name &optional mode ancillary)
"Create a temporary buffer called NAME using major MODE (if specified).
If ANCILLARY is non-nil, the buffer is added to `cider-ancillary-buffers'
and automatically removed when killed."
(with-current-buffer (get-buffer-create name)
(kill-all-local-variables)
(setq buffer-read-only nil)
(erase-buffer)
(when mode
(funcall mode))
(cider-popup-buffer-mode 1)
(setq cider-popup-output-marker (point-marker))
(setq buffer-read-only t)
(when ancillary
(add-to-list 'cider-ancillary-buffers name)
(add-hook 'kill-buffer-hook
(lambda () (setq cider-ancillary-buffers (remove name cider-ancillary-buffers)))
nil 'local))
(current-buffer)))
#2017-05-1513:38dpsuttonthis is in cider-popup.el#2017-05-1513:42kiemdoderThe "q" key was the thing I was looking for. Thanks a lot#2017-05-1514:03dpsuttonawesome.#2017-05-1514:09kiemdoderI notice now that "q" is used elsewhere in emacs as well like dismissing a dired window for instance#2017-05-1604:45xiongtxkiemdoder: That's right, q is bound to quit-window in special-mode-map, which is inherited by modes that derive from special-mode.
See the Elisp manual for more: https://www.gnu.org/software/emacs/manual/html_node/elisp/Basic-Major-Modes.html#2017-05-1607:51kiemdoderThanks a lot for that reference @U2J7JRTDX. I'm getting a lot of valuable emacs information from people in this channel.#2017-05-1607:53xiongtxYou can also ask questions on the Emacs StackExchange: https://emacs.stackexchange.com/
But be sure to spend some effort trying to figure it out yourself first 😉. It’s one of the more heavily moderated SEs.#2017-05-1514:46pesterhazyYeah, like less#2017-05-1603:03xiongtxcider-eval-last-sexp in a cljs buffer always returns nil in case of exception, with the ST only in the REPL buffer. Is this expected behavior?#2017-05-1603:03xiongtxI.e. there's no pop-up buffer containing an exception like w/ clj#2017-05-1603:11jfntnHas anyone noticed that if there’s an error with cider-load-buffer with the popup enabled and jump to error disabled, you’ll end up at a different place in the buffer after quitting the popup?#2017-05-1604:17richiardiandreaBoth the ☝️ are new to me, probably worth a cider issue. Thanks for reporting!#2017-05-1607:52kiemdoderdoes cider debugging work in macros as well?#2017-05-1607:52stardivinerHow to limit CIDER output? I found Clojure Incanter read-dataset will print the data. It is very big. So how to configure CIDER to limit its output size?#2017-05-1607:54pkova(set! *print-length* n)#2017-05-1607:55pkovathere's also *print-level*#2017-05-1607:56stardiviner@pkova Should I set it in Leiningen? which section should I set?#2017-05-1607:59pkovastardiviner: I've only ever set those vars at the repl#2017-05-1607:59pkovaI think you can use leiningens :repl-options though#2017-05-1607:59stardivinerI see. Thanks#2017-05-1705:37dpsuttonsaavik.unification> (time (def v (vrange 1000000)))
"Elapsed time: 71.227628 msecs"
#'saavik.unification/v
saavik.unification>
#2017-05-1705:37dpsuttonjust timed it. it was fast#2017-05-1705:38dpsuttonmake sure not to eval the `vrange 10000..) as this will print to the repl and that will get really nasty#2017-05-1705:38dpsuttonsaavik.unification> (time (def v2 (vrange2 1000000)))
"Elapsed time: 45.889161 msecs"
#'saavik.unification/v2#2017-05-1705:39stardivinerWeird? How to debug this issue?#2017-05-1705:39dpsuttonis it printing out a bunch of stuff to your repl?#2017-05-1705:40stardivinerNo, I ue (def v (vrange 1000000)).#2017-05-1705:40dpsuttonok#2017-05-1705:40stardivinerI have (set! *print-length* 20) in REPL.#2017-05-1705:40dpsuttonwhat does (time (def v2 (vrange2 1000000))) say?#2017-05-1705:41stardivinerBoth Emacs and Leiningen are running. Can't type in code.#2017-05-1705:41dpsuttondid you jack in or cider-connect?#2017-05-1705:42stardivinerlein repl, then cider-connect.#2017-05-1705:42stardivinerI pressed [C-c] in Lein repl, now typed your code.#2017-05-1705:42dpsuttonso what does it say in the lein repl?#2017-05-1705:43stardivinerNo responding.#2017-05-1705:44dpsuttonwell that's a problem with lein then. i'm not sure what to say#2017-05-1705:44dpsuttonbut we aren't touching CIDER, so it can't be a problem with that, if i'm understanding the situation correctly#2017-05-1705:44stardivinerWell, Maybe I need to debug this http://deeper.Do you know know to debug this?#2017-05-1705:45stardivinerYES.#2017-05-1705:45dpsuttoni don't i'm sorry. maybe head to the #clojure channel#2017-05-1705:45dpsuttoni've got to get to sleep tonight. i'm sorry#2017-05-1705:45stardivinerOk, bye, thanks.#2017-05-1708:27stardivinerI used to use CIDER's apropos to search, but don't know hot to specify the regexp pattern. Does anybody knows this?
For example I want to apropos search string in function name and function docstring by regexp matching "first n". Then what should I type in CIDER doc apropos prompt?#2017-05-1710:25tatuthow can I automatically truncate a cider repl buffer when it gets too long?#2017-05-1710:26tatutafter a long running repl session, the buffer itself is becoming slow and I don’t really care about output that happened days ago#2017-05-1711:02hansC-c M-o is what I use#2017-05-1800:32xiongtxhans: You mean cider-repl-clear-output, C-u C-c C-o? By default, C-c M-o is cider-repl-switch-to-other#2017-05-1810:15hansOh, yes. C-c M-o was the default binding in an ancient cider release and I've come to grow accustomed to it:
(add-hook 'cider-repl-mode-hook
'(lambda ()
(define-key cider-repl-mode-map (kbd "C-c M-o") 'cider-repl-clear-buffer)))
#2017-05-1711:31tatutbut there’s no setting to automatically truncate lines over some limit?#2017-05-1711:31tatutlike to automatically keep at most max 1000 lines#2017-05-1712:44dpsutton@tatut i could swear i've seen code like that. let me look#2017-05-1712:45tatutstandard feature in comint buffers#2017-05-1712:46tatutbut I couldn’t find the same for cider repl#2017-05-1800:31xiongtxtatut: CIDER does not use comint, it’s derived from SLIME’s custom REPL.
https://github.com/slime/slime#2017-05-1713:00dpsuttoni was mistaken. it's not there.#2017-05-1713:01dpsuttoni think bbatsov has wanted more comint features for a while. and there's some inclination on his part to switch to a comint buffer but it would be a lot of work#2017-05-1722:23bozhidarThat’s in the past now.#2017-05-1722:23bozhidarI decided I don’t want to use comint at all. You get some things for free, but you also get a lot of limitations.#2017-05-1722:24bozhidarImplementing some output truncation feature is trivial anyways.#2017-05-1722:24bozhidarWe’ve mostly been suggesting the use of Clojure’s own truncation mechanisms, but if people want something CIDER specific - that’s an option.#2017-05-1800:33xiongtxbozhidar: clj truncation applies to output for a particular expression; @tatut is talking about the REPL buffer specifically#2017-05-1807:13bozhidarYeah, I get this. Btw, it’s easy to have different value for Clojure’s truncation for the REPL and source buffers. We just haven’t implemented something like this.#2017-05-1810:15hansOh, yes. C-c M-o was the default binding in an ancient cider release and I've come to grow accustomed to it:
(add-hook 'cider-repl-mode-hook
'(lambda ()
(define-key cider-repl-mode-map (kbd "C-c M-o") 'cider-repl-clear-buffer)))
#2017-05-1810:00andrea.crottihi everyone, quick question, some weeks ago the Cider REPL started behaving a bit differently#2017-05-1810:01andrea.crottipressing TAB now on an empty line actually indents the REPL#2017-05-1810:01andrea.crottiI'm quite sure it didn't use to do that#2017-05-1810:01andrea.crottiis that something that was done on purpose or maybe a known bug/feature?#2017-05-1810:15hansSorry#2017-05-1813:01dpsutton@andrea.crotti I've seen this as well and I have no explanation#2017-05-1813:02andrea.crottigood that I'm not the only one @dpsutton I can file an issue on github#2017-05-1813:02andrea.crottisince it looks like a bug to me#2017-05-1813:02dpsuttonnot sure what we can do though#2017-05-1813:02dpsutton(defun cider-repl-indent-and-complete-symbol ()
"Indent the current line and perform symbol completion.
First indent the line. If indenting doesn't move point, complete
the symbol."
(interactive)
(let ((pos (point)))
(lisp-indent-line)
(when (= pos (point))
(if (save-excursion (re-search-backward "[^() \n\t\r]+\\=" nil t))
(completion-at-point)))))
#2017-05-1813:03dpsuttonthe lisp-indent-line is out of our hands#2017-05-1813:03dpsuttonthis is a strange one. i wonder why it has changed recently#2017-05-1813:03andrea.crottiwell it must be something that changed in Cider right?#2017-05-1813:04andrea.crottiat least I assumed so, but to be fair I'm keeping Emacs updated as well, now on
GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-05-17#2017-05-1813:08dpsuttonall of the code connected to pressing tab has existed since 2013 it seems#2017-05-1814:25bozhidarIndeed.#2017-05-1814:25bozhidarLikely a change in Emacs.#2017-05-1815:32andrea.crottimm well for me the change seemed way more recent than that @dpsutton#2017-05-1815:32dpsuttoni agree#2017-05-1815:32dpsuttonwhat emacs are you running? you mentioned 25.2#2017-05-1815:32dpsuttoni'm building from source so i'm 26.x#2017-05-1815:32andrea.crottino 26.0.50 as pasted above#2017-05-1815:32dpsuttonah same here#2017-05-1815:32andrea.crottibut on 26 from some time ago it wasn't like that#2017-05-1815:32dpsuttontip of emacs is a little wonky then#2017-05-1815:41andrea.crottiok good to know I'll see if I can find something about that#2017-05-1916:39oskarkvAny particular reason cider-stacktrace and cider-inspector does not have the -mode variables, that are true if they are active?#2017-05-1919:23oskarkvIs there a way to indent docstrings so the first letter in each line are aligned? Right now the first line's " is aligned with the first letter in the rest of the lines.#2017-05-1919:28oskarkvAh, clojure-docstring-fill-prefix-width#2017-05-2003:23stardivinerAsk one question. Does CIDER can do completion candidates case-sensitive like discussed in this issue? https://github.com/company-mode/company-mode/issues/364#2017-05-2109:42andrea.crotti@dpsutton FYI now the TAB issue solved itself#2017-05-2109:42andrea.crottiby upgrading Emacs again, now I'm using GNU Emacs 26.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-05-17#2017-05-2111:07stardivinerHow to get current nrepl connection with elisp function? I need to use in function nrepl-send-request.#2017-05-2111:13stardivinerIs it (nrepl-connection-buffer-name)?#2017-05-2117:53dpsuttongood to know @andrea.crotti i'll make bootstrap again soon and hopefully see the improvements#2017-05-2117:54dpsutton@stardiviner try (cider-current-connection)#2017-05-2215:25oskarkvI'm trying to bind (clojure.tools.namespace.repl/refresh) to a keyboard shortcut. I managed with cider-interactive-eval, but the problem is that the "minibuffer" or whatever it's called that comes up isn't big enough to display the complete output if there was an error. Can I make the output go to the repl instead?#2017-05-2215:31oskarkvSome output goes to the repl, but a stacktrace comes up in the minibuffer and it's not big enough.#2017-05-2215:34dpsuttonin cider-interaction.el there's a function cider-refresh that should do what you want#2017-05-2215:35dpsuttonand it's got its own refresh-response-hanlder to do exactly what you want#2017-05-2215:40dpsuttonand you can hook up pre and post functions to run, and some other options#2017-05-2215:41dpsutton"Reload modified and unloaded namespaces on the classpath.
With a single prefix argument, or if MODE is `refresh-all', reload all
namespaces on the classpath unconditionally.
With a double prefix argument, or if MODE is `clear', clear the state of
the namespace tracker before reloading. This is useful for recovering from
some classes of error (for example, those caused by circular dependencies)
that a normal reload would not otherwise recover from. The trade-off of
clearing is that stale code from any deleted files may not be completely
unloaded.
With a negative prefix argument, or if MODE is `inhibit-fns', prevent any
refresh functions (defined in `cider-refresh-before-fn' and
`cider-refresh-after-fn') from being invoked."
#2017-05-2303:04puzzlerI'm getting an error loading figwheel/piggieback repl in cider: `Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
A) not providing piggieback as a dependency and/or
B) not adding piggieback middleware into your nrepl middleware chain.
example profile.clj code:
-----
:profiles {:dev {:dependencies [[com.cemerick/piggieback <current-version>]
[org.clojure/tools.nrepl <current-version>]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
-----
Please see the documentation for piggieback here https://github.com/cemerick/piggieback#installation
Note: Cider will inject this config into your project.clj.
This can cause confusion when your are not using Cider. figwheel-sidecar.repl/eval28850/fn--28851 (repl.clj:166)#2017-05-2303:05puzzlerI've double-checked my profile.clj code, and it has all those dependenices and repl-options. Any other tips?#2017-05-2303:06puzzlerMy profile is based on a luminus template.#2017-05-2303:16puzzlerAfter the error, the cljs REPL comes up, but it doesn't recognize js/ as a valid namespace, and sending a form to the REPL triggers a message that the repl is misbehaving, urging me to report a bug.#2017-05-2303:32dpsutton@puzzler can you turn on nrepl-toggle-message-logging and then try a command at the repl, even something crazy simple. The visit the logging buffer and we can see what type of repl we've got. it'll say it at the end, something like
(<--
id "16"
session "42da1513-54f2-4a29-b4b1-603d07a18434"
time-stamp "2017-04-30 11:20:56.987795668"
changed-namespaces (dict)
repl-type "cljs"
status ("state")
)
here notice repl-type. This can help us find out if the cljs repl is starting at all, but my guess is its not and that's why js/ isn't recognized: the jvm clojure side has no idea what that is, and rightly so#2017-05-2303:33dpsuttoni don't know what profile.clj code is. what do you mean by this?#2017-05-2303:37puzzlerI meant project.clj.#2017-05-2303:38dpsuttonok just making sure#2017-05-2303:39dpsuttoncan you post that here?#2017-05-2303:39dpsuttonalso, do you have a profile.clj file for lein?#2017-05-2303:39dpsuttonsome people have this hanging around from the brave clojure book and its tied to CIDER 0.8.2#2017-05-2303:40puzzlerThere is a profiles.clj file. (This is from a luminus template).#2017-05-2303:40puzzlerI've enabled logging, am currently trying to find where the output is going...#2017-05-2303:43dpsuttonprofiles.clj file is a file that sets some standards across lein. are we talking about the same thing?#2017-05-2303:43dpsuttonand can you tell me which luminus template?#2017-05-2303:43dpsuttoni'll crank one up and see what i run into#2017-05-2303:44puzzlerYes, as you suspected, for some reason after the error, the clojurescript repl is just turned into a clojure repl.#2017-05-2303:44dpsutton:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}#2017-05-2303:45puzzlerThose repl-options are part of the figwheel setup in the project.#2017-05-2303:45puzzlerI tried adding it again separately, and it complained that I couldn't set that variable twice.#2017-05-2303:45puzzlerSo that tells me it is picking it up from the figwheel part of the profile.#2017-05-2303:46puzzlerThe error happens when I first load the webpage and figwheel makes the connection.#2017-05-2303:46dpsuttonand are you jacking in with the project/dev profile?#2017-05-2303:46puzzlerYes.#2017-05-2303:46dpsuttonok just going over it. trivial problems are great problems 🙂#2017-05-2303:46puzzlerActually, how would I check that?#2017-05-2303:47puzzlerTo be sure.#2017-05-2303:47dpsuttonwhat makes you think that you're actually doing it?#2017-05-2303:48puzzlerBecause back when things worked, I was getting compilation level none, which is how it is configured in dev. But now that things aren't working, I'm not as sure.#2017-05-2303:48puzzlerI've tried to compare my profile against the base template, to see what could have changed, and the main thing that has changed is I updated to the latest Clojure 1.9 alpha (template uses 1.8).#2017-05-2303:48dpsuttonahh#2017-05-2303:49dpsuttonif you go back to clojure 1.8 does it work again?#2017-05-2303:49dpsuttonbecause they changed the namespaces in spec to include alpha and if the deps didn't update to do this the latest clojure 1.9 might not work for you#2017-05-2303:50puzzlerThat's the next thing I was going to try. I needed to switch to 1.9, to make use of the cljs-oops library, so I'm not sure I can go back without my code breaking in other ways.#2017-05-2303:50dpsuttonah#2017-05-2303:50puzzlerHmmm, that's an interesting hypothesis.#2017-05-2303:50dpsuttonor perhaps specify an older 1.9 alpha#2017-05-2303:50dpsuttonlike 16 or 14 perhaps?#2017-05-2303:51dpsuttonthis is cljs-oops: org.clojure/clojure "1.9.0-alpha16"#2017-05-2303:51dpsuttontry that one#2017-05-2303:51puzzlerThat's the one I'm trying.#2017-05-2303:51puzzlerI mean, the one I'm using right now. 16#2017-05-2303:52dpsuttonah that's current. try 14?#2017-05-2303:52puzzlerWhile I'm doing this, what's the quickest way to do shut down both clojure and clojurescript cider repls and restart them?#2017-05-2303:52puzzlercider-restart seems to get confused by the two repls.#2017-05-2303:52puzzlerSo I've been exiting emacs, which seems really clunky.#2017-05-2303:53dpsuttonyeah the cljs repl gets started and doesn't know how to restart itself due to being intialized in a callback#2017-05-2303:53dpsuttonie, when you restart it, it doesn't know to call that callback again#2017-05-2303:53dpsuttonbest way is to C-c C-q to cider-quit#2017-05-2303:53dpsuttonbut you may have to do that in both repls#2017-05-2303:54dpsuttoncould make a function that would kill buffers with REPL at the end of their name as well#2017-05-2303:54dpsuttonthat's the kind of hacky code that can go in your emacs but wouldn't be acceptable for CIDER#2017-05-2303:56dpsuttoni don't know enough java to know if that's easy/possible#2017-05-2303:56puzzler1.9 alpha 14 didn't work. Trying 1.8 next.#2017-05-2303:56dpsuttondang#2017-05-2303:56dpsuttonmy guess is that some of your libs have 1.9a14 and some have 1.9a16 and they can't work together#2017-05-2303:57dpsuttonie spec isn't called the same thing across the two#2017-05-2303:58devn@puzzler can you use exclusions?#2017-05-2303:58dpsuttonwe're trying to see if that is the problem to begin with. gonna roll back to 1.8 and see if this mess goes away#2017-05-2303:58devnI'm catching up here, so forgive me in advance #2017-05-2303:58dpsuttonif so, then perhaps we could figure out which lib needs it#2017-05-2303:59dpsuttonno problem. i don't know much about spec or cljs so someone else here is nice#2017-05-2304:02puzzlerSorry, it takes forever to restart the repls.#2017-05-2304:02dpsuttonno worries#2017-05-2304:02devnWill reading the output of lein deps :tree be useful here? To see the deps for various clojure versions? #2017-05-2304:03dpsuttonsounds like a good idea#2017-05-2304:03devnOr rather the transitive deps on clojure?#2017-05-2304:05puzzlerBack on 1.8, the cljs file isn't compiling, and I'm still getting the error on top of that.#2017-05-2304:06dpsuttonwonder why the file isn't compiling#2017-05-2304:06puzzlerI can't find the error message, but I assume it's the cljs-oops, which is why I upgrade to 1.9.0-alpha16 in the first place.#2017-05-2304:07dpsuttonyeah. i would agree. and is it too much work to remove that?#2017-05-2304:07dpsuttonif so it's cool#2017-05-2304:07dpsuttonhow much work have you put in since running the template#2017-05-2304:08dpsuttonhave it in git? can you run a diff?#2017-05-2304:09dpsutton[org.clojure/clojure "1.8.0"]
overrides
[rolling-stones "1.0.0-SNAPSHOT"] -> [org.clojure/clojure "1.9.0-alpha13"]
#2017-05-2304:11dpsutton(ns rolling-stones.core
(:require [better-cond.core :as b]
[clojure.spec :as s]
[clojure.pprint])
(:import [org.sat4j.core VecInt]
org.sat4j.minisat.SolverFactory
org.sat4j.minisat.core.SolverStats
org.sat4j.tools.ModelIterator
[org.sat4j.specs ContradictionException TimeoutException ISolver IProblem]))
#2017-05-2304:11dpsuttonin clojure 1.9a16 i think this won't compile#2017-05-2304:11dpsuttonwhich might be the problem?#2017-05-2304:12dpsuttoncompared to spec here in cljs-oops:
(ns oops.config
"Code supporting static (compile-time) configuration. See defaults.clj for config map."
(:refer-clojure :exclude [gensym])
(:require [cljs.env]
[clojure.spec.alpha :as s]
[env-config.core :as env-config]
[oops.state]
[oops.helpers :as helpers :refer [gensym]]
[oops.defaults :as defaults]))
#2017-05-2304:12puzzlerrolling-stones is my library, so I can update that if that is really the culprit.#2017-05-2304:12dpsuttonclojure.spec vs clojure.spec.alpha#2017-05-2304:12dpsuttonoh are you mark?#2017-05-2304:12puzzleryes#2017-05-2304:12dpsuttonoh super cool#2017-05-2304:13dpsuttoni've followed instaparse's issue for a while. that's really nice software#2017-05-2304:13puzzlerthanks#2017-05-2304:13dpsuttonbut that's my guess#2017-05-2304:13puzzlerOK, will try that next.#2017-05-2304:15dpsuttoni've got to get to bed. is it possible we could continue tomorrow, perhaps with something i could clone to root around for issues?#2017-05-2304:16puzzlerI'll try to distill it down to something simple, and will let you know. Thanks for your help.#2017-05-2304:16dpsuttonanytime. i hope it gets working for you#2017-05-2304:16dpsuttonand i'm happy to help more tomorrow although i may be nearing the end of my ability to make educated guesses#2017-05-2304:42puzzler@dpsutton I have it boiled down to a few reproducible steps now:
1. lein new luminus luminuscljs +cljs
2. Open emacs. Open luminuscljs/src/cljs/luminuscljs/core.cljs.
3. cider-jack-in-clojurescript
4. After the figwheel repl starts up, wait a few minutes.
At this point, figwheel sometimes times out and reports an error here. If not, continue...
5. In the Clojure REPL, type (start)
6. In your browser (I used Chrome), open localhost:3000.
7. Wait a few more minutes, and you should see the error appear in emacs in the clojurescript repl.#2017-05-2304:45puzzler@dpsutton This demonstrates an error out of the box with the luminus template and cider, indicating it has nothing to do with the specific of my project. Why did it work for me before? I have no idea. Did I imagine it? I'd have to rewind my version control to various points in time to try to figure that out. I filed an issue on luminus, but he responded that it appears to be more of a cider issue, since the project file seems correct.#2017-05-2304:45dpsuttondo you run into issues when running this from a lein repl?#2017-05-2304:46dpsuttonbut i'm gonna for sure try it tomorrow#2017-05-2304:46dpsuttonbut lein repl will dictate if luminous is broken or CIDER#2017-05-2304:47puzzlerVerifying...#2017-05-2304:50puzzlerHmmm, I'm getting a slightly different, but similar error at the command line. Will add that to my luminus issue to see if that helps.#2017-05-2304:54dpsuttonwhew that's a lot of dependencies#2017-05-2304:55dpsuttoni'm able to run lein repl but it mentions i really want to run lein figwheel#2017-05-2304:55dpsuttoncompiling#2017-05-2304:56dpsuttonwhat's the url of the site generated by that template?#2017-05-2304:56dpsuttoncan't seem to find it on 3449 or 7002#2017-05-2305:08dpsuttonok. following your bug report i'm able to get it running with lein run and lein figwheel but unable to get it working with CIDER#2017-05-2305:08dpsuttonmine stops at Prompt will show when Figwheel connects to your application#2017-05-2305:36puzzlerI just access it through the server (localhost:3000). I think you're right that figwheel also runs its own server which can be accessed through another port. I would have guessed 3449.#2017-05-2305:37puzzlerBut the "lein repl" server serves through localhost:3000.#2017-05-2305:38puzzlerFigwheel can't connect to the application until you visit the page.#2017-05-2305:52puzzlerProblem solved!#2017-05-2305:53puzzlerBy backtracking to last week's commit that worked, I was able to track it down to my bumping up the version of figwheel and figwheel-sidecar from 0.5.9 to 0.5.10. My browser had cached something from the older version.#2017-05-2305:53puzzlerOnce I forced the browser to refresh and ignore the cache, everything was happy again.#2017-05-2305:54puzzlerThanks for taking the time to brainstorm on this with me. Much appreciated!#2017-05-2305:55puzzlerIt was useful to know that you got it working on your system with the exact same project template, because that really helped narrow it down to something quirky on my system, in this case, browser state.#2017-05-2312:09hkjelsIs it possible to use the debugger with cljc-files?#2017-05-2312:12dpsuttonif you're evaluating clojure not clojurescript it should be#2017-05-2312:12hkjelsOK, so that’s the problem#2017-05-2312:12hkjelsThanks#2017-05-2312:57stardivinerHow to get current cider project name with elisp function?#2017-05-2313:15dpsuttonnrepl-project-dir is a variable defined in ‘nrepl-client.el’.
Its value is "~/projects/clojure/luminuscljs/"
Local in buffer *cider-repl luminuscljs*; global value is nil
Automatically becomes buffer-local when set.
#2017-05-2313:16dpsuttonalso from clojure-mode:
(defun clojure-project-dir (&optional dir-name)
"Return the absolute path to the project's root directory.
Use `default-directory' if DIR-NAME is nil.
Return nil if not inside a project."
(let* ((dir-name (or dir-name default-directory))
(choices (delq nil
(mapcar (lambda (fname)
(locate-dominating-file dir-name fname))
clojure-build-tool-files))))
(when (> (length choices) 0)
(car (sort choices #'file-in-directory-p)))))
#2017-05-2313:17stardiviner@dpsutton I tried nrepl-project-dir, but in project source code file, it is nil.#2017-05-2313:17dpsuttonyeah you'll need to get it from buffers#2017-05-2313:17stardivinerI will try clojure-project-dir.#2017-05-2313:18dpsutton(with-current-buffer (cider-current-connection) #2017-05-2313:18stardivinersorry, I did get it from buffer,#2017-05-2313:18dpsuttonafter you've jacked in?#2017-05-2313:18stardivinerOh, I see.#2017-05-2313:18stardivinerYes.#2017-05-2313:19dpsuttonalso there's a function called (buffer-local-value VARIABLE BUFFER)#2017-05-2313:19stardivinerHere is the step, I jacked in project, and open the project source code file as buffer, then use a function to get the variable nrepl-project-dir's value to used in a custom mode-line.#2017-05-2313:19dpsuttonyeah that var is only in the repl buffer (which is kinda the same thing as the connection buffer)#2017-05-2313:20dpsuttonbut the clojure mode version of just look for a boot or lein file is fine too#2017-05-2313:20stardivinerRestarting Emacs to take a try. buffer-local-value and (with-current-buffer (cider-current-connection)#2017-05-2313:20dpsuttoncool. i'm off to work but if you have any questions let me know#2017-05-2313:20stardivinerThanks very much#2017-05-2317:13gastoveGood morning! Does anyone in here know how Cider selects a value for cider-cljs-lein-repl? I just lost a merry while trying to figure out what the heck was trying to bring figwheel in to a project that doesn’t use it.#2017-05-2317:18tanzoniteblackgastove: https://github.com/clojure-emacs/cider/blob/a82bfbebe8c3e470321ec79df5c08d49f3709bb1/cider.el#L458 it deafults to a rhino repl#2017-05-2317:18tanzoniteblackif you want it to be anything else, you have to manually set it in you .emacs config#2017-05-2317:18gastoveoh god did I set this somewhere and not realize it I did didn’t I#2017-05-2317:18gastoveoh christ, I did. Way to foot-gun future me, Past Me.#2017-05-2317:18wisemanIt can also be set in .dir-locals.el (which is what the chestnut template does)#2017-05-2317:19gastoveYeah, .dir-locals.el is clearly what I should be doing.#2017-05-2317:19wisemanthat took me a while to figure out.#2017-05-2317:20tanzoniteblackthat’s probably a better way to do it than what I was doing…which involved loading libraries#2017-05-2317:20tanzoniteblackactually, let’s not talk about how I did, .dir-locals.el is a far better idea#2017-05-2317:21gastoveHahahaha. Yeah — especially with projectile, managing a .dir-locals.el is almost certainly the easiest thing. I might… see if CIDER would accept a PR binding each config to a symbol, tho — make it a little easier to use than bare strings.#2017-05-2317:13gastove(Well, more properly, figwheel-sidecar, but same idea.)#2017-05-2415:33jfntnAre there any know issues with getting cider-debug-defun-at-point to pause execution when that function is running as part of of an environment captured by bound-fn?#2017-05-2420:13Matthew Davidson (kingmob)Does anyone know of a way to turn a bunch of (let [....]) binding forms into defs of vars at the REPL? I keep wishing for it.#2017-05-2423:31mathpunkI'm sure you're all not sick of people asking, Why can't I connect with CIDER?, so, here's a link to my post in #macchiato where I'm trying to figure out if it's my profile or the project that's causing problems: https://clojurians.slack.com/files/mathpunk/F5HP0FC85/project.clj#2017-05-2506:13hans@mathpunk you may want to add some information as to how you "cannot connect to cider"#2017-05-2508:17gmercerdoes cider have create new namespace function that creates the file in the correct dir and and adds the header ?#2017-05-2508:20gmercerI saw the buildfunthings guy Arjen doing it - but maybe it's another package ..#2017-05-2508:56mgrbyte@gmercer With the clj-refactor emacs package, when you create a new foo.clj file, it adds the namespace header automatically to the buffer#2017-05-2509:18gmercer@mgrbyte thanks - will add and check it out - you wouldn't happen to know the cool dependency adder he uses ??#2017-05-2509:29benedekthat should be clj-refactor too I guess#2017-05-2509:30benedekcheck out the feature list with small demos here https://github.com/clojure-emacs/clj-refactor.el/wiki#2017-05-2509:34mgrbyte@gmercer I've not seen the thing you're talking about, but the clj-refactor wiki lists all the available features. e.g: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-hotload-dependency#2017-05-2510:25gmercerhttps://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency
https://www.youtube.com/watch?v=I28jFkpN5Zk
pretty much swiped his init.el#2017-05-2612:57dpsuttoncould you post a screenshot?#2017-05-2615:48dpsutton@kiemdoder can you post a screenshow?#2017-05-2616:57tanzoniteblack@kiemdoder when you have your cursor over text in emacs, you can run M-x describe-face to see what face (i.e. named set of font attributes) is being applied, those names will generally be descriptive enough to understand why the mode is causing the symbol to be formatted in such a way#2017-05-2616:57tanzoniteblackor at least it would give us something to help explain it to you 🙂#2017-05-2617:01dpsuttonhere's a function i've been playing with: create a let binding of the local vars when debugging:#2017-05-2617:02dpsuttonvery rudimentary and looking at extending cider-nrepl to do this#2017-05-2617:03dpsuttonbut you need to be in the debugger, run this with whatever code you want for the body highlighted, and then quit the debugger#2017-05-2617:03dpsuttonworking to get the debugger to send the locals over and then quit for you#2017-05-2617:05richiardiandrea@dpsutton saving this as I have been trying to create something similar as well!#2017-05-2617:05dpsuttonluckily @malabarba 's debugger already sends back the locals so we just have to look at them and format them#2017-05-2617:07richiardiandreain my head there should be a function that defines a let with its results at the repl#2017-05-2617:07richiardiandreaI mean does the actual def#2017-05-2617:07richiardiandreafrom each let binding#2017-05-2617:08dpsuttoni didn't want to reach into def so it wouldn't clobber anything in the environment#2017-05-2617:08dpsuttonbut thought about interning the environment maps#2017-05-2617:08richiardiandreaah ah yeah#2017-05-2617:08dpsuttonand letting you name them and browse them#2017-05-2617:08dpsuttonlots of ways to go about it#2017-05-2617:08richiardiandreaI guess my use case is, you want to define the let so that you can debug the "body"#2017-05-2617:09richiardiandreathere could be a cleanup thing for undefining them#2017-05-2617:13richiardiandrea@dpsutton have you stumbled across a function to get a list of symbol+forms ... aka the bindings, from wherever I am in a let (or other binding forms) ?#2017-05-2617:14dpsuttonYeah check out the locals that come across in the debug messages#2017-05-2617:14dpsuttonAnd I make it copy to the kill ring so you can easily make your own function and then step through that#2017-05-2617:16richiardiandreaawesome yep I was looking for exactly that#2017-05-2617:24dpsuttonCool. Play around with it. Let's get a good prototype going#2017-05-2709:03kiemdoderI executed M-x describe-face @tanzoniteblack and got the following:
Face: font-lock-type-face (sample) (customize this face)
Documentation:
Font Lock mode face used to highlight type and classes.#2017-05-2709:05kiemdoderI see now that compojure.handler is deprecated. That is most probably why it gets highlighted.#2017-05-2711:31bozhidarYes, there’s deprecation font-locking, although this theme certainly could have handled it better.#2017-05-2712:51stardivinerI always get this error when lein repl in project starts.
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer, being replaced by: #'mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean?
REPL server launch timed out.
#2017-05-2713:10stardivinerI tried to delete all under .m2/repository/. And install again. and tried to disable some Clojure packages.#2017-05-2713:10dominicm@stardiviner do you have a cljs hook?#2017-05-2713:10stardivinerWhat kind of cljs hook?#2017-05-2713:10dominicm@stardiviner A line like :hooks [] in your project.clj#2017-05-2713:11dominicmtbh, I do't think this is a cider-specific bug btw. You can test by doing lein repl normally from the project directory#2017-05-2713:11stardivinerNo.#2017-05-2713:11stardivinerI see, I will ask this question in Lein.#2017-05-2713:12stardivinerI did get this error from lein repl.#2017-05-2713:12dominicm@stardiviner Do you have cider in your ~/.lein/profiles.clj? if so, you could confirm it by removing it from there.#2017-05-2713:14stardivinerTake a try#2017-05-2713:19stardiviner@dominicm Ask one question not realted to upper problem. Can I put cider-nrepl in :repl {:plugin []} vector instead of {:user :plugin []} vector?#2017-05-2713:19stardivinerConfirmed this is caused by clj-refactor.#2017-05-2713:19dominicm@stardiviner You shouldn't need to put it in profiles.clj anymore afaik.#2017-05-2713:19dominicmIt's automatically added.#2017-05-2713:23stardivinerI will take a try with cider-jack-in from Emacs.#2017-05-2817:47kiemdoder@bozhidar, I'm using the Zenburn theme that you ported. Looks like this line is used for deprecation warnings.
`(cider-deprecated-face ((t (:background ,zenburn-yellow-2))))
Maybe the yellow background for deprecation warnings is a good thing because it is an incentive to fix the use of deprecated code.#2017-05-2907:46bozhidarHah, that’s a surprise. Perhaps, I don’t really remember what I was thinking bad then. 🙂#2017-05-2909:29stardivinerWhen I cider-jack-in outside of project, it success.#2017-05-2909:29stardivinerI guess this is because clj-refactor Maybe.#2017-05-2915:40benedekwhen you cider-jack-in you don’t need anything cider or clj-refactor related in your ~/.lein/profiles.clj#2017-05-2918:13oskarkvWhat must I do to get #break to work? If I place a #break and eval with cider-eval-defun-at-point it doesn't break when I call the function.#2017-05-2918:16oskarkv(defn testfn [] #break (+ 1 2)) then (testfn)#2017-05-2918:18oskarkvNow all of a sudden it works. I swear it didn't work before. 😛#2017-05-2918:19dpsuttonoh well. as long as its working now 🙂#2017-05-2920:16richiardiandrea@dpsutton quickly and untested thoroughly:
(defun cider--eval-bindings (bindings)
"Sends a (def bound-name expr) form to the cider repl for each
binding in bindings."
(let ((bound-name (pop bindings))
(init-expr (pop bindings)))
(when bound-name
(let ((form (concat "(def " bound-name " " init-expr ")")))
(set-buffer (cider--get-repl-buffer))
(insert form)
(cider-repl-return)
(cider--eval-bindings bindings)))))
(defun cider-eval-all-let-bindings ()
(interactive)
(when (cider--get-repl-buffer)
(cider--eval-bindings (clojure--read-let-bindings))))
#2017-05-2920:22dpsuttonlooks cool. just off hand, maybe remember the variable names and make an easy way to unintern them?#2017-05-2920:22dpsuttonwhat does (clojure--read-let-bindings) look like?#2017-05-2920:26dpsuttonif it's similar to what i did, i just grab that local environment which might be unbounded. not sure what we might clobber#2017-05-2920:27dpsuttonalso, with throwing your own defs in there, this is something to watch out for:
whatever> (def a 'bob)
#'whatever/a
whatever> a
bob
whatever> (defn a [x] (inc x))
#'whatever/a
whatever> a
#function[whatever/a]
#2017-05-2920:33richiardiandreaYes my version assumes so many things, good points up above for sure#2017-05-2920:34richiardiandreaAnothnr function would unbind all#2017-05-2920:36dpsuttoni like it#2017-05-2920:36dpsuttonalthough i might like a defnversion more#2017-05-2920:37dpsuttoni think that's why i like the idea of killing it so you can enter it wherever you like#2017-05-2920:37dpsuttonbut make a (defn investigate-cider-env [] (let [bindings ....] body))#2017-05-2920:38richiardiandreaBtw the read function is in clojure-mode#2017-05-2920:39richiardiandreacider-invnstigate-bindings maybe?#2017-05-2920:40richiardiandreaOr cider-repl-def-bindings#2017-05-2920:48dpsuttonoh ok. this doesn't seem to be what i was thinking#2017-05-2920:48dpsuttonmy version was run during the debugging session and would capture the local variables during debugging#2017-05-2920:48dpsuttonthis included forms from function parameters and let bindings#2017-05-2920:48dpsuttonthis clojure mode style seems to try to parse things?#2017-05-2920:53dpsutton(<--
code "#dbg
(defn func [x y z]
(let [a 1
b 2]
(let [c..."
column 0
coor (3 2 2)
debug-value "16"
file "c:/Projects/pomegranate/src/main/clojure/cemerick/whatever.c..."
id "6"
input-type (dict ...)
key "d0e9418e-65ac-41ad-9263-2c3e2aa8e681"
line 4
locals (("x" "1")
("y" "2")
("z" "3")
("a" "1")
("b" "2")
("c" "3")
("d" "4"))
original-id "74"
prompt nil
session "81f41c44-4cdd-4cd3-a027-5ccaeb53e6cc"
status ("need-debug-input")
)
#2017-05-2920:54dpsutton(defn func [x y z]
(let [a 1
b 2]
(let [c 3
d 4]
(+ a b c d x y z))))
#2017-05-2920:54dpsuttonso we just ask the debugger for the local values#2017-05-2920:54richiardiandreaYes it looks at the code and sends def in the repl...Maybe a different feature#2017-05-2920:55richiardiandreaBecause sometimes you want to use the value of something in a let#2017-05-2920:55dpsuttonso it is useful for values known at compile time?#2017-05-2920:56dpsuttonthe benefit that i'm thinking of is you would captuze x y z and get those values and then you could investigate the form. since a, b, c, d are bound in the let you could just copy that over#2017-05-2920:56richiardiandreaNo no, say I have a function, I know the value of the params, I have a let and i want to evaluate against those let bindings at runtime#2017-05-2920:57richiardiandreaSo the the body of the let can be tweaked/debugged#2017-05-2920:57dpsuttonah ok. i think i see now#2017-05-3014:00rickmoynihanhow can I make a cider-debug buffer read only? I keep typing changes into it and then loosing them 😞#2017-06-0102:13renewdoithow can I call "javac" before jack-in a boot process?#2017-06-0107:55dominicm@renewdoit change cider-boot-parameters #2017-06-0116:48renewdoit@dominicm Thanks! It is very hard to google it or search it in the documentation, or does it exist?#2017-06-0116:49dominicm@renewdoit I think it is in documentation.
https://cider.readthedocs.io/en/latest/up_and_running/ hints at cider-boot-parameters 🙂#2017-06-0117:42richiardiandreayeah that would do#2017-06-0219:23mpingHi, Im finding out that the repl becomes super slow when I have a huge line on the repl history#2017-06-0219:23mpingmaybe bc of word wrap#2017-06-0219:23mpinga) is there a way to clear the repl? and b) is there a way to disable word wrap?#2017-06-0219:24oskarkvcider-repl-clear-buffer#2017-06-0219:25dpsutton@mping hit , in the repl buffer#2017-06-0219:25dpsuttonyou'll see a list of options#2017-06-0219:27oskarkvHm, I got "Containing expression ends prematurely" while debugging. fordward-sexp raised it 😕#2017-06-0219:28oskarkv@mping maybe because of line numbers, if you have them on. Line numbers are slow.#2017-06-0220:18mpinghmmm can't really tell#2017-06-0220:19mpingI think its the highlight of the sexp#2017-06-0505:34benedekclj-refactor and refactor-nrepl 2.3.1 is out. thanks for all the contributors, quite a few of them are @here ;)#2017-06-0509:01gmercerI was sure that for the last month or so that whenever I did cider-jack-in on clj/cljs project it started both repls - Have I gone insane OR has this changed recently ?#2017-06-0509:02gmercerI have updated cider .. for the record#2017-06-0509:09gmercerother way around - cider-jack-in-clojurescript will start both - hmm ...#2017-06-0509:45bozhidar> I was sure that for the last month or so that whenever I did cider-jack-in on clj/cljs project it started both repls - Have I gone insane OR has this changed recently ?#2017-06-0509:45bozhidarIt never worked like this and this wasn’t changed recently.#2017-06-0510:13gmercer@bozhidar thanks - just a memory lapse 😃#2017-06-0521:19rmuslimovI have question about debugging with cider. Why if function is wrapped within def statement it doesn’t allow debugging in cider? For example, check next few lines of code:
(defn target
[x]
(let [a (+ x 1)
b (inc a)]
(+ (/ b 1) 4)))
(defn wrap-nothing
"This function does nothing, just for example."
[f]
(fn [& args]
(apply f args)))
(def test (wrap-nothing target))
(test 3) ;; debugging of `target` is not working
(target 3) ;; debugging of `target` works if this executed
If I set cider-debug-defun-at-point in target function, and call test debugger won’t stop. But it should actually. Why?#2017-06-0521:53grzmgood afternoon. I'm trying to extend a Java class in Clojure, so I'm using (:gen-class) in my namespace declaration. I haven't figured out how to work with this in a Cider repl. Here's what I'm working with:
(ns ex.Example
(:gen-class))
(defn -toString
[this]
"Hello, World!")
#2017-06-0521:54grzmI get a ClassNotFoundException when I try to instantiate it, e.g., (ex.Example.). I get java.lang.ClassCastException when I try to compile it via (compile 'ex.Example)#2017-06-0521:55dpsuttoni'm not sure that you've hit any CIDER issues to be honest#2017-06-0521:55grzmI'm sure I'm missing something quite basic, but my google-fu is failing me.#2017-06-0521:55dpsuttoni've seen lots of people say to tiptoe around (:gen-class)#2017-06-0521:55dpsuttonmay want to ask in #clojure#2017-06-0521:56grzmOkay. I'll give that a shot as well.#2017-06-0521:57grzmWas it wrong to think that the #cider channel would be useful for using Cider, as opposed to finding bugs or other issues with Cider?#2017-06-0521:57dpsuttonnot necessarily#2017-06-0521:58dpsuttonhappy to help with how to interact with CIDER and get you up and running#2017-06-0521:58dpsuttonbut this into the kinda shady dark corners of clojure and I don't think I can help and I think that lots of people there will be able to help you#2017-06-0521:58dpsuttonbut i'm never too strict on rooms and topics. ask anywhere#2017-06-0521:58dpsuttoni'm just pointing to where you'll get better help in this case#2017-06-0521:59grzmGotcha. Cider is my go-to IDE and I do use it successfully for other things.#2017-06-0521:59dpsutton👍#2017-06-0600:11grzmI came across (boot (aot :namespace '#{ex.Example})) and that worked for me.#2017-06-0604:47gonewest818@rmuslimov - well, when I try evaluating the same code, I get#2017-06-0604:47gonewest818WARNING: test already refers to: #'clojure.core/test in namespace: foo, being replaced by: #'foo/test
#2017-06-0604:48gonewest818on a hunch, I wondered if the issue had to be with the aliasing of the underlying function. So I renamed your test to xtest like so#2017-06-0604:49gonewest818(def xtest (wrap-nothing target))#2017-06-0604:49gonewest818and now calling (xtest 3) gets the debugger too.#2017-06-0607:41rmuslimov@gonewest818 Which is your version of cider-nrepl/refactor-nrepl/cider ?#2017-06-0607:42rmuslimovMine are latest [refactor-nrepl "2.3.1"]
[cider/cider-nrepl "0.15.0-SNAPSHOT"]
and latest cider from MELPA#2017-06-0607:47rmuslimovRenaming test -> xtest didn’t help.#2017-06-0612:28pedrorgirardiHi, I’m very new to Emacs/Cider, I’m coming from Cursive. I’m struggling a little bit, but I’m enjoying the adventure 🙂
I just would like to ask, if clj-refactor support *.cljs. I’m trying to rename a symbol and I’m getting Only .clj is supported
#2017-06-0612:29pedrorgirardiI’m using Spacemacs#2017-06-0612:38dominicm@pedrorgirardi some ops do not work in some files#2017-06-0612:39dominicmI think it's just to do with renaming things, particularly globally#2017-06-0612:40pedrorgirardi@dominicm thanks!! what is a “good way” to rename a symbol in a *.cljs file then?#2017-06-0612:43dpsuttonif its locally bound, it's easy to jump to closing parens. what i normally do is go to the beginning of the defun or form that encloses the var, set the mark C-space and then press C-m-f to go the the closing brace. It should now be highlighted. M-x narrow-to-region and then just M-x replace-regexp#2017-06-0612:45dpsuttonthis is obviously not scope aware but that's why we narrow so as to hopefully limit to the score.#2017-06-0612:53benedek@pedrorgirardi unfortunately those features needing an AST are not yet supported in cljs. this might change eventually, see reasons and discussion on how to tackle this here: https://github.com/clojure-emacs/refactor-nrepl/issues/195#2017-06-0612:54benedekwe have support for quite a few things for cljs too: see refactoring functions in clojure-mode https://github.com/clojure-emacs/clojure-mode#refactoring-support#2017-06-0612:55benedekand clean ns also works for cljs#2017-06-0612:56pedrorgirardithanks very much guys!!! it’s the first time that I ask something here and you were super helpful!#2017-06-0612:57pedrorgirardi@benedek I will check the issue you mentioned and the docs about the other functions#2017-06-0612:58benedekcoolio, good luck @pedrorgirardi and let us know how you get on#2017-06-0612:58pedrorgirardithanks @benedek !!#2017-06-0615:05gonewest818@rmuslimov 0.14.0
https://github.com/gonewest818/.emacs.d
https://github.com/gonewest818/.lein#2017-06-0618:17pandeiroWhat should a team do if their dev workflow requires cider-connect and members are using different versions of cider?#2017-06-0618:29benedekcan you elaborate? this sounds tricky...#2017-06-0618:30benedekyou either have ur own repl process so you can control the versions of middlewares you use#2017-06-0618:30benedekor you need to synchronize you versions#2017-06-0618:31benedekusing the latest stable of cider & cljrefactor is not a bad idea if you need to sync#2017-06-0618:35pandeiro@benedek So in most complex apps the entrypoint to the development system is not just lein repl or boot repl but a custom function or alias#2017-06-0618:36pandeiroI should say, in my experience 🙂#2017-06-0618:36pandeiroIs there a reason that cider-connect can't resolve dependencies from lein/boot profiles?#2017-06-0618:36pandeiroI thought cider used to work this way but I may be wrong#2017-06-0618:38benedekwhen you cider connect you attach to an already running repl server#2017-06-0618:38benedekyou can't control its classpath#2017-06-0618:38pandeiroso the cider-nrepl middleware needs to be loaded on the server, not the client#2017-06-0618:38benedekyup!#2017-06-0618:39pandeiroSo couldn't that particular dependency version be kept in sync via the emacs customization UI?#2017-06-0618:39pandeiroBecause it needs to match the Emacs version of cider#2017-06-0618:40pandeiroAh but there's no way to inject it into the server process if Cider doesn't start it#2017-06-0618:40pandeiroNow I get it#2017-06-0618:41pandeiroSo is it possible to customize the cider-jack-in REPL command?#2017-06-0618:42benedekcool :)#2017-06-0618:43benedekin fact cider already does that#2017-06-0618:43benedekif you jack in that is#2017-06-0618:43benedekI mean injecting the right version of middleware#2017-06-0618:43pandeiroOh yes, right#2017-06-0618:44pandeiroBut I think I need cider-jack-in-params to return something special for my project#2017-06-0618:44pandeiroso that instead of lein repl, it calls lein special-repl etc#2017-06-0618:44benedekyou can also further tweak the lein or boot commands #2017-06-0618:44benedekah right#2017-06-0618:45benedekis that messing up the middleware injection?#2017-06-0618:45benedekI don't think it should....#2017-06-0618:45pandeiroWell actually I don't even know how to customize that yet, haven't tried#2017-06-0618:46benedekyour project have a dir-locals file in its root?#2017-06-0618:46pandeiroNo#2017-06-0618:47benedekhm... that is the usual way to set emacs things on a per project basis#2017-06-0618:47pandeiroSo I could gitignore that and set up the params there, that works I think#2017-06-0618:48benedekyup that is what ppl usually do I guess...#2017-06-0619:10pandeiroSo @benedek actually the ~/.boot/profile.boot mechanism mentioned here does work for me with cider-connect#2017-06-0619:10pandeiroBecause the REPL server task has the correct middleware injected via the profile#2017-06-0619:11pandeiroOops, forgot URL: https://github.com/boot-clj/boot/wiki/Cider-REPL#2017-06-0619:59pandeiroHmm, I spoke too soon. Boot's profile.boot gets evaluated but still it seems like cider doesn't recognize the loaded cider-nrepl middleware when I M-x cider-connect#2017-06-0619:59pandeiroI'm pretty sure this used to work fine#2017-06-0621:34benedekagain the profile only takes effect if you start the server#2017-06-0621:41pandeiroHmm, I don't understand "if you start the server" -- I am starting it?#2017-06-0621:41dpsuttonaren't you just connecting?#2017-06-0621:41dpsuttonie, the server was already running?#2017-06-0621:41dpsuttoncider-jack-in starts a jvm, cider-connect connects to an existing one. If you connect to an existing one it did not start with a profile in your dir locals file#2017-06-0621:42pandeiroOh yes @dpsutton - but actually this is orthogonal to the dir-locals approach#2017-06-0621:43pandeiroBoot itself evals the file at ~/.boot/profile.boot#2017-06-0621:43pandeiroAnd that is happening when the server is invoked#2017-06-0621:43dpsuttoni don't know what's going just saw one potential source for confusion#2017-06-0621:43pandeiroAh sure thanks#2017-06-0621:43pandeiroSo the profile.boot is getting read in fact, and when I comment out certain deps, I am getting the expected loading of middleware#2017-06-0621:44pandeiroHowever with my entire deps vector loaded, something is interfering#2017-06-0621:50benedekany chance you can actually share the project in question?#2017-06-0621:50benedekor at least the relevants bits...#2017-06-0621:51benedek(all the files in the proj root perhaps...)#2017-06-0621:51pandeirosolved#2017-06-0621:51benedekhaha ok#2017-06-0621:51pandeiroa lib was bringing in a transitive dependency on an old version of cider/cider-nrepl#2017-06-0621:51pandeiroI went through commenting them out til I isolated it#2017-06-0621:51benedekha ok#2017-06-0621:51pandeiroThat is very crazy#2017-06-0621:52pandeiroAlso because the version was so old that cider-nrepl's error message says "version (nil)"#2017-06-0621:52benedekwhat was depending on cider middleware?#2017-06-0621:52pandeiroA library#2017-06-0621:52pandeiroThis is why it's not a great idea to have to include cider/cider-nrepl as a project dependency#2017-06-0621:53pandeiroUnfortunately the transitive dep was taking precedence over the version in my profile.boot#2017-06-0709:45nblumoeHi, what are your preferred ways of setting JVM options for boot when starting a repl via cider-jack-in? My first try was using the env variable BOOT_JVM_OPTIONS. Wondering if I am missing something, this is not working (yet).#2017-06-0802:27sooheonHey I’ve followed the instructions [here](https://github.com/clojure-emacs/cider/blob/master/doc/up_and_running.md#browser-connected-clojurescript-repl-in-boot-project) for getting a browser-connected cljs repl in cider. However, if one of the the boot tasks fails, I have no way of seeing the error messages (which would normally be printed in the terminal where I ran boot). Is there a workaround for this?#2017-06-0813:57noogais there something like this in cider?
https://d3nmt5vlzunoa1.cloudfront.net/idea/files/2017/06/Screen-Shot-2017-06-06-at-16.36.48.gif
would be awesome for pretty printed values 😮#2017-06-0814:28benedekyou want to check cider debugger and more importantly sayid#2017-06-0814:29benedekhttps://github.com/bpiel/sayid#2017-06-0900:54jsa-aerialYou can jump to source of function from a call site easy enough, but is there a 'find all call sites' of a function?#2017-06-0907:11dominicmjsa-aerial: in refactor el there is#2017-06-1017:47jsa-aerialcljr-find-usages seems to be it, is that what you meant?#2017-06-1017:47jsa-aerial@U09LZR36F ^^^#2017-06-1017:48dominicm@U06C63VL4 yeah#2017-06-1017:48jsa-aerialThanks!#2017-06-0910:52danielnealIs there any simple thing I'm missing that would explain why cider-pprint-eval-last-exp prints in one long line to the repl. I'm using spacemacs....cider 0.15-SNAPSHOT#2017-06-0911:44dpsuttonwhat are you trying to print @danieleneal#2017-06-0912:00danielnealA nested map#2017-06-0912:01danielnealcomes out like this:#2017-06-0912:06dpsuttonthat's not the repl. i think pprint-last-sexp will pretty print in the repl#2017-06-0912:08dpsuttonbut it for sure should pretty print it#2017-06-0912:08dpsuttonlooking into it now#2017-06-0912:08dpsuttoncan you tell me what your value for fill-column is?#2017-06-0912:08dpsutton(defun cider--pretty-print-width ()
"Return the width to use for pretty-printing."
(or cider-repl-pretty-print-width
fill-column
80))
#2017-06-0912:09dpsuttonyou can check those values and see if they affect your results#2017-06-0912:12danielneal#("fill-column is a variable defined in ‘C source code’.
Its value is 80
Original value was 70
#2017-06-0912:12danielneal#("cider-repl-pretty-print-width is a variable defined in ‘cider-repl.el’.
Its value is nil
#2017-06-0912:12dpsuttonhmm#2017-06-0912:13dpsuttoncan you navigate to cider--pprint-eval-form?#2017-06-0912:13dpsuttonin that defun, there's a form (cider--nrepl-pprint-request-plist (cider--pretty-print-width))#2017-06-0912:13dpsuttonsee what that results#2017-06-0912:13dpsuttonmine is#2017-06-0912:14dpsutton("pprint" "true" "pprint-fn" "clojure.pprint/pprint" "print-right-margin" 80)#2017-06-0912:14danielnealmm mine is exactly the same#2017-06-0912:15dpsuttonwell let me see if it works for me. i was assuming it does since the repl pprinting does, but i haven't actually checked#2017-06-0912:15danielnealah cool thanks!#2017-06-0912:16danielnealit's my favourite way of looking at a form C-c C-p bang boom there it is#2017-06-0912:17dpsuttonhmm#2017-06-0912:18dpsuttoncan you C-c C-p this form? (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))#2017-06-0912:18dpsuttonthat for me was printed on several new lines#2017-06-0912:18danielnealmm that was printed on one line for me. How strange#2017-06-0912:18dpsuttonok#2017-06-0912:19dpsuttoncljs by any chance?#2017-06-0912:19dpsuttonforgot from your screenshot#2017-06-0912:19danielnealnah just clj#2017-06-0912:19danielnealI'm just restarting spacemacs#2017-06-0912:20danielnealmm still the same#2017-06-0912:20dpsuttoni'm never sure of people's proficiencies here. do you know how to debug elisp code?#2017-06-0912:21danielnealhaha sadly not at all I can just about manage to set a variable in emacs but that's about it#2017-06-0912:21dpsuttonsounds good#2017-06-0912:22dpsuttoni'm still looking#2017-06-0912:23dpsuttonshot in the dark#2017-06-0912:23dpsuttonso you told me the value of fill-column but it can be different by buffer#2017-06-0912:24dpsuttoncan you go to the results buffer where you expect it to be pretty printed and tell me the value of fill-column there?#2017-06-0912:24dpsuttonin emacs parlance its a buffer-local var#2017-06-0912:24dpsuttonhypothesis is that when you're getting that popup buffer, its value is either nil or really large#2017-06-0912:25danielnealhmmm fill column still 70 in that buffer#2017-06-0912:25danielneal80 sorry#2017-06-0912:26dpsuttonok#2017-06-0912:26dpsuttonlet's see if this stuff is working in the repl#2017-06-0912:27dpsuttonyou can enable [spc] [spc] cider-repl-toggle-pretty-printing#2017-06-0912:27dpsuttoni think space space is spacemacs for M-x#2017-06-0912:27dpsuttonlet's just see if the repl is pretty printed#2017-06-0912:28dpsuttonexamples.exploring> (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))
{0 0, 7 7, 1 1, 4 4, 6 6, 3 3, 12 12, 2 2, 11 11, 9 9, 5 5, 10 10, 8 8}
examples.exploring> (into {} (map (fn [k v] [k v]) (range 0 13) (range 0 13)))
{0 0,
7 7,
1 1,
4 4,
6 6,
3 3,
12 12,
2 2,
11 11,
9 9,
5 5,
10 10,
8 8}
#2017-06-0912:28dpsuttonthese are my "before" and "after" toggling that feature#2017-06-0912:29danielnealahh it has no effect even there#2017-06-0912:29dpsuttonok#2017-06-0912:30dpsuttonwell that's some useful information#2017-06-0912:30dpsuttonyou're working with ouroborous#2017-06-0912:30dpsuttondoesn't that do a lot of funky stuff with jvm internals?#2017-06-0912:31danielnealhaha sorry this is just the name of my current clojure project using as a scratchpad, I've noticed this in all my projects#2017-06-0912:31dpsuttonok#2017-06-0912:32dpsuttoni had it confused with something else#2017-06-0912:33dpsuttonwhen you jack-in, do you get a warning that cider and cider-nrepl versions don't match?#2017-06-0912:34danielnealjust jacking out#2017-06-0912:34dpsutton?#2017-06-0912:34danielnealso I can jack in again#2017-06-0912:34dpsuttonah gotcha#2017-06-0912:35danielnealhmm no messages like that#2017-06-0912:36dpsuttondoes your project use spec?#2017-06-0912:36danielnealthanks for your help by the way, I think I've used up my quota of free assistance by now 🙂#2017-06-0912:36dpsuttoni've got a little more time until i need to go if you want to try a few more things#2017-06-0912:37danielnealif you have any thoughts about what it could be that would be cool#2017-06-0912:37danielnealbut no pressure#2017-06-0912:37dpsuttoni'm wondering if dropping clojure down to 1.8 might resolve it#2017-06-0912:37dpsuttonmaybe there's an issue with cider and 1.9#2017-06-0912:37danielnealI'll have a quick go#2017-06-0912:38dpsuttonthat's why i was asking about spec. if you've got it in there 1.9 won't work#2017-06-0912:38dpsuttonbut you could crank a repl either way and try our little map function#2017-06-0912:40danielnealoh weird, cider-jack-in is opening up a clojure 1.9.0-alpha16 project even though project is 1.8.0#2017-06-0912:41danielnealoooh#2017-06-0912:41danielnealI had [venantius/ultra "0.5.1"] in my plugins#2017-06-0912:41danielnealI've taken that out#2017-06-0912:41danielnealand it works#2017-06-0912:42danielnealIt was that mismatched clojure version that indicated something weird was going on there#2017-06-0912:42danielnealThanks so much#2017-06-0912:43dpsuttona plugin was breaking it?#2017-06-0912:43danielnealI guess so#2017-06-0912:43dpsuttonweird#2017-06-0912:43danielnealI commented it out, jacked in again and the clojure version matched and it started working#2017-06-0912:44dpsuttonwithout the plugin, if you jack in with clojure 1.9 can you pretty print?#2017-06-0912:44danielnealwill just try#2017-06-0912:45dpsuttonok. it looks like that lib tries to do its own pretty printing#2017-06-0912:45dpsuttoni wonder if there was an epic battle going on there#2017-06-0912:45danielnealyeah it works with 1.9 too#2017-06-0912:45danielnealhaha "STEP ASIDE LIBRARY I SHALL TAKE CARE OF THE PRETTY PRINTING HERE"#2017-06-0912:46dpsuttonok so it was just those two jockeying for who was prettier#2017-06-0912:46dpsuttonit looks like that lib is useful on a bare repl but maybe not so much in CIDER#2017-06-0912:46dpsuttoncan't tell though#2017-06-0912:46dpsuttoneither way it seems we've tracked it down#2017-06-0912:46dpsuttonmaybe open an issue with them?#2017-06-0912:46danielnealcool, thanks again, so glad to have that sorted, it was one of those little things that was a daily irritation but not big enough to look into#2017-06-0912:46dpsuttonfor sure#2017-06-0912:47dpsuttonhappy coding!#2017-06-0912:47danielnealthanks!#2017-06-1010:34stardivinerI found #emacs is very quiet, so ask this question which not very related to CIDER at here.#2017-06-1010:36stardivinerI want to know how to output image to stdout so that Org-mode babel can pipe output to a file result. (Assume Org-mode Babel can handle this)#2017-06-1200:23bbssNot sure what's causing it :thinking_face:#2017-06-1401:53xiongtxbbss: Try updating Helm. There’s been some heavy development lately and you may have gotten a buggy release.#2017-06-1503:02radonIn general, this will happen if you run M-x toggle-debug-on-error. I guess something in Helm was accidentally setting the debug flag?#2017-06-1201:27bbssanyway not the biggest issue as it only seems to happen when I just start emacs and haven't opened a file before.#2017-06-1216:35wisemani ran cider-test-run-loaded-tests, but it seems like maybe one of my tests is in an infinite loop. in any case, my repl is now unresponsive. C-c C-c has no effect. is there any way to recover my repl?#2017-06-1216:37wisemanhm maybe it’s just broken with pjstadig/humane-test-output. Once i remove that injection, the repl doesn’t hang and tests complete.#2017-06-1216:38wisemanoh, and now i see it’s known to be incompatible with cider. oh well.#2017-06-1320:18jasonjckni’m calling cider-interactive-eval in lisp , but it doesn’t popup exception with stack trace#2017-06-1320:18jasonjckninstead it gets printed to messages(#2017-06-1321:59mgrbyte@jasonjckn are you invoking cider-interactive-eval via call-interactively ?#2017-06-1321:59jasonjckncider-interactive-eval#2017-06-1321:59jasonjcknno#2017-06-1321:59jasonjcknwell the lambda is bound to a hotkey#2017-06-1322:02mgrbytejasonjckn: if you want to share that keysetup/lambda, I could try to re-produce. I expect it needs to be wrapped with call-interactively.#2017-06-1322:03jasonjckn`#2017-06-1322:03jasonjckn(spacemacs/set-leader-keys-for-major-mode 'clojure-mode
"eg" (lambda ()
(interactive)
(save-buffer)
(cider-interactive-eval "(try
(if (resolve 'user/stop!) (@(resolve 'user/stop!)))
(require 'clojure.tools.namespace.repl)
(clojure.tools.namespace.repl/refresh :after 'user/start!))
")))
#2017-06-1322:09mgrbytewithin cider.el itself, all uses of cider-interacive-eval are within a an emacs-lisp interactive function (one that has (interactive ..) at the head of the fn - so yep, wrap with call-interactively should work.#2017-06-1322:09mgrbytealthough... you have interactive at the top of your lambda there so should be no need :s#2017-06-1322:10mgrbyte(i don't use spacemacs here, so sorry can't re-produce)#2017-06-1322:00jasonjcknmaybe that causes call-interactively#2017-06-1402:33dpsutton@jasonjckn i'm unable to duplicate what you're seeing#2017-06-1402:33dpsutton(cider-interactive-eval "(+ 1 b)") gives me a stacktrace window#2017-06-1412:06mike_ananevHi! I'm using Spacemacs and opened two repl processes: 1- jvm, 2-cljs +figwheel. When I send cljs S-exp to REPL I got a stacktrace, cause S-exp is evaluated in JVM repl. How to send CLJS S-exp to appropriate repl?#2017-06-1414:49dotemacs@mike1452 see: https://cider.readthedocs.io/en/latest/using_the_repl/ C-c M-o#2017-06-1418:49naomarik@mike1452 if the buffer is in clojurescript-mode it should choose the correct repl automatically.#2017-06-1421:03mike_ananev@naomarik yes, that was an issue. for cljs files by default I had clojure mode. now I've added (add-to-list 'auto-mode-alist '("\.cljs$" . clojurescript-mode)) and then everything works as expected#2017-06-1421:19naomarik@mike1452 strange you had to do that — spacemacs does this automatically for me. do you have the clojure layer enabled?#2017-06-1421:19mike_ananevyes#2017-06-1421:40dpsuttonis this a cljc file by any chance?#2017-06-1421:41mike_ananev@naomarik found wrong setting in my custom files. now spacemacs works correctly without additional settings.#2017-06-1505:28bennyhow does one go do the definition of a function in cider?#2017-06-1506:10benedekM-. usually #2017-06-1506:10benedekand M-, to jump back#2017-06-1506:46jumarYes, it's usually M-. and the command is called cider-find-var - see https://cider.readthedocs.io/en/latest/interactive_programming/. In spacemacs it's also aliased as spacemacs/jump-to-definition and it's bound to , g g in evil mode#2017-06-1506:51dpsuttonnote these require an active repl session to work. they are not textual in emacs but hits the repl itself#2017-06-1509:33Sam Hi usually use gd (evil mode) and for me the code needs to be loaded into the repl for it to work (for clojure anyway)#2017-06-1516:33bennyI've done a cider-jack-in and tried M-. but it just prompts me for Symbol: #2017-06-1516:35Sam Hbenny: have you loaded your forms into the repl? (`SPC m s b` sends the buffer to the repl)#2017-06-1516:36dpsuttonthen put your cursor on a symbol that you want to see the source of. Pressing M-. should give the prompt at the bottom along with the symbol under your cursor (called thing at point in emacs parlance)#2017-06-1516:58bennythanks guys!#2017-06-1519:11agile_geekYou can jump straight to the current symbol under point (cursor) by using the prefix argument key binding C-u i.e. C-u M-.#2017-06-1519:11agile_geekand you can jump back to where you came from with M-,#2017-06-1706:08bennyTrying to debug my tests where i am making mock calls to my service, but i cannot get my debugger to break on the "server side". Is there a way to debug the actual route handling?#2017-06-1810:57stardivinerIs there a hook for cider-interactive-eval finished? I want to execute a function to notify user then the evaluation is done. I saw cider-interactive-eval has an CALLBACK argument, and CIDER support spinner. So I think CIDER already has this. Just I don't know how to do this.#2017-06-1814:58dpsutton(defun cider-interactive-eval (form &optional callback bounds additional-params) the second parameter is a callback#2017-06-1815:00dpsuttonand if you look at the callback that it constructs,#2017-06-1815:00dpsuttonthe signature of that nrepl-make-response-handler incldes a done handler, which here is the '`()` empty list at the end#2017-06-1815:02dpsuttonyou could easily adapt this to include your handler in that spot and pass this into cider-interactive-eval#2017-06-1903:22stardiviner@dpsutton Thanks.#2017-06-1904:07richiardiandreaGeneric question, how would folks here envision displaying specs of function arguments? Eldoc is already overcrowded ..#2017-06-1904:10richiardiandreaSame could be applied to inf-clojure#2017-06-1904:13richiardiandreaDon't remember whether eldoc shows params incrementally (if I am writing the second show me the second) but if it does, maybe small specs can fit quite nicely there and a key binding could jump to the s/def#2017-06-1905:04gonewest818cider-debug-defun-at-point yields a stack trace and “no reader function for tag dbg”… what do I do?#2017-06-1905:48gonewest818Google knew the answer: (#'clojure.core/load-data-readers)
(set! *data-readers* (.getRawRoot #'*data-readers*))
#2017-06-1905:51gonewest818from the discussion in this issue, https://github.com/clojure-emacs/cider/issues/1462#2017-06-1916:36richiardiandrea@gonewest818 there should even be a task for doing that (maybe overkill though)#2017-06-1917:18gonewest818Cool. I'm actually using lein (and circularly, debugging a feature I'm proposing for leiningen) but yes I saw some mention of a boot task for this.#2017-06-2001:50macrobartfastI'm messing around with the untangled client ( https://github.com/untangled-web/untangled-template ) and the instructions show how to use Intellij with JVM arguments; however, I use cider... can anyone help me grok what I'll need to do in cider to run this project?#2017-06-2001:51macrobartfastI usually just cider-jack-in-clojurescript and off I go but don't really know what I'm actually doing, so the JVM arguments have me a bit uncertain about what to do.#2017-06-2118:04pandeiroAnyone noticed that jump-to-source doesn't work when developing inside a docker container?#2017-06-2118:05pandeiroWondering how I can debug that#2017-06-2118:26pandeiroStepped through with edebug, the problem is that the source file is mounted to a different filepath inside the docker container, which doesn't exist on the host where emacs is running#2017-06-2118:27pandeiroMaybe I could solve that with some custom advice to translate filepaths that look like docker container paths to the normal host path#2017-06-2118:41tanzoniteblackI’ve run into the same issue when using tramp to connect to a remote server, that even when I have cider installed on the remote server, I can’t use it to do jump to source, for the same reasons of the file path not including the necessary information for emacs to know it’s on a remote server#2017-06-2118:42tanzoniteblackI’ve never found a solution for that either, just commiserating 🙂#2017-06-2120:10bjais it possible (or even sensical) to duplicate stdout from *cider-repl ...* such that the stdout also continues logging to the process's stdout?#2017-06-2215:06jfntnI noticed undo is not disabled in the test report and error buffers and I’m getting undo limit warning for those buffers over time. Is this intentional or should we fix it?#2017-06-2215:07dpsuttoncan't imagine that's intentional#2017-06-2215:07dpsuttonare those not read-only anyways?#2017-06-2215:09jfntnThey are but I think all the programatic insert calls in the different render-* functions end up in the undo-list regardless#2017-06-2215:54zlrthi’m having trouble with my clojurescript repl, and was wondering if this was the place to get help. when i enter a certain kind of syntax error, i can’t do anything else in the cljs repl. it says “eval timed out! no stacktrace available.” i have to restart the cljs-repl.#2017-06-2215:55gtrakI think I'm noticing some new behavior, not sure when it started.#2017-06-2215:55gtrakI'm having to manually turn on eldoc-mode in existing .clj buffers after the repl has connected, I thought this used to be automatic?#2017-06-2215:56gtrakAdding a clojure-mode-hook for eldoc-mode works for new buffers but not existing ones.#2017-06-2215:57gtrakIf I run 'eldoc-mode' manually before the repl has connected in a clj buffer, I get the minibuffer message 'There is no ElDoc support in this buffer'#2017-06-2217:24pandeiroIf anyone has thoughts on how to dynamically translate filepaths in cider (to map from docker container paths to host system paths), I'd love to hear them. My initial investigation has me thinking about creating advice around the cider-var-info function -- is this a bad idea?#2017-06-2218:10jfntn@pandeiro if your project is running inside docker I think what you want to do is use tramp to open a file with ssh inside the container and from then on cider will do the right thing#2017-06-2219:16pandeiro@jfntn hmm, that's one idea. The container however isn't running an SSH daemon and I don't really want to add that.#2017-06-2219:16pandeiroAlso the files inside the docker container are volume mounts from the host system, so they could be accessed directly#2017-06-2615:20ronenDoes anyone know how I can customize cider's repl buffer width? Couldn't find anything through customize-group#2017-06-2615:22dpsuttonwhat does buffer width mean? certainly you can resize the buffer itself in emacs. and the only thing that has a notion of width in the repl that i'm aware of is the pretty printing#2017-06-2615:22dpsuttonand there's a defcustom for that#2017-06-2615:23dpsuttoncider-repl-pretty-print-width on my CIDER 0.15 at work although i'm not sure how stale this is here. we're a c# shop at work#2017-06-2615:24ronen@dpsutton Right now the repl buffer is the same width as the .clj buffer I'm jacking in from. I'd like the increase the ratio in favor of the code buffer.#2017-06-2615:25dpsuttonenlarge-window-horizontally if i'm understanding you correctly. You want to know how to resize windows in emacs#2017-06-2615:26dpsuttonThere's the native stuff in https://www.emacswiki.org/emacs/WindowResize and I also have my own emacs resizing window library on melpa https://github.com/dpsutton/resize-window#2017-06-2615:29ronen@dpsutton Right, I was just wondering if there was a way to customize it once so I don't have to resize each time I spin up a REPL. Thanks!#2017-06-2615:29dpsuttonahhh i'm with you#2017-06-2615:32dpsuttoni can check at lunch#2017-06-2615:33ronenThank you 🙂#2017-06-2615:53dotemacs@ronen see this blog post, half way down, not cider specific, but you can take inspiration from it to tweak it for your need: http://bastibe.de/2012-10-14-emacs-customizations.html#2017-06-2615:56dpsuttonthat seems generic to emacs windows in general. In CIDER, there's nrepl-create-client-buffer-function which gets defined somewhere in the jack-in proceess and then later called. No grep on windows through emacs at work so at lunch i'll track this down. I'm guessing it can be tailored to exactly what @ronen wants to do#2017-06-2616:22ronen@dpsutton thanks! I'll look into it #2017-06-2700:13luchiniProbably a very stupid question but what’s the basic difference between cider-jack-in and cider-jack-in-clojurescript?#2017-06-2701:32richiardiandrea@luchini the latter creates two buffers , one for clj and one for cljs#2017-06-2706:19stardivinerWhy CIDER does not complete .getCanonicalPath?#2017-06-2707:23stardivinerWhich is a method from object java.io.File that created by .#2017-06-2707:33jumar@stardiviner because it's a java method, not clojure function.
You'd have to introspect the object on which that method is invoked.#2017-06-2707:36stardivinerI see, is it possible to make cider-doc related functions work on .getCanonicalPath?#2017-06-2707:39jumarI'm not sure, but I'd say no - everything works on static methods (like java.io.File/createTempFile), but in case of instance methods it's probably the same problem as with autocomplete#2017-06-2707:41jumarThat's said, it seems to work in many cases, especially classes from java.lang package, e.g. .toUpperCase#2017-06-2707:59jumarThis is the best source I could find: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/java.clj#L263
resolve-symbol and resolve-member (in case of instance method) in cider-nrepl are used for getting the list of candidates.#2017-06-2708:04jumarand looking at the source it seems that it scans java classes imported in current namespace - you can try
(doseq [[name fq-name] (ns-imports *ns*)] (println fq-name))
If you import File:
(import java.io.File)
Then you should be able to get autocomplete and documentation work on .getCanonicalPath.
It's not a smooth experience, however.#2017-06-2709:15stardiviner@jumar I see, thanks for your explain, very detailed.#2017-06-2714:18luchiniThanks @richiardiandrea#2017-06-2714:23jumarAlready asked in #spacemacs but trying here too:
Is there any good way to search for a string in all jars/libraries (or at least in given jar/library) on the classpath ?#2017-06-2714:23jumarThe best thing I've found so far is to invoke cider-classpath, look for interesting jars and then do zipgrep "search-string" library.jar in eshell#2017-06-2717:42pandeiro@jumar That would be an awesome feature to add to cider IMO#2017-06-2717:42pandeiroOne very hacky way I've accomplished something similar is to specify a project-local .m2 cache and then use projectile to grep for something#2017-06-2717:43pandeiroFrom the results, I'm pretty sure it is able to search within the jar files#2017-06-2810:28gmercerI guess I used a template that always gave me a running figwheel .. can anyone help ?#2017-06-2810:30dasibrethanks for the assistance#2017-06-2810:31gmercerI guess I start with lein new chestnut my-app +rum
#2017-06-2810:33dasibrehmmm, I guess I can do that too...#2017-06-2810:35plexus@dasibre try this: M-x customize-variable cider-cljs-lein-repl, then from the options choose Figwheel Sidecar#2017-06-2810:36plexusthen start your REPL with M-x cider-jack-in-clojurescript (`C-c M-S-j`)#2017-06-2810:37plexusyou'll have to make sure figwheel-sidecar and piggieback are in your dev dependencies and that your clojurescript/figwheel configuration is working (in other words make sure lein figwheel works first), but that's basically it#2017-06-2810:37dasibrealrighty, thanks @plexus#2017-06-2810:41gmercer@dasibre emacs src/cljs/my_app/core.cljs
#2017-06-2810:41gmercerand M-x cider-jack-in-clojurescript
#2017-06-2810:41gmercerworks out of the box#2017-06-2810:43gmercerat least using chestnut would help you check @plexus info in your project.clj vs and OOTB working version#2017-06-2810:48gmercera bit of magic with chestnut lives in my-app/.dir-locals.el - as specified in the doco you referred to https://cider.readthedocs.io/en/latest/up_and_running/#using-the-figwheel-repl-leiningen-only#2017-06-2810:48gmercerwell similar#2017-06-2810:49gmercer((nil . ((cider-refresh-before-fn . "reloaded.repl/suspend")
(cider-refresh-after-fn . "reloaded.repl/resume")
(cider-cljs-lein-repl . "(do (user/run) (user/browser-repl))"))))#2017-06-2810:52dasibreyea I think I will go the chestnut route, and take a look at that setup see if I can copy to my app...thanks for the help#2017-06-2810:56gmercer@dasibre please post a "got it working", when it does 🙂#2017-06-2811:05dasibrewill do#2017-06-2811:21dasibregot it working--- with the chestnut template...#2017-06-2811:22dasibregoing to try and port it over to my app#2017-06-2811:56gmercerExcellent, at least it shows nothing odd with your cider/emacs#2017-06-2913:15stardivinerHow to change CIDER/nREPL currently working directory?
Here is my question asked in Org-mode mailing list:
https://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00285.html
https://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00540.html#2017-06-2913:17a13afaik you can't change JVM working dir, see http://raynes.github.io/fs/me.raynes.fs.html#var-*cwd*#2017-06-2913:17dpsuttoni see this in the cider jack in stacktrace (setq nrepl-project-dir directory)#2017-06-2913:18dpsuttonbut i doubt it would work. just changing that wouldn't add anything to your classpath, etc#2017-06-2913:18dpsuttonand that's buffer local to the server proc it looks like#2017-06-3000:43stardiviner@a13 @dpsutton Thanks for your suggestion. Seems (setq nrepl-project-dir default-directory) does not used by CIDER every cider-interactive-eval or in Emacs org-mode ob-clojure execution.#2017-06-3000:54stardivinerI will try to dig into CIDER source code.#2017-06-3009:13dasibre@gmercer got it working with my project as well#2017-07-0216:53normanI find myself often using C-u C-c C-z (cider-switch-to-repl-buffer, to switch to the repl and set NS) a lot. I do it so much that sometimes When I really just want to C-c C-z, muscle memory kicks in and I add the C-u and change NS.#2017-07-0216:57normanIs the previous repl NS saved somewhere so that I can make a keybinding to go back?#2017-07-0216:57normanBasically I’m looking for “cd ~-”#2017-07-0310:48a13@norman Do you want that binding for a repl buffer?#2017-07-0314:35norman@a13 I’d normally be in the repl when I wanted to do that#2017-07-0315:04a13so you want smth like C-c M-n, but for previous NS only?#2017-07-0320:22normanexactly#2017-07-0320:39ennIs it possible to pretty-print ex-info maps in *cider-error*? I see some options in the cider-stacktrace customize group to wrap at a certain column, but structure-aware formatting would make it much easier to read.#2017-07-0320:42ennAlso, setting cider-stacktrace-fill-column has no effect for me; I still end up with everything on a single 1000+-character-line#2017-07-0400:43featheredtoasthey yall, looking for some info about cider-refresh - it doesn't appear to honor an earlier call to set-refresh-dirs for me#2017-07-0400:45featheredtoastis there a way to set up the refresh-dirs in cider's config perchance?#2017-07-0406:50dominicm@featheredtoast cider-nrepl doesn't expose a set-refresh-dirs for it's version of tools.namespace (it uses a private copy)#2017-07-0407:48dominicmIn boot using cider-nrepl 0.15.0 snapshot, my jump to source seems to be going to the temporary directories in boot. Using the ops raw I get:
[{'status': ['done'], 'file': 'file:/home/dominic/.boot/cache/tmp/home/dominic/src/github.com/foo/bar
/a9/-m7ldk0/foo/bar/baz.cljs', 'name': baz', 'column': 1, 'id': 'fireplace-bian
ca2-1499151061-107', 'session': '6cf8e95c-33cc-4fc8-bd78-1aba3f6fd9cc', 'ns': 'foo.bar.baz', 'line'
: 15, 'arglists-str': '[uuid benefit at]'}]
which suggests this is a problem at the cider level.
It seems to work OK in clojure files. Just not for cljs.
Am I being daft, or should I raise an issue?#2017-07-0407:51dominicmLooks like cljs & clj :file metadata is quite different which could cause the discrepancy.#2017-07-0409:34dominicm(update :file
(fn [f]
(str
(let [path (java.nio.file.Paths/get f (into-array String []))]
(loop [n 0]
(if (= n (.getNameCount path))
:give-up
(let [x (.subpath path n (.getNameCount path))]
(if ( (str x))
x
(recur (inc n))))))))))
@richiardiandrea this fixes it for info-cljs. It's a bit of a hack (I think my loop-recur is non-idiomatic & should be replaced with a reduce over (range) or something). It could also validate that the absolutePath of the resource is the same as f to reduce false positives.#2017-07-0414:21featheredtoast@dominicm I'm trying to work around https://github.com/clojure-emacs/cider-nrepl/issues/376 https://dev.clojure.org/jira/browse/TNS-45 https://github.com/stuartsierra/component/issues/45#issuecomment-245052313 - my component works in the repl after a call to set-refresh-dirs to exclude the user ns, but I cannot currently configure the same workaround in cider-refresh.#2017-07-0416:39dominicm@featheredtoast if you're desperate you could try calling the same function on CIDER's private copy of tns#2017-07-0507:35uditI am getting a spec error when I try to do a cider-jack-in in my project.
`Caused by: clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
In: [0] val: “my-ui.core” fails at: [:args :name] predicate: simple-symbol?`
My project.clj has "my-ui.core" as the value for `:main: key.
However I am able to run the app via lein run, the failure only happens when I want to do cider-jack-in or cider-jack-in-clojurescript#2017-07-0507:38uditAh scratch that. I need to unquote the namespace in project.clj#2017-07-0507:38uditThanks!#2017-07-0512:51michael zhouHi.Anyone have idea why I can not jump to function definition source code when coding clojure in spacemacs? Clojure code works.#2017-07-0512:52dominicm@zhoumin79 are you jacking in? So you mean you can't with clojure*script? Are you using boot or lein?#2017-07-0512:53michael zhouyes,when I press “, g g” ,it shows the error “No jump handler..”
I run Spacemacs in WINDOWS. Thanks.#2017-07-0512:55michael zhouIt cannot jump to external source code.#2017-07-0512:57michael zhoufor example, When coding I want to jump to “defstate” in mount source code ,it cannot.#2017-07-0512:58dpsuttonwhat version of emacs are you using?#2017-07-0512:58michael zhouemacs 25.2#2017-07-0512:59dpsuttoncan you tell me exactly which function is bound to , g g?#2017-07-0513:01dpsuttonhttps://github.com/syl20bnr/spacemacs/blob/bd7ef98e4c35fd87538dd2a81356cc83f5fd02f3/core/core-jump.el#L42#2017-07-0513:01dpsuttonthat looks like a spacemacs jump handler is being called#2017-07-0513:04dominicmhttps://github.com/syl20bnr/spacemacs/tree/bd7ef98e4c35fd87538dd2a81356cc83f5fd02f3/layers/%2Blang/clojure @zhoumin79 try <space>mgg#2017-07-0513:04michael zhouspacemacs/go-to-definition#2017-07-0513:06dpsuttondo you have the clojure layer installed? it looks like it registers those jump handlers#2017-07-0513:06dpsuttonas far as i can tell you're not hitting cider code at all#2017-07-0513:13michael zhouInstalled.I find I can go to clojure core source code, but I cannot go to other source code such as mount code#2017-07-0513:13dpsuttonhave you loaded the namespace before you try to navigate to the code?#2017-07-0513:13dpsuttonand are you getting the same error?#2017-07-0513:31michael zhou@dpsutton thanks. It seems like the ns problem. I will try more.#2017-07-0513:31dpsuttonAwesome#2017-07-0514:16dominicm@richiardiandrea I'm probably not the person to dig into this, but how does a variable become allowed in .dir-locals.el?#2017-07-0514:17richiardiandreathe defcustom declares the type that is considered safe#2017-07-0514:18dominicmSo cider-boot-parameters could use :safe #t or similar in it's defcustom?#2017-07-0514:23richiardiandreaYeah that is something I'd like to discuss with Bozhidar...#2017-07-0514:24dominicmAgree. I can't think of anything particularly malicious that could be done… that couldn't be done by putting things into build.boot anyway#2017-07-0514:42bozhidarMany variables are not marked as safe just because nobody thought of this. Relatively few people use .dir-locals.el.#2017-07-0514:42bozhidarI’m completely fine with making more defcustoms safe.#2017-07-0514:46dominicmI couldn't implement this myself in a timely manner (not an emacs user) but I'll open the cider issue anyway. Would make boot repos simpler for cider users to have this marked as safe.#2017-07-0514:49richiardiandreaI suspect emacs checks also the names and where it finds command it emits a warning...I have this gut feeling#2017-07-0514:50richiardiandrea@dominicm you just need to add :safe #'stringp#2017-07-0514:50richiardiandreain the defcustom definition#2017-07-0514:50richiardiandreaI'd do it but not now now 😄#2017-07-0514:50dominicm@richiardiandrea that implies I know how to install cider into emacs 😉#2017-07-0514:51richiardiandrealol sure...you could use vim to just modify the cider repo, no tests...then I will try it 😄#2017-07-0514:52dominicmIf that's useful, I have no problem with that 🙂#2017-07-0514:52dominicmProbably quicker in vim anyway.#2017-07-0514:55dominicmcider-boot-global-options looks useful too, adding.#2017-07-0514:56richiardiandreamaybe we need to make all the lein and gradle params safe too?#2017-07-0514:56richiardiandreaand -command...or we wait for folks to complain 😄#2017-07-0514:56bozhidarSure.#2017-07-0514:57dominicm2 approaches really: wait for complaints or open it all up. I don't mind which.#2017-07-0514:57richiardiandreaalso maybe cider-default-repl-command and cider-preferred-build-tool... @bozhidar @dominicm up to you 😄#2017-07-0515:01dominicmEven cider-allow-jack-in-without-project looks like it could be useful for .dir-locals.el#2017-07-0515:03dominicm@richiardiandrea https://github.com/clojure-emacs/cider/tree/65c30528aed982024c87c65e95193fbb49ff4f99 these look good#2017-07-0515:14richiardiandrea@dominicm cool, I'll review the PR 🙂#2017-07-0515:15dominicmCan't tick any boxes for the PR as I can't even make test (ofc). So I'm just gonna mark you as the culprit 😉#2017-07-0515:22richiardiandreaok queued!#2017-07-0520:10featheredtoast@dominicm thanks for the suggestion re set-refresh-dirs - I'm not sure how to go about calling cider's copy of tns though, sorry#2017-07-0520:46dominicm@featheredtoast cider.inlined-deps.toolsnamespace.v0v3v0-alpha3.clojure.tools.namespace.repl/set-refresh-dirs#2017-07-0520:49featheredtoastah; thank you!#2017-07-0520:52dominicm(that will likely move from version to version)#2017-07-0608:22degI'm playing with a style where I use pre/post conditions heavily in my Clojure code. I like it a lot so far, but my source files are more cluttered. Is there a cider setting or mode or hack somewhere that will customize the fontification of the {:pre ... :post ...} map in each defn?#2017-07-0608:42a13@deg there's no simple solution afaics, since function metadata are fontified the same way as the rest of the code#2017-07-0610:37robert-stuttafordwhy does cider colour :cljs branches of reader conditionals as comments, but :clj branches retain full syntax colouring? can i stop this?#2017-07-0610:50a13(defface cider-reader-conditional-face
'((t (:inherit font-lock-comment-face)))
"Face used to mark unused reader conditional expressions."
:group 'cider
:package-version '(cider . "0.15.0"))
#2017-07-0610:52a13"An unused reader conditional expression is an expression for a platform
that does not match the CIDER connection for the buffer."#2017-07-0610:56robert-stuttafordaha!#2017-07-0610:56a13so you can try to customize cider-reader-conditional-face so it don't inherits fl-comment-face#2017-07-0610:56robert-stuttafordso if i had a cljs repl connected somehow, then it’d show me the other path?#2017-07-0610:57a13I think it should 🙂#2017-07-0610:57robert-stuttafordok. i’m one of those unfortunate souls who never got cljs repls right. i wonder how i might stop it from doing this#2017-07-0610:58robert-stuttafordit’s a very nice facility for those who can eat their cake, and have it, too, though 🙂#2017-07-0610:58a13a I said before, try to remove all customizations from cider-reader-conditional-face#2017-07-0610:58a13M-x customize-face RET cider-reader-conditional-face#2017-07-0610:58robert-stuttafordwell that was easy#2017-07-0610:58robert-stuttaforduntick the checkbox, apply and save#2017-07-0610:58robert-stuttafordthank you a13!#2017-07-0611:00a13Welcome! is it working as expected now?#2017-07-0611:02robert-stuttafordit is!#2017-07-0611:04robert-stuttafordwell, actually, not perfectly#2017-07-0611:05robert-stuttafordthat’s with (custom-set-faces '(cider-reader-conditional-face ((t nil))))#2017-07-0611:05robert-stuttafordbut it’s still better than solid green 🙂#2017-07-0611:10robert-stuttafordwow, you’re a wizard, that works!#2017-07-0611:10a13😉#2017-07-0611:10robert-stuttafordi thank you sir#2017-07-0611:15a13I got it!#2017-07-0611:15a13(setq cider-font-lock-reader-conditionals nil)
is all you need 🙂#2017-07-0611:16a13no hacks, no function redefs anymore ;; removed all hacky stuff not to confuse people#2017-07-0611:17a13@robert-stuttaford ^#2017-07-0611:17robert-stuttafordtrying …#2017-07-0611:18robert-stuttaford👌#2017-07-0614:47dominicm@featheredtoast your problem can be fixed by applying the patch from TNS-45 to tns. It might make sense for Cider to use metosin's fork for refreshing, temporarily. It makes sense for CIDER to adopt it despite Stu's concerns as cider only cares about reloading.
Be interested if there would be an actual issue with that for CIDER.#2017-07-0614:48juhoteperiI'm not using the fork myself anymore#2017-07-0615:08dominicm@juhoteperi what do you do now?#2017-07-0615:09juhoteperi@dominicm I make sure Cljs output is not in classpath, and I serve it from filesystem instead#2017-07-0616:19featheredtoastI've been tinkering with the same methodology in the last day actually, and it works fine as is. Have a dev flag for routes that serves cljs + assets from a non-classpath directory during development, and compiles minified js into classpath, and serve from there when packaging via uberjar.#2017-07-0616:33dominicmWe always forget to do it 😛#2017-07-0616:43featheredtoastit's not terrible to do in lein; I'm hoping that boot's able to do similar. Definitely a "best" vs "common" practice conflict.#2017-07-0617:35juhoteperiIt is possible to do with Boot built in tasks: https://github.com/Deraen/saapas/commit/2947fd02ed5096c6004ad0b973a31a746d8a3803 not very clean but works#2017-07-0617:36juhoteperiBoot-cljs by default adds the files to classpath, which is a bit unfortunate#2017-07-0704:59sooheonHow do I set cider to prefer build.boot over project.clj when both exist? I need to be lein compatible for someone else using cursive, but I want things like cljr-add-project-dependency to work with the boot file.#2017-07-0705:26dpsuttoncider-preferred-build-tool#2017-07-0705:26dpsutton@sooheon#2017-07-0705:26dpsutton> "Allow choosing a build system when there are many.
> When there are artifacts from multiple build systems (\"lein\", \"boot\",
> \"gradle\") the user is prompted to select one of them. When non-nil, this>
> variable will suppress this behavior and will select whatever build system
> is indicated by the variable if present. Note, this is only when CIDER
> cannot decide which of many build systems to use and will never override a
> command when there is no ambiguity."#2017-07-0705:28dpsuttonand the code in cider-project-type:
(cond ((and multiple-project-choices
(member cider-preferred-build-tool choices))
cider-preferred-build-tool)
#2017-07-0705:34sooheonThanks very much#2017-07-0705:37richiardiandreaIs there a way to produce html documentation from elisp's docstrings?#2017-07-0706:10bozhidarDon’t think so.#2017-07-0708:26sooheon@dpsutton cider-preferred-build-tool only seems to affect jack-in, adding a dependency with cljr-add-project-dependency still results in the dependency vector appearing in project.clj regardless.#2017-07-0708:27bozhidar@sooheon Yep. Fixing this should be trivial, though. Just send a patch to cljr to honour the value of the defcustom. //cc @benedek#2017-07-0708:55benedek@sooheon can you pls file a github issue in cljr?#2017-07-0709:46sooheonSure.#2017-07-0712:23benedekta#2017-07-0714:36dominicmhttps://github.com/clojure-emacs/cider-nrepl/issues/345 @arrdem any idea on the root cause of this? I'll tackle it if you can point me at either the bad inputs or what is different in jaunt that might cause it.#2017-07-0716:45tcouplandbeen having all sorts of trouble using the debugger, think i've boiled it down to this:
(ns other)
(ns scratch)
(alias 'o 'other)
#dbg
(defn debugs
[r]
(inc (:n r)))
#dbg
(defn debugs-2
[r]
(inc (:other/n r)))
#dbg
(defn no-debug
[r]
(inc (::o/n r)))
(debugs {:n 1})
(debugs-2 {::o/n 1})
(no-debug {::o/n 1})
Had in confirmed by a colleague as well, so not just me! 🙂#2017-07-0716:47tcouplandthought i'd check here before raising a issue#2017-07-0805:01arrdem@dominicm so one of the things I tried in Jaunt was restricting clojure.core/get to associatives, and dropping the "everything is implicitly an empty associative" behavior which clojure.core features. This lead to the screenshotted exception many months ago which represents the result of trying to use get on a non-associative string which in Clojure would give you I believe null, but in Jaunt is a type error as shown. I suspect this us due to a subtle type/dataflow "error" in cider, but whether it's an error or intended behavior is up for debate. Jaunt has been abandoned by me so it's kinda a moot ticket unless diving into it uncovers some techdebt or weirdness in the associated data flow.#2017-07-0806:35dominicmI don't suppose Jaunt changed any ordering did it? Even things that were ordered by coincidence?#2017-07-0806:39dominicmThere is a bug in complete, which would only make sense if the ordering was changed. I imagine it works in cider because the dependency graph always puts it early.
Jaunt could have changed maps or something though.#2017-07-0915:58cjhoweis there a way to do something like cider-cljs-lein-repl for the normal non-cljs repl? or is there a way to make it so two repl's don't show up when i do cider-jack-in-clojurescript? doing front-end only so i don't need the non-cljs repl#2017-07-0916:02dpsuttoni don't believe so#2017-07-0916:02dpsuttoncljs repl starts up as an optional to the clj repl starting up and requires it#2017-07-0916:02dpsuttonwill take some changing of code but i think it would be worthwhile#2017-07-0916:05dpsuttonin cider-jack-in (when cljs-too #'cider-create-sibling-cljs-repl)#2017-07-0916:08cjhowei see#2017-07-0916:08cjhowethanks! maybe i'll get good enough at elisp to submit a PR#2017-07-1010:34rickmoynihanit’d be great if jump to definition could work for aliased spec keywords that have an s/def… though I suppose to be truly robust that would require specs to have line number metadata#2017-07-1220:46xiongtxrickmoynihan: This information is not available when a spec is defined. See: https://dev.clojure.org/jira/browse/CLJ-2037
It’s something that’ll need to be resolved before tooling supports jumping to definition.#2017-07-1220:49xiongtxIn the meantime, check out the new spec browser in CIDER: https://github.com/clojure-emacs/cider/blob/ff4c0ed9bc70c3f48ad74d08c9f7c97e91b2553c/doc/miscellaneous_features.md#spec-browser
And corresponding functionality in helm-cider: https://github.com/clojure-emacs/helm-cider#specs
No jump to source, but you can view definitions.#2017-07-1221:41rickmoynihanThanks for the info on the metadata ticket, I hadn’t seen that one… but have been following this related ticket with interest: https://dev.clojure.org/jira/browse/CLJ-2194
Thanks also for the info on cider spec - it looks great — is cider stable enough to use off master right now?#2017-07-1010:36rickmoynihananother thing I’ve found myself wanting is to expand aliased keywords under the point to their fully qualified names and put them onto the kill-ring… probably easy enough to write with a bit of elisp#2017-07-1011:04richiardiandrea@bozhidar other two nice fix to inf-clojure and I think we are ready for another release 😉#2017-07-1109:06rickmoynihanDoes anyone know what causes cider pretty printing to intersperse the output with comments that look like this ;; =>#2017-07-1109:06rickmoynihanHmm… I think it’s because I’ve set cider-repl-result-prefix to that string, so it outputs:
user> (range 100)
;; =>
(1 2 3 4 5 6....)
#2017-07-1109:08rickmoynihanBut for large outputs I see it interpolated in the middle of the result… Perhaps it prints it on every page of output??#2017-07-1109:08rickmoynihanCan confirm setting it the the empty string works around the issue#2017-07-1200:13dorabAny issues running cider with emacs-25? Just asking before I start going down that path.#2017-07-1200:35gonewest818@dorab no problems here.#2017-07-1218:24dorabgonewest818: Thanks#2017-07-1311:25jmayaalvall good for me as well.#2017-07-1217:10yefoakiraI am currently experiencing an annoying issue with cider-find-var. It can find and go to the source files of symbols when the file from where I am looking is under the src directory. But if I try to look for the same symbol on a file under the test directory, doesn't find. I have Emacs 25, cider 0.14, using Leinining. The project file didn't have :test-paths, but adding it didn't make a difference. Any idea?#2017-07-1219:02xiongtxyefoakira: Try cider-refresh (`C-c C-x` by default) to reload the variables#2017-07-1307:07yefoakiraDoing cider-refresh right now throws an exception on a file that shouldn't fail, and doesn't fail when compiling on lein. The failure happens on all buffers, though, and doesn't change the behaviour of cider-find-var#2017-07-1400:02xiongtxcider-refresh failing suggests that something is wrong w/ your code. Try cider-restart, then cider-refresh again. Perhaps your classpath got into a bad state.#2017-07-1217:11yefoakiraThe message on the buffer is Symbol x not resolved, where x is whatever symbol I'm looking for.#2017-07-1409:28benedekwhen I jack-in-clojurescript there are two REPLs created. is there a way to exit them both with one command?#2017-07-1416:33featheredtoast@benedek http://cider.readthedocs.io/en/latest/managing_connections/ - C-u C-c C-q seems to be what you're looking for#2017-07-1416:45benedekyes and no @featheredtoast #2017-07-1416:45benedekthis cloases all connections#2017-07-1416:45benedekif I happen to be jacked in on multiple projects this would close all of them#2017-07-1416:46benedekwould be nice just to close clj and cljs buffers for the same project with one go#2017-07-1416:56featheredtoastfair enough, that seems to be the only way sofar that I know of, assuming you're on a single project#2017-07-1416:58benedekfair, thanks#2017-07-1417:38rickmoynihandoes anyone know why with cider, how sometimes setting and evaluating a #dbg form doesn’t work? I don’t get an error, just the breakpoint is never hit. Not even when I refresh.#2017-07-1417:38rickmoynihansometimes it works, others it doesn’t and I never know why#2017-07-1417:38rickmoynihanI’m on 0.14.0 of cider#2017-07-1420:00grzm@rickmoynihan have you tried 0.15.0-SNAPSHOT? I don't know if there's a resolution, but at least you'll know whether you can confirm the behavior with the latest CIDER.#2017-07-1420:02rickmoynihan@grzm: Hey thanks for the reply… I tried it yesterday (not to resolve this issue - just to try it) and it seemed a little buggy with my setup, so I switched back to 0.14.0#2017-07-1420:03rickmoynihanjump to definition seemed a little glitchy… I’d have to do it twice for some reason IIRC before it’d jump.#2017-07-1420:03grzmYuck. Sorry to hear it.#2017-07-1420:04rickmoynihannot sure if it was a cider issue or just my emacs - but didn’t have time to debug#2017-07-1420:05rickmoynihani think the debugger behaved similarly (i.e. worked sometimes not others)#2017-07-1420:05rickmoynihanbut can’t be sure#2017-07-1420:06grzmI find debugging CIDER very frustrating 😕 I'm currently fighting CIDER/cider-nrepl right now. I'm starting my nrepl server from the command line to pick up environment variables, and I'm getting version mismatches which is preventing me from running cider-refresh. And something I did last night fixed it, and then something I did today broke it again.#2017-07-1420:07rickmoynihan😞#2017-07-1420:07rickmoynihanI ran into that same issue#2017-07-1420:08grzmDid you resolve it?#2017-07-1420:08rickmoynihanyeah I managed to formulate a work around#2017-07-1420:10rickmoynihanI created a script called lein-cider and use lein-cider repl to start my repl.
The script then injects the cider middleware in the same way M-x cider-jack-in does:
#!/bin/bash
lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.14.0\"\] -- "$@"
#2017-07-1420:11grzmYeah, that looks similar to what I was doing last night, though I'm using boot.#2017-07-1420:11rickmoynihanproblem for me was that a dependency was somehow a higher precedence than my :user profile. I’ve only seen it on one project we have.#2017-07-1420:14benedekgenerally speaking it is not a good idea to have something in your lein/boot profiles.clj and also inject deps from the CLI#2017-07-1420:16benedek@grzm i think you can define env variables in emacs itself#2017-07-1420:16benedekfor that reason you don’t really need to start from CLI#2017-07-1420:17benedekin fact i guess you can set them in lein/boot too#2017-07-1420:17benedekor using some config support library there are loads 🙂 but surely i am not aware of your full context…#2017-07-1420:17rickmoynihan@grzm: You can? I tried a few things but never got it to work quite right on mac. Problem I had is that GUI emacs starts up outside of the shell (via the UI) so skips the env vars.#2017-07-1420:18grzm@benedek I'm using emacsformacosx, which doesn't pick up bash profiles, etc.#2017-07-1420:18benedektry setenv?#2017-07-1420:18benedeki am using that too#2017-07-1420:18benedeklove the ligature support#2017-07-1420:18benedek😄#2017-07-1420:20rickmoynihan@benedek: that might well work… but i’d have to maintain the env vars in two places#2017-07-1420:21grzmYeah, the point using the environment variables is to not have to maintain them in two places.#2017-07-1420:21rickmoynihanbasically I use wrapenv to manage my env vars for different projects etc… I’d found it’s easier to do it outside of emacs
https://github.com/RickMoynihan/wrapenv#2017-07-1420:21dotemacs@rickmoynihan are you using exec-path-from-shell ?
https://github.com/purcell/exec-path-from-shell#2017-07-1420:23rickmoynihan@dotemacs: I had tried that a while back, but like I said I like to swap the environments#2017-07-1420:23dotemacsah, my bad, sorry#2017-07-1420:23grzm@dotemacs Would that work for a GUI emacs? Any custom path set by a profile would ignore those customizations.#2017-07-1420:23rickmoynihanthough if I recall it never seemed to work quite right for me… probably did something wrong#2017-07-1420:24dotemacs@grzm the whole point of that package is to make sure that your Mac installed Emacs picks up your env vars from your shell init file, instead of the “default” ones#2017-07-1420:24benedeki am really thinking hard here…. but as far as i remember at least in jvm clojure if you use the java api to get env variables and run my project in a repl they are picked up…#2017-07-1420:24grzm@dotemacs gotcha. I see that now from reading it.#2017-07-1420:24benedekbut perhaps i am tricked by my memory. would not be the first time…#2017-07-1420:26benedekok so i might be right then @dotemacs 😉#2017-07-1420:33rickmoynihanoh just remembered the other thing that seemed broken in 0.15.0-SNAPSHOT jumping to source from a stackframe#2017-07-1420:40grzmokay. I should be able to use cider-connect to connect to an nrepl server started with boot repl -s wait#2017-07-1420:43grzmFrom a boot repl (no -s wait option), I can see (:version-string cider.nrepl.version/version) ;; => "0.15.0-snapshot", which is what I expect because I have that version of cider-nrepl in my dependencies.#2017-07-1420:45grzmWhen I use cider-connect, I see this warning: WARNING: CIDER's version (0.15.0-snapshot) does not match cider-nrepl's version (nil). Things will break!#2017-07-1420:46grzmAny suggestions for my next step of debugging?#2017-07-1420:47rickmoynihani don’t know much about boot; but if it were lein, I’d be running either lein deps :tree or lein classpath right now#2017-07-1420:49grzmThat makes sense. The equivalent of lein deps is boot show -p#2017-07-1420:49benedeksince you are connecting you need to make sure the middlewares are there yourself#2017-07-1420:49benedekso you basically need to add them via boot.profile or something similar#2017-07-1420:49benedeksee the cider documentation#2017-07-1420:50grzm@benedek the cider task? I have that defined as per https://github.com/boot-clj/boot/wiki/Cider-REPL#2017-07-1420:51grzm(with updated versions) That's been working when I use cider-jack-in#2017-07-1420:52benedekhold on. so you have that defined but you don’t use it when you start up the repl you connect to from cider?#2017-07-1420:53benedekso the documentation you linked says you have to start up your repl like#2017-07-1420:53grzm@benedek thanks. That's what I've been forgetting today. sigh#2017-07-1420:54benedekcider repl -s wait#2017-07-1420:54grzmIt's working now#2017-07-1420:54benedekah ok#2017-07-1420:54grzm@benedek ++#2017-07-1420:54benedek:rubber: 🦆 😉#2017-07-1420:58grzmWithout tools like the repl, would developing in JVM Clojure even be practical?#2017-07-1421:01benedeknot sure i follow…#2017-07-1421:04grzmI just know that when I'm not able to use CIDER, my development cycle slows to a crawl. The dev/compile/test cycle is so long.#2017-07-1421:05grzmClojureScript I suspect wouldn't be so bad, using bootstrapped ClojureScript.#2017-07-1421:06benedekhaha well, ok. the REPL is awesome yes. shorter the feedback loop better is the dev experience for sure#2017-07-1421:06benedekyou can get many diff repls for clojurescript and there is figwheel as well#2017-07-1421:06benedekwhich makes cljs experience even better#2017-07-1421:07grzmIt's been about a year since I did much ClojureScript development.#2017-07-1421:07benedekhave you used figwheel?#2017-07-1421:07grzmI was at the time, yes. That was pretty sweet.#2017-07-1421:08grzmI like the way Bruce Hauman thinks.#2017-07-1702:03qqqis there a way to have the cider repl to output / render dom/svg elements ?#2017-07-1702:04qqqso I want to have a sexp that returns a reagent component, then I want cider to, instead of displaying the data, render the element in a browser and display it#2017-07-1706:12benedekyou essentially want figwheel, @qqq?#2017-07-1706:38qqqno#2017-07-1706:38qqqI don't want auto recompilation of cljs#2017-07-1706:38qqqI want a clj repl that can also display hiccup#2017-07-1706:38qqqthey're two separate issues#2017-07-1708:41benedekok fair#2017-07-1712:23richiardiandrea@qqq that is an interesting idea, display hiccup in a browser? If so you could work in Dirac (Google dev tools for Cljs)#2017-07-1712:35dpsuttonwell, if it's returning a reagent component it would seem like it needs quite a bit of infrastructure to display, ie, all of the subscriptions, etc. so it would need to be in a clojurescript repl. then there would be the dependencies required like CSS. but newer versions of emacs have a webkit browser accessible to them so perhaps this would be possible. but quite a bit of code required to do so#2017-07-1716:09ustunozgur@qqq proto-repl (atom plugin) could probably do something similar: https://atom.io/packages/proto-repl#2017-07-1716:09ustunozgurhttps://github.com/jasongilman/proto-repl-charts#2017-07-1721:28qqq@dpsutton : you're right, reagent can contain functiknos/ code, hiccup is juust pure data right? let's say it returns hiccup, which I want to serialize to client and display#2017-07-1721:31dpsuttonhiccup (i think) has a html function. and that should return some html and then you could use emacs to render that either by saving to a temp file and browsing the url of that file or working with the webkit stuff#2017-07-1803:00qqqactually, I just got "in emacs, run a command, have output [hiccup] displayed to browser in websocket" working#2017-07-1803:00qqqquite happy with it#2017-07-1806:03benedekany code you can share?#2017-07-1808:35qqqit would be rather rude of me to not; it's spread over a few files, let me see how I can best share it#2017-07-1808:53qqqI can't copy/paste since it ties into an 'object system' our code has, but the server side looks like:
(def *ws-clients (atom #{}))
(defn blast! [data]
#?(:clj (doseq [c @*ws-clients]
(when (not (org.httpkit.server/send! c (str data)))
(reset! *ws-clients disj c)))
))
#2017-07-1808:53qqqand for the client side, we have a
[:div
[:h1 "here is your result"]
@some-r-atom]
#2017-07-1808:53qqqand all what the ws does is updates the some-r-atom#2017-07-1808:53qqqthen inside a emacs + clojure repl, to display something, you do
(blast! [:h1 "hello world"]) C-x C-e#2017-07-1808:54qqqand it sends the hiccup through the websocket to the client side, which rendcers it#2017-07-1808:58benedeknice#2017-07-1809:00qqqwhat convniced me it's working for real is when I got#2017-07-1809:01qqq(blast!
[:div
[:h1 "Hello World"]
[:img {:src ""}]
[:h2 "More info 555"]]
)
to work#2017-07-1809:01qqqafter that, it was clear it could display arbitrary hiccup#2017-07-1815:23michaellindonI'm using Clojure with Java interop. The following line excutes as expeccted (.get x gurobi.GRB$DoubleAttr/X) but cider doesn't autocomplete anything. I wanted typing gurobi.GRB$Dou... to autocomplete to gurobi.GRB$DoubleAttr#2017-07-1820:58jumarYou probably need to add an import for that class first.#2017-07-1816:40rickmoynihannot sure why but cider master seems to keep dying trying to parse spec errors when there’s large gen’d data.
Oddly the spec errors are thrown on another thread (web server)… perhaps they’re being parsed from stdout?!#2017-07-1816:41rickmoynihanwhatever it is it’s a little annoying as it locks emacs up, I’m guessing trying to parse/font-lock the data… Is this a known issue, and if its intended is there a way to disable this behaviour?#2017-07-1911:36jumarI've found an interesting way how to temporarily modify the code of 3rd party clojure library (e.g. for debugging purposes - adding println statements, etc.) and apply the changes to current REPL.
Let's take as an example clj-http library:
1. run cider-open-classpath-entry
2. search for clj-http; open (ENTER)
3. search for namespace, e.g. clj_http/core.clj; open (ENTER)
4. search for function of interest, e.g. get-route-planner modify
5. eval in cider repl - answer "n" to question "File ... is read-only on disk. Make buffer read-only, too?"#2017-07-1911:36jumarI wonder if anyone else ever do similar stuff and whether there's a more reasonable/convenient approach to do this#2017-07-1911:47hans@jumar I do this regularily. But I use M-. to go to the source of the function/macro in question and C-x C-q to make the buffer writeable.#2017-07-1911:55jumar@hans this is much easier. Thank you!#2017-07-1911:59hans@jumar also, i use C-M-x to evaluate the form that I'm currently editing in a buffer. no need to deal with the repl, really#2017-07-1912:00jumarI use that too (eval buffer or eval function) - I've just used wrong words ("eval in cider repl") in my former post#2017-07-2011:26robert-stuttafordany clj-refactor folks in here? just want to make this issue visible: https://github.com/clojure-emacs/clj-refactor.el/issues/386#2017-07-2015:51bozhidarI think they already fixed it.#2017-07-2015:51bozhidarhttps://github.com/clojure-emacs/cider/releases/tag/v0.15.0#2017-07-2015:51bozhidarCIDER 0.15 is out everyone! Enjoy! 🙂#2017-07-2015:52dpsuttoncider#2017-07-2018:52benedekwoot!!#2017-07-2019:16ajsi'm trying to add some custom cider keybindings, but it doesn't look like the way to do it is with (define-key cider-mode-map ... emacs claims that cider-mode-map is void. any pointers?#2017-07-2106:25fiddlerwoaroofI'm using boot-cljs-repl to connect a web app to my cider session and the output from (print ...) statements doesn't show up in the emacs repl buffer until I hit enter in it#2017-07-2106:25fiddlerwoaroofis this expected behavior?#2017-07-2108:19fiddlerwoaroofHmm, I'm having a lot of issues with cider, I'll have to look into this tomorrow#2017-07-2113:40bozhidar@ajs You have to require CIDER first, so this wouldn’t be void.#2017-07-2113:45ajs@bozhidar i assume the proper technique is to assign custom keymaps for cider-mode-map only to an add-hook for cider, right?#2017-07-2113:49bozhidarYep. Or after you’ve explicitly loaded it in your config (which is generally not a great idea).#2017-07-2119:31kurt-o-syscross-posted from #boot and #spacemacs#2017-07-2208:27richiardiandrea@kurt-o-sys tried once and it used to work... haven't tried recently#2017-07-2208:28richiardiandrea@bozhidar Congrats for the release! Loads of cool stuff in there#2017-07-2208:29kurt-o-sys@richiardiandrea well, good to know it can work 🙂. I'm just wondering why it's not 'commiting' the changes, but keeping it in cache. Any ideas how to debug this?#2017-07-2208:35richiardiandrea@kurt-o-sys not sure, I would check first of all if the buffer that cider opens is associated with project files or .boot/cache files. Then whether there is a mechanisms to support resolution from one to the other.#2017-07-2208:36kurt-o-systhe buffers opened are the project files...#2017-07-2208:36richiardiandreaOk then it is weird that clj-refactor even knows about .boot/cache files#2017-07-2208:36kurt-o-sysa new (cache) buffer, of the file I'm working in, opens when I refactor#2017-07-2208:37kurt-o-sysIt states that x files are changed, it is true: the x cached files do change, but they are not open in the buffer (except the newly opened cache of the one I'm working in)#2017-07-2209:01richiardiandreaUhm seems like there is some sort of resolution going on there I would report it as a bug to maybe clj-refactor first#2017-07-2209:21dominicm@kurt-o-sys I think some commands have a known bug with this. To explain why @richiardiandrea, the files are searched for on the classpath.#2017-07-2209:24dominicmProbably along the lines of https://github.com/clojure-emacs/refactor-nrepl/issues/97#2017-07-2209:26dominicmThis is a possible fix (not having looked into it properly): https://github.com/clojure-emacs/cider-nrepl/pull/422#2017-07-2218:47kurt-o-sysRight, I saw issue #97, but that does seem to be something else. I checked #422 - it seems to be cljs related. The fix is merged and added to the latest CIDER-nrepl (0.15.0). Using the latest version doesn't solve the problem. It may be related, but it doesn't fix the problem I described (refactor - rename symbol).
I don't know if it's related, but here's another issue I have:
1. start a new boot project
2. position yourself on the println in core.clj
3. SPC m r e f (refactor - extract - function) and give it a name
4. see (println... extracted in a new function
5. position yourself on the new function symbol
6. SPC m r i s (refactor - inline - symbol)
7. see a NPE be thrown <- *first issue* (this is different than the case I described before about 'refactor - rename')
8. undo your changes
9. repeat 2 and 3
10. see extracting not working anymore <- *second issue* (restarting the repl and refactoring works again)#2017-07-2219:38kurt-o-sysQuestion: is it possible to 'boot/commit' the files from spacemacs/emacs/...? I mean, if I refactor and the only thing I need to do to 'save' the changes is another command, that's no problem at all.#2017-07-2219:52dominicm@kurt-o-sys the change in cider wouldn't fix the bug in refactor#2017-07-2219:54kurt-o-sysnope... well, not in my case. Pretty easy to reproduce:
1. start a new boot project
2. refactor - rename
Renaming is done on the cached file.#2017-07-2219:56dominicmSorry, wouldn't fix it.#2017-07-2219:58dominicmI'd take a look through how rename symbol locates the location of the symbol.#2017-07-2219:59dominicmIt'll be in the refactor-nrepl repo#2017-07-2219:59kurt-o-sysok, thx... I have no idea, but I might take a look as well 😛#2017-07-2220:06dominicmfind-symbol operation is used to locate all uses#2017-07-2220:18dominicm@kurt-o-sys https://github.com/clojure-emacs/refactor-nrepl/blob/master/src/refactor_nrepl/find/find_symbol.clj
Find symbol in file looks useful#2017-07-2220:20kurt-o-sysright... although the file to search in is already set there.#2017-07-2220:21kurt-o-sys(core/dirs-on-classpath) inside find-global-symbol?#2017-07-2220:23kurt-o-systhe cp the 'root' of a boot app is inside the cache-dir?#2017-07-2220:23kurt-o-sys(just guessing)#2017-07-2220:35kurt-o-sys(->> (core/dirs-on-classpath)
(mapcat (partial core/find-in-dir (some-fn core/clj-file? core/cljc-file?)))
(mapcat (partial find-symbol-in-file fully-qualified-name ignore-errors)))
This defines which files are searched, I guess?#2017-07-2220:36kurt-o-syshttps://github.com/clojure-emacs/refactor-nrepl/blob/992e9a25bdb411bc49c5c38a48ff0182d91631f2/src/refactor_nrepl/find/find_symbol.clj#L138#2017-07-2220:52richiardiandreaThe fact is that boot resolution is not bidirectional (AFAIK) so you cannot go back from a file in the cache to a file in the project dir. I don't know because I haven't had time to check if this is the actual problem though and if not I apologise. If it is, probably this is worth a feature request in boot#2017-07-2304:19kurt-o-sys@richiardiandrea It might be. I alread filed a question: https://github.com/boot-clj/boot/issues/632 - no answers yet. I'm starting to wonder if I'm the only one using boot and spacemacs who wants to rename symbols 🙂.#2017-07-2304:20richiardiandrea@kurt-o-sys still good to solve that problem 😀#2017-07-2304:22kurt-o-sys🙂 Not sure yet how exactly to make it work. I do get why it's not working, but that's not good enough 🙂#2017-07-2304:24richiardiandreaWill try to look into it as well at some point 😀#2017-07-2304:26kurt-o-systhx. It'll be ok one day, I guess 😛#2017-07-2306:59benedekso this is essentially the boot issue referenced here previously, right?#2017-07-2306:59benedekcc @kurt-o-sys @richiardiandrea #2017-07-2307:00benedekI mean https://github.com/clojure-emacs/refactor-nrepl/issues/97#2017-07-2307:01benedekhttps://github.com/clojure-emacs/refactor-nrepl/issues/97#issuecomment-121038439#2017-07-2307:01benedekspecially and I guess @micha never created a boot issue for this or?#2017-07-2307:29kurt-o-sysWell, not really - it is related, but not the same. The fix in https://github.com/clojure-emacs/refactor-nrepl/issues/97#issuecomment-121038439 don't solve the issue I have with renaming symbols (not the same as renaming files).#2017-07-2307:30kurt-o-sysbut it's true that the problem is that refactoring seems to use cache-files of boot.#2017-07-2307:52benedekok I can review your 10point reproduce description #2017-07-2307:58kurt-o-sys@benedek the 10point review is actually another problem... There's a 7 point review to reproduce the replace symbol:
1. start a new boot project
2. position yourself on the println in core.clj
3. SPC m r e f (refactor - extract - function) and give it a name
4. see (println... extracted in a new function
5. position yourself on the new function
6. SPC m r r s (refactor - rename - symbol) and give it a name
7. see renaming performed on the cached file, not on the project file#2017-07-2308:00benedekthis sounds to me like the original problem i quoted. eg no way for boot to track back orig file location#2017-07-2308:01kurt-o-sysright... so, you're saying it can't (or won't?) be solved?#2017-07-2308:03kurt-o-sysI mean: renaming files/dirs does work. renaming symbols doesn't. The issue may be related, but is not the same. If it can't work, it's fine, but it'd be nice to know it can't work (so I can stop trying).#2017-07-2308:07benedeksorry. I am just trying to make sense of it before having a proper look and perhaps do a PR for boot#2017-07-2308:08benedekif the problem is really there#2017-07-2308:08benedekif it is in cljr that is easier to fix ;)#2017-07-2308:11kurt-o-sysright. That makes perfect sense... well, about the problem, I only know that it is because refactoring symbols seems to be working on boot cached files, probably because of these lines (although I'm not sure): https://github.com/clojure-emacs/refactor-nrepl/blob/992e9a25bdb411bc49c5c38a48ff0182d91631f2/src/refactor_nrepl/find/find_symbol.clj#L138 , having (core/dirs-on-classpath) this probably pointing to the cache-files, not the actual project files. It's a guess, but I'm not really sure about it.#2017-07-2308:12benedekas far as I understand this is flagged to @micha in the github issue quoted#2017-07-2308:13benedekand we kinda agree that we need at least an api in boot to properly handle this#2017-07-2308:13benedekI will dblcheck this tho#2017-07-2308:13benedekand if so will try to put together something for boot#2017-07-2308:14kurt-o-sysok... thx for the info. - it was a bit confusing, since renaming a file or dir seems to work, and the title doesn't seem to adddress renaming symbols (which doesn't work).#2017-07-2308:15benedeknw will get back here after I see more clearly #2017-07-2308:15kurt-o-sys🙂#2017-07-2309:51dominicm@benedek this is the trick I came up with for cider-nrepl https://github.com/clojure-emacs/cider-nrepl/pull/422 If there's a better way to go from temp file → real file it would be useful to replace my code doing that.#2017-07-2309:56benedekthx#2017-07-2309:56benedekwill have a look#2017-07-2313:55benedeki was most likely wrong to drag @micha into this. sorry#2017-07-2314:44dominicmI'm not certain, there might be something in the cache which allows us to figure out the origin#2017-07-2314:48dominicmI mean, I suppose the proper thing to do would be to semantically strip the ~/.boot/cache/home/… relative to the cwd of the jvm or something like that#2017-07-2314:48benedekbased on the discussions around this i am not sure that is the case. acc to dearen one could use
boot.user=> (into (get-env :source-paths) (get-env :resource-paths))
#{"src" "resources"}
#2017-07-2318:22kurt-o-sysNot sure how this would help? I mean, :source-paths and resource-paths are set... Well, let me try first 🙂#2017-07-2314:48benedekbut i just went for the fake.class.path solution tbh#2017-07-2314:49benedekhttps://github.com/clojure-emacs/refactor-nrepl/commit/59c377fad9fcfc30cf9d7a2c0064dfb69624bf21#2017-07-2314:52benedeknew snapshot is on clojars, give it a spin @kurt-o-sys pls#2017-07-2315:14dominicmThat might have been more sensible for me to use :thinking_face:#2017-07-2315:29benedekjust lazyiness driven dev here#2017-07-2318:32kurt-o-sys@benedek no errors, that's ok, but still saving to the boot cache files, not the project files.#2017-07-2318:34kurt-o-sysoh wait... not sure if it's the right refactor-nrepl#2017-07-2318:34benedekyou are using latest snapshot, right? #2017-07-2318:35kurt-o-syswell... I thought I was. This is my .boot/profile.boot:
(deftask cider "CIDER profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.12"]
[cider/cider-nrepl "0.15.0"]
[refactor-nrepl "2.4.0-SNAPSHOT"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
#2017-07-2318:36benedekdo you cider jack in or connect?#2017-07-2318:36benedekshould be latest tho. M-x cljr-versiontell you?#2017-07-2318:37kurt-o-syscider jack-in#2017-07-2318:37kurt-o-sysSPC m s i#2017-07-2318:37benedekyou don't need the above in your profile then#2017-07-2318:37kurt-o-sysoh, wrong one...#2017-07-2318:37benedekbrb#2017-07-2318:37kurt-o-sysoh damn'd.#2017-07-2318:42kurt-o-sysI followed this https://github.com/boot-clj/boot/wiki/Cider-REPL#a-better-way - but apparently, I did something wrong 😛#2017-07-2318:45dominicm@kurt-o-sys it's a bit confusing. cider-jack-in basically generates the cli by itself (and doesn't know about the cider task) the boot wiki is aimed at cli users really#2017-07-2318:45kurt-o-sysok... so, I can remove profile.boot and it should work?#2017-07-2318:46dominicmyep#2017-07-2318:47radonQuestion: is require supposed to work in CIDER-CLJS?#2017-07-2318:47radonWhenever I (require 'my-namespace) at the REPL, I get a spurious error message… even though I can perfectly well use my-namespace/functions-defined-there.#2017-07-2318:47radonAs suggested at https://groups.google.com/forum/#!topic/clojure/qSiGeQZzyT0, if I use cljs.core/require instead of require, it works.#2017-07-2318:48radonBut unfortunately that means I can’t evaluate a namespace declaration that depends on one of my other namespaces, because it gives me a big stack trace (since it uses regular require).#2017-07-2318:49kurt-o-sys@dominicm Things seem to be more complicated. When I do SPC m s i (cider jack-in, apparently)
Starting nREPL server via /usr/local/bin/boot -i "(require 'cider.tasks)" -d org.clojure/tools.nrepl\:0.2.12 -d refactor-nrepl\:2.3.0-SNAPSHOT -d cider/cider-nrepl\:0.15.0-SNAPSHOT cider.tasks/add-middleware -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware cider repl -s wait...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0-alpha17 already loaded, NOT loading version 1.2.0
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 2027
boot.core/boot/fn core.clj: 1030
...
boot.core/construct-tasks core.clj: 984
java.lang.IllegalArgumentException: No such task (cider)
clojure.lang.ExceptionInfo: No such task (cider)
file: "/tmp/boot.user8420735862008947390.clj"
line: 31
error in process sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0-alpha17 already loaded, NOT loading version 1.2.0
java.lang.Thread.run Thread.java: 745
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 2027
boot.core/boot/fn core.clj: 1030
...
boot.core/construct-tasks core.clj: 984
java.lang.IllegalArgumentException: No such task (cider)
clojure.lang.ExceptionInfo: No such task (cider)
file: "/tmp/boot.user8420735862008947390.clj"
line: 31
#2017-07-2318:49radonThis issue has apparently been reported at https://dev.clojure.org/jira/browse/CLJS-1473, and probably has something to do with the namespace being created during my CIDER session, rather than coming purely from disk.#2017-07-2318:49radon… but it seems like a pretty big usability problem. How do people manage it?#2017-07-2318:51radon(Also reported at https://github.com/clojure-emacs/cider/issues/2028, apparently.)#2017-08-0715:53richiardiandreaLol you can ask here but I will be back in front of my pc in about 24 hours, traveling now :) #2017-08-0716:01ghadino worries. I am trying to go all in on Socket REPL. I'm using inf-clojure but had a couple questions: how can I prevent inf-clojure from sending forms to the REPL except ones I explicitly send? I think there is some sort of background trickery going on that blows away the vars *1#2017-08-0716:04michaelwfogleman@ghadi If you figure out a good workflow for that, would love to see a blog post about it#2017-08-0716:04dpsuttoncan it? i know cider gets around this by maintaining two sessions to nrepl to prevent exactly this. there's your primary session and a tooling session#2017-08-0716:04dpsuttonso you never see autocomplete results in *1#2017-08-0716:40ghadii guess you could also have two socket connections#2017-08-0716:40ghadipersonally I don't really care about autocomplete#2017-08-0717:27ghadi@michaelwfogleman
(s/start-server {:name "repl" ;; s is clojure.core.server
:port 5555
:accept 'clojure.core.server/repl
:server-daemon false})
#2017-08-0717:28ghadiI put that in some sort of init namespace, then I run clojure with java -cp $(cat cp.txt) clojure.main -m my-init-ns#2017-08-0717:29ghadithen I connect emacs to it using inf-clojure-connect#2017-08-0717:30ghadiSo much faster than lein or boot#2017-08-0717:31ghadiAlternatively, you can start a socket repl using a java property with that map above embedded inside it#2017-08-0717:32ghadiI don't care for debugging, autocompletion, etc. Or at least I haven't missed them yet.#2017-08-0717:43richiardiandrea@ghadi there is way more to discover on #unrepl but yes, we send some form for autocomletion and autodoc#2017-08-0717:43richiardiandreaThere we were thinking of better tooling and multiplexing/multiple connection #2017-08-0717:43richiardiandreaAlso Thomas Hellers' shadow-cljs already provides that, and I am working (slowly) on a mode for that. Shadow-cljs is the closest you can get to have a no-magic repl#2017-08-0717:43richiardiandreaAbout inf-clojure, if you setq the defcustoms for completion and eldoc (sorry don't remember by heart), you won't send the form under the hood.#2017-08-0717:43richiardiandreaI would open an issue for '*1' because it is a bug#2017-08-0717:45ghadi@richiardiandrea thank you#2017-08-0718:05dominicm@ghadi just an fyi, that's not quite how cider works. Evaluations go through a different channel to completions. But it's still one nrepl session. Only evaluations blow away *1#2017-08-0720:16ghadiinstalling inf-clojure from git and not melpa stable has helped#2017-08-0720:48michaelwfogleman@ghadi Thanks for the explanation ghadi!#2017-08-0903:29bennyhow do i start a figwheel app from my cider nrepl?#2017-08-1020:19dpsuttondoes anyone know how to easily jack into a particular build for cljs?#2017-08-1020:20dpsuttonie, lein figwheel build-id#2017-08-1106:21featheredtoast@benny that's less of a cider issue and more of a figwheel issue - see the wiki for integrating figwheel into an existing repl here: https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#2017-08-1215:17paulspencerwilliamsHey, as an Emacs / Cider newb, I hoped someone might be able to point me at documentation / explanation of how Cider / Emacs chooses which window to open Cider buffers. It always seems to choose the least appropriate window... For example, I open a fresh Emacs instance, C-3, C-2 to create a 3 window frame, opening a unit test in the first small window, production code below it, and nothing in the large right window. When compiling the test, failures are reported in the below small window rather than the unused large one. How can I configure Cider to always display it's buffers in the right window, or am I not following the Emacs way?#2017-08-1216:34jumar@paulspencerwilliams I don't know/understand the details, but cider calls emacs function display-buffer: https://github.com/clojure-emacs/cider/blob/master/cider-popup.el#L70
If I repeat your steps I indeed get the cider-test-report buffer to be opened in small window (left bottom).
Possible workaround is to first split frame vertically into 2 windows, open test buffer on the left, run tests for the first time in this setup -> cider-test-report is opened on the right side. Then split left window horizontally and open production code in the bottom window. Now re-run tests - cider-test-report buffer should be opened in the right window.#2017-08-1218:28paulspencerwilliams@jumar yes, that would work. It appears that generally, opening up the buffer into a window first helps. Difficulty is not knowing how many buffers could be opened. I'll have a dive into your linked code. Cheers!#2017-08-1415:36ghadiprinting fipp in the repl is sooooo much faster than the default -- I think -- because fipp introduces line breaks, and something is super slow about printing long lines without breaks in cider/inf-clojure#2017-08-1415:36ghadieither it's syntax highlighting or something else#2017-08-1415:41dpsuttoni think emacs just isn't good (is terrible) at wrapping lines#2017-08-1415:47richiardiandrea@ghadi interesting, have you tried disabling clojure-mode in the REPL buffer?#2017-08-1415:48ghadino, I should try that#2017-08-1416:39dominicmI think fipp is the default on cider, or puget#2017-08-1417:55grzmI recently added some packages to my emacs configuration. One of the pleasant additions has been that when I create a new .clj buffer using find file in a Clojure project, it's inserting a namespace declaration automatically. Very nice. However, I don't know what feature is doing this and I'd like to change the template it uses. Anyone know what feature I need to tweak?#2017-08-1417:58grzmI think it might be part of ido, but I haven't been able to confirm that.#2017-08-1421:58dominicm@grzm this sounds like the feature in refactor.el#2017-08-1505:21domkmHas anyone had issues with printing (both via println and via Timbre) being dropped some of the time when connected with CIDER? If I connect a REPL on the command line instead of via CIDER, all printing works as expected, so it appears to be related to CIDER in some way. If I directly eval a print form with CIDER, it prints the expected output in the *cider-repl localhost* buffer, but if a print form is included in a function body, nothing is printed. It's very odd.#2017-08-1505:54domkmI've narrowed the issue a bit more. It appears that out is only dropped after running cider-refresh. Any idea why that might be?#2017-08-1621:57rickmoynihansounds like it could be an issue with binding. Are the printlns on different threads? If so the thread local bindings are probably different.#2017-08-1623:17domkm@U06HHF230 They may well be on different threads. Is cider-refresh expected to drop logging from other threads?#2017-08-1616:32richiardiandreais there an equivalent to inf-clojure-eval-form-and-next in cider?#2017-08-1616:44dpsuttonwhat does that do in inf-clojure?#2017-08-1616:51richiardiandreaevaluates a form and the goes to the next top level form#2017-08-1617:30dpsuttonnot that i know of. not really a work flow that i would do. i eval the namespace or functions as i define them#2017-08-1617:35richiardiandreauhm wondering how many people would like it#2017-08-1701:26bennywhat's the best way to remove an entry from a map?#2017-08-1701:27bennylike if i start with
{:foo "data"
:bar "more"}
#2017-08-1701:27bennyand i want to remove :foo so it looks like this instead
{:bar "more"}
#2017-08-1701:28bennywhat's the best way to remove the first pair and bring the line up like that?#2017-08-1708:10hkjels(dissoc m :foo)#2017-08-1708:31deg@benny There are probably better ways of doing it, but I do it with C-M-k C-M-k s-SPC, where I have a custom binding of s-SPC to 'kill-whitespace, and Super ("s-") is attached to the "Windows" key on my keyboard.#2017-08-1717:53pwrflxhi! Is there a fuzzy search possibility for function names? eg I'd like to search for "blank?" and this should show me that there is such a function available in clojure.string/blank? and offer the possibility to jump there with enter#2017-08-1719:19mgrbyte@pwrflx You can do cider-apropos (`C-c C-d C-a`); click/ENT on the link to follow to definition#2017-08-1719:36pwrflx@mgrbyte thanks! is there maybe a way that works via company mode? having the two extra buffers in between slows down in my flow..#2017-08-1719:37pwrflx@mgrbyte eg I'd like to just have a fuzzy matched company mode window and when I select something it goes to definition, that's all#2017-08-1810:05mgrbyte@pwrflx So I've started using company-mode with cider, and have what you wanted working. Pressing C-w opens a buffer with the source of the completion.#2017-08-1810:25pwrflxYou mean you have developed/configured something custom or you're saying it works out of the box?#2017-08-1810:34mgrbyteworks out of the box#2017-08-1810:34mgrbytewith some custom config#2017-08-1810:35mgrbytemine: https://github.com/mgrbyte/emacs.d/blob/master/init.el#L79-L86#2017-08-1810:36mgrbyteand https://github.com/mgrbyte/emacs.d/blob/master/init.el#L335-L336#2017-08-1810:37mgrbytehttps://github.com/clojure-emacs/cider/blob/master/doc/code_completion.md#2017-08-1719:43mgrbyte@pwrflx no idea sorry, I don't use company-mode#2017-08-1720:57waffletowerOverall I like CIDER a lot but am trying to wrangle its cider-error popup buffer behavior. Due to my eyes I am less tolerant than others and find the default cider-error behavior really annoying and jarring. Worse, the buffers usually appear in a window that I am not currently editing in, and I have to navigate back to the window, and its frames, that I was actually editing. Are there alternatives to the popup exception behavior? Are there ways to control which frame their buffers appear in?#2017-08-1721:08waffletower(setq cider-show-error-buffer nil) feels so much nicer, but is there a way to navigate to the trace when I choose not to display them automatically?#2017-08-1721:10waffletowerSorry I am being lazy, I guess I could write a little bit of elisp to show the current cider-error buffer and initiate it from the window of my choosing#2017-08-1721:29waffletowerBound to keys, these will work much nicer than default behavior for my eyes, I think
(defun cider-switch-to-error ()
(interactive)
(switch-to-buffer "*cider-error*"))
(defun cider-pop-to-error ()
(interactive)
(pop-to-buffer "*cider-error*"))
#2017-08-1721:31waffletowerIt seems that cider-error display uses switch-to-other-buffer rather than pop-to-buffer by default. Would this be configurable or would I need to change the source?#2017-08-1721:47andrea.crottiif I am in a cljc file and I have both the clojure and the clojurescript repl active#2017-08-1721:47andrea.crottihow do I choose which one to evaluate expressions with?#2017-08-1723:11dpsuttonnot positive but i think it goes to the last repl. evaluate (+ 1 1) in whichever repl you prefer#2017-08-1723:11dpsuttonpossible it also still respects clojurescript-mode vs clojure-mode @andrea.crotti#2017-08-1723:37featheredtoastswitching to clojurescript mode seems to work, but ideally we should be able to pick a repl in cljc mode. this seems related - https://github.com/clojure-emacs/cider/issues/1913#2017-08-1819:02bjais there an out of the box way to make cider/nrepl not capture stdout?#2017-08-1819:02bjaor to dup stdout back to the real stdout of the jvm#2017-08-1819:03bjaideally I'd be able to get it via nrepl and it'd also get to the jvm's stdout#2017-08-1820:15dominicmhttps://github.com/clojure-emacs/cider-nrepl/blob/d15b1d3/src/cider/nrepl/middleware/out.clj#L123-L124 You can turn off stdout redirection in nrepl#2017-08-1820:15dominicmso I'm guessing there's an nrepl option somewhere I'd bet.#2017-08-1820:15dominicmOr are you talking about during an evaluation?#2017-08-1820:19dpsuttonthis was a contentious thing in the past because the output not going to the repl in the past was a bug that was finally fixed#2017-08-1820:20dpsuttonbut it doesn't make sense in general for stdout to not go to the repl. there was talk of putting ways to suppress it but it was abandonded#2017-08-1904:58bbssis there a way to "go back" when using the cider-inspect-last-result ?#2017-08-1914:12volrathI believe l does the trick#2017-08-1915:44bjathis doc string Change *out*, *err*, System/out and System/err to print on sessions
in addition to process out.
claims that it does what I want#2017-08-1915:44bjawhich is to go to both my repl AND the process's usual stdout#2017-08-1915:45bjabut I haven't observed it actually working#2017-08-1915:45bjaI only get output in my repl#2017-08-1915:45bjapossible that this is a weird interaction between my logging library and *out* rebinding#2017-08-1915:46bjathanks for the pointer @dominicm#2017-08-1918:08martinklepschhello 🙂 I’d like to do something like this with inf-clojure: https://github.com/stuartsierra/dotfiles/blob/d0d1c46ccc4fdd8d2add363615e625cc29d035b0/.emacs#L307-L312#2017-08-1918:08martinklepschI got the insertion bit working but the return stuff isn’t as clear to me#2017-08-1918:10martinklepschI tried putting a linebreak after my to be evaluated form which results in the cursor being placed on the next line but not “submitting” the form for evaluation#2017-08-1918:45Lambda/Sierra@martinklepsch Isn't inf-clojure based on comint? Mayber there's a comint-return or comint-enter function.#2017-08-1918:46Lambda/SierraI'd also like that for cider-repl: Eval expression as input to REPL, exactly as if I'd typed it into the REPL buffer.#2017-08-1918:48Lambda/Sierra@martinklepsch comint-send-input is it, I think#2017-08-1919:02martinklepsch@stuartsierra that works, magic! 🙂#2017-08-1919:02martinklepschthanks a lot 🙂#2017-08-1919:04Lambda/Sierrayou're welcome#2017-08-2107:05jonasIs there some difference between cider-connect and cider-jack-in that I’m missing? When I use cider-connect I can’t get jump-to-definition M-. to work properly.#2017-08-2107:35dominicmCider connect requires that you've loaded cider into the repl. Either via your profile.clj, or by adding the cider task to boot.#2017-08-2107:35dominicmCider connect requires that you've loaded cider into the repl. Either via your profile.clj, or by adding the cider task to boot.#2017-08-2118:07dominicmDebugging something unrelated. Don't use cider myself. I have a suspicion that this can't be debugged by cider:
(defn foo [^long x] 10)#2017-08-2118:08dominicmCould someone here figure out if I'm right? I'll send a patch if so#2017-08-2308:50benedekis there a way to run some clojure code before quitting a cider REPL?#2017-08-2308:51benedekthinking to run (stop) in a component env for a clean shut down when I quit cider...#2017-08-2308:52richiardiandrea@benedek maybe using emacs' adivce you could send that to a REPL: https://www.gnu.org/software/emacs/manual/html_node/elisp/Advising-Functions.html#2017-08-2308:53benedekright, good idea. thx!#2017-08-2407:54myguidingstarhi all i'm trying to use shadow's cljs repl with cider#2017-08-2407:55myguidingstarI cider-connect to shadow's nrepl port, then (require '[shadow.cljs.devtools.api :refer [repl]]) and (repl :my-build)#2017-08-2407:56myguidingstarhowever I can't type directly into the new cljs repl (brought by the (repl ...) above)#2017-08-2407:57myguidingstarinstead emacs shows up a Stdin: input dialog#2017-08-2407:58myguidingstarand whatever i typed in that stdin dialog will be evaluated in the browser#2017-08-2407:59myguidingstarshawdow's wiki says something about this at https://github.com/thheller/shadow-cljs/wiki/REPL#2017-08-2408:00myguidingstarQuoted from the above: This DOES NOT WORK while in nREPL unless your nREPL client supports needs-input#2017-08-2408:01myguidingstarbut I don't understand what that means#2017-08-2408:04myguidingstarbtw, the cljs-repl works nornmally if I just start it from a clj-repl outside of emacs, eg with boot repl -c#2017-08-2408:21richiardiandrea@myguidingstar I tried and could not make it work either. One thing that differs that comes to mind is the prompt: you need another regex#2017-08-2408:22myguidingstarI've just got an answer from shadow-cljs#2017-08-2408:23myguidingstari should use (shadow/nrepl-select ...) instead of (shadow/repl ...)#2017-08-2408:24richiardiandreaLol I was going to add...btw the wiki has that: https://github.com/thheller/shadow-cljs/wiki/REPL#2017-08-2408:29richiardiandreaI was working on a shadow-mode a bit a couple of weeks ago, but it was more of an inferior mode than a fully fledged cider experience#2017-08-2413:16dominicmneeds-input is used when something tries to read from *in* and can't get anything. The client should prompt the user for input at that time.#2017-08-2413:34dpsuttonit can also happen in another way. (read nil) will prompt the user for input, so if there is a read call on a nil variable you will see this as well. My first look would be to find all reads and see if any of the forms could be nil#2017-08-2413:35dominicmI'm presuming this isn't a mistake, and is actually intentional & correct usage of the nREPL given that it's part of the docs.#2017-08-2611:12vinnyataidehello good sirs. is there a way to enable spec checking linting-style? squiggly lines, I'm using clojure's yada which is built with spec too and I make some mistakes only to be seen at runtime at the terminal. Thanks!#2017-08-2618:32dominicm@vinnyataide fwiw, yada uses schema, not spec#2017-08-2619:32vinnyataideReally? I didn't knew that schema failed on runtime with spec error maps#2017-08-2620:16dominicm@vinnyataide It doesn't :thinking_face: I'm not sure what you've encountered there.#2017-08-2717:12andyparsonsperhaps a n00b question, but I’m trying to get Cider going in a fresh spacemacs env, and get this with jack-in (on a fresh project): java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context#2017-08-2717:13andyparsonsthis is emacs 25.2 on a mac. Thanks for any insight!#2017-08-2720:13andyparsonshey all, ignore that- this was a profiles.clj conflict, user error!#2017-08-2720:20pwrflxhi! which package are you guys using to add fuzzy matching to cider's minibuffer commands? (eg for looking up files, switching to CLJ/CLJS repl, etc.)#2017-08-2822:55aaelonyI'm using CIDER 0.15.0 and do not have a ~/.lein/profiles.clj file but am seeing the following warning in emacs WARNING: CIDER's version (0.15.0) does not match cider-nrepl's version (nil). Things will break!
I forget how to correct this..#2017-08-2822:55aaelonyprobably need to specify cider-nrepl somewhere?#2017-08-2822:58aaelonydisregard... I added [cider/cider-nrepl "0.15.0"]
to my plugins vector in project.clj. I don't think I needed to do that previously...#2017-08-2823:01dpsuttonif you use cider-jack-in it manages that for you. if you use cider-connect you are in charge of ensuring there's an nrepl stack in your project for cider to communicate with#2017-08-2823:14aaelonyI'm using cider-jack-in via C-c M-j I think#2017-08-2909:21bbssWhen I try to cljr-extract-function it takes out the form and what I guess is at the step where I name the function I just get a M-x helm interactive buffer. And I an empty args list in the extracted function, but I'm not sure if that's related.#2017-08-2909:22bbssNot sure if this is the place to ask questions about clj-refactor.#2017-08-2915:30benedekright place yeah#2017-08-2915:31benedeknot sure I follow tho :/ any chance you can put together something so I can replicate the error?#2017-08-2915:32benedekalso would be interesting to see the nrepl msgs between your emacs and the nrepl server#2017-08-2915:34benedekhttps://github.com/clojure-emacs/cider/blob/master/doc/troubleshooting.md#2017-08-2915:34benedeksee nrepl messages section#2017-08-2915:43pwrflxbtw extract-function. ..is there a way to create a function that is currently missing? In eclipse or IDEA you can just click the red part and the IDE offers to create the method for you (also infering the parameters). is there similar functionality in cider/clj-refactor?#2017-08-2916:08dominicmcreate-function-from-example iirc#2017-08-2916:09dominicm(or similar name)#2017-08-2916:09benedekyup @dominicm fe#2017-08-2916:58adamfreyI'm looking at an emacs packages source and I'm seeing some functions a-merge and a-list. Does anyone recognize where those functions might be coming from? (x-post from #emacs)#2017-08-2916:58adamfreyhere's the reference: https://github.com/plexus/unrepl.el/blob/master/unrepl.el#L316#2017-08-2916:59richiardiandrea@adamfrey it is https://github.com/plexus/a.el#2017-08-2917:00adamfreythere we go, thanks!#2017-08-2918:34pwrflx@dominicm thanks!#2017-08-3002:23bbss@benedek thanks, for me something as simple as this fails:
clojure
(let [thing 1
other 2]
<cursor>(+ thing other))
;;M-x cljr-extract-function
;;result open helm buffer and slightly refactored:
(defn
[thing other]
(+ thing other))
(let [thing 1
other 2]
( thing other))
#2017-08-3107:30benedeksorry @bbss did not have time to look at this#2017-08-3107:30benedekwill try today#2017-08-3107:33bbss@benedek no worries. I have an awesome keyboard, pareditting around a bit manually isn't that bad.#2017-08-3107:39benedekhaha atreus? ;)#2017-08-3109:27bbssHHKB BT 🙂#2017-08-3109:29bbssI haven't tried matias switches yet! Wouldn't mind trying them out. I had ergodox which broke down which has a similar lay-out to the atreus. I liked it!#2017-08-3110:10benedeknice. I have two atreuses now an original with matias switches and one built from scratch with cherries. I prefer matias after typing for a few month on the cherry one.#2017-08-3110:10benedekcherry blue mainly btw#2017-08-3110:12dominicmgeeking on the keyboards, sat here with my ergodox ez. Feeling cool.#2017-08-3110:12shemmy JD45 is waiting for keycaps#2017-08-3111:17benedekis there a keyboards room? ;)#2017-08-3111:18bbss#keyboards 🙂#2017-08-3111:19bbss@shem, cute looking keyboard.#2017-08-3111:19bbssI like the layout of the hhkb, also very small#2017-08-3116:36bbrinckIs there a way to “watch” one or more expressions so that when I reload code, they are re-evaluated? I often write a few simple uses cases for a function and then work on the function. It’d be handy to see that output change as I re-defined the function. I don’t need everything in the buffer to be re-evaled, just a few expressions#2017-08-3116:37bbrinck(ideally with the output inline in the source, like cider usually does)#2017-08-3117:20dominicmEnlightenment is the search term for this feature @bbrinck #2017-08-3118:09bbrinck@dominic I’m afraid I’m not sure what you mean. Is this an existing feature or upcoming?#2017-08-3118:18dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/doc/miscellaneous_features.md#enlighten-display-local-values#2017-08-3118:25bbrinck@dpsutton Thanks!#2017-09-0508:09vinai[deleted]#2017-09-0508:10vinaiAh, I guess I should post this in #component - sorry. Will repost there.#2017-09-0601:12aghas anyone succeeded running cljs repl while connected to a clojure.repl in Emacs?
(require 'cljs.repl)
(require 'cljs.repl.node)
(def repl-env (cljs.repl.node/repl-env))
(cljs.repl/repl repl-env)
This doesn't really work#2017-09-0601:13agit kinda works (I think), but not really once it's connected to cljs repl - it prompts for input in minibuffer, not in the cider-repl#2017-09-0606:34dominicm@ag you need to use cemerick piggieback for integration with nrepl#2017-09-0618:50ag@dominicm oh, yeah, I forgot about that. Now I need to find a way to wrap piggieback around cljs.repl/repl#2017-09-0619:02tanzoniteblackif it helps you at all, I have a cljs project set up with the following in the project.clj: :plugins [[lein-cljsbuild "1.1.4"]
[lein-figwheel "0.5.8"]]
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
[figwheel-sidecar "0.5.8"]]}}
and then also a .dir-locals.el in the same directory with ((nil . ((cider-cljs-lein-repl . "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))"))))
#2017-09-0619:03tanzoniteblackyou're not using cider, if I read this correctly? But what I'm calling with cider-cljs-lein-repl should be runnable from any clojure repl if the right libraries are loaded to start a cljs repl#2017-09-0619:03tanzoniteblack(if this isn't actually useful, then just ignore me 🙂 )#2017-09-0619:08ag@U236LQYB0 cljs.repl and figwheel repl aren't the same thing#2017-09-0619:09tanzoniteblackyep, didn't read that close enough. so ignore me#2017-09-0619:16agokay, made it:
(require 'cljs.repl)
(require 'cljs.repl.node)
(require 'cemerick.piggieback)
(def repl-env (cljs.repl.node/repl-env))
(cemerick.piggieback/cljs-repl repl-env)
#2017-09-0619:28dominicmThat looks how I'd expect. You're not using cljs.repl anymore, so that line can go.#2017-09-0619:54fabraoHello all, is there any way to dynamic load dependencies from cider repl?#2017-09-0620:40dominicm@fabrao refactor.el provides this functionality#2017-09-0621:15mike_ananev@fabrao If you use Spacemacs then C-c C-f a p - add project dependency and load it to current repl without restart (hotreload)#2017-09-0621:16fabrao@mike1452 I tried the plugin alembic, I´m using pure Emacs#2017-09-0621:17mike_ananev@fabrao alembic works too.#2017-09-0621:17fabraobut do you think ur process is better?#2017-09-0621:18mike_ananevalso you may try https://github.com/arichiardi/vinyasa#2017-09-0621:18mike_ananevor#2017-09-0621:18mike_ananevhttps://github.com/ardumont/vinyasa#2017-09-0621:20fabrao@mike1452 Thanks, I´ll give a try#2017-09-0621:43oskarkvMy pretty-printing in the REPL has stopped working, it seems. cider-repl-use-pretty-printing is t and cider-pprint-fn is fipp but my REPL looks like this http://i.imgur.com/8ahdIZg.png Any ideas?#2017-09-0705:29gonewest818Check the value of clojure.pprint/*print-right-margin*?#2017-09-0705:56gonewest818huh, looks like new in cider 0.15.0, pretty printing is controlled by cider-repl-pretty-print-width and if that variable is nil then it uses`fill-column`#2017-09-0705:56gonewest818https://github.com/clojure-emacs/cider/issues/1876#2017-09-0707:32oskarkvclojure.pprint/*print-right-margin* is 72. I have tried with both cider-repl-pretty-print-width 80 and nil. My fill-column is 80#2017-09-0717:43gonewest818Sorry, at this point I have only generic debugging suggestions. The kind of stuff you’ve already considered, i.e. can you recall when’s the last time it worked, and has anything in your environment changed since then. That kind of stuff.#2017-09-0718:42oskarkvHehe no problem. I can't really recall when it stopped working, but it stopped without me updating cider, and persisted even after updating yesterday.#2017-09-0718:53gonewest818does it work in a repl that is NOT running in a lein project? what if you move aside your .lein/profiles.clj?#2017-09-0719:42oskarkvIt does!#2017-09-0719:42oskarkvHm, something in my profiles.clj...#2017-09-0719:47oskarkvLuckily it's not very big.
Thank you!#2017-09-0709:03magnarsAfter updating cider, cider-switch-to-repl-buffer no longer takes cljs/clj into account. It used to switch to a cljs-repl when in clojurescript-mode and a clj-repl when in clojure-mode. Is this a known bug? Or intended?#2017-09-0710:48magnarsYeah, same thing happens with multiple clojure projects with their own repl. It used to switch to the correct repl for that project, but now only switches to the last used one.#2017-09-0712:25magnarsFrom what I can tell, there is no mention of a relevant repl any more in the cider code. Was this feature just removed, or is there some replacement I'm not finding?#2017-09-0712:39magnarsOkay, so C-x C-e and C-c C-k obviously are able to find the correct repl to send the code to - so how do I use that information to visit the correct repl?#2017-09-0712:39dpsuttoni've run into the same issues as you. i haven't opened an issue or tried to fix it due to time issues#2017-09-0712:41magnarsI have several clojure projects running at once, and some of them with clojurescript repls running as well - so this is really hampering my style.#2017-09-0712:43dpsuttonyeah. i think its more based now on a concept of last repl#2017-09-0712:43dpsuttonso i'll put my cursor in the one i want and then try to eval#2017-09-0712:44dpsuttonthis seems like a fine strategy as a last resort but it seems to be too high up the chain on the repl resolution path for me#2017-09-0712:44magnarsguess I'll just have to find an old version of cider and stick with that one for a while#2017-09-0712:59dpsutton14 should work#2017-09-0713:00magnarsyes, I just installed 14. It works like it should. 🙂 Now I have to find the correct version of clj-refactor to go with it.#2017-09-0713:01magnarsI really hope that this is just a regression, and that the relevant switching is coming back.#2017-09-0713:02magnarsThe docs still say
> To switch to the relevant REPL buffer based on the Clojure namespace in the current Clojure buffer, use: C-c C-z.#2017-09-0713:10dpsuttonyeah. it was the mechanism that determined this that was changed#2017-09-0713:11dpsuttonhttps://github.com/clojure-emacs/cider/commit/746e4d694104c0c3e0493d84b091a4fd2d54f626#2017-09-0713:13magnarsThis should only pick default to the most recent in ambiguous cases, tho, and still pick correctly from clj vs cljs repls for instance.#2017-09-0713:13dpsuttoni totally agree#2017-09-0713:13magnarsMaybe it's some bug in that code causing the bug.#2017-09-0713:14dpsuttonit seems to get the most recent far too often#2017-09-0713:14dpsuttonit also is not good at even recognizing that i'm coming from a cljs buffer and will try to load it in the clj repl#2017-09-0713:15magnarsindeed#2017-09-0714:48jumarI've also noticed this issue. For now, I'm using (way too often) cider-assoc-buffer-with-connection. However, for some reason, even this function sometimes fail to recognize any active cider connection (although I have e.g. 3 cider repls running)#2017-09-0714:49dpsuttondoes someone have the time to raise an issue on github?#2017-09-0720:14oskarkvI am using two Emacs frames (on two different monitors), and when cider-doc opens up a new buffer, it appears in the same position as last time, but that might be in the other frame (the one I'm not currently in) and it annoys me. Does anyone know how I can force the buffer to appear in the current frame?#2017-09-0720:46oskarkvI guess deleting the old buffer first works.#2017-09-0805:23richiardiandreaHi folks! What is the binding/command I need for dumping the nRepl activity again (all the commands sent and received) ?#2017-09-0807:44benedeknrepl-toggle-message-logging ?#2017-09-0812:57noogaI have auto complete in my repl but I don’t in clj files (clojure-mode), how do I find out why?#2017-09-0814:32richiardiandrea@nooga C-h m should give you the list of all the active modes for a buffer#2017-09-0815:25alpoxHi all! Has anyone encountered the problem that cider just doesn’t open a cider-repl buffer and also does not connect to the nrepl-server even though that one is running? (All after a call to cider-jack-in)#2017-09-0815:26dpsuttonis there anything in the *Messages* buffer?#2017-09-0815:27alpox@dpsutton It ends with
>Starting nREPL server via /Users/Elias/.local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.15.1-SNAPSHOT\"\] -- repl :headless :host ::...#2017-09-0815:27alpoxAfter this is nothing#2017-09-0815:28alpoxAnd nothing more seems to come#2017-09-0815:28dpsuttonis there a buffer created *nrepl-server [project-name]*?#2017-09-0815:28alpoxyes that one is working#2017-09-0815:29alpoxIt evaluated my file#2017-09-0815:29dpsuttonand nothing in there giving any info?#2017-09-0815:29alpoxOnly a warning about something in my code#2017-09-0815:29alpox>WARNING: or already refers to: #‘clojure.core/or in namespace: clojure-org.visualization.svg, being replaced by: #‘clojure-org.visualization.svg/or#2017-09-0815:30alpoxFrom some testing around - i redefined or as macro#2017-09-0815:30dpsuttonyeah that's not blocking this. hmm#2017-09-0815:30dpsuttondo you have a lein profiles file or anything?#2017-09-0815:30dpsuttonis this recent or have you been using cider for a while?#2017-09-0815:30alpoxYes i do but its only {:user {:plugins [[lein-exec "0.3.6"]]}}#2017-09-0815:31alpoxI have been using cider for a while - it stopped working today after i tried out some code, mainly trying to get data from google/bing through slurp - working through clojure for the brave and true atm.#2017-09-0815:32dpsuttonafter you tried out some code?#2017-09-0815:32alpoxSeems weird but yes#2017-09-0815:32dpsuttonwhat code?#2017-09-0815:32dpsuttonelisp or clojure?#2017-09-0815:32alpox(defn google-search-url
[term]
(str "" term))
(defn bing-search-url
[term]
(str "" term))
(defn search
[term]
(doseq [url [google-search-url bing-search-url]]
(let [result (promise)]
(future (if-let [answer (slurp (url term))]
(deliver result answer)))
@result)))
(search "golf")
#2017-09-0815:33alpoxI ran this clojure code in the repl and after that cider broke#2017-09-0815:33alpoxAnd i couldn’t get it to work anymore with reinstalling everything, restart… etc.#2017-09-0815:33alpoxI somehow don’t think that the code could have broken cider - its just when it happened somehow#2017-09-0815:34dpsuttonyeah it looks innocent enough#2017-09-0815:35dpsuttondo you have any java processes running?#2017-09-0815:35alpoxNot that i recall, no#2017-09-0815:35dpsuttoncan you kill any you see and then try jacking in again#2017-09-0815:35alpoxThe only things running are chrome, terminal, slack and emacs#2017-09-0815:39dpsuttonare you able to crank up a lein repl outside of cider?#2017-09-0815:39dpsuttonmaybe things are borked lower than we are looking?#2017-09-0815:39alpoxI just killed all processes which are not crucial and tried again - to no avail.#2017-09-0815:39alpoxDo you think it could be something OSX specific?#2017-09-0815:40alpoxYes lein repl runs nicely in terminal#2017-09-0815:41dpsuttonhave you nuked CIDER and reinstalled/#2017-09-0815:42alpoxInside, emacs, yes, i did#2017-09-0815:42alpoxI once even threw out the whole emacs configuration with all packages and reinstalled everything#2017-09-0815:43alpoxThis bugs me a little that that didn’t even work ^^#2017-09-0815:43alpoxI would like to see at least an error message somewhere - but i’m not familiar enough with emacs yet to find any 😄#2017-09-0815:45dpsutton(shell-command "lein repl") can you try that? is it possible that emacs can't see lein on your path?#2017-09-0815:45alpoxHmm where can i try that command? (Sry, really not so familiar with emacs)#2017-09-0815:45alpoxShould i just put it in the config?#2017-09-0815:49dpsuttonno, you can eval arbitrary emacs lisp by M-:#2017-09-0815:49dpsuttonit'll ask you for the input in the minibuffer#2017-09-0815:50dpsuttonor just (cider--lein-resolve-command)#2017-09-0815:50dpsuttonto see if its on your path#2017-09-0815:52alpoxI’ll try it 🙂 just my emacs is stuck atm#2017-09-0815:53dpsuttonsorry to hear that. i know that's frustrating#2017-09-0815:53alpoxWell it stuck after the shell command 😄 i guess lein repl was running in the background and held the process#2017-09-0815:53alpoxYea its on the path#2017-09-0815:53alpox(cider--lein-resolve-command) found it#2017-09-0815:54dpsuttonok#2017-09-0815:55dpsuttonhave you ever debugged emacs lisp code?#2017-09-0815:55alpoxNot really 😄 i have not written any either except some small configurations#2017-09-0815:55dpsuttonthat's fine. it'll be straight forward#2017-09-0815:55dpsuttonand i have a suspect in the code#2017-09-0815:55dpsutton(when-let ((repl-buff (cider-find-reusable-repl-buffer nil project-dir)))
(let ((nrepl-create-client-buffer-function #'cider-repl-create)
(nrepl-use-this-as-repl-buffer repl-buff))
(nrepl-start-server-process
project-dir cmd
(when cljs-too #'cider-create-sibling-cljs-repl))))
#2017-09-0815:56dpsuttonthat's a part of the cider-jack-in function. and if that when-let isn't satisfied, it would just error out#2017-09-0815:56dpsuttonso my guess is that emacs isn't finding a repl buffer and there's no code for that case#2017-09-0815:59alpoxHmm but that used to work before and it started a repl buffer#2017-09-0816:00alpoxSo i wonder why it should suddenly be broken#2017-09-0816:00alpoxAnyways, how can i debug this?#2017-09-0816:00dpsuttonno idea#2017-09-0816:00dpsuttonit's easy to instrument emacs lisp#2017-09-0816:01dpsuttonto evaluate elisp you run C-M-x. To debug it you instrument it with C-u C-M-x (the prefix in emacs lingo)#2017-09-0816:01dpsuttonand when you run cider jack in, it'll bring you to the emacs code with a little mark where evaluation is and you can hit n for next, c for continue, etc#2017-09-0816:03alpoxHmm i cannot really use any C-M commands, because on my mac, the meta key is somehow broken 😄 i use spacemacs with SPC-something-something#2017-09-0816:03alpoxDo you know the names of these commands?#2017-09-0816:04dpsuttoneval-defun with a prefix argument#2017-09-0816:05alpoxWhen i run cider jack in it doesn’t sadly bring me to any code 😕#2017-09-0816:06dpsuttonnavigate to it#2017-09-0816:06dpsuttonthere may be a mark showing that youre in the debugger#2017-09-0816:06dpsuttonfind-function and then cider-jack-in will navigate right to it#2017-09-0816:09alpoxI don’t get to the code o.O
>condition-case: Symbol’s value as variable is void: helm-bookmark-map#2017-09-0816:10dpsuttoncan you navigate to the cider.el buffer in the cider package?#2017-09-0816:10dpsuttoni don't know what's going on with your emacs#2017-09-0816:10alpoxMe neither#2017-09-0816:10alpoxBut i’ve seen Symbol's value as variable is void quite some times now >.<#2017-09-0816:11alpoxOkay i found cider-jack-in#2017-09-0816:11dpsuttonrun eval-buffer on this file#2017-09-0816:12alpoxdone#2017-09-0816:12dpsuttonhave you installed any packages recently?#2017-09-0816:12alpoxWell, all packages i use, yes 😄#2017-09-0816:12alpoxBecause i reinstalled them all#2017-09-0816:12dpsuttonany new ones recently?#2017-09-0816:12dpsuttonaround the time this stopped working?#2017-09-0816:12alpoxNo, they are stable since some time#2017-09-0816:13alpoxBut it stopped working today#2017-09-0816:13dpsuttonbut either way after evaling the file, try cider jack in now#2017-09-0816:13alpoxNo wait, it was yesterday… but i didn’t add any packages#2017-09-0816:14alpoxI did, to no avail 😞#2017-09-0816:15dpsuttonok. now that you know where cider-jack-in is defined, want to try debugging it again?#2017-09-0816:16alpoxOkay#2017-09-0816:16dpsuttonor if you want you can print debug it but putting (message "some message here") and it will print them for you#2017-09-0816:20alpoxI put it in when-let and it shows in the message buffer after cider-jack-in#2017-09-0816:20alpoxSeems to be working so far#2017-09-0816:33alpoxI wonder what
(let ((nrepl-create-client-buffer-function #'cider-repl-create)
(nrepl-use-this-as-repl-buffer repl-buff))
are for. These variables don’t seem to be used#2017-09-0816:33dpsuttondynamic vars. used lower down the call stack#2017-09-0816:33dpsuttonnot great#2017-09-0816:34alpoxOuch that sounds dangerous#2017-09-0816:34dpsuttoncider#2017-09-0817:05michaelwfogleman@magnars @dpsutton @jumar I filed an issue because this has also affected me, please pipe in to add details if needed 🙂 https://github.com/clojure-emacs/cider/issues/2084#2017-09-0817:05dpsuttonthanks!#2017-09-0817:30alpox@dpsutton i dropped it for now - going to take another try on time. I hope i don’t have to switch the editor because of this#2017-09-0817:32dpsuttonFor sure. Sorry we couldn't get it right now#2017-09-0917:16alpox@dpsutton I went on trying for some hours now, even removed all the traces of emacs from my computer and reinstalled everything again but already after the installation of spacemacs i get errors when reloading the config.
After installing clojure and cider, the behavior is the same as before 😞 there seems to be no way to repair it#2017-09-0917:16alpoxGuess the only thing i can do is use Cursive from now on#2017-09-0917:49alpoxI could now get rid of all error messages popping up, but cider still doesn’t connect#2017-09-0917:51alpoxCorrection: I can now connect to a lein repl which i opened in the terminal through cider-connect. Only cider-jack-in still bugs 😄 i guess i can work with that for now#2017-09-0918:05gonewest818fwiw, I’ve scanned this thread and I saw mention of cider 0.15.1-SNAPSHOT and refactor-nrepl 2.4.0-SNAPSHOT… and I didn’t see a general summary of what else you’re running. Have you tried this with stable versions of, well, everything?#2017-09-0919:54alpox@gonewest818 I’m quite new to emacs so i don’t exactly know how to check versions. I am sure though that i tried with stable versions of emacs itself and spacemacs. No idea about cider though#2017-09-0919:54alpox@gonewest818 I use the builtin cider/clojure stuff from spacemacs#2017-09-1214:24normanCan I send clojure expressions from emacs without updating *1 *2 *3? Right now I have emacs code that does cider-interactive-eval, but doing the eval updates *1 *2 *3, which negatively impacts my REPL experience#2017-09-1214:24dpsuttonthere are two sessions open for CIDER. there's the main one and a tooling one#2017-09-1214:24dpsuttonif you send your expression in the tooling session it will not update *1, etc#2017-09-1214:25dpsutton(defun cider-tooling-eval (input callback &optional ns)
"Send the request INPUT and register the CALLBACK as the response handler.
NS specifies the namespace in which to evaluate the request."
;; namespace forms are always evaluated in the "user" namespace
(nrepl-request:eval input
callback
(cider-current-connection)
ns nil nil nil t ; tooling
))
#2017-09-1214:26dpsuttonif you look at nrepl-send-request, you'll see the last parameter is tooling controls this line in the ultimate nrepl send off function, nrepl-send-request
(when-let ((session (if tooling nrepl-tooling-session nrepl-session)))
(setq request (append request `("session" ,session))))
#2017-09-1214:27dpsuttonso however you want to do it, if you correctly set this var you can send forms without affecting the results#2017-09-1214:27dpsutton@norman ^#2017-09-1214:28normannice#2017-09-1214:28normanThanks -I’ll try this out#2017-09-1214:28dpsuttoncider#2017-09-1221:00pwrflxI'm using cider, but miss some features from IDEs 😞 eg. immediate highlighting of problematic code (eg wrong arity), or when the cursor is on a parameter, I'd like to have it highlighted where the parameter is used and such things.. any tips?#2017-09-1221:04jmayaalv@pwrflx i recommend you https://github.com/candid82/flycheck-joker#2017-09-1221:06jmayaalvsome examples of what joker can do: https://github.com/candid82/SublimeLinter-contrib-joker#examples#2017-09-1221:06pwrflx@jmayaalv thx, I'll take a look#2017-09-1312:30pwrflxis there a way to put a breakpoint on exceptions? Many times the stack trace does not tell anything and would like to inspect locals..#2017-09-1314:29jmayaalvi don’t think that’s possible right now#2017-09-1314:30dominicm@pwrflx https://github.com/prismofeverything/schmetterling/blob/master/README.md I found this last night.#2017-09-1314:30dominicmmight be useful#2017-09-1314:32pwrflx@jmayaalv strange, as this is one of the most commonly occurring error scenarios#2017-09-1314:34jmayaalvhmm, maybe. i’ve prefer to use enlighten-mode leaving step debugging for really few cases.#2017-09-1317:18gonewest818(try … (catch Exception e …)) and set a breakpoint inside the catch?#2017-09-1417:18eggsyntaxHey folks, I recently did a reinstall with fresh emacs and fresh spacemacs, and I'm encountering something odd. When I'm cider-jacked-in, if I try to save a cljs file, emacs freezes up for an extended period of time with cpu maxed out (on one core). I get weird delays at other times, too, but saving a cljs file is the most noticeable by far. Running the profiler, 95% of cpu is being used by execute-command, and it won't let me unfold that to see what's specifically being called.
Has anyone encountered something like this? I'm at my wits' end, I've lost pretty much a whole day to emacs/cider problems at this point.#2017-09-1420:16hkjelsI’d try using a recursive struss/dtruss on your emacs PID. Might turn up something useful#2017-09-1421:39eggsyntaxSolved. Turned out to be aggressive-indent-mode, which I really love, but not at the cost of extended freezing.#2017-09-1606:10magnars@eggsyntax Seems like you encountered my issue as well: I recently upgraded Emacs and clojure-mode, and the indentation is a lot slower. I used to indent all the time, and now it is way too slow for that. #2017-09-1614:56eggsyntax@magnars do you use aggressive-indent-mode? I know that @bmaddy has specifically had problems with indentation since updating.
I’ve also got a really odd one — I’ve changed clojure-syntax-table to treat hyphenated words as single words, which has always worked fine. But since the update, navigating by w does odd things: it jumps to the space following a hyphenated word (instead of to the next word), and on certain s-exps, pressing w on a closing paren does nothing. Planning to look into that one today.#2017-09-1615:41magnars@eggsyntax not aggressive-indent-mode, no - just regular full-buffer indentation. It was almost a tick, I would do it all the time while coding. Then after updating, I had to stop doing that since it would take seconds.#2017-09-1713:52oskarkvDoes anyone know which function in cider-nrepl produces those arglists that the dynamic font locking uses?#2017-09-1714:02dpsutton@oskarkv i just commented on the github issue but check here http://hackingcider.com/posts-output/2017-05-10-font-lock-bug/#2017-09-1714:02dpsuttonbut i believe it is cider–compile-font-lock-keywords#2017-09-1714:03dpsuttonthat blog post has ways of hijacking it so its output is smaller and more manageable.#2017-09-1714:06oskarkv@dpsutton But there is some clojure function in the middleware that extracts the arglists, right? But I can't figure out where. 😛#2017-09-1714:07dpsuttonoh i see. one second#2017-09-1714:09dpsuttoni believe it is this one https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/ns.clj#L45#2017-09-1714:11dpsuttonand this populates a cache in cider-repl--state-handler#2017-09-1714:12oskarkvOk! Thanks!#2017-09-1714:12dpsuttonfor sure 👍 thanks for working on this issue#2017-09-1714:13oskarkvRight now I'm trying to see if I can get the (def sym (fn ...)) to be the right color 😛#2017-09-1714:17dpsuttongood luck to you. feel free to write notes and create an entry on hacking cider#2017-09-1714:17dpsuttonhttps://github.com/clojure-emacs/hackingcider#2017-09-1721:36cjhoweis there an issue for running clojurescript tests through CIDER? i'd like to help contribute to making this work if i can, but i can't find the issue for it (there must be one?)#2017-09-1804:07oskarkvFor some reason cider-nrepl can't dynamically font lock itself. But the code works for other projects...#2017-09-1804:07oskarkv😕#2017-09-1812:46oskarkv@dpsutton https://i.imgur.com/fMtz7Sj.png#2017-09-1812:52oskarkvHm, do I want that a-fn after def to be orange?#2017-09-1812:53dpsuttonnice!#2017-09-1812:54oskarkvStill no good solution for the ns/fn problem, i have just commeted out the clojure-mode code#2017-09-1812:54oskarkvBut I made a PR for the other part, about def:ed fns#2017-09-1814:00dpsuttonit looks like set/union is font lcoked here, right?#2017-09-1814:30oskarkvyes#2017-09-1814:34dpsuttondoesn't that mean the ns/fn feature s working?#2017-09-1814:40oskarkvAs I said, I have just commented out those lines in my clojure-mode. But I don't know if just removing a feature in clojure-mode is a good idea.#2017-09-1814:43oskarkvBut, yeah, I guess it works in CIDER.#2017-09-1814:43oskarkvBut people use clojure-mode too, right?#2017-09-1814:44oskarkv@dpsutton ^#2017-09-1814:44dpsuttoni think its a requirement for cider#2017-09-1814:45dpsuttonone thing, i haven't seen the clojure mode but the compiled font lock info is put in a cider var. perhaps you could inhibit the font locking when this var is present and not nil#2017-09-1814:47oskarkvYou mean disable clojure-mode's font locking?#2017-09-1814:49dpsuttonyes, when its apparent that cider has done more intelligent font-locking#2017-09-1814:50oskarkvI think some font locking from clojure-mode is still useful. For docstrings, keywords, etc.#2017-09-1814:50oskarkvBut maybe that's not how it works 😛#2017-09-1814:51dpsuttonis it possible to inhibit it for just the functions?#2017-09-1814:51dpsuttoni haven't looked into this at all, just wondering#2017-09-1814:51oskarkvI haven't look that much either 😛#2017-09-1814:51oskarkvBut it must be possible#2017-09-1816:04oskarkvI almost have a solution. But I don't know how to refontify.#2017-09-1816:23richiardiandreaThis can be of help, I use these functions a lot when hacking on font lock: http://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Basics.html#2017-09-1816:23oskarkvThey don't seem to do anything for me.#2017-09-1816:24oskarkvI have not tried unfontify. But fontify, flush and ensure don't work...#2017-09-1816:25oskarkvBut killing the buffer and reopening works.#2017-09-1816:28richiardiandreaYeah that's the extreme solution 😉#2017-09-1816:29oskarkvYeah, but I meant that my settings work. It's not really a solution. 😛#2017-09-1816:49richiardiandreaOf course#2017-09-1817:34oskarkvApparently turning the major mode off and on works.#2017-09-1816:11oskarkvBut the solution is bad...#2017-09-1816:13oskarkvThe more relaxed font-locking is so complected with the original.#2017-09-1816:44oskarkvThere's a very easy way to do it. But then the functions overwrite everything, even comments. 😛#2017-09-1817:20oskarkv@dpsutton Hm, from what I can tell at this point, these are the alternatives for the ns/part problem.
1. Remove the feature in clojure-mode (it's not that important to font lock the namespace part, I'd say).
2. Set overwrite to t in the new font lock rules in CIDER, but then they overwrite even comments, so that's not so good.
3. Remove elements from clojure-font-lock-keywords in clojure-mode when cider-font-lock-dynamically is set (but then one loses colors if not jacked-in).
4. Remove elements from clojure-font-lock-keywords in clojure-mode if cider--dynamic-font-lock-keywords is set, but when? Maybe with some sort of hook?
5. Remove elements from clojure-font-lock-keywords in CIDER, but that would be horribly complected with clojure-mode. Worst idea ever. 🙂
Even removing elements from clojure-font-lock-keywords in clojure-mode would be complecting two functions such that you gotta keep them in sync.#2017-09-1817:24oskarkvMaybe there is something I'm not thinking of thought. 😛#2017-09-1821:45malabarba@nooga looks like company-mode completion, it should work in Clojure buffers #2017-09-1822:02nooga@malabarba somehow it doesn’t 😞 and I don’t know how to debug#2017-09-1822:11noogaand repl has all the same minor modes as clojure buffer#2017-09-1822:31malabarbaIs the buffer loaded? (C-c C-k) #2017-09-1908:29noogaIt is. But I don’t think it matters. While I get doc based hints in minibuffer when typing function names, I don’t get this popup for auto completion.#2017-09-1918:05noogaOoooh…. it works under M-TAB in buffers and under TAB in the repl, lame me ;(#2017-09-2122:03malabarbaAh. You'll need to bind TAB to one of the company-mode commands. #2017-09-1900:39oskarkvHm, how do I work on cider-nrepl conveniently with cljs? 😧#2017-09-1900:47gonewest818The modern-cljs tutorial shows one approach based on boot-cljs-repl but with the caveat that this is a “let’s learn this from the ground up” style tutorial, and not just a template to clone and use https://github.com/magomimmo/modern-cljs#2017-09-1900:49gonewest818I’ve seen a bunch of templates to clone and use too. for example https://github.com/martinklepsch/tenzing#2017-09-1901:00oskarkv@gonewest818 I meant testing cider-nrepl in cljs at the same time as I'm trying to change cider-nrepl. Is there a tutorial for that? 🙂#2017-09-1901:09gonewest818Ah. My misunderstanding then. #2017-09-1901:16gonewest818https://cider.readthedocs.io/en/latest/hacking_on_cider/#2017-09-1901:16gonewest818http://www.hackingcider.com/posts-output/2017-04-27-basic-setup-cider-nrepl/#2017-09-1901:18oskarkvYeah, but those do not really cover cljs.#2017-09-1912:28alpox@dpsutton I finally made my cider work again! i actually forgot the .lein/profiles.clj entry :repl {:plugins [[cider/cider-nrepl "0.15.1"]]} >.<#2017-09-1912:30dpsuttonhaha. yeah. that can be a real pain. good debuggin!#2017-09-1912:30alpoxThanks ^_^ yea stupid little config entry messed with me 😄#2017-09-1912:41hkjelscider-format-buffer moves point. That’s a bug right?#2017-09-1912:43dpsuttonno, not looking at how it works#2017-09-1912:44dpsuttonyou can use crux-cleanup-buffer-or-region to get the cleanup without moving point, but the cider apparatus does something more extreme:
(unless (equal original formatted)
(erase-buffer)
(insert formatted))
#2017-09-1912:45dpsuttonwell, maybe it is a bug but it sounds difficult with little benefit. but no doubt there would be interest in a patch#2017-09-1915:14bozhidar> Thanks ^_^ yea stupid little config entry messed with me 😄#2017-09-1915:15bozhidar@alpox In recent version of CIDER updating the config is not longer needed so you can simply remove it.#2017-09-1916:20alpox@bozhidar good to know. I assume that spacemacs still ships an old version then because it doesnt work for me without it#2017-09-2016:14oskarkv@bozhidar Should I create an issue for this PR? I don't think there was one. https://github.com/clojure-emacs/cider/pull/2086#2017-09-2016:17dpsuttoni suppose so. it would also be nice to include some screenshots of before and after#2017-09-2016:17dpsuttonwhen you make your final commit, you can squash all your stuff down into one and preface it with [bug#]: ....#2017-09-2016:17dpsuttonthis way people can easily find discussion, screenshots, etc#2017-09-2016:18dpsuttoncheck out this bit: https://github.com/clojure-emacs/cider/pull/2067/commits#2017-09-2016:19dpsuttonits not super cod to nsistent and there seems to be no open issue on this so i'm surprised he's holding to this. its possible he wants to make it more consistently tied to open issues or perhaps he's confused this with the fontlocking issue about namespace/function-name#2017-09-2016:19dpsuttoneither way, thanks for the contrib!#2017-09-2016:19dpsuttonand i think the screenshots would be of value so i'd just make the issue 🙂#2017-09-2017:25oskarkv@dpsutton ok, done 🙂#2017-09-2017:25dpsuttonjust saw. nice#2017-09-2017:26dpsuttoni haven't looked into your code change, but presumably it recognizes functions in general?#2017-09-2017:26oskarkvYes#2017-09-2017:26dpsuttonlike (def func (partial func-a 2)) and the like?#2017-09-2017:26oskarkvYes#2017-09-2017:26dpsuttonawesome!#2017-09-2017:26dpsuttonvery nice#2017-09-2017:26dpsuttonwill this be your first contribution?#2017-09-2017:26oskarkvYes#2017-09-2017:26dpsuttonsuper!#2017-09-2017:26oskarkv🙂#2017-09-2017:27dpsuttondo you think you would like to write up some notes about how you tested things?#2017-09-2017:27dpsuttonlike what seemed weird, what took you a while to figure out , etc#2017-09-2017:27dpsuttoneither about the issue you worked on or about setting up cider/cider-nrepl to test and poke things?#2017-09-2017:27dpsuttonif you feel like it throw up a md file on https://github.com/clojure-emacs/hackingcider#2017-09-2017:28oskarkvIt took me a while to figure out where the code i needed was, but then I read the article about debugging, and the repl-toggle-messages, or whatever, led me to the right place#2017-09-2017:28dpsuttonno pressure to do it either way, but if you think others looking to get involved might benefit from what you learned, I'm a big fan of lowering barrier to entry 🙂#2017-09-2017:28dpsuttoneither way i'm glad you took the time and made CIDER better#2017-09-2017:28dpsuttoni'm glad you found those articles useful#2017-09-2017:28oskarkvNo problem#2017-09-2017:29dpsuttonfeel free to PR those particular articles as well if you think they could be more clear#2017-09-2017:29oskarkvI would like an article about how to debug a CLJS environment with cider-nrepl#2017-09-2017:30oskarkvI spit some debug messages because I couldn't figure out any better way#2017-09-2017:31oskarkvor maybe I should have said#2017-09-2017:31oskarkvHow to debug cider-nrepl for cljs#2017-09-2017:31dpsuttoni don't know the answer to that question#2017-09-2017:32dpsuttonhttps://github.com/clojure-emacs/cljs-tooling#2017-09-2017:32dpsuttonbut it may involve that ^#2017-09-2017:42oskarkvHm, I see another problem with the colors 😛#2017-09-2017:44oskarkvI turned off clojure-mode's font locking#2017-09-2017:44oskarkvbut partial is not green... hmm#2017-09-2017:44oskarkvIt's just in that position, after def#2017-09-2017:50oskarkvMaybe I didn't turn off everything from clojure-mode... I just emptied clojure-font-lock-keywords#2017-09-2017:50dpsuttonare you jacked in?#2017-09-2017:50oskarkvYes#2017-09-2017:51oskarkvA-fn and + are green 😛#2017-09-2017:51dpsuttonhmm#2017-09-2017:51oskarkvIf I enter something before partial, partial turns green#2017-09-2018:44oskarkvI found a clue#2017-09-2018:45oskarkvIf I comment out all the code in cider--parse-and-apply-locals then partial becomes green.#2017-09-2018:47dpsuttonoh god, those locals get confusing. useful but really tough to reason about#2017-09-2018:47oskarkvHehe#2017-09-2018:48oskarkvIt seems#2017-09-2018:48oskarkvIt looks for def just to be short#2017-09-2018:48oskarkvIt sould look for defn and defmacro, I think#2017-09-2018:49oskarkvGotta read more carefully#2017-09-2019:16oskarkvI solved it...#2017-09-2019:16oskarkvFor def#2017-09-2019:17oskarkvBut what about other things that are like def 😞#2017-09-2019:17oskarkvdefconst for example. It's not in clojure.core but I have defined it 😛#2017-09-2019:19oskarkvI really need forks of everything and merge in new updates instead of downloading from melpa 😛#2017-09-2019:20oskarkvBut I get an annoying message all the time when I do that#2017-09-2019:20dpsuttonwhat do you mean?#2017-09-2019:20oskarkvAbout forks?#2017-09-2019:21oskarkvI mean I should load all my emacs plugins from git repos instead of downloading them automatically from melpa#2017-09-2019:22oskarkvThat way it's much easier to manage personal changes#2017-09-2019:22oskarkvBut I get some error annoying warning message when I do that#2017-09-2019:22oskarkvGotta get rid of that#2017-09-2019:22dpsuttonahhhhh yeah#2017-09-2019:22dpsuttonwhat warning?#2017-09-2019:23oskarkvLet's see...#2017-09-2019:26oskarkvHm, not getting it now... 😛#2017-09-2019:27oskarkvOh, yeah, here#2017-09-2019:27oskarkv"The local variables list in ... contains values that may not be safe"#2017-09-2019:27oskarkvGoogling...#2017-09-2019:35oskarkvToo tired for that right now 😛#2017-09-2019:37dpsuttonfor sure#2017-09-2019:37dpsuttonit sucks when there's so many things moving at the same time#2017-09-2019:37dpsuttonwhen what you need to do is conceptually easy but 5 small, easy things are all difficult to do#2017-09-2108:39oskarkvFinally, took a while to move to loading from git repos, because of a lot of problems in my init.el that didn't show up when getting packages from melpa for some reason. 😛#2017-09-2108:55achikinHi. Does anyone have issues using figwheel with cider? It works extremely slow for me and errors never show up in emacs error buffer.#2017-09-2110:35jumar@achikin how do you use it? It usually works for me well. Also, I can see the warnings in cider repl e.g. if I use undeclared variable.#2017-09-2115:02achikin@jumar yes, I can see warnings in the repl, but I’d prefer to see them in the error window like with the clojure repl.#2017-09-2115:04achikinThe other question - is it better/easier to go with the default rhino repl rather than figwheel? I have figwheel running as a separate process anyway, so what I need from the cider clojurescript repl is a better code completion and compile errors/warnings…#2017-09-2115:10dpsuttonone thing you might like: https://github.com/clojure-emacs/cider/pull/2043#2017-09-2420:07michalhi, is there any way to configure cider to get a persistent repl history per project (in terms of projectile project) ?#2017-09-2505:42benedekset the repl history file to a project local file with a dir-local in the project root dir?#2017-09-2712:11andrea.crottiHello!#2017-09-2712:11andrea.crottiI just noticed that in the cljs cider repl#2017-09-2712:11andrea.crottiI don't have completion for things like js/console for example#2017-09-2712:11andrea.crottibut everything else seems to auto complete fine#2017-09-2712:12andrea.crottiis that a known issue?#2017-09-2712:37dominicm@andrea.crotti to my knowledge, js/ is not completed for, no.#2017-09-2712:37dominicmis there an apropos for Java things? Sometimes I see java code out of context of the import, and it would be useful.#2017-09-2807:59Shantanu KumarHi#2017-09-2808:00Shantanu KumarCan somebody explain how M-. works in CIDER? Does it simply try to resolve the symbol in that namespace and looks at the metadata?#2017-09-2809:14jumar@kumarshantanu I don't know the details, but this should give you some idea: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/info.clj#L59#2017-09-2809:31Shantanu Kumar@jumar Thanks#2017-09-2814:36ghadicrosspost https://clojurians.slack.com/archives/C03S1KBA2/p1506609263000566#2017-09-2911:24malabarba@ghadi are you talking about instrumenting cider midddleware in particular? Or just midddleware in general? #2017-09-2911:25malabarbaCider midddleware is tricky, since the debugger itself is a midddleware, instrumenting other parts of cider might not work. #2017-09-2911:26malabarbaGeneral midddleware should work just fine. I used to work with ring and pedestal, and had no problems instrumenting either of them. #2017-09-2920:26lilactownnewbie question: what's the best way to load a new dependency when using CIDER + nREPL?#2017-09-2920:26lilactownso far I've been restarting CIDER + nREPL#2017-09-2920:28dpsuttonyou mean a new dependency in your project.clj or boot file?#2017-09-2920:29lilactownexactly#2017-09-2920:29dpsuttonif so, you're gonna want clojure-refactor https://github.com/clojure-emacs/clj-refactor.el/wiki#2017-09-2920:29dpsuttonhttps://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency#2017-09-3004:24bbssNot sure if it's ciders fault, but I have a weird issue where I can't cider-load-file on my core.clj file. Because some of the other local namespace dependency can't be found on classpath.#2017-09-3004:24bbssBut when I load file in that specific file then it is found.#2017-09-3004:25bbssthe directory that holds the file is the same as the core file.#2017-09-3004:25bbsshttps://github.com/bbss/cljsc2/tree/master/src/cljsc2/clj#2017-09-3004:25bbssis my directory structure wrong?#2017-09-3005:20dpsutton@bbss
Caused by java.lang.RuntimeException
Error parsing grammar specification: Parse error at line 1, column
1: /Users/baruchberger/stah/cljsc2/resources/proto.ebnf ^ Expected
one of: < ε eps EPSILON epsilon Epsilon (* #"[^,
\r\t\n<>(){}\[\]+*?:=|'"#&!;./]+(?x) #Non-terminal"
#2017-09-3005:21dpsuttonyour proto.clj file is not able to load, which is why the core namespace is not able to load its dependencies#2017-09-3005:22dpsuttonor possibly not, its got a link to a file on your file system. my guess would be that this is your problem though:
(def proto-parser
(insta/parser "/Users/baruchberger/stah/cljsc2/resources/proto.ebnf" :auto-whitespace :standard))
#2017-09-3005:24bbssyeah, I didn't run through it running on other machines, it's a work in progress#2017-09-3005:24bbssbut that file is available on my system#2017-09-3005:25dpsuttonyeah its in the repo as well#2017-09-3005:25bbssand the proto.clj file loads when I load that one specifically (no errors and up to the last var is available)#2017-09-3005:25bbssjust when I first try to eval core.clj (which refers to proto in the require) it only works after I first manually load file on the proto.clj#2017-09-3005:26bbssthank you for having a look by the way 🙂#2017-09-3005:29dpsuttoni'm getting the same results ou are . strange#2017-09-3005:31bbssyeah I thought it was pretty strange, I thought maybe it's the source-paths in my lein.#2017-09-3005:31bbssSpecifically my :dev profile didn't include the /clj. But that didn't matter either.#2017-09-3005:31dpsuttonseems to be working in lein rpel#2017-09-3005:32bbssI just ran lein repl (but what do I run to eval core? in-ns?)#2017-09-3005:35dpsuttonah no, it doesn't seem to work there#2017-09-3005:35dpsuttonuse=> (clojure.core/load-file "/home/dan/projects/clojure/cljsc2/src/cljsc2/clj/core.clj")
CompilerException java.io.FileNotFoundException: Could not locate cljsc2/clj/proto__init.class or cljsc2/clj/proto.clj on classpath., compiling:(/home/dan/projects/clojure/cljsc2/src/cljsc2/clj/core.clj:1:1)
use=>
#2017-09-3005:38dpsutton@bbss it doesn't seem to work under lein so there's no chance of CIDER correcting it. may want to head to #clojure to ask#2017-09-3005:38bbssI think I'm using bad namespace names.#2017-09-3005:38bbssOkay, thanks for having a look 🙂#2017-09-3005:38dpsuttonthey don't jump out at me as bad but i'm not saying they are correct#2017-09-3005:38dpsuttoncheers. hope you get it sorted#2017-09-3005:38bbssYeah, I'm sure it will get sorted out eventually 😄#2017-09-3005:39bbssand my project runs, so I'm not really blocked on it, not a big issue 🙂#2017-09-3005:40bbssonce I get to training AI's with Neural Nets on huge cloud GPU set-ups it will need to get fixed though suspect 😎#2017-10-0119:54slipsetHmm, just upgraded cider:#2017-10-0119:54slipset;; Connected to nREPL server -
;; CIDER 0.16.0snapshot (package: 20171001.112), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
#2017-10-0119:55slipsetand get the following when starting up my repl:#2017-10-0119:55slipset2017-10-01 19:51:42,055 [clojure-agent-send-off-pool-4] ERROR clojure.tools.nrepl.server - Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session ff8d1f1f-6d17-4481-8df9-7977861ccf20, :id 6}
clojure.lang.Compiler$CompilerException: java.lang.IllegalAccessError: with-safe-transport does not exist, compiling:(cider/nrepl/middleware/info.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:2088)
at cider.nrepl.middleware.debug$eval7152$loading__5569__auto____7153.invoke(debug.clj:1)
at cider.nrepl.middleware.debug$eval7152.invokeStatic(debug.clj:1)#2017-10-0119:56slipsetKnown issue?#2017-10-0120:02danielszI also notice errors after upgrading Cider.#2017-10-0120:12danielszERROR clojure.tools.nrepl.server - Unhandled REPL handler exception processing message
#2017-10-0120:15danielszThat is when doing cider-connect to an existing nREPL session .#2017-10-0120:51danielszVersion 20171001.112.#2017-10-0120:51danielszWith cider 20170925.208 I saw other errors that I had never seen before.#2017-10-0205:25bigdaddys1othYea emacs is saying it's unable to connect cider#2017-10-0212:48bruno.bonaccisame issue here with-safe-transport does not exist with CIDER 0.16.0snapshot (package: 20171001.112), nREPL 0.2.12#2017-10-0212:57raggesame, temp fix is to revert to [cider/cider-nrepl "0.16.0-20170916.095133-1"]#2017-10-0213:08clojerSame with-safe-transport problem. Reverting back to [cider/cider-nrepl “0.16.0-20170916.095133-1”] worked, thank **d.#2017-10-0213:08twillisso do you just put that in your project.clj dependencies I take it?#2017-10-0213:11clojertwillis: No, you need to revert to an earlier version of of Emacs Cider. I used a backup.#2017-10-0213:12twillisgotcha#2017-10-0213:12clojertwillis: It’s a Cider package issue, not Clojure.#2017-10-0213:49twillisso has anyone reported this as a bug yet? i didnt immediately see it in github anywhere, though i'm still not clear which repo it should be reported in.#2017-10-0214:16twillisI just reported it the best I could here. https://github.com/clojure-emacs/cider/issues/2092#2017-10-0219:58slipsetSeems to be a fix on the way.#2017-10-0220:36slipset(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))#2017-10-0220:37dpsutton(sleep-for 0.1) the imporant bit that is new#2017-10-0220:37slipsetfixes the issue, and is according to https://github.com/clojure-emacs/cider/issues/2092 the thing that's going out as an intermediate fix.#2017-10-0220:37slipset@dpsutton correct#2017-10-0220:57bigdaddys1othStick that (sleep-for 0.1) in cider.el?#2017-10-0221:00bigdaddys1othOr just comment that and (cider-debug-init)?#2017-10-0221:00dpsuttonits in cider--connected-handler#2017-10-0221:01dpsuttonah, either one will work.#2017-10-0221:02dpsuttonif you put it in your init, it might be easier to undo it or keep it around, but you'll need to make sure that it is evaluated after cider rather than before, since last one would win#2017-10-0303:20bigdaddys1othYa know...just going back to a previous version sounds much simpler.#2017-10-0313:05dpsuttonso @boogie666 we need to find cider.el#2017-10-0313:07boogie666if i go to the .clj file and do same i did before i can find the cider--connected--handler function#2017-10-0313:07dpsuttonawesome. that means cider was loaded#2017-10-0313:07boogie666problem is that pressing "enter" does not open it#2017-10-0313:07dpsuttonok. are you in that function definition now?#2017-10-0313:07boogie666no#2017-10-0313:07dpsuttonopen what?#2017-10-0313:07boogie666the function definition#2017-10-0313:07boogie666it just shows up in the window#2017-10-0313:07boogie666wait#2017-10-0313:09boogie666see here#2017-10-0313:09boogie666https://imgur.com/2H9gbdR#2017-10-0313:10dpsuttoncool. visit that function#2017-10-0313:10boogie666pressing "enter" with the function selected does nothing#2017-10-0313:11dpsuttonare you sure you have that function selected? maybe just try to find-function on cider-mode or something similar#2017-10-0313:11dpsuttonwe just want to get into that directory somehow#2017-10-0313:11dpsuttonif emacs helps us get there easier just taken any avenue#2017-10-0313:11boogie666actually it says Symbol’s value as variable is void: helm-bookmark-map#2017-10-0313:11dpsuttonah ok. so something is going wrong with helm#2017-10-0313:11boogie666sry#2017-10-0313:11dpsuttonno biggie#2017-10-0313:11boogie666i'm new here 😛#2017-10-0313:11dpsuttonno problem at all#2017-10-0313:12dpsuttonwell, welcome to emacs, where things usually work nicely and often dont 🙂#2017-10-0313:12boogie666😄#2017-10-0313:12dpsuttoncan you visit ~/.emacs.d/#2017-10-0313:12dpsuttonwe can just root around for the downloaded source#2017-10-0313:12boogie666ok#2017-10-0313:13dpsuttonever used dired before?#2017-10-0313:13boogie666one sec i'll try to find cider#2017-10-0313:13boogie666no#2017-10-0313:13dpsuttonok. do spc spc dired and it'll ask you which directory and let's go to ~/.emacs.d/#2017-10-0313:14dpsuttonnavigate as normal, hit enter to go to directory or file, and hit ^ to go up a directory#2017-10-0313:14dpsuttonwe'll root around until we find the elpa directory#2017-10-0313:14boogie666found elpa#2017-10-0313:14dpsuttonawesome! search for cider, should be a directory like cider-23423423423432 something like that#2017-10-0313:15dpsuttongo to that directory and we want cider.el#2017-10-0313:15boogie666ok, i'm there#2017-10-0313:15dpsuttonawesome. now search for cider--connected-handler#2017-10-0313:15boogie666found it#2017-10-0313:15dpsutton(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))
#2017-10-0313:16dpsuttonso there's a line (when cider-auto-mode ...#2017-10-0313:16dpsuttonwe want to put in a sleep expression right after that#2017-10-0313:16boogie666ok#2017-10-0313:16dpsuttonthe bug has to do with loading classes not being done yet when we try to invoke it#2017-10-0313:16dpsuttonso we're just giving time for the jvm to finish its thing (i think)#2017-10-0313:16dpsuttonso add in that line (sleep-for 0.1) or longer if you want to be extra safe#2017-10-0313:17boogie666ok, let me test it out#2017-10-0313:17dpsuttondid you re-evaluate the defun?#2017-10-0313:17boogie666i restarted emacs 🙂#2017-10-0313:17dpsuttonwe modified the source code but we need to eval it#2017-10-0313:18dpsuttonah well, that should do it#2017-10-0313:18dpsuttonyou're now an elisp programmer 🙂#2017-10-0313:18boogie666yey 🙂#2017-10-0313:18boogie666it worked 🙂#2017-10-0313:18dpsuttonyour editor is super extensible. and you obvoiusly like lisps#2017-10-0313:18boogie666💋 💋 💋#2017-10-0313:18dpsuttonawesome. haha you're super welcome#2017-10-0313:18boogie666thx a lot#2017-10-0313:18dpsuttonno problem#2017-10-0313:19boogie666i've been using atom with proton-mode so far and thought i'd give spacemacs a try for a little bit 🙂 looks like i'm back in business 🙂#2017-10-0313:19dpsuttongood. sorry for the hiccup. but emacs is super great and has really been nice. its so nice that its just an elisp ide that happens to edit text pretty well#2017-10-0313:20boogie666everybody keeps saying that emacs is great OS, it just needs a good text editor 😛#2017-10-0313:21dpsuttonfor sure. and understandably people love vim interaction so spacemacs has got a lot going for it#2017-10-0313:22boogie666anyway, thx a lot#2017-10-0313:22dpsuttonfor sure. happy coding#2017-10-0313:22boogie666cheers 🙂#2017-10-0313:28andrea.crottianyone having this issue?#2017-10-0313:29andrea.crottinREPL server started on port 56754 on host :: - nrepl://:::56754
[2017-10-03 14:27:43,717] ERROR Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session e25f7710-305d-4e6e-a3ca-176d8f861ea4, :id 6} (clojure.tools.nrepl.server)
java.lang.IllegalAccessError: with-safe-transport does not exist, compiling:(cider/nrepl/middleware/info.clj:1:1)#2017-10-0313:29andrea.crottion 0.16.0snapshot?#2017-10-0313:30andrea.crottiah I'm not the only one apparently https://github.com/clojure-emacs/cider/issues/2092#2017-10-0314:03dpsuttonSee the conversation above. It's how to introduce a temporary fix#2017-10-0314:08dpsutton@andrea.crotti #2017-10-0315:08andrea.crottiyes ok that makes it works, thanks @dpsutton#2017-10-0315:08andrea.crottiI'll keep that around until there is another fix of some sort#2017-10-0315:08dpsuttonawesome. if you are feeling more investigative, there's a patch to nrepl you can try and report if that fixes#2017-10-0315:09dpsuttonyou need to clone a fork of cider-nrepl and lein install it. takes substantially more work so not necessary if you're trying to get other things done#2017-10-0315:09andrea.crottiah yes ok I'll see it if fixes it, however it's not an OSS project what I'm working on now so would be maybe better to reproduce it on something I can show#2017-10-0315:09dpsuttonunderstood. i'm in the same boat here#2017-10-0315:09andrea.crottiit depends on the dependencies from my understanding#2017-10-0315:21andrea.crottimm odd now I tried to debug a function and I get
1. Unhandled java.lang.Exception
Debugger not initialized!
#2017-10-0315:21andrea.crottidon't think it's related but I've never seen that before, anyone knows what it could be the problem?#2017-10-0315:22dpsuttondid you happen to clobber anything when editing that function?#2017-10-0315:22dpsutton(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))
#2017-10-0315:23dpsuttonnote the line right after is (cider--debug-init-connection)#2017-10-0315:46twillisFwiw installing a new version of cider-nrepl per the instructions in the issue I reported fixes things so I no longer have an issue#2017-10-0316:35andrea.crottimm well I didn't edit anything I just redefined it @dpsutton#2017-10-0316:38dpsuttonif you didn't edit it, then you changed nothing. i'm not sure i follow. did you just paste the above or did you add the one line that fixes the problem: (sleep-for 0.1)?#2017-10-0316:51andrea.crotti@dpsutton I just copied that function in ielm#2017-10-0316:51andrea.crottiwhich evaluates it re-defining the original one#2017-10-0316:52andrea.crottiI prefer to do that than changing a file not under revision control#2017-10-0316:52dpsuttonunderstandable for sure#2017-10-0316:53dpsuttonthen i'm out of ideas. assuming the above is correct. maybe past that into the elisp repl or whatever you are using and make sure all of the names are spelled correctly?#2017-10-0319:04preIs there a reason why cider-format-buffer won't work on large edn files?#2017-10-0319:05dpsuttonwhat error are you seeing?#2017-10-0319:05preno error, it just doesn't format.#2017-10-0319:10dpsuttonah, strange#2017-10-0319:11preit's a file with a list of maps generated by pr-str.#2017-10-0319:11dpsuttonthere's a way to change the pretty printer. perhaps the one you have isn't good with your data. if its long strings or heavily nested maps perhaps?#2017-10-0319:12preI've been trying many "ways" for three years in cider, and still can't get a reliable formatting for edn files.#2017-10-0319:13dpsuttonhave you tried clj-format? https://github.com/weavejester/cljfmt#2017-10-0319:13dpsuttonand apologies if i'm telling you something you've tried a long time ago#2017-10-0319:14preyes I have, cider includes it and I have my tab keybinding set to it.#2017-10-0319:14dpsuttoni'm trying to remember how to see the nrepl traffic. i think the toggle function has been renamed#2017-10-0319:14dpsuttoni wonder if its abandoning with some kind of message?#2017-10-0319:15prewhere can i see the logs?#2017-10-0319:15dpsuttonM-x nrepl-toggle-message-logging maybe see what the call to format the edn is returning#2017-10-0319:15dpsuttonhttp://hackingcider.com/posts-output/2017-04-30-eval-walkthrough/#2017-10-0319:15dpsuttonthat talks about how you can see what cider and nrepl are saying to each other#2017-10-0319:16dpsuttonmaybe there's some response coming back with more information than cider is displaying?#2017-10-0319:17preI get a response as "done" (<--
id "95"
session "917da08e-ebb3-4e5e-8492-16bcaf6716e5"
time-stamp "2017-10-03 12:16:41.289718364"
formatted-code "({:uri "chef_module", :name "chefnode1", :kind :chef_node, :..."
status ("done")
)
#2017-10-0319:17dpsuttonand the formatted-code will contain the payload#2017-10-0319:17dpsuttonhmm#2017-10-0319:20preyou can try this in your own cider: Create a map with three keys, repeat 500, and spit it using pr-str. Now, try to format it.#2017-10-0319:27dpsuttonsorry i'll try this in about ten minutes#2017-10-0319:28dpsuttonand is this lacking newlines between the structures? my worry is that this is long lines and guessing new lines running up against 20,000 characters in a row#2017-10-0319:29preevery single editor does that for json, I don't see a reason not to provide a default in cider.#2017-10-0319:30dpsuttonoh for sure. it should but i don't know if it does#2017-10-0319:30prethat's what I'm trying to figure out, if it's an easy el script ... could copy that in my emacs ...#2017-10-0319:30dpsuttoni think emacs might use pprint by brandon bloom by default. this is not simple code.#2017-10-0319:31dpsuttonsorry i mean fipp#2017-10-0319:31dpsuttonbut i'm sure contributions are welcome#2017-10-0319:32preIf your day job involves parsing large edn files (who doesn't do that :)) I'm positive that formatting and paredit navigation to edn structures is a massive help.#2017-10-0319:33dpsuttonundoubtedly. just need one of those busy people to code something up 🙂#2017-10-0319:34preSeems like cider has been busy for years fixing other bugs 🙂#2017-10-0319:34preI'd like to help if you can point me to the right direction ....#2017-10-0319:37dpsuttonlooks like here#2017-10-0319:37dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj#L33#2017-10-0319:37dpsuttonwrote this about getting started with cider-nrepl#2017-10-0319:37dpsuttonhttp://hackingcider.com/posts-output/2017-04-27-basic-setup-cider-nrepl/#2017-10-0319:38dpsuttonif this is your first time getting up and going, keep notes and would love tutorials, code walkthroughs, newbie instructions, overviews, whatever, you want to submit as a PR to hacking-cider. it's just a collection of markdown files to get people going#2017-10-0319:43preHow do I customize wrap-pprint-fn middleware?#2017-10-0319:45dpsuttoni'm not sure what you mean#2017-10-0319:46dpsuttoni think you choose your pretty printer in cider
(defun cider--pprint-fn ()
"Return the value to send in the pprint-fn slot of messages."
(pcase cider-pprint-fn
(`pprint "clojure.pprint/pprint")
(`fipp "cider.nrepl.middleware.pprint/fipp-pprint")
(`puget "cider.nrepl.middleware.pprint/puget-pprint")
(_ cider-pprint-fn)))
#2017-10-0319:47dpsuttonnot sure if that's what you're asking about however#2017-10-0319:47dpsuttonand you can see the middleware here reads the pprint-fn var set in the message:
defn pprint-reply
[{:keys [pprint-fn session transport] :as msg} response]
(with-open [writer (pprint-writer msg)]
;; Binding `*msg*` sets the `:id` slot when printing to an nREPL session
;; PrintWriter (as created by `pprint-writer`), which the client requires to
;; handle the response correctly.
(binding [*msg* msg
*out* writer]
(let [value (cljs/response-value msg response)
print-fn (if (string? value) println pprint-fn)]
(print-fn value))))
(transport/send transport (response-for msg :pprint-sentinel {})))
#2017-10-0319:48dpsutton{:keys [pprint-fn]is how elisp and clj are connected#2017-10-0319:51dpsutton@pri did that answer your question? i didn't meant to spend a lot of time on irrelevant or things you already knew#2017-10-0319:53preThanks @dpsutton What do I need to add in my config?#2017-10-0319:54preI have added fipp and ultra in ~/.lein/profiles.clj the past (no luck)#2017-10-0319:54dpsuttonto change the var used (and i'm not totally sure this is actually used in formatting end) set the var cider-pprint-fn. in your init you can (setq cider-pprint-fn 'fipp) or use the customize menu#2017-10-0319:57preThat didn't work.#2017-10-0319:58preThe more important question--as I've run through this issue for three years, is: why is cider reluctant to provide a sensible default?#2017-10-0319:59dpsuttondefault for what?#2017-10-0320:00preformatting and navigating edn files.#2017-10-0320:00dpsuttoni think it has built in to format edn? and it defaults to the clojure pretty printer.#2017-10-0320:00dpsuttonmaybe this is a bug for them? i dont' know#2017-10-0320:00dpsuttonbut as defaults go that's pretty sensible#2017-10-0320:00dpsuttonhonestly i bet this is one area where cursive really shines#2017-10-0320:01prea default that doesn't do anything is useless, IMHO#2017-10-0320:01dpsuttonbig data structures. emacs just isn't very good with long lines#2017-10-0320:01dpsuttoni'm pretty sure we're in a "default doesn't do anything in this situation" type of situation#2017-10-0320:01dpsuttonbut i take your point#2017-10-0320:02preThanks for your time. For now, it's Intellij for edn files ...#2017-10-0320:03dpsuttonyeah. i'll bet it will excel at it. lodge an issue? i may not know enough to help you out and someone else can get you closer to your goal?#2017-10-0321:58bschragCan CIDER be configured to warn in case of a lein error? With a certain bug in my source code, lein repl tells me #error {:cause Unable to resolve symbol: Foo in this context ... }, then starts a REPL anyway with my project's namespace prompt. cider-jack-in just gives me the prompt, leaving it to me to discover that something is busted, then try to figure out what. Is there a better workflow than first running lein repl to make sure your project is qualified for cider-jack-in? Running Emacs 25.2.2, just installed CIDER today from Melpa-stable.#2017-10-0410:06chrisblomi'm using the cider debugger to debug a large function, but i'm only interested in a few parts, is there a way to mark expressions so that the debugger always skips there?#2017-10-0410:07chrisblomSomething like this: (let [not-interesting ^:no-dbg (skip-this ...) interesting (will-break ...)] ....)
#2017-10-0413:45jmayaalv@chrisblom you can alway use h to jump to force the debugger to stop on the cursor point.#2017-10-0414:28chrisblomyeah, but its still a bit too manual#2017-10-0414:29chrisblomanyway, i'm now annotating just the parts i want with #dbg instead of marking the whole function, and what does the trick for new#2017-10-0415:47catamorphismsHi channel. Can anyone tell me if it is possible to get better test diffs in emacs cider?#2017-10-0512:21andrea.crottiis there a problem with cider-javadoc or is it just me?#2017-10-0512:21andrea.crottilooking up something related to Kafka for example the url it tries to fetch is https://kafka.apache.org/090/javadoc/index.html?org/apache/kafka/streams/kstream/Predicate.html#2017-10-0512:22andrea.crottithe actual correct url would be something like https://kafka.apache.org/0101/javadoc/org/apache/kafka/streams/kstream/Predicate.html instead#2017-10-0513:08andrea.crottiit seems to work well for other things like http://docs.oracle.com/javase/8/docs/api/java/io/FileFilter.html#2017-10-0517:43boogie666hello all, does anybody know what this is?? https://imgur.com/a/qUjME (the "opts!!! nil" in the cider repl)#2017-10-0517:43boogie666it happes twice for anything i eval in the repl#2017-10-0608:11zetafishHi there, is there a way to “unload” a jar in the REPL?#2017-10-0615:11andrea.crottiis there a way to jump to a variable that was defined in a let block?#2017-10-0615:11andrea.crottiat the moment it doesn't resolve names that are defined in a let block in the same function#2017-10-0615:15bjaI use vim^H^H^Hevil, but I usually just use * and then n#2017-10-0718:49scaturrDoes the spec browser not support cljs?#2017-10-0718:49scaturrJust wondering if im looking in the wrong spot 🙂#2017-10-0912:05achikinHi! I'm using cider with re-frame and figwheel, so I have a lot of definitions like (reg-sub :my-event ...) is there any way to navigate to that keywords using cider?#2017-10-0912:08jumar@achikin how about "smart search" via SPC * or SPC / ?#2017-10-0912:08achikinYes, that works great, but I'd prefer "go to definition"#2017-10-0915:02bigdaddys1othSo with cider there's a function you can add to you config file named cider-annotate-completion-function and it says that the 2 arguments it takes are the abbreviations from cider-completion-annotations-alist (I configured that already) and the namespace that candidate is from. So do I put (cider-annotate-completion-function "c" "clojure.core") etc etc?#2017-10-1004:50bozhidar@andrea.crotti No. Jump to definition uses some location metadata that’s available just for vars. In theory doing this won’t be very hard - we can just try the regular resolution, fail and see if we’re in a let and try going higher and higher in nest lets.#2017-10-1004:52bozhidar> Hi! I’m using cider with re-frame and figwheel, so I have a lot of definitions like (reg-sub :my-event ...) is there any way to navigate to that keywords using cider?#2017-10-1004:52bozhidar@achikin CIDER still doesn’t have “find references” functionality built-in, but clj-refactor.el has it.#2017-10-1004:53bozhidar> So with cider there’s a function you can add to you config file named cider-annotate-completion-function and it says that the 2 arguments it takes are the abbreviations from cider-completion-annotations-alist (I configured that already) and the namespace that candidate is from. So do I put (cider-annotate-completion-function "c" "clojure.core") etc etc?#2017-10-1004:53bozhidarThe abbreviations indicate the type of something - function, macro, etc.#2017-10-1004:58bozhidarBasically for each item on the completion list this the function receives the type of the thingy and it’s namespace. The default behaviour in just to concatenate those, but you can define a new function that does something fancier. But you’ll also have to change the logic for figuring out the type of candidates.#2017-10-1005:00bozhidarThe types come straight from the middleware though.
(defun cider-completion--parse-candidate-map (candidate-map)
"Get \"candidate\" from CANDIDATE-MAP.
Put type and ns properties on the candidate"
(let ((candidate (nrepl-dict-get candidate-map "candidate"))
(type (nrepl-dict-get candidate-map "type"))
(ns (nrepl-dict-get candidate-map "ns")))
(put-text-property 0 1 'type type candidate)
(put-text-property 0 1 'ns ns candidate)
candidate))
so this is not a change you can easily do locally.#2017-10-1005:00bozhidarWhat you can do locally is to add some if in the annotation function to handle clojure.core differently.#2017-10-1005:00bozhidarP.S. We already use c for classes.#2017-10-1012:13andrea.crottiah nice @bozhidar should I open a ticket to keep track of that?#2017-10-1012:13andrea.crottiI can also try to do it myself possibly#2017-10-1012:39bozhidar@andrea.crotti That’s fine by me - especially if you try to tackle it yourself. 🙂#2017-10-1207:37qle-guenhello, is there a way to access the result of the last command?#2017-10-1207:49jmayaalv@qle-guen there is M-x cider-inspect-last-result#2017-10-1207:58qle-guen@jmayaalv ah, yes, it helps, but what I'd like is to the result of the last sexp in cider to be stored#2017-10-1207:59qle-guenlike, I think there's something like this in ghci#2017-10-1207:59qle-guenso like I sometimes have a big IO operation and I'd like to manipulate the result of it without having to execute it again#2017-10-1211:37jumar@qle-guen you can use *1 (also *2 and *3) for that purpose - this is a standard clojure repl functionality#2017-10-1212:29qle-guen@jumar yes excellent, that is what I was looking for, thanks#2017-10-1307:32achikinHi, I'm looking at the inf-clojure and I have several questions about it. I've managed to set it up with my spacemacs config, but looking at the source code I can tell that it uses clojure-complete to provide completions from the repl. It seems to me that none of my projects have clojure-complete in their dependencies. Am I right that completions doesn't work for me with inf-clojure? I'm still getting some completions from somewhere so it's hard to tell if it works or not.#2017-10-1316:07richiardiandrea@achikin inf-clojure targets the environment you are running in, so it should automatically get completions for Clojure REPL, Plank, Lumo#2017-10-1316:08richiardiandreaIf you don't see them there must be some detection problem and it is very likely the REPL is not yet supported#2017-10-1316:08richiardiandreaWhat are you running against?#2017-10-1316:09achikin@richiardiandrea I understand that. But in case of the "default" environment it tries to call complete.core/completions here https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L794#2017-10-1316:09richiardiandreaYep that's right#2017-10-1316:10achikinAnd when I'm trying to do that same call using that same running repl - it gives me an error#2017-10-1316:10achikinI'm running standard nrepl#2017-10-1316:10achikinagainst a clojure app#2017-10-1316:10richiardiandreaSo I would check if the namespace is on the classpath#2017-10-1316:11achikinNo, it's not.#2017-10-1316:12richiardiandreaOk ok so it's a documentation issue, I thought it was written somewhere that you need that (Dev) dependency for Clojure#2017-10-1316:12achikinAnd the project clojure-complete seems abandoned https://github.com/ninjudd/clojure-complete#2017-10-1316:14richiardiandreaI would personally use https://github.com/alexander-yakushev/compliment#2017-10-1316:15achikinAs far as I can see from Cider - it uses nrepl internal completion, right?#2017-10-1316:15dpsuttoncider uses compliment#2017-10-1316:15richiardiandreaMaybe we can change that btw, cider can import things btw as transitive deps#2017-10-1316:15richiardiandreaOh yes true#2017-10-1316:16richiardiandreaSo I would raise an issue asking to someone (maybe it will be me) to switch things to compliment#2017-10-1316:16dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/complete.clj#L12#2017-10-1316:17richiardiandreaIn the meantime you can add the dependency and override inf-clojure-completions IIRC, in order to use implement instead#2017-10-1316:17richiardiandreaIt can get more sophisticated than that because compliment accepts a context and can complete locals..but one step at the time :))#2017-10-1316:26achikin@richiardiandrea @dpsutton thank you very much for clarifying the situation and pointing me to the appropriate places in the source code.#2017-10-1316:29dpsuttonfor sure. if you need a little intro on how to start messing with cider, checkout http://hackingcider.com. and if you put together some thoughts, add a PR and make an article to the site#2017-10-1316:31achikin@dpsutton I have severe freezes using cider+figwheel, that's why I'm looking at the inf-clojure.#2017-10-1318:32wpcarroHey all. I’m looking to write a function that runs (require 'some-ns) for the current buffer, which is similar to cider-repl-set-ns, but should hopefully fetch the dependencies, etc… before I write this, I wanted to be sure that it doesn’t already exist and I’m missing it somehow#2017-10-1318:33wpcarroAdditionally — and not related — is I’m also looking for a CIDER variable that I can configure to always require the REPL-utils. Does this exist?#2017-10-1318:41wpcarroI’m trying to avoid symbol lookup failures for things like (doc ...), (source ...), etc,#2017-10-1401:08gonewest818@wpcarro is what you want equivalent to C-c C-k followed by C-x M-n?#2017-10-1409:11qqqhow do I get cider to indent "forv" the sameway it indents "for" ?#2017-10-1412:08jumar@qqq maybe via :style/indent metadata? https://cider.readthedocs.io/en/latest/indent_spec/#2017-10-1412:39qqqI'm not familiar with that yet. I ended up using:
(define-clojure-indent
(match 1)
(tdefm 3)
(forv 1))
#2017-10-1418:01gonewest818@wpcarro something like this? (defun cider-load-buffer-and-set-ns (&optional buffer)
"Load buffer's file and set ns in nREPL"
(interactive)
(let ((buf (or buffer (current-buffer)))
(ns (cider-current-ns)))
(cider-load-buffer buf)
(cider-repl-set-ns ns)))
#2017-10-1418:12gonewest818while we’re at it, can also use clojure.repl: (defun cider-load-buffer-and-set-ns (&optional buffer)
"Load buffer's file and set ns in nREPL"
(interactive)
(let ((buf (or buffer (current-buffer)))
(ns (cider-current-ns)))
(cider-load-buffer buf)
(cider-repl-set-ns ns)
(cider-nrepl-sync-request:eval "(use 'clojure.repl)")))
#2017-10-1418:25madstap@qqq
(defmacro forv
"Like for, but returns a vector. Not lazy."
{:style/indent 1}
[seq-exprs body-expr]
`(vec (for ~seq-exprs ~body-expr)))
#2017-10-1418:40wpcarro@gonewest818 C-x M-n is undefined for me… which fn is it supposed to run?#2017-10-1418:40wpcarroRE: C-c C-k followed by C-x M-n#2017-10-1418:41gonewest818Should be cider-repl-set-ns ... #2017-10-1418:43wpcarro@gonewest818 correct me if I’m mistaken, but -set-ns doesn’t (require ...) the ns, right?#2017-10-1418:44wpcarroI’m looking to have access to the deps being required by the buffer’s namespace#2017-10-1418:45gonewest818Yes, but loading the buffer and changing ns should do what you want .. if I’m understanding you properly #2017-10-1418:46wpcarro@gonewest818 I’m new to Clojure, but if my buffer requires deps like ... :as reagent, the REPL should be able to resolve a symbol like reagent, yea?#2017-10-1419:37gonewest818yes, but only if the (ns ...) or (require ...) or (use ...) form is evaluated in the repl. Opening a file in emacs doesn’t automatically load it into the repl. Instead you have to ask for it explicitly, using C-c C-k (which runs the elisp function cider-load-buffer) to load the current buffer. And C-c M-n (which runs cider-repl-set-ns) switches the repl to the namespace of the current buffer.#2017-10-1419:37gonewest818(I just realized I typoed C-x M-n before …. my bad. It’s C-c M-n)#2017-10-1421:40gonewest818So in other words, the emacs workflow would be: C-c C-k to load the buffer, C-c M-n to set the namespace in the repl, C-c C-z to switch focus to the repl. At that point the repl should resolve reagent.#2017-10-1521:05wpcarrothank you @gonewest818 seems to working at the moment!#2017-10-1609:06qqqin boot, I just updated from cider-nrepl 0.15 to 0.15.1 -- how do I updte cider on eamcs side ?#2017-10-1613:06dpsuttonusing the package manager. M-x list-packages. However cider-nrepl has been managed directly by CIDER for quite some time. CIDER will bring in the correct version so there are no mismatches. And the version of CIDER and cider-nrepl are by convention the same#2017-10-1718:32ccanndid cider jack in get a very recent speed boost?#2017-10-1718:34dpsuttoni believe so. there was some work done on lazy loading dependencies which should give a user facing speed up#2017-10-1817:58kingcodedoes anyone know how to navigate by form units? E.g. how do I “jump three forms ahead of the current one”?#2017-10-1817:58kingcodeLikewise, how do I “delete the last three forms”, etc…? thx#2017-10-1818:40jeremyI'm now seeing {#} in the pretty printed output in the *cider-test-report* buffer when it the depth of the map is too deep. any ideas where this is coming from or how to override it?#2017-10-1907:52kardanAnyone know why “M-.” & “M-,” does not work automagically (without manually evaluation of namespaces) when connecting to a app running within docker (with docker-compose)? I can get it working if I evaluate the namespace I want to “jump to”, but then if I reset (using Duct) I need to evaluate again. Does this ring a bell for anyone?#2017-10-1911:22benedek@kingcode paredit forward with prefix perhaps?#2017-10-1911:23benedekyep works#2017-10-1911:30benedekso basically explore paredit with prefixes#2017-10-1912:07kingcodeThank you @benedek - I will look into it..#2017-10-1914:47benedek@kardan I think the nses you want to be able to jump from etc need to be loaded#2017-10-1914:48benedekif you use one flavor of the reloaded repl they usually are#2017-10-1914:52kardan@benedek we’re using Duct but for some reason when we migrated to an docker-compose setup things stopped working properly.#2017-10-1915:52benedeknever used duct @kardan #2017-10-1915:52benedekwhat is your workflow in terms of cider/repl?#2017-10-1915:53kardancider-connect to an exposed repl#2017-10-1915:54benedekthere is some kind of reloaded repl in duct, right? does it start working if you reset?#2017-10-1915:55benedekthat should tnr/refresh eg load all the nses in your repl#2017-10-1915:55kardanSo docker-compose exposes at https://github.com/akvo/akvo-lumen/blob/develop/docker-compose.yml#L23#2017-10-1915:56kardanThen we run nrepl server at https://github.com/akvo/akvo-lumen/blob/develop/backend/project.clj#L78#2017-10-1915:57kardanRunning Cider v 0.15.1-snapshot at the moment (but think I have tried with an older version to)#2017-10-1915:58kardanTo answer your earlier question Duct uses reloaded.repl & we call reset from https://github.com/akvo/akvo-lumen/blob/develop/backend/dev/src/dev.clj#L16#2017-10-1915:59kardanSorry to spam 😳#2017-10-1916:31dominicm@kardan I know why, it's because the paths are set to those inside the docker container#2017-10-1916:31dominicmWhen you re-eval, you send a new filepath for the namespace, which means you can jump to it.#2017-10-1916:32dominicmI think there might a way to handle this in emacs around re-writing paths, but that's beyond my knowledge, @benedek?#2017-10-1916:33dominicmYou can confirm this by looking at the (meta #'symbol) before and after re-eval'ing the namespace#2017-10-1916:35kardan@dominicm interesting#2017-10-1916:41benedekrings a bell dominicm#2017-10-1916:41benedekwe had a similar issue in cljr#2017-10-1916:42benedeknot solved afaik#2017-10-1916:43gonewest818Given this function, defined in cider-interaction.el
(defun cider-eval-defun-to-comment (loc)
"Evaluate the \"top-level\" form and insert result as comment at LOC.
With a prefix arg, LOC, insert before the form, otherwise afterwards."
(interactive "P")
(let* ((bounds (cider-defun-at-point 'bounds))
(insertion-point (nth (if loc 0 1) bounds)))
(cider-interactive-eval nil
(cider-eval-print-with-comment-handler
(current-buffer) insertion-point ";; => ")
bounds)))
#2017-10-1916:43gonewest818I can trivially make a variant that evals the last sexp, like so:
(defun cider-eval-last-sexp-to-comment (loc)
"Evaluate the \"top-level\" form and insert result as comment at LOC.
With a prefix arg, LOC, insert before the form, otherwise afterwards."
(interactive "P")
(let* ((bounds (cider-last-sexp 'bounds))
(insertion-point (nth (if loc 0 1) bounds)))
(cider-interactive-eval nil
(cider-eval-print-with-comment-handler
(current-buffer) insertion-point ";; => ")
bounds)))
#2017-10-1916:44gonewest818where the only change is the let binding for “bounds”.#2017-10-1916:44gonewest818So then, why can’t I also pprint the output like this? If I try this function the output is lost in the void somewhere.
(defun cider-pprint-eval-last-sexp-to-comment (loc)
"Evaluate the \"top-level\" form and insert result as comment at LOC.
With a prefix arg, LOC, insert before the form, otherwise afterwards."
(interactive "P")
(let* ((bounds (cider-last-sexp 'bounds))
(insertion-point (nth (if loc 0 1) bounds)))
(cider-interactive-eval nil
(cider-eval-print-with-comment-handler
(current-buffer) insertion-point ";; => ")
bounds
(cider--nrepl-pprint-request-plist (cider--pretty-print-width)))))
#2017-10-2007:16gonewest818I think this is because pprint typically directs to *out* unless explicitly told otherwise. So the solution is going to involve setting a handler that takes care of that.#2017-10-1917:01kardanWill have to look into my issue more but thanks @dominicm & @benedek . You given me a direction to look at#2017-10-2021:42normanWhen using cider-jack-in, it injects tools.nrepl 0.2.12, but I notice that the cider-nrepl project itself hass tools.nrepl 0.2.13 as a dependency#2017-10-2021:43norman(RE: 0.16-SNAPSHOT)#2017-10-2021:43normanI’m wondering if that’s intentional#2017-10-2021:50normanThe motivation of this question is because I include cider and nrepl dependency in my project so that we can build a non-lein runnable server with nrepl capabilities. I’m not sure whether I should force 0.2.12 like cider-jack-in does or use the 0.2.13 that cider-nrepl requests.#2017-10-2416:02borkdudeDoes cider allow sorting namespaces or do I specifically need clj-refactor for this?#2017-10-2416:14tanzoniteblack@borkdude clojure-mode has a function clojure-sort-ns that will sort each sexp inside the ns declaration#2017-10-2416:20borkdudeawesome#2017-10-2421:35teeshey folks I'm running into this error with figwheel + cider. I've run into when using re-frame and just using the lein new figwheel template.
Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to
load piggieback. This is commonly caused by A) not providing piggieback as a
dependency and/or B) not adding piggieback middleware into your nrepl
middleware chain.
example profile.clj code: ----- :profiles {:dev {:dependencies
[[com.cemerick/piggieback <current-version>] [org.clojure/tools.nrepl
<current-version>]] :repl-options {:nrepl-middleware
[cemerick.piggieback/wrap-cljs-repl]}}} ----- Please see the documentation
for piggieback here
I found this thread: https://clojurians-log.clojureverse.org/cider/2017-05-23.html
that went over why it might be happening (the browser caching an old version of figwheel it seems?) and I have not been able to find a fix despite that. Any input ?
pastebin of my project.clj https://pastebin.com/XQ6Qp4tx#2017-10-2421:36teesAlso, using spacemacs. Any help is appreciated!#2017-10-2421:48teeshmm. running lein figwheel instead of cider led to this : https://imgur.com/a/4lVDF#2017-10-2421:49teestried all the above but have not had any luck yet..#2017-10-2517:49mitchelkuijpers@tees had that before make sure when you start you have no tab open with an old figwheel en doe full reload without cache. Then it should be fixed#2017-10-2517:50mitchelkuijpersMake sure you have no tab anywhere that tries to connect#2017-10-2519:48normanERROR nrepl.server - Unhandled REPL handler exception processing message {:op describe, :session e2fa2fab-cb8b-4e0e-87af-a275c8fe762e, :id 3}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2208)
at clojure.core$deref.invokeStatic(core.clj:2228)
at clojure.core$deref.invoke(core.clj:2214)
at cider.nrepl$wrap_pprint_fn$fn__108074.invoke(nrepl.clj:85)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__29336.invoke(middleware.clj:22)
at cider.nrepl$wrap_tracker$fn__108194.invoke(nrepl.clj:410)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__29336.invoke(middleware.clj:22)
at clojure.tools.nrepl.middleware.session$session$fn__29653.invoke(session.clj:192)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__29336.invoke(middleware.clj:22)
at cider.nrepl$wrap_version$fn__108206.invoke(nrepl.clj:429)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__29336.invoke(middleware.clj:22)
at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16)
at clojure.tools.nrepl.server$handle$fn__29710.invoke(server.clj:28)
at clojure.core$binding_conveyor_fn$fn__4676.invoke(core.clj:1938)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)#2017-10-2519:49normanIf that looks familiar to anyone, ping me. It’s a remote nrepl not launched from lein. Started happening with a recent cider - the last week or two#2017-10-2519:49normanDebugging now, but if someone has seen this, it’ll save me hours#2017-10-2519:50dpsuttoni haven't seen it, but i know that the last changes to cider-nrepl were lazy loading dependencies. so i would use that as my initial thread#2017-10-2520:06normanDefinitely one of those recent changes. Reverting to a september snapshot fixes it.#2017-10-2520:17dpsuttonif you create an issue, vspinu has been really really helpful and prompt with helping. he/she has a newborn but might be able to point you in the right direction if unable to fix it#2017-10-2520:19normanYeah - I should do that before I spend too much more time on it#2017-10-2520:20normanhttps://github.com/clojure-emacs/cider-nrepl/issues/447 well - apparently I’m not the only one#2017-10-2520:21dpsuttonwell dang. maybe put a "me too" but also point out you arehitting this without running from an uberjar?#2017-10-2520:21dpsuttonor whatever non-standard way that person was getting it?#2017-10-2520:39normanNot using ubjerjar, but effectively we’re doing the same thing as that issue.#2017-10-2607:56NiclasIs there a way to browse one’s own project’s ClojureScript specs? I tried cider-browse-spec/`cider-browse-spec-all` but I’m only able to see the core ones and not project specific?#2017-10-2607:59NiclasCould it be that it’s only supported for Clojure and not ClojureScript?#2017-10-2608:32NiclasSeparate question, is there a way to get the output from cider-doc to be displayed in a pos-tip tooltip instead of a separate buffer?#2017-10-2609:35NiclasTook the time to create my own fn for the tooltip docs, enjoy 😄 :
(defun my-cider-describe-function ()
"Display the full cider documentation of the function at point in tooltip."
(interactive)
(let ((err-msg "** Could not find function **")
(function (cider-symbol-at-point)))
(if (null function)
(pos-tip-show err-msg '("red"))
(let ((info (cider-var-info function)))
(if (null info)
(pos-tip-show err-msg '("red"))
(pos-tip-show
(with-temp-buffer
(cider-docview-render (current-buffer) function info)
(buffer-string))
nil nil nil 0))))))
#2017-10-2717:08h.elmougyWARNING: CIDER's version (0.8.1) does not match nider-nrepl's version (0.15.1)#2017-10-2717:08h.elmougyhow to update cider#2017-10-2717:10dpsuttondo you have a lein-profiles.clj file by any chance?#2017-10-2717:10dpsuttonthat CIDER version is from 2014. not sure why you have a reference to 0.8.1 anywhere#2017-10-2717:10dpsuttonthis problem normally comes up when people are using the brave clojure setup but i think its normally 0.8.2#2017-10-2717:11dpsuttonalthough this seems like the backwards version. Do you know how to use the package manager in emacs, @h.elmougy#2017-10-2717:12dpsuttonM-x list-packages search for CIDER, hit u for upgrade when point is on the same line, and then x for execute#2017-10-2717:31h.elmougyI got an error after installing cider. I fed up of this. do you know any guide to install a fresh version of cider ?#2017-10-2717:31h.elmougyOther than the guide found in cider's guide#2017-10-2717:43dpsuttonCan you describe what steps you followed?#2017-10-2717:45dpsuttonBecause if you installed it with the emacs package manager it should largely "just work"#2017-10-2717:48h.elmougyI already did but paredit and clojure-mode didn't work#2017-10-2717:49h.elmougyI can't install paredit#2017-10-2717:49h.elmougyand also the theme#2017-10-2717:52dpsuttonWhat does a theme have to do with cider. I'm not sure what you're attempting to do#2017-10-2718:17dpsutton@h.elmougy i'm back from lunch. can you describe what you're doing? it seems like you are doing more than just installing CIDER. are you working on getting a full emacs install up and running?#2017-10-2718:18dpsuttoni can help out a little bit if you want some help#2017-10-2719:37h.elmougy@dpsutton already installed CIDER by I want to paredit and the theme installed from brave and true guide but i can't get it to work#2017-10-2719:38dpsuttonah so you are following the brave and true guide#2017-10-2719:38dpsuttondid brave and true tell you to put a profiles.clj file?#2017-10-2719:39dpsuttonbut honestly, the brave and true guide should not be followed for setting up cider. they give you a repo to clone that has compiled emacs lisp byte code and pegs you to a three year old version of CIDER. I think there are changes in the bytecode interpreter and things get really wonky with the checked-in .elc files.#2017-10-2719:39dpsuttonhttps://github.com/bbatsov/prelude#2017-10-2719:40dpsuttongive that setup a go. i think you'll find things work just fine. if you like vim keybindings spacemacs is for sure the way to go#2017-10-2719:40dpsuttonunless i'm misreading what youve said#2017-10-2719:40h.elmougyyes and i don't want to follow the guide I want to install all the components myself to upgrade them and understand what every component is actually doing#2017-10-2719:40dpsuttonok. so you didn't clone the brave repo?#2017-10-2719:40h.elmougyNo I did not#2017-10-2719:40dpsuttonok i'm with you now#2017-10-2719:41h.elmougyI installed cider now#2017-10-2719:41h.elmougyI need syntax highlight plugin and paredit#2017-10-2719:41dpsuttonso what is paredit saying when you try to install that?#2017-10-2719:42h.elmougylet me copy this#2017-10-2719:43h.elmougyI am using this#2017-10-2719:43h.elmougyhttps://gist.github.com/mowat27/8187351#2017-10-2719:44dpsuttonok#2017-10-2719:44dpsuttonso is it working?#2017-10-2719:45h.elmougyno it is not#2017-10-2719:46dpsuttonok. and what is the symptom that it is not working#2017-10-2719:46h.elmougywhat should i do to install paredit#2017-10-2719:46dpsuttonwhat makes you think it is not isntalled#2017-10-2719:46dpsuttonwhat is an indication of error#2017-10-2719:47dpsuttonbut in general, you should be able to M-x install-package [ret] <package-name>#2017-10-2719:49h.elmougylet me install paredit-mode from install-package command to see#2017-10-2719:49h.elmougyI got no match#2017-10-2719:50dpsuttonare you looking for paredit or paredit-mode#2017-10-2719:50dpsuttonalso, try M-x list-packages to ensure that you have a fresh copy of all of the packages available#2017-10-2719:50h.elmougy(add-to-list 'package-archives
'("melpa-stable" . "http://melpa-stable.milkbox.net/packages/"))
(add-to-list 'package-archives
'("marmalade" . "https://marmalade-repo.org/packages/"))#2017-10-2719:50h.elmougydo I need any extra package repositories ?#2017-10-2719:51dpsuttonno#2017-10-2719:51dpsutton#2017-10-2719:51dpsuttonand do it from the graphical interface with M-x list-packages#2017-10-2719:51h.elmougyyes I am doing this#2017-10-2719:52dpsutton(add-to-list 'package-archives
'("melpa" . "") t)
#2017-10-2719:53dpsuttonbut the melpa stable should be fine for you as well#2017-10-2719:53h.elmougyI got emacs freezed#2017-10-2719:54dpsuttoni think marmalade has fallen out of use. try without that#2017-10-2719:54dpsuttonremove this line from your init:
(add-to-list 'package-archives
'("marmalade" . ""))
#2017-10-2719:55h.elmougyok#2017-10-2719:55dpsuttonand replace it with the melpa one i linked#2017-10-2719:55dpsuttoni think this should give us some progress#2017-10-2719:55h.elmougyOk let me check#2017-10-2719:58h.elmougywith no highlights on closing parans#2017-10-2719:58h.elmougyYes it should be installed now but still able to delete parans#2017-10-2719:58dpsuttonhave you turned the mode on?#2017-10-2719:58dpsuttonhighlighting closing parens is a different functionality than paredit#2017-10-2719:58h.elmougyhow? execuse my weak knowledge on this#2017-10-2719:59h.elmougyhow to turn the mode on#2017-10-2719:59dpsuttonM-x paredit-mode should turn it on#2017-10-2720:00h.elmougyyes this works#2017-10-2720:00h.elmougynow which plugin should i use for highlights and theme?#2017-10-2720:02dpsuttontheme is pretty personal across users so just google emacs themes and see what's out there. i'm not sure what you mean by highlights but there's show-paren-mode that i use#2017-10-2720:03h.elmougyyes this works also thank you very much for help @dpsutton#2017-10-2720:03h.elmougyI got everything now#2017-10-2720:03dpsuttonawesome! for sure#2017-10-2720:03dpsuttonthere's lots of good stuff out there. the think i linked earlier, emacs prelude has lots of super useful helper functions#2017-10-2720:04dpsuttonthe maintainer of emacs is a super cool guy and has his dot emacs here: https://github.com/jwiegley/dot-emacs#2017-10-2720:04dpsuttonperuse, reuse, create and have fun#2017-10-2720:06h.elmougymy last question. can i have .emacs.el and init.el files together?#2017-10-2720:08dpsuttonhttps://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html#2017-10-2720:08dpsuttonusually best to make a directory out of it and organize it.#2017-10-2720:09dpsuttonbut this will have way more information that i know#2017-10-2720:09dpsuttoni used a premade one and extended it as i needed. there's gonna be lots of stuff you will recreate and its awesome if you do. you'll learn emacs lisp: the most widespread used lisp 🙂#2017-10-2721:56h.elmougyplaying around with prelude for a while. it is awesome. thanks @dpsutton#2017-10-2721:56dpsuttonyeah. it's really well done#2017-10-2721:56dpsuttonsame person as the maintainer of CIDER too#2017-10-2721:56dpsuttonit's nice to learn how its done, and then its nice to have lots of the little niceties done for you#2017-10-2722:00h.elmougyYes I'm having a look at emacs lisp to learn how these great stuff actually work#2017-10-2722:04dpsuttonawesome. it's got its plusses and minuses. great debugger, one of the best lisp environments. enjoy coding your environment#2017-10-2903:53puzzlerWhen my cider repl hits about 8000 lines of output, the interaction slows to a crawl. Even if I enter a simple expression at the prompt like "1", it takes a minute to return the output. Is there a trick to preventing this slowdown?#2017-10-2904:00puzzlerActually, it seems to slow down as soon as something large is printed.#2017-10-2904:16dorabTry C-c C-o or C-u C-c C-o. https://cider.readthedocs.io/en/latest/using_the_repl/#2017-10-2905:15gonewest818I saw slowdowns in the repl with very long lines of output, but in your emacs init.el you can (setq cider-repl-use-pretty-printing ‘t) and then you won’t have those excessively long lines. #2017-10-2905:38puzzlerDoes that variable cause it to truncate it, or just not show it?#2017-10-2906:18gonewest818It causes the output to be pretty-printed, which results in output broken into many short lines instead of one massive line. In my experience that helps a lot. #2017-10-2906:21gonewest818You can also look at the clojure variables *print-length* and *print-level* to control output in the repl. #2017-10-2906:32puzzlerThanks.#2017-10-2911:52agigaoHey guys, CIDER pulls up REPL nicely in regular Emacs gui, but does seem to have an issue in iTerm/Terminal, it’s just stuck with “Starting REPL message”. Any ideas?#2017-10-3010:54chrisblomIs there a way to install older versions of a package in emacs? I've updated to the latest cider version but want to go back to version 0.14#2017-10-3011:32jumar@chrisblom check https://stackoverflow.com/questions/21610968/installing-an-older-version-of-an-emacs-package#2017-10-3011:33chrisblom@jumar thanks#2017-10-3113:19zaneFor some reason cider-connect is now auto-filling the wrong port for a server I started with lein repl :headless.#2017-10-3113:19zaneHas anyone seen that kind of behavior before?#2017-10-3118:12reefersleepIs there a way to avoid the recent javax.xml.bind exception when starting up a cider repl? https://dev.clojure.org/jira/browse/CLJS-2377#2017-10-3118:12reefersleepI see that there are some args that you can add in the repl command line, but I don’t know about Cider/Spacemacs#2017-10-3118:15reefersleepTo be accurate; when I start a Cider cljs repl, I get the following exception:
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling cljs/util.cljc at (1:1)
Compiler.java: 7391 clojure.lang.Compiler/load
RT.java: 372 clojure.lang.RT/loadResourceScript
RT.java: 363 clojure.lang.RT/loadResourceScript
RT.java: 453 clojure.lang.RT/load
... loads of stacktrace lines omitted ...
java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 641 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 844 java.lang.Thread/run
1. Caused by java.lang.ClassNotFoundException
javax.xml.bind.DatatypeConverter
URLClassLoader.java: 466 java.net.URLClassLoader/findClass
DynamicClassLoader.java: 69 clojure.lang.DynamicClassLoader/findClass
ClassLoader.java: 563 java.lang.ClassLoader/loadClass
... loads of stacktrace lines omitted ...
#2017-10-3118:18dpsuttoni'm seeing
(defcustom cider-lein-global-options
nil
"Command global options used to execute Leiningen (e.g.: -o for offline)."
:type 'string
:group 'cider
:safe #'stringp)
#2017-10-3118:18dpsuttonyou could set that to "--add-modules java.xml.bind"#2017-10-3118:18dpsuttonno idea if that will work but that's where i would start#2017-10-3118:19reefersleephow do I do that?#2017-10-3118:19reefersleepI’m not handy with elisp#2017-10-3118:19dpsuttonah ok#2017-10-3118:19reefersleep(setq cider-lein-global-options “--add-modules java.xml.bind”)#2017-10-3118:19reefersleep?#2017-10-3118:19dpsuttonthat's one way but that will be "global"#2017-10-3118:20dpsuttonyou can look into dir-locals, which will only apply under a particular directory structure#2017-10-3118:20dpsuttonbut if this is a jdk thing it sounds like it should be global?#2017-10-3118:20reefersleepmaybe it’s OK that they’re global? 🙂#2017-10-3118:20reefersleepI’ll just give it a go#2017-10-3118:20dpsuttonsounds good#2017-10-3118:20reefersleepfeedback in a min#2017-10-3118:20dpsuttonand you'll probably want that in your init so it is persisted#2017-10-3118:22reefersleepapparently I don’t know how to add it properly to my .spacemacs#2017-10-3118:22reefersleeptried both init and config#2017-10-3118:22tanzoniteblackYou could also set in the top level of the project that needs this a file called .dir-locals.el with the content ((nil . ((cider-lein-global-options . "--add-modules java.xml.bind"))))
#2017-10-3118:22tanzoniteblack^^^ this way, when checked in, it will work for anyone else using the project and emacs as well#2017-10-3118:22reefersleepwait#2017-10-3118:23reefersleephmmm
error in process sentinel: Could not start nREPL server: ‘--add-modules’ is not a task. See ‘lein \
help’.
#2017-10-3118:23dpsuttonoh. we're feeding lein the java options. i think there's a way to do this#2017-10-3118:24reefersleep@tanzoniteblack I’ll try your approach#2017-10-3118:24dpsutton:jvm-opts ["-Xmx1g" "-server"] #2017-10-3118:24dpsuttoni think we are fundamentally in the wrong area#2017-10-3118:24dpsuttonwe need clj optionsin project, not elisp#2017-10-3118:24tanzoniteblack^^^ Agreed, didn't realize this was a javac option#2017-10-3118:24tanzoniteblackadd to your jvm-opts vector "--add-modules=java.xml.bind" (or whatever the exact appropriate thing is) inside your project.clj#2017-10-3118:24dpsuttonalthough you could look to see how cider slides in cider-nrepl and try to emulate that#2017-10-3118:25dpsuttonso that this fix would happen for all of your projects until the fundamental fix is applied#2017-10-3118:25dpsuttonelse you will have to edit every project.clj file you use#2017-10-3118:25reefersleepI’m expecting the fix to go in soon, maybe foolishly. This is just for my hobby projects (until the same thing occurs at work, of course ; ) so I’ll live with the project.clj changes#2017-10-3118:25reefersleeplet me give it a go#2017-10-3118:26reefersleepwhere do I put it in my project.clj?#2017-10-3118:26reefersleepdon’t have a :jvm-opts key there already#2017-10-3118:27dpsuttonhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L286#2017-10-3118:27reefersleepcheers#2017-10-3118:32reefersleepgreat success! 😄 😄 😄 cider#2017-10-3118:32reefersleepThank you so much, @dpsutton @tanzoniteblack!#2017-11-0121:54qqHi I have one question, in cider-inspector, while inspecting a deep nested map (tree structure), is there anyway to “jump out”, and go back to the previous parent node, very much like navigating in and out directories? I am using Spacemacs with cider, anyway#2017-11-0123:57featheredtoast@qq is l what you're looking for? http://cider.readthedocs.io/en/latest/miscellaneous_features/#value-inspection#2017-11-0200:00qq@featheredtoast thank you very much, it may be the answer, the exception is that in spacemacs-evil, hjkl is the navigation, I may need to remap it though 😄#2017-11-0200:01qqok got it, in spacemacs, it’s L, how fool I am not to read the docs first https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/clojure#inspector-mode 😞#2017-11-0218:44shayhi. a question about cider-nrepl, if i may – how i can unload/disable a middleware that is in use in an already running repl? (specifically, cider.nrepl.middleware.out).#2017-11-0310:55andrea.crottiis there a way to run a single test (the one where my cursor is ideally)?#2017-11-0310:55andrea.crottiI have auto-test-mode which is great but most of the times I just want to run a single test really#2017-11-0311:04vijaykiranPerhaps this https://cider.readthedocs.io/en/latest/running_tests/ will help ?#2017-11-0311:36andrea.crottishould be run-test-at-point in theory#2017-11-0311:36andrea.crottibut I get NPE errors from CLojure#2017-11-0311:36andrea.crottiwith a test that otherwise works running the while namespace#2017-11-0311:41benedekload the test ns or ideally rhe whole project and then C-c C-t C-t#2017-11-0311:45andrea.crottiah great thanks works thanks#2017-11-0312:18benedekcoolio#2017-11-0401:30brainfreezeDoes cider-dynamic-indent work on libraries too? I have it enabled and it's still screwing up the indentation with compojure-api even though the source files have the right metadata#2017-11-0520:59dominicmI don't seem to be able to build cider-nrepl on master, is there a known issue?#2017-11-0521:56gfredericks@dominicm what's failing and how?#2017-11-0521:56dominicm@gfredericks afk now. But it was an maven/aether error.#2017-11-0521:57gfredericksdid you try with LEIN_NO_USER_PROFILES=1? could be a dependency conflict#2017-11-0521:57dominicmIf it's unknown, I can report it. I've heard there's some issues with lein 2.8.1, could be related to that I guess?#2017-11-0521:59dominicmI'll try that in the morning, but I think my profiles are empty.#2017-11-0522:01gfrederickslein jar and lein check work for me#2017-11-0522:01gfredericks(but I get an aether error with my user profile turned on)#2017-11-0522:01gfrederickstrying test now#2017-11-0522:02gfrederickstest works too#2017-11-0522:16gfredericksalso the passing build banner at the top of the readme would give you something to compare to#2017-11-0600:37brainfreezeHmm, turns out cider-dynamic-indent only works things like cider-format-buffer? Seems unintuitive#2017-11-0614:38dominicm@gfredericks http://ix.io/C1V this is what I'm getting with: LEIN_NO_USER_PROFILES=1 ./build.sh install#2017-11-0614:41gfredericks@dominicm works fine for me. builds & installs in 47s#2017-11-0614:41dominicmAre you on lein 2.8.1?#2017-11-0614:42gfredericksLeiningen 2.7.1 on Java 1.8.0_112 Java HotSpot(TM) 64-Bit Server VM#2017-11-0614:42gfredericksupgrading and trying again#2017-11-0614:43gfredericksfails the same way yours does#2017-11-0614:43dominicmOkay. lein 2.8.1 bug then. Fun.#2017-11-0616:34benedekI guess this is biting you @dominic https://github.com/clojure-emacs/cider-nrepl/issues/449#2017-11-0616:34benedekhave not had time to look at it yet :/#2017-11-0616:36dominicmweird, search didn't actually pick that up#2017-11-0616:39dominicm@benedek looks like it's the upgrade of pomegranite & ergo upgrade to maven's aether from the old sonatype one.#2017-11-0616:39benedekyup#2017-11-0616:40benedeksuppose mranderson need to follow suit or something ...#2017-11-0616:42dominicmmranderson doesn't use sonatype directly though… Bit less direct#2017-11-0616:43dominicm@benedek does mr anderson just need to mirror the version of pomegranate used by lein?#2017-11-0616:48dominicm@benedek yep, it's as simple as that#2017-11-0617:07benedekah nice one!! thx @dominicm #2017-11-0617:08dominicmthat's okay. I've been slowly driven insane today by a tree which contains this 🙂 Want to clear my brain.#2017-11-0617:08dominicmI was just able to patch cider-nrepl and fix the bug.#2017-11-0619:02ghaskinshi all…just getting up to speed on using the debugger in cider+emacs….im seeing this behavior where I set a BP, hit it, hit ‘c’ to continue, and then I lose the ability to see a BP get hit again#2017-11-0619:02ghaskinsnot sure what I am doing wrong, but any advice apprecated#2017-11-0619:03ghaskins(this happens regardless of whether I try to reset the current BP, or set a new one#2017-11-0619:04ghaskinsemacs v25.3.1 and cider-nrepl 0.15.1, in case that matters#2017-11-0709:38jumar@ghaskins c means "continue without stopping" that is ignoring all breakpoints. if you use #break explicitly you can just press n to continue execution until the breakpoint is hit.
For example:
(defn break [x]
(let [y (* x x)]
(doseq [n (range y)]
(let [msg (str "Hello " n)]
#break (println msg)))))
;; just call the function and press "n"
(break 3)
#2017-11-0719:19preDoes anyone use flycheck-clojure (https://github.com/clojure-emacs/squiggly-clojure) with cider 0.15.1 and emacs 25.1 on a daily basis? I've attempted to use it on many occasions, but each time I find the typing to be unusuable, as flycheck keeps interrupting every keystroke with false errors.#2017-11-0721:41noogacider is usually lightning fast for me but there is one file in one relatively small project where fans spin up and even cursor movement makes emacs freeze#2017-11-0721:41noogaI’m not sure what’s going on#2017-11-0721:44admaywhats the file look like?#2017-11-0721:44dpsuttonm-x profiler-start and then after a bit m-x profiler-report#2017-11-0721:44dpsuttonwill show you some info. note that you run report before stop. stop throws away the information rather than end the watching period for analysis#2017-11-0721:51noogathe file has a huge (comment ...) section but otherwise it’s just some short defns#2017-11-0721:52noogaah, and it seems that editing inside (comment ...) is much slower than outside#2017-11-0721:57noogaodd#2017-11-0721:58dpsuttoni think i remember searching backwards is especially slow in emacs due to an internal text representation. i bet that function looks back to see if its in a comment#2017-11-0721:58dpsuttonis my wild guess#2017-11-0722:01noogaI tend to put unfinished/harmful stuff in huge comment sections so I don’t accidentaly C-c C-k them at some point#2017-11-0722:03dpsuttoni love reading through core stuff and seeing hardcode's to rich's machine in comment sections#2017-11-0722:03dpsuttonslurp /Users/rich/example-rrb-tree.edn or whatever#2017-11-0722:03noogayeah, I found some on my own and laughed hard at some of them#2017-11-0912:20jumarMy new mini-episode about cider enlighten mode: https://www.youtube.com/watch?v=tCu2AewBTR4#2017-11-0915:37qqqin cider, I can eval an expr; I can eval an expr and inject result in buffer, is there a way to:
eval expr, inject result in buffer, but
1. run clojure.pprint/pprint on answer and#2017-11-0917:20ajsThere's always a way in emacs if you write some elisp#2017-11-0918:15gonewest818There is a cider-pprint-eval-last-sexp but the pretty-printed output lands in another buffer. I wrote a gist for cider-pprint-eval-last-sexp-to-comment which sounds close to what you’re looking for…#2017-11-0918:16gonewest818Here’s the gist: https://gist.github.com/gonewest818/5f68a092994ba135d915bf14c807329f#2017-11-0918:16gonewest818huh, weird, if I post the gist in a thread it ends up in the main channel anyway.#2017-11-0918:18gonewest818oh, it’s because I posted the same gist earlier and slack cached it. actually it’s an older/obsolete version of the work. I deleted that file — the link above should take you to the latest.#2017-11-0918:48qqq@U4PUTN69G ++#2017-11-0915:37qqq2. put a #_ in front of the result ?#2017-11-1005:03achesnaisHi all, quick one: has anyone who uses Spacemacs managed to pin the CIDER and clj-refactor packages to the latest stable version? Spacemacs only seems to be able to download the latest snapshot as far as I can tell?#2017-11-1005:19gonewest818@achesnais I don’t use spacemacs but the dev community seems to be building its own package repo like so: https://github.com/syl20bnr/spacelpa #2017-11-1010:33borkdudeSomeone mentioned it here, but alas I can’t find it. How can I get autocompletion etc in ClojureScript cider? I opened a clojurescript sibling repl using boot#2017-11-1109:05psimonHi all. Is there a way to break cider debugger on exception, like Cursive allows me to?#2017-11-1109:11dominicm@psimon I don't use it, so I'm not certain, but my understand is no. I think this allows you to achieve the same thing though: https://github.com/prismofeverything/schmetterling#2017-11-1109:15psimonThanks! Will have a look.#2017-11-1115:18bhaumanhmmm how do I see the cider message buffer now?#2017-11-1115:35dpsutton@bhauman do you mean the nrepl logging?#2017-11-1115:35bhaumanyeah#2017-11-1115:35dpsuttonnrepl-toggle-message-logging#2017-11-1115:36dpsuttonm-x ^#2017-11-1115:36bhaumanthere used to be a buffer with all the messages#2017-11-1115:36bhaumanahhh#2017-11-1115:36bhaumanthat will do it#2017-11-1115:36bhaumanI looked for that and didn't find it#2017-11-1115:36dpsuttonyeah i always look for a cider prefix and forget its nrepl#2017-11-1115:36bhaumanI probably need to upgrade#2017-11-1115:36dpsuttonoh. you don't see that?#2017-11-1115:36bhaumanoh yeah nrepl#2017-11-1115:36bhaumanthat was my confusion as well#2017-11-1115:37dpsuttonit may have been on by default in a past version#2017-11-1115:38bhaumanyeah, I've written a replacement for piggieback that hosts its cljs on a thread#2017-11-1115:39bhaumanwhich makes it just as responsive as the shell repl, or lumo#2017-11-1115:39bhaumantrying to work out the last few bugs#2017-11-1115:39dpsuttonif i can help let me know#2017-11-1115:39bhaumanthanks man!#2017-11-1115:39dpsuttonand that sounds really really awesome#2017-11-1115:39dpsuttonand complicated#2017-11-1115:40dpsuttonyeah if you have any questions feel free to directly ping me here#2017-11-1115:40dpsuttonor message whatever#2017-11-1115:40bhaumanthanks again#2017-11-1115:54bhauman@dpsutton any reason c-x c-e inside a ClojureScript buffer would get redirected to the Clojure REPL connection, when I'm not using piggieback? Is cider looking specifically for piggieback vars?#2017-11-1115:55dpsuttonyeah. there have been some changes to the "choose connection" logic that i don't like#2017-11-1115:55dpsuttonbring up your cljs repl and evaluate something simple in it like (+ 1 1)#2017-11-1115:55dpsuttonand then try again#2017-11-1115:56dpsuttonsomewhere if it can't decide which connection to use it uses the last one#2017-11-1115:57bhaumanI think something else is going on... I'll come back with a more specific question#2017-11-1115:57dpsuttonok. one other thing to check is the session id's in the nrepl traffic#2017-11-1115:58bhaumanyeah they are different and it seems like all buffer traffic is going to the Clojure nREPL connection#2017-11-1115:58bhaumanthis isn't the case when I use piggieback#2017-11-1115:59bhaumanwhich makes me think that there is piggieback detection going on#2017-11-1115:59bhaumanbut I don't see messages that do any such thing#2017-11-1116:01dpsuttoni don't even know where to begin looking into that#2017-11-1116:01bhaumanno worries#2017-11-1116:01dpsuttonlet me crank up something and watch the traffic#2017-11-1116:10bhauman@dpsutton no need https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/cljs.clj#2017-11-1116:11bhaumanlots of piggieback specific stuff in there#2017-11-1116:15bhaumanwhich is pretty dissappointing#2017-11-1116:15dpsuttonyeah#2017-11-1116:15dpsuttoni'm looking at it and wondering if there is a way to describe a contract that any bridge like piggieback could satisfy#2017-11-1116:23bhaumanthe bottom line is that they need the compiler environment which makes complete sense#2017-11-1218:08jfntnAnyone experiencing typing lag with company-mode?#2017-11-1308:43blasutyeah, a lot. Turned it off because I don't have any time to debug and profile atm. Are there any patterns you've noticed?#2017-11-1517:21grzmI like the auto-ns insertion feature in cljr-refactor, but it keeps inserting the wrong namespace: for example, instead of (ns com.example.foo), it's inserting (ns ...full.path.to.my.project.src.com.example.foo)#2017-11-1517:21grzmIs there a configuration setting I'm missing?#2017-11-1518:32grzmIs there a better place I should ask?#2017-11-1518:39dpsuttonthis would be the best place i'm sure#2017-11-1518:39dpsuttondo you know how to investigate?#2017-11-1518:45grzmWell, I've dug into the refactor code a bit, and it seems likely related to clojure-find-ns, but that's as far as I was willing to dig before asking. I'm trying to work against my tendency to spend a couple of days digging into a problem when asking often gets the solution much more quickly.#2017-11-1518:49dpsuttonyeah i got you. i think the person that could answer that for you is on here just not now#2017-11-1518:49dpsuttonbut you could file an issue on github#2017-11-1518:49grzmthanks. I'll look into that.#2017-11-1519:21grzmI think it's interaction between boot and cider. lein projects don't exhibit this behavior#2017-11-1519:22grzmAnd there's an open ticket https://github.com/clojure-emacs/cider/issues/1651#2017-11-1522:44chadhswhen you finally find a stackexchange question that matches your own, but it’s unanswered QQ#2017-11-1522:44chadhshttps://emacs.stackexchange.com/questions/32318/how-do-i-control-what-profile-cider-is-using-to-connect-to-a-repl-with-or-to-ru#2017-11-1600:36Drew Verleedoes cider require you to be connected to the internet to work?#2017-11-1601:27gonewest818https://stackoverflow.com/questions/40002805/lein-repl-without-network-connection#2017-11-1601:48grzmI've got a POC for fixing the boot/cider-expected-ns issue: it looks like it's actually in cider-nrepl (what get's returned from cider-sync-request:classpath): https://github.com/grzm/cider-nrepl/commit/4fe4a7021835a5cd2305a9a322c412b8bbd24c05#2017-11-1611:24benedek@grzm wonder if this is not similar or related to this https://github.com/clojure-emacs/refactor-nrepl/issues/97#2017-11-1611:25benedekI think it is and was fixed for some use cases in refactor-nrepl#2017-11-1616:02grzm@benedek Yeah, I think that's addressing the same issue. I think it might be fixed at the wrong level here, as I think this is something that should be shared by all nrepl user, rather than fixed per-user, e.g., in cider-nrepl rather in refactor-nrepl and cider.#2017-11-1616:06dominicm@grzm there's a few bits of cider that's in both cider-nrepl and refactor-nrepl around handling boot, it's mostly copy & paste.#2017-11-1616:06dominicmIt could go into a library, but it's hard to beat copy & paste.#2017-11-1616:09grzm@dominicm I'd argue that that copy-and-paste misses a lot of use cases and duplicates code, requiring more places to fix as code is updated. That in particular bit me here.#2017-11-1616:09benedekwell the midterm goal is to merge refactor-nrepl into cider-nrepl#2017-11-1616:10benedekwhich will kill these annoying duplications#2017-11-1616:10benedekonly I don't have time to work on this merge#2017-11-1616:10grzmwell, this would be a start of some it it 🙂#2017-11-1617:50grzm@benedek Is there an open ticket or wiki page or other reference related to merging refactor-nrepl into cider-nrepl?#2017-11-1622:08benedek@grzm not really. quite a bit of discussion about it on gitter i think. this issue is kinda related (https://github.com/clojure-emacs/refactor-nrepl/issues/195) as would make sense to rewrite/make the analyzer part more robust to support cljs#2017-11-1722:45dominicmhttps://github.com/clojure-emacs/cider-nrepl/issues/450 I'd appreciate feedback on this idea. I'll probably start attacking it tomorrow a.m.#2017-11-1722:45dominicmWould this be the first time a key was added for non-emacs-client usage?#2017-11-1800:19grzm@dominicm I'd take a look at refactor-nrepl. They likely have something like this that you may be able to adapt.#2017-11-1818:19decoursinBased on my survey, Kibit & Eastwood are almost useless integrated within Emacs.
Since they can only run when the source code compiles, they can't actually detect compile errors.
(Detecting compile errors can also be done with just a normal stacktrace, but it would be nice to get a red squiggle underneath the errors to quickly find the problem, rather than searching the stacktrace.)
Sure they provide some nice static analysis hints and tips, but hardly much that needs to run after every change/save.
As such, cored.typed seems like the only useful linter (of the three) to be integrated within Emacs.
What do you guys think?#2017-11-1819:40dominicmKibit can be run on piped in code, it's a limitation of squiggly clojure that it does not provide the buffer to kibit#2017-11-1819:40dominicmThere is other tools outside out of cider which can have the buffer piped#2017-11-1819:50decoursinWhat tools?#2017-11-1819:51decoursinThanks though, that's nice to know.#2017-11-1820:01dominicm@decoursin I put in a lot of effort getting it to work with https://github.com/SevereOverfl0w/clojure-check/#2017-11-1820:10dominicm@decoursin https://github.com/SevereOverfl0w/clojure-check/blob/master/main.go#L121 kibit can take a StringReader as input#2017-11-1820:25decoursinCool thanks#2017-11-1820:26decoursinIf i was an elisp pro, I'd wip out integration with it.#2017-11-1820:28decoursinI'm not though lol#2017-11-1820:30decoursinHere was my attempt at adding dump-jump-go to work with right mouse click: https://github.com/decoursin/emacs.d/blob/master/init.el#L337.#2017-11-1908:40dominicmDoes anyone know if the stacktrace inspector works for Clojurescript exceptions too? My testing & source reading suggests not.#2017-11-2004:1513talesHey there; I’m a Clojure newbie doing some http://Exercism.io problems in Spacemacs. Does anyone have any advice on getting the Cider REPL to work for these exercises? I can’t seem to get the REPL to use the right namespace; I get “undefined” errors when trying to run my functions.#2017-11-2005:01grzmHave you required the namespace?#2017-11-2005:04grzmI'd do something like
(require '[this.is.my.ns :as ns])
(ns/my-func ,,,)
#2017-11-2005:12jumar@thomas.armstrong depending on your workflow you can also use cider-repl-set-ns (C-c M-n) to set the REPL namespace to the namespace of the current buffer.
I usually work only in namespace buffer (the actual file with code) and eval either the whole buffer or expressions one by one. That way, it should always work. Sometimes, I want to send expression to the REPL (for better "visualization" of result) - then I need to make sure that REPL has proper namespace (C-c M-n) and just call cider-send-last-sexp-to-repl (`,s e` using Spacemacs in evil mode)#2017-11-2005:1513tales@grzm Hey, thanks for getting back to me. I tried that, and it works. Was hoping to get it to work without needing to require the ns first, but whatever works 🙂#2017-11-2005:1613tales@jumar Yes, I had found that command; not sure what I was doing wrong before, but it seems to work now. Thanks, though!#2017-11-2005:18grzm@thomas.armstrong No problem. require loads the file. Code isn't automatically loaded at the repl.#2017-11-2011:33iperdomohi all, I'm working with a Dockerized dev environment - See: http://danlebrero.com/2017/09/25/how-do-docker-compose-development-environement#2017-11-2011:34iperdomothere is a container with the Clojure code and an nREPL server running, I can connect from my host machine using cider-connect#2017-11-2011:35iperdomoand everything seems to work except Jump to definition: Meta + .#2017-11-2011:36iperdomoall the vars have relative file path, e.g.#2017-11-2011:36iperdomo(meta #'akvo.lumen.lib.collection/all)
{:arglists ([tenant-conn]), :line 5, :column 1, :file "akvo/lumen/lib/collection.clj", :name all, :ns #namespace[akvo.lumen.lib.collection]}#2017-11-2011:40iperdomowhen i try to jump to that definition collection/all i get .. No source location#2017-11-2011:42iperdomoif i evaluate the file(Ctrl + c , Ctrl + k), the vars get redefined, the metadata gets changed to absolute paths and the jump to definition works again#2017-11-2011:43iperdomois this considered a bug? can i workaround this issue without evaluating the target namespace ?#2017-11-2011:45dominicm@iperdomo I think cider resolves the metadata to an absolute path for you, but that absolute path is the one inside the docker container.#2017-11-2011:46dominicmSomeone once told me there was a trick to have emacs rewrite the path using some built-in emacs feature (maybe tramp?) but I don't know what it is.#2017-11-2011:47iperdomohey @dominicm ... I've been reading about tramp but it feels that i'm adding more complexity to the whole thing#2017-11-2011:47iperdomoif there is a trick to rewrite the path would be really nice#2017-11-2011:49dominicmI wonder if this solves the problem? https://github.com/emacs-pe/docker-tramp.el#2017-11-2011:49iperdomohummm#2017-11-2011:49dominicmhttps://www.gnu.org/software/emacs/manual/html_node/emacs/File-Aliases.html#File-Aliases this might also work?#2017-11-2011:55iperdomo@dominicm thanks will try this out#2017-11-2012:16iperdomodocker-tramp seems to work ... it feels slower though#2017-11-2016:07gonewest818What about mounting the source dir in the docker container using the same absolute path that occurs on the outside? You’d have to customize the docker-compose.yml per developer, or possibly use environment variable substitution to generalize it. #2017-11-2308:15carkhHi, I have tried a full reinstall of emacs 25.3, but for some reason i can't get company mode to work in the cider repl (works fine when editing a file with cider). I get the usual old emacs completion list when pressing tab (that's my company-indent-or-complete-common key).
Any idea what i can do, or if it is at all possible to have company completion in the repl ?#2017-11-2308:47carkhwhen i "M-x company-complete" in the repl, i get the desired behaviour...#2017-11-2309:26magraHi, when point is on a function, is there a feature to bring me to all the places this function is called from?#2017-11-2309:27magraA bit like the opposite of M-.#2017-11-2309:28carkhthere is "find usages" in clj-refactor.el#2017-11-2309:51magra@carkh Thank you! That is what I needed 🙂#2017-11-2309:52carkh😃#2017-11-2410:39qqqIs there a minimal build.boot for using https://github.com/adzerk-oss/boot-cljs-repl together with cicder? I'm having a situation where cide-connect tries localhost:4001 ... then it times out#2017-11-2718:58borkdudeI have (setq cider-cljs-lein-repl "(do (ns boot.user) (start-repl))") in my init.el. But when I do cider-create-sibling-cljs-repl I get
> Wrong type argument: stringp, nil#2017-11-2719:00borkdude@qqq
I have this in ~/.boot/profiles.boot:
(require ‘boot.repl)
(swap! boot.repl/*default-dependencies*
concat ’[[cider/cider-nrepl “0.15.1-SNAPSHOT”]
[refactor-nrepl “2.4.0-SNAPSHOT”]
])
(swap! boot.repl/*default-middleware*
conj
’cider.nrepl/cider-middleware
’refactor-nrepl.middleware/wrap-refactor)
#2017-11-2719:20dominicm@borkdude fwiw, I'm pretty sure that should be in-ns, not ns#2017-11-2719:21dominicmYou're also missing a single quote#2017-11-2719:23borkdude@dominicm where? And in-ns or ns doesn’t matter. This used to work.#2017-11-2719:28borkdude@dominicm I tried it, still the same error. Not sure about your quote?#2017-11-2719:31dominicm@borkdude If it used to work, ignore me. I'm just a bit confused because:
- you've set it for lein, but you're using boot
- you're doing ns boot.user but that would wipe the ns#2017-11-2719:34borkdude@dominicm This is from my setup a year ago. Things might have changed since then. For boot projects you had to use this variable too, as there wasn’t a separate one for boot.#2017-11-2719:35dominicm@borkdude do you (require 'cider) in your init.el before that setq?#2017-11-2719:36dpsutton(defcustom cider-cljs-boot-repl "(do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
"Clojure form that returns a ClojureScript REPL environment.
This is only used in boot projects. It is evaluated in a Clojure REPL and
it should start a ClojureScript REPL."
:type `(choice ,@(seq-map (lambda (x) `(const :tag ,(apply #'concat (cdr x)) ,(car x)))
cider--cljs-repl-types)
(string :tag "Custom"))
:safe (lambda (x) (assoc x cider--cljs-repl-types))
:package-version '(cider . "0.15.0")
:group 'cider)
#2017-11-2719:36dpsutton@richiardiandrea added this recently#2017-11-2719:36dominicmAlso that ^^#2017-11-2719:37borkdudeThanks, I’m going to try this soon#2017-11-2721:16richiardiandreaYeah that should work#2017-11-2912:43daveliepmannWhat kind of response should I expect from cider-scale-background-color? I'm on 0.15.1 (London) and the responses seem odd: "#22e322e322e3" or "#f332f332f332". (This may be the source of problems I'm having with background color in stacktraces.)#2017-11-2918:13grzmAre those copy-paste?#2017-11-2918:24tanzoniteblackI'm seeing values like that too "#3ccd3ccd3ccd" (with the background color of the frame being "#303030"), and as far as I know these should be RGB values with normal 2 digit hex codes per value (i.e. max of 65535)#2017-11-2918:26dpsuttonit's set in this line from cider-test: (overlay-put (make-overlay beg (point)) 'font-lock-face bg) it's bg at this point#2017-11-2918:26dpsutton(bg (:background ,cider-test-items-background-color))`#2017-11-3008:30daveliepmann@grzm those are values I'm seeing, yes.#2017-11-3008:37daveliepmann@tanzoniteblack that's exactly my confusion. Weird, right? To me this looks like it's coming from line 343 of cider-util https://github.com/clojure-emacs/cider/blob/master/cider-util.el#L339#2017-11-3008:37daveliepmannBecause all the numbers we're seeing are triples of 4 hex characters#2017-11-3008:39daveliepmannAnd line 343 formats each component of an RGB color (so, 3) into a 4-hex-character string based on the rounded scale. That seems wrong to me.#2017-11-3009:40daveliepmannnvm the four digits are because it goes to 65535. I think it's broken further up.#2017-11-3023:36tylerDoes anyone know how to get emacs to respect cider indentation metadata? Would like to share formatting options across the team and it would be nice to have emacs editor support.
As far as I can tell cider-format-buffer dispatches to cljfmt, but even when I set up cljfmt in the project, cider doesn’t seem to do anything when I try to format using that command. When I run lein cljfmt fix it identifies the formatting errors correctly.#2017-12-0101:15gonewest818try the clojure-mode settings… https://github.com/clojure-emacs/clojure-mode#indentation-options#2017-12-0103:25tylerGotcha, I’ve been able to get those to work but would prefer to use cljfmt for ci purposes. Is there a way to get that to work or is it incompatible with clojure-mode?#2017-12-0112:02gfredericksI thought the cljfmt readme had claimed emacs support for years
even if it has, that doesn't mean it's easy to setup 🙂#2017-12-0115:23dominicmdoesn't cider indentation metadata do more than cljfmt? I'm pretty sure it does.#2017-12-0116:03tylerThats what seemed to be implied by the docs. Not all of my team uses emacs so using cljfmt would be nice as a source of truth since it has support for vim and could be used in CI.#2017-12-0118:42tylerActually as a side-note, have you been able to get cider indentation metadata to work @dominicm? Just tried that as well and it likes clojure-mode is overriding that.#2017-12-0118:42dominicmI don't use cider#2017-12-0121:02parkeristypingAnyone know an easy way to hook in a function to process repl results before displaying them, when evaluating with e.g. cider-eval-defun-at-point? (I want to walk all seqable results and truncate large strings)#2017-12-0216:38richiardiandreaDon't have that, but the unrepl folks have that feature built-in their repl. Try to ask in #unrepl #2017-12-0215:57gonewest818I’m messing with the hiwin module which highlights the current window by setting an overlay on all the other windows. But as it happens, when the overlay is applied to the repl and/or an eshell it causes the window content to scroll offscreen. So it’s basically useless this way.#2017-12-0216:00gonewest818As a hack, I want to scroll the repl window back to where it was. The elisp fn recenter-top-bottom can move the current buffer line to any specified window line. But which line? How do I determine which window line each buffer’s line is on?#2017-12-0402:43chadhsIs there a good way to make running tests via cider and using environ to define a test db url play nice together?#2017-12-0402:44chadhsif i run lein test my tests work with my test profile, but when using cider it uses my dev profile.#2017-12-0407:29kardanWe had that issue, in the end defined what db to use for tests independent of profiles. Not sure if there is a good solution#2017-12-0407:36dominicmcider runs "inside" leiningen, it cannot control leiningen.#2017-12-0414:24chadhs@dominicm i had the realization a bit after posting here as well.#2017-12-0414:25chadhs@kardan i’m going to do something similar. a full test run im a ci pipeline can use a defined test profile and therefore db, i’m just going to be ok with cider running tests against my local dev profile for convenience of quick testing feedback#2017-12-0506:57borkdudeHmm, all of a sudden I get:#2017-12-0506:58borkdude[nREPL] Establishing direct connection to localhost:57718 ...
nrepl--direct-connect: [nREPL] Direct connection to localhost:57718 failed
#2017-12-0507:38borkdudeRebooted my system, threw away elpa, upgraded to cider-0.16.0-SNAPSHOT and it works again#2017-12-0522:24agcan you guys remind me what should be the value of cider-lein-parameters for jack-in-clojurescript if the lein task is dev? I tried setting it to "dev" but I think it didn't work#2017-12-0522:32dpsutton(defun my-jack-in-jib ()
(interactive)
(let ((cider-lein-global-options "with-profile dev"))
(cider-jack-in-clojurescript)))
#2017-12-0522:32dpsuttonthat's how i start my project for work 🙂#2017-12-0522:34dpsutton@ag #2017-12-0522:38agwhat's the difference between cider-lein-parameters and cider-lein-global-options?#2017-12-0522:38agdon't you have to set also cider-cljs-lein-repl?#2017-12-0522:46ag@dpsutton this still doesn't work for me. It does create 2 repls, and in cljs one - I can see it's compiling cljs, but it doesn't automatically start the server#2017-12-0522:47agin order for it to work, in Clojure repl I also have to execute (go)#2017-12-0522:47agI want it to be executed automatically#2017-12-0522:54agthe project uses integrant.repl#2017-12-0523:02agoh shoot..... I think I made it work:#2017-12-0523:02ag(setq cider-cljs-lein-repl
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl))")
#2017-12-0523:30grzmIs there a happy medium between cider-eval-defun-to-comment and cider-eval-print-last-sexp ?#2017-12-0523:33grzmI'd like to print just the last sexp with a comment prefix#2017-12-0523:57grzmI've got this:
(defun cider-eval-last-sexp-to-comment ()
"Evaluate the expression preceding point.
Print its value into the current buffer."
(interactive)
(let* ((bounds (cider-last-sexp 'bounds))
(insertion-point (nth 1 bounds)))
(cider-interactive-eval nil
(cider-eval-print-with-comment-handler
(current-buffer) insertion-point ";; => ")
(cider-last-sexp 'bounds))))
#2017-12-0616:32chrisblomthe docstring of cider-last-sexp is not correct#2017-12-0616:32chrisblomit works if you use a variant:#2017-12-0616:32chrisblom(defun my/cider-last-sexp (&optional bounds)
"Return the sexp preceding the point.
If BOUNDS is non-nil, return a list of its starting and ending position
instead."
(apply (if bounds #'list #'buffer-substring-no-properties)
(save-excursion
(clojure-backward-logical-sexp 1)
(list (point)
(progn (clojure-forward-logical-sexp 1)
(point))))))
(defun my/cider-eval-last-sexp-to-comment ()
"Evaluate the expression preceding point.
Print its value into the current buffer."
(interactive)
(let* ((bounds (my/cider-last-sexp 'bounds))
(insertion-point (nth 1 bounds)))
(cider-interactive-eval nil
(cider-eval-print-with-comment-handler
(current-buffer) insertion-point ";; => ")
(cider-last-sexp 'bounds))))
#2017-12-0618:26grzmThanks. I came up with a similar workaround by decrementing point. Yours is cleaner. Any idea why that change was made? The commit message lacks detail as to the motivation. https://github.com/clojure-emacs/cider/commit/f57abc71dbb2baf07687ac9c73025f31ee1a7c3e#2017-12-0618:27grzmcider-eval-print-with-comment-handler has similar extra effects: that's where the newline is coming from.#2017-12-0523:59grzmWhich works with the minor issue that it prints on the next line, rather than after the expression. For example:
(solve-j)⬅︎ point was there
;; => 21841249
#2017-12-0609:31chrisblomdoes cider 0.15 support namespaced maps?#2017-12-0609:32chrisblomin 0.14 if i C-x C-e #:person {:name "chris"}, it just returns {:name "chris"}#2017-12-0609:33chrisblomwhile (read-string "#:person{:name "chris"}") returns #:person{:name "chris"}#2017-12-0618:08grzmDoes that depend on the Cider version or the Clojure version?#2017-12-0618:08grzmFWIW, in 0.16:
boot.user> {:foo/bar :a :foo/baz :b}
#:foo{:bar :a, :baz :b}
boot.user> #:foo{:bar :a, :baz :b}
#:foo{:bar :a, :baz :b}
#2017-12-0618:14grzmOh, I see what you mean about using cider-eval-last-sexp:
{:foo/bar :a :foo/baz :b};; => #:foo{:bar :a, :baz :b}
#:foo{:bar :a :baz :b};; => {:bar :a, :baz :b}
#2017-12-0618:14grzmYeah, there's something wonky going on there.#2017-12-0619:32gonewest818@grzm I have a pull request open to pretty-print the last sexp to comment. Check the cider project on GitHub. #2017-12-0619:50grzm@gonewest818 cool. Does this always print the result on the following line? I'd like an option to append to the current line. It looks like it is always the following line (which makes sense for multi-line comments), if I'm reading the commit correctly.#2017-12-0620:09gonewest818I can’t remember but I thought the behavior was it inserts at the point, so if the point is on a new line then it inserts from there. when I get to a laptop I can check. #2017-12-0620:34grzmYou're right. It does look like it inserts at point. It does look like it indiscriminately adds a newline. It would be nice if there were only one line to the result that it wouldn't do that, or at least make it optional.#2017-12-0704:58gonewest818@grzm there were comments on the pull request so while I was dealing with those comments, I fixed the newline behavior per your request too. https://github.com/clojure-emacs/cider/pull/2111#2017-12-0705:10grzmthanks 🙂#2017-12-0719:51agdoes anyone know how to get fully-qualified name of clojure symbol-at-point?
like cider-symbol-at-point but fully qualified#2017-12-0720:25arrdem@ag resolve in the repl, could probably wrap it up in a cider command.#2017-12-0801:03gonewest818…copying a debugging question over from github to get more eyes on it. I have a function cider-pprint-eval-defun-to-comment. It’s a variant of cider-eval-defun-to-comment (C-c M-;) where the output is pretty-printed across multiple lines where necessary.#2017-12-0801:07gonewest818When the function is invoked via a keybinding it works as expected. When the function is invoked via M-x cider-pprint-eval-defun-to-comment the function completes without appearing to insert anything into the current buffer. However, as soon as I type any other character (including navigation like C-f, C-b) that’s when the inserted comment appears.#2017-12-0801:08gonewest818(☝️ I’m referring to the same cider pull request I mentioned last night….)#2017-12-0801:09gonewest818Anyone willing to help look into this?#2017-12-0801:19grzmI'm really new to elisp, but I'll look at it in a couple of hours. I want this patch to get it!#2017-12-0808:47daveliepmann@fommil I know this is reaching way back in time, but did you ever find a solution to white-backgrounded stacktraces? https://clojurians-log.clojureverse.org/cider/2016-03-19.html "I have a dark theme (darcula) and when I get a stacktrace or test failure the default faces are all dark text on a white background." I'm experiencing the same issue.#2017-12-0809:19bozhidar> @ag resolve in the repl, could probably wrap it up in a cider command.#2017-12-0809:20bozhidarIndeed. That should be trivial to do.#2017-12-0809:20bozhidar@gonewest818 I can’t imagine what might be different. There’s no real difference between running a command with M-x or via a keybinding.#2017-12-0809:21bozhidarAnd I don’t see anything special happening in the wrapper command.#2017-12-0809:22bozhidarI think what you should do is instrumenting the command with the Elisp debugger (`C-u C-M-x` while inside its body) and just step through the code and see what’s going on.#2017-12-0816:13gonewest818annoyingly, bug doesn’t occur when I instrument the command with the debugger…#2017-12-0819:38gonewest818I think the issue is occurring in execute-extended-command in simple.el, in particular there seems to be a delay while it figures out a suggested shorthand for the new command: (`You can run the command 'cider-pprint-eval-defun-to-comment' with M-x -p-d-t RET`).#2017-12-0819:39gonewest818If I use the suggested shorthand M-x -p-d-t the bug doesn’t occur. Likewise if I just turn the feature off (setq suggest-key-bindings nil).#2017-12-0819:39gonewest818So I’m looking at the implementation in simple.el.#2017-12-0819:40gonewest818Interesting, there’s a “fixme” comment in the implementation that says “Can be slow. Cache it maybe?” https://github.com/emacs-mirror/emacs/blob/d20161b25e9cd184d841ba9e36ee5141c01fd75f/lisp/simple.el#L1801-L1803#2017-12-0819:57gonewest818so… one workaround is if there is a valid keybinding for the function. In that case it just reminds you what the keybinding is, without trying to compute a shortened string.#2017-12-0809:22bozhidarThat’s always the best approach to solving such problems.#2017-12-0809:25bozhidar> Does anyone know how to get emacs to respect cider indentation metadata? Would like to share formatting options across the team and it would be nice to have emacs editor support.#2017-12-0809:26bozhidar@tyler This only work when CIDER is running. There’s nothing special that you need to do - you just have to have this metadata attached to some definition and evaluate it.#2017-12-0809:26bozhidar> As far as I can tell cider-format-buffer dispatches to cljfmt, but even when I set up cljfmt in the project, cider doesn’t seem to do anything when I try to format using that command. When I run lein cljfmt fix it identifies the formatting errors correctly.#2017-12-0809:27bozhidarWell, what CIDER does is that it uses the cljfmt API to do the formatting. Not sure what you’d expect it to do.#2017-12-0809:28bozhidarI’ve been thinking recently about the usefulness of this, because it’s very annoying that results produced by clojure-mode + CIDER would normally differ from cljfmt. Maybe I’ll just remove this functionality at some point, as I doubt it’s useful to make people. When this was added I hope cljfmt would eventually add support for out metadata format as well.#2017-12-0809:29bozhidar> I thought the cljfmt readme had claimed emacs support for years#2017-12-0809:30bozhidar@gfredericks The README is referring just to this. That you can use this straight from CIDER, nothing more.#2017-12-0809:31bozhidarThe only real advantage over running the external command is that using the API in CIDER is fast, as you don’t have to wait for a process to start every time. This command was intended to used as something you’d use as file save hook for instance.#2017-12-0809:32bozhidarBut yeah, as I said, I think this didn’t turn out to be useful, so the chance of it being removed at this point is pretty big.#2017-12-0917:38dominicm@bozhidar RE: cljfmt. As a vim user, there's little I can do to consume that metadata, so having a fmt in cider-nrepl would be useful still. Furthermore, fireplace just started using it for the vim format command.#2017-12-1000:14bozhidar@dominicm Fair enough. It’s good to know things like these. Often my perspective is shaped primarily by my own usage of certain things.#2017-12-1000:19grzmIs there a roadmap for Cider using the socket repl?#2017-12-1000:20grzmI see that it's a goal, but I'm looking for details as to what would be required to do so, where to get started. The FAQ is (understandably) pretty brief.#2017-12-1000:21grzmhttp://cider.readthedocs.io/en/latest/faq/#will-cider-eventually-support-the-clojure-18-socket-repl#2017-12-1000:50bozhidar@grzm There’s just a plan at this point, as I have almost no time to work on CIDER these days and we really need someone else to tackle this if it’s to happen any time soon. The steps are relatively clear:
* implement some elisp client library for the socket repl
* abstract away the nREPL specifics from CIDER’s main API
* extract from cider-nrepl the core functionality as some standalone library that can be used directly via evaluation (as that’s the approach the socket repl takes for tooling stuff)#2017-12-1000:51bozhidarNone of this is particularly complex, but it’s certainly a lot of work, especially the second point.#2017-12-1000:54bozhidarI can go into more details regarding this if needed. I guess the most simple way to explain things would be the following - we need an equivalent of nrepl-client.el for the socket repl and all commands in CIDER should take the connection type into account (nREPL or socket repl) when they determine what exactly to invoke - some nREPL middleware op or just eval something over the socket repl connection.#2017-12-1001:13grzmthanks for taking the time for typing this out. Would it make sense to start a wiki page or something on this?#2017-12-1008:34dominicm@grzm I think the best way to do this is with unrepl. Classes can be hotloaded, and unrepl injects a structured api on top of socket repl.
The missing part is cider as a client library rather than as nrepl middleware. But I don't think it would be impossible to use without right now anyway.#2017-12-1009:53dominicm@grzm fwiw, I have interest in using cider with unrepl, so would be interested in helping with a cider nrepl standalone client.#2017-12-1009:58bozhidar@dominicm That’s the dream. 🙂#2017-12-1009:58bozhidarObviously after things are decoupled from nREPL adding support for new clients would become significantly easier. Whether the first is the socket repl or unrepl doesn’t make much of a difference.#2017-12-1009:59bozhidar> thanks for taking the time for typing this out. Would it make sense to start a wiki page or something on this?
@grzm I’d start a GitHub issue. 🙂#2017-12-1010:02bozhidar> The missing part is cider as a client library rather than as nrepl middleware. But I don’t think it would be impossible to use without right now anyway.
Yep, eventually there should a be a CIDER library that’s completely independent from any communication protocol. It’d be wrapped by middleware for nREPL, and by whatever’s appropriate by other “adapters”.#2017-12-1010:18dominicm@bozhidar just to be clear, unrepl is quite unlike nrepl in that it's not expected that you will be running any more than a socket repl. Unrepl bootstraps itself into a socket repl, using a "blob" that would be provided by CIDER.el. So if CIDER wants to support socket repl, using unrepl would be a convenient route.#2017-12-1010:44bozhidarYeah, I’m aware of this.#2017-12-1010:49bozhidarI was mostly alluding to the fact that supporting socket REPL connections by itself doesn’t solve the problem of how to leverage them directly. In particular:
* You can just do eval on one socket connection for all “tooling” operations (e.g. completion, var resolution whatever) or two can have two connections (one for user eval, the other for tooling eval)
* How do you do session management - in nREPL this is built-in and you can have many sessions per one connection. Do you even what to do session management for socket repl connections?
* How do you determine the repl’s tooling capabilities? In nREPL you can query the connection for the ops that it supports, what do they return etc. For the socket repl I guess you can check whether certain namespaces are present and eval stuff or we can add some simple abstraction on top of this.#2017-12-1010:50bozhidarNothing particularly complex, but those are decisions that have to be made. 🙂#2017-12-1010:56naomarikhi! I used to be able to connect to my servers with ssh fallback using cider-known-endpoints. I’ve recently completely updated everything and I’m now getting this error for my remote machines Bad local forwarding specification 'nil:localhost:nil'
emacs version 27.0.50
cider version 0.16.0snapshot#2017-12-1013:40bozhidar@naomarik Some backtrace and more details would be useful. 🙂#2017-12-1013:41bozhidarYou might want to check out this http://cider.readthedocs.io/en/latest/troubleshooting/#2017-12-1013:58naomarik@bozhidar apologies i have no experience with elisp, so not too sure what to provide.
I did attempt to evaluate format-spec independently using the commands passed in when I use cider-connect and I get this backtrace
Debugger entered--Lisp error: (void-variable host)
(cons 104 host)
(list (cons 115 ssh) (cons 112 port) (cons 104 host) (cons 117 (if user (format "-l '%s' " user) "")))
(format-spec "%s -v -N -L %p:localhost:%p %u'%h'" (list (cons 115 ssh) (cons 112 port) (cons 104 host) (cons 117 (if user (format "-l '%s' " user) ""))))
nrepl--ssh-tunnel-command("/usr/bin/ssh" "/ssh:#2017-12-1013:58naomarikdidn’t realize it was that big, line wrap was off#2017-12-1013:59naomarikbut it seems to me format-spec is no longer producing the intended string#2017-12-1014:02naomarikremoving the undefined variables, (nrepl--ssh-tunnel-command "/usr/bin/ssh" "/ssh: evaluates to this "/usr/bin/ssh -v -N -L nil:localhost:nil''"#2017-12-1014:03naomarikand so that’s the error i’m getting in the nrepl-tunnel buffer — Bad local forwarding specification 'nil:localhost:nil'#2017-12-1014:06naomarikignore what i said about format-spec… the function (nrepl--ssh-tunnel-command) as it appears on master evaluates to this "/usr/bin/ssh -v -N -L nil:localhost:nil -l 'root' ''"#2017-12-1014:07naomarikso it’s just the port that’s missing#2017-12-1014:10naomariki reckon because of format-spec though 🙂 i’ll open up my other laptop and test what it evaluates to in awhile#2017-12-1014:10naomarikdidn’t update that one#2017-12-1014:55bozhidarit seems right now you evaluated some piece of code with a missing variable in in - Debugger entered--Lisp error: (void-variable host)#2017-12-1015:28New To Clojure"it can’t find namespaces whenever I evaluate some piece of code"#2017-12-1015:35bozhidarUnfortunately that’s all too vague for me to be able to help.#2017-12-1015:39bozhidar@dominicm I’ve noticed that someone recently started a project similar to CIDER in nature, but targeting unrepl - https://github.com/Unrepl/unrepl.el
While I would have loved it if this person worked instead on adding this support to CIDER directly, it seems that now the client library for the socket repl is a solved problem. 😉#2017-12-1015:39dominicm@bozhidar It is indeed 😉#2017-12-1015:40dominicmI'm hoping that it will lay a good groundwork, the following step is entirely to get CIDER into a good shape for use as a library#2017-12-1015:56bozhidarTime will tell. I’m cautiously optimistic about the future of Clojure dev tools. As usual. 🙂#2017-12-1016:04BraviHi everyone. I’m having trouble getting cider to work with cljs app (re-frame template app specifically) to work properly.
I do a fresh lein new re-frame someapp and then I do jack-in-clojurescript. Then, in any cljs file I type (+ 1 2) and hit C-c C-c to evaluate the line. It usually takes about 10 seconds to ‘think’ and then comes back with a time out message.
After a few retries, it works but then as soon as it evaluates, cljs loses ‘connection’ to nREPL it seems. Because next time I try to evaluate something, even though cider buffer is till open, it says that I need to connect to nREPL for it to work..#2017-12-1016:07dominicm@bozhidar understandable. I often find myself nodding along to your ~rants~ talks.#2017-12-1016:08dominicmI personally am interested in using unrepl with cider-nrepl. So I will likely solve that part, even if someone else doesn't.#2017-12-1016:09naomarik@bozhidar i looked up the docs on tramp filename and fixed it by adding a #(port-num) after the domain, so my cider-known-endpoints has an entry that looks like this: ("staging" "#2017-12-1016:37bozhidar@naomarikInteresting. I guess they changed this recently, as this is the first time I hear of this.#2017-12-1016:38bozhidar> I do a fresh lein new re-frame someapp and then I do jack-in-clojurescript. Then, in any cljs file I type (+ 1 2) and hit C-c C-c to evaluate the line. It usually takes about 10 seconds to ‘think’ and then comes back with a time out message.#2017-12-1016:39bozhidar@bravilogy http://cider.readthedocs.io/en/latest/troubleshooting/ take a look here at the part about nREPL message logging and see what happens there.#2017-12-1016:40bozhidar> @bozhidar understandable. I often find myself nodding along to your ~rants~ talks.
😄 That remark made my laugh. I guess I’m a pretty negative person when it comes to this. 😄
> I personally am interested in using unrepl with cider-nrepl. So I will likely solve that part, even if someone else doesn’t. (edited)
Happy to hear this.#2017-12-1016:41bozhidarToday was the first day in a long time I actually sat down to do some CIDER work. ClojureX put me in the right frame of mind for this. 🙂#2017-12-1016:41bozhidarActually I think yesterday was the first day, but anyways - close enough.#2017-12-1016:42dominicm@bozhidar As you're about today, I'm working on the new resources list op, and I'm considering what to call it. I've called it "resources-list2" for now. I see 2 options:
resources-list-XXX where someone has a good idea for XXX
resources-list gains an option flag like more which sends you back a dictionary.#2017-12-1016:42dominicmAlthough, appealing to authority. Halloway has mentioned that sometimes the best name is foo2 😄#2017-12-1016:44dominicm@bozhidar I appreciate having you around more today 🙂 It would be nice to see you more often!#2017-12-1016:56kommenhi all! I’m looking into a gofmt in go-mode and refmt in reason-mode like cider-format experience. go-mode suggests to reformat the buffer in the on-before-save hook. the problem I have with cider-format-buffer is that the point position is lost after reformatting, which make it not really fitting to use in that hook, which is kinda annoying. wondering how gofmt solved this, was a bit surprising but also interesting: they make a diff between the orig and the reformatted buffer, then apply the diff line by line, making emacs not loose the cursor position: https://github.com/dominikh/go-mode.el/blob/7eb5b3dd0ac31d176e9d56da4172f66aef8fae47/go-mode.el#L1064#2017-12-1016:57kommenany thoughts on this? is this the way to go to make cider-format-buffer not lose the point position?#2017-12-1017:41bozhidar@kommen Just file a ticket and I’ll fixed this. All it needs is one save-excursion call to the current command which anyone can basically add.#2017-12-1017:42bozhidar@dominicm Why not simply replace the existing op? I doubt anyone would complain if they got something better. 🙂#2017-12-1017:42bozhidar> @bozhidar I appreciate having you around more today 🙂 It would be nice to see you more often!#2017-12-1017:43bozhidarThat’s a lot of fun! 🙂 Hopefully it will happen a bit more often down the road.#2017-12-1017:43dominicm@bozhidar then I will break cider.el#2017-12-1017:43kommen@bozhidar ok, will file an issue. I tried wrapping cider-format-buffer in a save-excursion though and had no luck though#2017-12-1017:44kommen@bozhidar thanks for all your work, really appreciate it!#2017-12-1017:44bozhidar@dominicm Don’t worry about this. I can update the Emacs side. 🙂#2017-12-1017:47dominicm@bozhidar are there any other nrepl clients to be aware of? I just scanned fireplace & saw no use of this particular op (it looks like fireplace scans based on the path returned from the classpath op, ew)#2017-12-1017:50bozhidarNot to my knowledge. It’s definitely not some fundamental feature, so I’m fine with breaking it. There’s a reason why I’m avoiding that magic version 1.0. 😉#2017-12-1017:53dominicmOkay, great. Hopefully this will let you reduce the resource list down to a single op as well.#2017-12-1017:55richiardiandreaUnrepl is cool, still a long road ahead for it to be adopted though. For example it is Clojure only for now. Including unrepl.el in cider would also mean change the way the middleware add-ons + nRepl protocol, adopting the new unrepl protocol...for sure doable, which is a good thing...#2017-12-1018:04dominicm@bozhidar I have a PR coming your way this evening I'm afraid.#2017-12-1018:05bozhidarhaha#2017-12-1018:05bozhidarIt’s a good thing I’m going to a bar with some friends then. 😄#2017-12-1018:06dominicmThe alcohol will certainly help#2017-12-1022:08dominicm@bozhidar I've left a steaming pile of PR on your doorstep. Enjoy 😄 I think things are nominally better after the changes than they were before.#2017-12-1022:24grzmhttps://github.com/clojure-emacs/cider-nrepl/pull/459 ?#2017-12-1022:31grzmthanks for improving the class path splitting, by the way. I picked that up from code in refactor-nrepl without looking up the appropriate way to do it.#2017-12-1022:40dominicm@grzm that's okay. It was mostly the test that was broken, it was expecting two items in the path, but only adding one.#2017-12-1022:44dominicmI only realised the path separator is defined somewhere when I started reading the documentation.#2017-12-1022:48grzmYeah, though whenever I put a literal somewhere like that I tend to think it's a code smell.#2017-12-1022:49grzmEven if it's not defined somewhere in Java, it should be defined in the project.#2017-12-1023:07dominicmApparently it's actually platform dependent!#2017-12-1023:31grzmRight. And it's nice that Java does the feature detection for us 🙂#2017-12-1023:58dominicm@grzm btw, thanks to your patch, I was able to implement automatic ns insertion for my own plugin! I would have given up without your path I'm sure.
We primarily use boot, so lacking boot support is a problem for me.#2017-12-1100:00grzmI'm beginning to think I have a lower tolerance than many when it comes to infelicities in tooling. I'm definitely frustrated by the balkanization we currently have. Not enough stuff is written to be easily applied in different environments. That's one of the reasons I'm kinda interested in getting Cider to support the socket repl.#2017-12-1100:01grzmAnd what motivated that tiny patch.#2017-12-1100:02grzmActually, I'm sure that's not true.#2017-12-1100:03grzmI just haven't yet learned enough to be able to fix all of the things I'm frustrated with 🙂 All of those who work on tooling are obviously looking to improve things, and have the skills to actually do so.#2017-12-1100:04grzmI am not a special snowflake.#2017-12-1100:05grzmI want to mix and match all the things.#2017-12-1100:09dominicm@grzm communicating is hard. Isolated experiments allow rapid growth within that glass house.
I'm also very keen to see an improvement to tooling! I have a low tolerance for broken things, and the pedant in me loves fixing those things.
We should definitely collaborate on pushing forward CIDER :)#2017-12-1100:10grzmI'll probably continue tinkering. There are only so many round tuits. Gotta figure out where to use mine, or get more.#2017-12-1115:25bozhidar@graham I’m also here to help with whatever questions you might have.#2017-12-1115:26bozhidarI don’t always have time for doing the coding myself, but I usually find time to help people with PRs and ideas.#2017-12-1115:26bozhidar> I’m beginning to think I have a lower tolerance than many when it comes to infelicities in tooling. I’m definitely frustrated by the balkanization we currently have. Not enough stuff is written to be easily applied in different environments. That’s one of the reasons I’m kinda interested in getting Cider to support the socket repl.#2017-12-1115:26bozhidarI completely agree with this sentiment! And funny enough, I leave in the very heart of the Balkans! 😄#2017-12-1115:26bozhidarIt always amuses that our peninsula is usually referred in such a context.#2017-12-1115:40daveliepmann@bozhidar As long as we have you here, can I bug you to share some insight on CIDER innards that are causing me trouble? The output of (cider-scale-background-color) returns color codes like "#22e322e322e3". Is this expected? (I'm on 0.15-London)#2017-12-1115:42daveliepmannat https://github.com/clojure-emacs/cider/blob/master/cider-stacktrace.el#L170#2017-12-1116:38dpsuttonthere are imbalanced parens in CIDER right now. it does not successfully read at the moment#2017-12-1116:38dpsuttonPR submitted#2017-12-1121:32bozhidar@dpsutton Thanks!#2017-12-1121:33bozhidar@daveliepmann What’s wrong with this? Is it not a valid color code? (I don’t remember color codes of the top of my head 🙂 )#2017-12-1121:46grzm@bozhidar They're either 3 or 6 hex digits in length#2017-12-1123:26bozhidarWell, that’s certainly a bug then. 🙂#2017-12-1123:26bozhidarI’m reasonably sure it had to be 6 digits.#2017-12-1209:01daveliepmann12-digit color codes exist. I'm just not sure that they work in emacs, or whether they're meant to be output from cider-scale-background-color. I know that 12-digit colors (from that fn) break cider-stacktrace-frames-background-color on my system (`version` GNU Emacs 25.3.1 (x86_64-apple-darwin17.2.0, Carbon Version 158 AppKit 1561.1) of 2017-11-27; cider-version CIDER 0.15.1 (London)).#2017-12-1209:02daveliepmannSpecific breakage described in this issue: https://github.com/jackrusher/dotemacs/issues/33 (which is also the repo with my theme "eigengrau", but I am 99% sure my theme has nothing to do with it.)#2017-12-1209:04daveliepmannCorrection: I think the bug is in cider-scale-color, not scale-background-color.#2017-12-1123:30dpsuttonseems to be an issue with the new macros still#2017-12-1123:31dpsuttonhttps://travis-ci.org/clojure-emacs/cider/jobs/314874715#L1407-L1416#2017-12-1123:31dpsuttoni'm ont sure but i'm thinking it's the new when-let* and autoloads not playing nice together. but i don't have any reason why tat would be the case#2017-12-1123:43michal.stolarczykHi folks. Got a question. I’ve got a case that a function which when I’m evaling it, gives me java.lang.Long cannot be cast to clojure.lang.IFn, but if I’ll step through and debug, it finishes successfully. Would you have any tips how I can trace finding what’s the problem here?#2017-12-1123:44michal.stolarczykAlso, not sure if that’s the right channel to ask that type of a question.#2017-12-1123:45dpsuttoncan you paste the function here?#2017-12-1123:45michal.stolarczykIt’s a bit nasty as I’ve been playing with advent of code, give me a sec, I’ll create a gist with it.#2017-12-1123:47michal.stolarczykhttps://gist.github.com/zeroDivisible/bf75d84b8ad73e00215e3a2ade4a11ab - the one at the very bottom is the invocation which fails for me when running, but works when debugging. Not sure if worth mentioning but I’m playing with latest Spacemacs, Cider & Clojure 1.9#2017-12-1123:57dpsuttonit's because of laziness i think. your for loop creates a lazy list. it doesn't "do" anything. and no one ever realizes that list#2017-12-1200:04michal.stolarczykHmmm.. you may be right, this sounds totally plausible. Going to dig into the code again.#2017-12-1202:21jfntnAnyone knows how to customize the stacktrace face in the test report? For some reasone describe-face shows default, I also tried customizing cider-stacktrace-filter-active-face and cider-stacktrace-filter-inactive-face and somehow the exception is still underlined#2017-12-1202:35jfntnOh got it, this thing is actually a button#2017-12-1216:28solfHas anyone manage to have a syntax highlighted buffer when using cider-grimoire?#2017-12-1216:30solfCalling markdown-mode on the buffer helps, although the clojure blocks aren't highlited#2017-12-1216:30arrdemWe played with markdown font locking it for a bit.#2017-12-1216:31arrdemTrouble is that Clojure and consequently Grimoires docstrings are super inconsistently formatted.#2017-12-1216:31arrdemSo the font locking actually made some things worse.#2017-12-1216:31solfOh#2017-12-1216:32arrdemNow that I'm working in Clojure again full time I've kinda dusted off the project again and that may change, but that's why cider doesn't do so by default.#2017-12-1216:33arrdemHOWEVER, for the top probably 80% of vars, I've written markdown docs. Try hacking your emacs config and let us know if it's good or not.#2017-12-1216:34solfAh you mean that when I call cider-grimoire and it returns a markdown text, it's not from grimoire?#2017-12-1216:35arrdemNo it is text from the Grimoire http API, I'm just saying that markdown font locking will probably be good enough to be worth trying.#2017-12-1216:35solfAh nevermind, you're the guy who made grimoire.#2017-12-1216:36solfyes I understood that now 🙂#2017-12-1216:37arrdemI keep Grimoire as a highlight word in this slack. I have my pride 😝#2017-12-1216:39solfThanks for that 🙂 I actually though that all of grimoire was written in markdown, since every time I used it I got markdown back#2017-12-1216:42arrdemIt is indeed overwhelmingly markdown and likely to get moreso, but there are plenty of gaps left. See https://www.conj.io/worklist for an incomplete list of things without makdown notes or examples.#2017-12-1222:30bozhidar@dromar56 Are you on 0.16? We’re using there markdown-mode to get some limited font-locking.#2017-12-1302:42richiardiandreaIs there any ggtags package for clojure? if not, where should I contribute it? I have noticed that clojure tags are generating correctly with the right .globalrc, but not queried correctly using ggtags-mode#2017-12-1302:44richiardiandreain particular for things like namespace/symbol, I need to specify a file on top of the global command#2017-12-1313:42daveliepmann@arrdem Is there currently any way from emacs to pull in all of grimoire and refer to it as static files, rather than making one-off HTTP requests? I'm super excited to use cider-grimoire (it scratches an itch I've had for a couple months) but I'd rather update the docs once every six months rather than insert a 1 to 2 second network delay into my lookup workflow.#2017-12-1317:34gonewest818It seems feasible to change cider-grimoire such that it caches the retrieved data, and uses a configurable time-to-live to decide when to go get the remote URL again.#2017-12-1317:34gonewest818Toy example of that strategy: https://github.com/gonewest818/adafruit-wisdom.el/blob/master/adafruit-wisdom.el#L43-L56#2017-12-1317:36gonewest818The obvious downside would be, if you visited a particular topic in grimoire less often than the configured TTL, then basically the caching wouldn’t help.#2017-12-1317:52richiardiandrea@bozhidar does cider include any jump-to-symbol functionality? If not, where does that live? I am trying to use ggtags-mode in Clojure#2017-12-1318:51richiardiandreaa further question on top of this is whether there should be a separate gtags hook for static info rather then dynamically fetching stuff from the REPL, I was actually able to generate tags with global -u and universal-ctags.#2017-12-1318:10New To Clojure@richiardiandrea See cider-find-var in cider-client.el#2017-12-1318:11richiardiandreathanks! however I don't use cider, so I wonder whether this functionality should go instead in clojure-mode?#2017-12-1318:39arrdem@daveliepmann So Grimoire the website is a thin wrapper around lib-grimoire which provides a consistent API between making requests to Grimoire the service and to the filesystem store that Grimoire the service uses under the hood. I’ve thought in the past about how to distribute a zipfile or some other archive containing a snapshot of Grimoire (early versions of Grimoire which were all static HTML were available this way) but right now there’s no blessed local or cached client. I just never got around to building one.#2017-12-1409:30daveliepmannI extremely don't have time to do this work right now, but a standalone grimoire-mode based on such an archive would be awesome. I might be able to hack on it after the holidays, though. That would require moving forward with some kind of static files. What do you think the best format would be for distribution? My naive assumption would be that the easiest would be git clone but I wonder what other options you see.#2017-12-1418:58arrdemYeah there’s been some ideas back and forth on stuff like this before. Grimoire actually has a script in the main repo that clones down the data repos, builds the data directory structure and sets everything up for lib-grimoire. It shouldn’t be that hard to adapt the same toolset to maintaining a local copy in ~/.grim or wherever. Maybe once I get some headway on the current improving doc writing projects.#2017-12-1318:40arrdemIt’s definitely doable, just a couple separate git repos you could keep cloned into ~/.grim or somewhere.#2017-12-1319:10bozhidar@richiardiandrea It’s not possible. This relies on var metadata. It can easily be added to inf-clojure, though.#2017-12-1319:14bozhidar(meta #'map)
{:arglists ([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]), :doc "Returns a lazy sequence consisting of the result of applying f to\n the set of first items of each coll, followed by applying f to the\n set of second items in each coll, until any one of the colls is\n exhausted. Any remaining items in other colls are ignored. Function\n f should accept number-of-colls arguments. Returns a transducer when\n no collection is provided.", :added "1.0", :static true, :line 2618, :column 1, :file "clojure/core.clj", :name map, :ns #namespace[clojure.core]}#2017-12-1319:14bozhidarYou just need to :column, :line and :file from the meta.#2017-12-1319:18bozhidar@gonewest818 I like the idea of caching for grimoire. If that’s combined with the ability to fetch all entries for a certain namespace I think it’d would solve much of the aforementioned problem. It would also be nice if this was moved to a middleware and started using lib-grimoire as that would simplify the code and make it accessible to other editors - e.g. @dominicm’s beloved vim. 🙂#2017-12-1319:20dominicmI have been thinking about moving grimoire into the nrepl, I've been working on an improved doc. I wanted runnable examples and stuff.#2017-12-1319:21dominicmSo I would appreciate this work#2017-12-1319:21arrdemIt’s doable. I test Grimoire using lib-grimoire loaded into a REPL. Been sketching at more structured examples / REPL sessions notation recently. https://github.com/arrdem/stacks#2017-12-1319:22arrdemJust takes dev time I’m not able to commit to.#2017-12-1319:24arrdemPart of the problem is that as-is markdown-clj doesn’t give you a data based intermediate representation and I just haven’t gone and fixed that yet.#2017-12-1319:27bozhidar> I’ve been working on an improved doc. I wanted runnable examples and stuff.#2017-12-1319:27bozhidar@dominicm That sounds interesting!#2017-12-1319:30richiardiandrea@bozhidar shouldn't that go to clojure-mode? Also, meta is a runtime thing#2017-12-1319:30richiardiandreatags are built statically#2017-12-1319:31bozhidarThat’s why it can’t go to clojure-mode - it relies on a having a REPL.#2017-12-1319:32richiardiandreaOk let me ask this, would you be open to a patch to clojure-mode that hooks up ggtags?#2017-12-1319:32bozhidarBuilding tags is a step most people dislike having to deal with, that’s why I’m not particularly interested in trying to do something about this in clojure-mode - you always need to build some command to run this, you need to install something.#2017-12-1319:39richiardiandreaI am using projectile and everything works pretty well, but I see the point and felt the pain when installing all these tagging tools#2017-12-1319:33bozhidarIf you come up with something I might consider it, but overall, I think getting this info at runtime is a pretty decent approach.#2017-12-1319:33richiardiandrea@bozhidar ok I will put in a separate package for now..#2017-12-1319:35New To Clojurecljr-rename-symbol fails to rename anagrams-for in https://github.com/developer2019/example/blob/master/src/anagram.clj
I just position cursor at anagrams-for and press M-x cljr-rename-symbol RET.
It tells that project needs to be evaluated, I type y RET, and then if fails with Wrong type argument: char-or-string-p, nil.
Is this a bug?
lein test compiles this code and runs successfully.
clj-refactor.el version: 2.3.1#2017-12-1319:35arrdemYeah I think cljr is currently busted.#2017-12-1320:36dpsuttonIt's never worked consistently for me. There are some clojure mode refactoring I need to learn more#2017-12-1320:46New To ClojureIt seems that nobody needs Clojure refactoring. Otherwise somebody would have done it already.#2017-12-1320:50dpsuttonClojure-mode and cljr refactor both provide it. I've had some success with the cljr refactor in the past. I think both are great and refactoring tools are great#2017-12-1321:11arrdemcljr is great, and the best implementation thereof I’m aware of outside of cursive.#2017-12-1321:11arrdemNot sure why it’s currently broken tho.#2017-12-1407:26bozhidarIf someone’s interested - for a while we’ve a had a similar issue for CIDER (https://github.com/clojure-emacs/cider/issues/1840)#2017-12-1407:27bozhidarBasically the gist of it is that someone needs to extract the old SLIME approach of doing xref from here (https://github.com/technomancy/swank-clojure/blob/master/src/swank/commands/xref.clj), convert it to middleware and we can also use this for replacing occurrences.#2017-12-1407:27bozhidarI think that this approach that doesn’t rely on actually parsing all namespaces in advance is relatively simple and would yield decent results.#2017-12-1408:27dominicmWhy does refactor do it differently?#2017-12-1410:31benedek@arrdem @ghsgd2 not aware of cljr being broken. have you tried newest snapshot tho? also a github issue with detailed info would be appreciated if you have a genuine breakage#2017-12-1410:35benedekessentially cljr went down the path of working with ASTs. cljrs find usages is basically an ast based search#2017-12-1410:36benedekcc @dominicm #2017-12-1410:36New To ClojureIs it enough to load into Emacs
https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el
https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor-compat.el
to have latest snapshot?#2017-12-1410:42New To Clojure@benedek
Latest snapshot doesn't seem to work.
Successfully evaluated clj-refactor-compat.el buffer.
Doing the same for clj-refactor.el which provides clj-refactor and it fails:
Can't find library clj-refactor
#2017-12-1411:56benedeknope. if you use packages you need to pull the latest version of cljr via package-list-packages etc#2017-12-1412:17dominicm@benedek but not particularly because the other xref system doesn't particularly work very well?#2017-12-1412:20benedektbh I've never used slime#2017-12-1413:49daveliepmannHey folks, I'm trying to understand cider-grimoire behavior, specifically in the context of this tweet from Bozhidar https://twitter.com/bbatsov/status/941281929390907392 which says that grimoire doc lookups in CIDER use the REPL to resolve symbols. As far as I can tell, a cider-grimoire lookup goes to cider-prompt-for-symbol-function, then cider-try-symbol-at-point, then cider-symbol-at-point, which wraps thing-at-point. Which of these relies on a running REPL?#2017-12-1413:57volrathso, from what I understand, the main concern is that in general you want to get the fully qualified name of a symbol in order to do a proper lookup in grimoir#2017-12-1413:57daveliepmannright#2017-12-1413:58volraththe thing is that thing-at-point may not give it to you, so you need to go to a running repl to get the fully qualified name#2017-12-1413:58volrathnow, this is the part that the IDE should handle#2017-12-1413:59volrathif you establish that your library expects only fully qualified names, it can be used by any IDE to run these types of searches#2017-12-1413:59volrathbut I'm not entirely sure on what you have in mind#2017-12-1414:00daveliepmannd'oh, I think I see it now—it's in cider-grimoire-lookup#2017-12-1414:01volrathyeah... this bit#2017-12-1414:01volrath(name (nrepl-dict-get var-info "name"))
(ns (nrepl-dict-get var-info "ns" "clojure.core"))
#2017-12-1414:01daveliepmanngenau#2017-12-1414:02volrathso what I would do, to achieve modularity, is to forget about that part completely#2017-12-1414:02daveliepmannand try to assume a namespace?#2017-12-1414:02volrathso that your library would expect fully qualified names#2017-12-1414:03volrathhmmm yeah, that's the part i wasn't sure.. you want a stand alone package or more like a library?#2017-12-1414:04volrathbecause you could just let something else (cider or unrepl or any other repl-connected thing) to figure out the fully qualified name, and leave your library to be in charge of looking that up#2017-12-1414:04volrathwithout worrying on how to resolve a symbol#2017-12-1414:04volrathi mean, symbol resolution is a different task#2017-12-1414:05daveliepmannwell, before I saw this part I was hoping to be a standalone package, so that it would be possible to run without either unrepl or CIDER#2017-12-1414:05daveliepmannbut I see the difficulty with that now#2017-12-1414:05volrathyou can still provide a prompt, so that the user would insert the resolved symbol there#2017-12-1414:05volrathsymbol resolution can be done by the user#2017-12-1414:06daveliepmannthat's just as bad as an HTTP delay, really#2017-12-1414:06volraththe other thing is: I don't know grimoir's api, I don't know if you can search with a non qualified symbol and get a list of possible options#2017-12-1414:08volrathwould it be possible with their api to get a list of options given a query string?#2017-12-1414:09volrathif so, you could try completing-read#2017-12-1414:09daveliepmannfrom https://www.conj.io/heatmap it looks like I could just assume clojure.core and 90% of use cases would be solved#2017-12-1414:14daveliepmannand that should fail fast, so then look down the list at alternate namespaces. If it exists in, say, both clojure.core and clojure.edn or something, then let them choose#2017-12-1414:15daveliepmannbut I don't expect that to be a common issue#2017-12-1414:16volrathso, your idea is to download all grimoire as .md files and search based on their file names, right?#2017-12-1414:16daveliepmannroughly yes#2017-12-1414:17volraththen maybe it shouldn't be that hard that given a name, if you don't find a straight match, you can list all close options#2017-12-1414:18volraththis is a big maybe, I don't know how would be your local .grimoire/ structure#2017-12-1414:18daveliepmannme neither. it's still an open question to arrdem (in a thread a page or so up)#2017-12-1414:18daveliepmannbut I agree#2017-12-1414:20volrath👍#2017-12-1414:22daveliepmannthanks#2017-12-1414:32bozhidar@volrath is right, that’s the main concern.#2017-12-1414:32bozhidarAs I mentioned on twitter you can always try to do some guesswork about the thing at point or just simply adopt an interface where you have to enter something manually and you’d get the possible candidates in ambiguous cases.#2017-12-1414:33bozhidarWith CIDER and unrepl.el we have luxury to avoid this and I think it’s preferable as it leads to better UX.#2017-12-1414:35bozhidar> from https://www.conj.io/heatmap it looks like I could just assume clojure.core and 90% of use cases would be solved#2017-12-1414:35bozhidarWell, that’s one approach, but it’s going to be pretty annoying for the cases when that’s not right. 🙂#2017-12-1414:36bozhidarAnd, of course, you can write your package in a way it relies on a repl-connection when present, and does something else without it. 🙂#2017-12-1414:44daveliepmannWouldn't it make sense to keep the existence of a REPL outside the concerns of grimoire? "If full namespace provided do X; if given an unqualified var name then do Y" is still possible in that architecture. I think Grimoire doesn't need to know if a REPL exists or not, it just needs to know if the symbol's fully qualified name is known or not.#2017-12-1414:46daveliepmannI agree it will be interesting to see how often "assume ns is clojure.core, if that fails then try the other Grimoire-covered namespaces (in some order?); if the symbol exists in multiple namespaces covered by Grimoire then offer the choice" is annoying.#2017-12-1414:47daveliepmannI'm not familiar with how much disambiguation will be necessary within the domain that Grimoire covers.#2017-12-1415:18bozhidar> if the symbol exists in multiple namespaces covered by Grimoire then offer the choice” is annoying.#2017-12-1415:18bozhidarIt’s also annoying to be looking for clojure.string/reverse and get the core one 😉#2017-12-1415:19bozhidarProbably the overlap is not big, but there’s some for sure.#2017-12-1415:21bozhidarAnother option would be to adopt an interface similar to this one - https://github.com/clojure-emacs/clojure-cheatsheet#2017-12-1415:23daveliepmannclojure.core/reverse versus clojure.string/reverse is a good example, thanks. That would be a good reason to want a REPL to differentiate, but in cases where one doesn't it wouldn't be terrible to default to making the user choose (like CIDER often does with Java classes)#2017-12-1415:24bozhidarTrue.#2017-12-1419:17arrdemGrimoire actually has an undocumented search endpoint which does pretty much what you’re suggesting here - it tries to figure out “which one” you meant based on using its heatmap score to infer the most likely match.#2017-12-1420:15New To Clojure@benedek
>not aware of cljr being broken. have you tried newest snapshot tho?
It's the same on latest snapshot.
>also a github issue with detailed info would be appreciated if you have a genuine breakage
Could you please clarify what do you mean by "genuine"? And how to determine whether the breakage is "genuine"?
Nevertheless I've reported the breakage: https://github.com/clojure-emacs/clj-refactor.el/issues/401
Hope it will be accepted and fixed eventually.#2017-12-1420:39benedekthanks for issue @ghsgd2 i am having a look#2017-12-1420:40benedekby genuine i just meant that without a detailed bug report i have little hope of deciding if there is a problem with your environment/configuration or if there is a real bug/breakage in cljr#2017-12-1420:40benedeksorry if it was a misleading/confusing phrase#2017-12-1420:41benedeki was kinda in a rush.. 🙂#2017-12-1420:41New To Clojure@benedek no worries 🙂#2017-12-1421:37benedeksee my answer and workarounds on the issue. also ta for the bug report#2017-12-1422:53New To Clojure@benedek Thank you! I tried to refresh from CIDER repl as suggested:
user> refresh
CompilerException java.lang.RuntimeException: Unable to resolve symbol: refresh in this context, compiling:(*cider-repl example*:1:7527)
user> (clojure.repl/refresh)
CompilerException java.lang.RuntimeException: No such var: clojure.repl/refresh, compiling:(*cider-repl example*:49:7)
Going to use (setq cljr-warn-on-eval nil) in the meantime because I need to rename symbols in all project files, not just in one of them.#2017-12-1508:47bozhidar> Why does refactor do it differently?#2017-12-1508:48bozhidar@dominicm It’s basically part of the overall approach of cljr - most of the functionality there depends on parsing the entire project code on operating on the resulting AST. swank-clojure and CIDER generally rely on just analyzing the state of the running application.#2017-12-1508:49bozhidarMeaning we never build an AST and just inspect whatever we can from interactions with the nREPL server. For find and replace the problem with this approach is that obviously this works only for loaded namespaces, but you can easily load all namespaces if you want to do this.#2017-12-1508:50bozhidarBuilding the AST up front is pretty slow for big projects and you obviously have to keep rebuilding it all the time.#2017-12-1508:51bozhidarThe old SLIME approach worked pretty well even though it was pretty primitive. I was just about to port (and enhance it a bit), when my CIDER time dropped to close to 0.#2017-12-1508:51dominicmI've taken two weeks off work. I'm mostly playing VR, but I might have a go at seeing how that works out.#2017-12-1508:57bozhidarI haven’t played anything in while, so I’m not sure what’s VR is. 😄 I doubt it’s Virtual Reality. 🙂#2017-12-1509:03dominicmIt's virtual reality#2017-12-1509:03dominicmIt's amazing#2017-12-1509:04dominicmThe horror of being stabbed.
The isolation of being in the cinema.
The immersion.
The looking around.
It's all amazing.#2017-12-1513:15bozhidar🙂#2017-12-1508:58benedek@ghsgd2 should have been more specific#2017-12-1508:59benedektype , in your cider repl#2017-12-1508:59benedekyou get a list of commands to choose from#2017-12-1508:59benedekpick refresh#2017-12-1509:01New To Clojure@benedek
1. Caused by clojure.lang.Compiler$CompilerException
#2017-12-1509:19benedekseems to be a compilation error#2017-12-1509:53benedekanagram_test line 7 col 10#2017-12-1510:58New To Clojure@benedek Thank you! Yeah, this time it was a compilation error (I've done a refactoring and then undo'ed it but undo reverted to previous state only one of files). Sorry for that.#2017-12-1511:59benedeknw#2017-12-1608:25theeternalpulsecider connect doesn't seem to detect the repl I created in a tmuxsession#2017-12-1608:25theeternalpulseI can manually add it by the port but it doesn't just show up, just an old stale connection that doesn't work#2017-12-1614:31bozhidar@theeternalpulse I’m not sure I understand you. Does connecting to this succeed or not? I’m not sure how tmux can affect connecting to an nREPL server.#2017-12-1623:22arohnerIs there configuration for always setting *print-level*, *print-length* when I jack into a repl? I try to do it in user.clj, but they aren’t bound until I repl in#2017-12-1716:33bozhidar@arohner You can take a look here http://cider.readthedocs.io/en/latest/using_the_repl/#2017-12-1716:33bozhidar(search for *print-level*)#2017-12-1716:35bozhidarWe can always do something similar to what we’re doing for pretty-printing and just wrap CIDER evaluations into something configurable via CIDER itself, but we haven’t gotten to doing this. (see https://github.com/clojure-emacs/cider/blob/f42b26202fb8ae2df32f31e8a6ac93e697c48ae6/doc/configuration.md#pretty-printing to get an idea about what I’m talking)#2017-12-1800:39gonewest818I use :repl-options :init in my ~/.lein/profiles.clj like so:#2017-12-1800:40gonewest818{:user
{:repl-options
{:init (do (set! *print-length* 500)
(set! *print-level* 10))}}}
#2017-12-1801:11Drew VerleeWhen i run cider-jack-in from spacemacs, its seems to be reading a different file then my .lein/profiles.clj. Any idea how i can figure out what the location of the file is?#2017-12-1801:11dpsuttoncider doesn't read that file at all. lein should read that file#2017-12-1801:11dpsuttonwhat makes you think that the wrong one is being read?#2017-12-1801:12dpsuttonie, what symptoms are you seeing#2017-12-1801:12dpsuttonand does it read the correct one if you just run lein repl?#2017-12-1801:14Drew Verleehmm. What i’m seeing is when i run cider-jack-in. There is a some string output at the bottom of the screen that has what looks like information from a profiles.clj. Only it doesn’t have the same versions as are in my ~/.lein/profiles.clj. I haven’t had to look into this before so i have been happy ignorant.#2017-12-1801:14dpsuttoncan you post the string? that's not sounding familiar#2017-12-1801:15dpsuttonand if you run lein deps :tree does it output the correct versions?#2017-12-1801:18dpsuttonit should be in the *Messages* buffer. what is the wrong version?#2017-12-1801:22Drew VerleeThis version in my ~/.lein/profiles.clj is [cider/cider-nrepl “0.16.0-SNAPSHOT”]. That one is 0.15.
Whats troubling me is more that i can’t jack-in at all. When I try, i’m meet with a long wait an exception about like this:
java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context
I poked around and this problem seems to be resolved on later versions or cider.#2017-12-1801:23dpsuttonif you are using cider-jack-in, it manages its own dependencies so you don't need to specify one. have you updated cider in emacs? it always brings in the version of cider-nrepl that matches itself#2017-12-1801:23dpsuttonand these should basically always go in lockstep#2017-12-1801:36Drew Verleei’m on Cider 0.15snapshot and emacs 24.5 on spacemacs release 0.200.9 . Not sure thats relevant.
I don’t recall manually messing with cider. I’m only having this issue on my mac, my desktop works fine. I recall trying to do a clean install of spacemacs, which i assume includes Cider and it not resolving the issue (repl not connecting, the above error message). To make things more confusing (to me) the error only appears in certain clojure projects.#2017-12-1801:36Drew Verleeim going to figure out how to get the message buffer, as that might help.#2017-12-1801:36dpsuttoni'm still not following. why are you specifying a cider-nrepl version at all#2017-12-1801:37Drew Verleein my profiles.clj?#2017-12-1801:37dpsuttonyes#2017-12-1801:38Drew VerleeBecause i mis-read these instructions http://spacemacs.org/layers/+lang/clojure/README.html#2017-12-1801:38dpsuttonno problem#2017-12-1801:38dpsuttonand it looks like this works in clojure 1.8 and not clojure 1.9#2017-12-1801:38dpsuttonit was an abuse of the reader in 1.8 that no longer worked in 1.9#2017-12-1801:38dpsuttonyou should be able to upgrade cider and it will work#2017-12-1801:40dpsuttonas far as I'm aware, you don't need to specify either cider-nrepl or refactor-nrepl anywhere. cider will take care of them#2017-12-1801:40dpsuttonim sorry you're running into these issues 🙂#2017-12-1801:41dpsuttonif you are using cider-jack-in. if you are using cider-connect, then it is just connecting to an existing repl and you have to make sure the middle ware are there yourself. does that make sense?#2017-12-1801:42dpsuttonrecent versions should be 0.16-snapshot which will get the cider-nrepl version automatically#2017-12-1801:43dpsuttonhere's a ticket about what I think is happening to you
https://github.com/clojure-emacs/cider/issues/2081#2017-12-1801:43Drew VerleeYes. Though i need a better mental model for the REPL at some point. In your past message you said that if i upgrade cider then it should correct the problem (a symtom of which is the NullPointer Exception).#2017-12-1801:43dpsuttonright#2017-12-1801:43dpsuttonso here's how it works#2017-12-1801:43dpsuttonwhen you say cider-jack-in, cider will crank up lein and make sure the right nrepl middlleware are present#2017-12-1801:43dpsuttonand it just dictates a version of cider-nrepl that matches itself#2017-12-1801:44dpsuttonso if you have cider 0.15, it asks for cider-nrepl 0.15#2017-12-1801:44dpsuttonand 0.15 nrepl has a bug in it so if you get a newer cider it will ask for a newer cider nrepl#2017-12-1801:45dpsuttonsorry it's so confusing but it's trying to "do what you need"#2017-12-1801:54dpsuttonAnd the symptom you are seeing is it not knowing what a function is (wrap-test) because that code has invalid syntax in clojure 1.9#2017-12-1801:56Drew VerleeI updated everything and i’m connected. 🙂#2017-12-1801:56dpsuttonAwesome! Glad it worked and sorry it was a pain#2017-12-1801:58Drew VerleeWell, i’m fairly sure i got myself into that mix. There was an issue with my emacs config so it wasn’t updating. Actually, what confused me the most was that when i went to update emacs i thought it was saying i was already on the latest version.#2017-12-1817:58New To ClojureIs there a way to have different highlighting of function and macros names?#2017-12-1818:43dpsuttonbased on `cider-mode.el line 597:
,@(when macros
`((,(concat (rx (or "(" "#'")) ; Can't take the value of macros.
"\\(" (regexp-opt macros 'symbols) "\\)")
1 (cider--unless-local-match font-lock-keyword-face))))
,@(when functions
`((,(regexp-opt functions 'symbols) 0
(cider--unless-local-match font-lock-function-name-face))))
#2017-12-1818:44dpsuttonit looks like macros get font-lock-keyword-face and functions get font-lock-variable-name-face. so there are two different ones for them#2017-12-1818:47dpsuttonin the theme i'm using, brin, these are defined and can be adjusted#2017-12-1818:47dpsutton@ghsgd2#2017-12-1818:50dpsuttonand these can be modified in the source they are defined in or in M-x customize-group faces, custom faces#2017-12-1818:52dpsuttonthat's really confusing looking elisp in the cider font lock compile function#2017-12-1818:59New To ClojureThank you, @dpsutton!#2017-12-1818:59dpsuttonof course!#2017-12-1819:00dpsuttonfeel free to look at that source to see what other faces are used#2017-12-1819:00dpsuttoncider--compile-font-lock-keywords and emacs should let you jump there with C-h C-f#2017-12-1904:58dpsuttonbig big appreciation for the simple change in the repl to quickly include the repl utilities. Hitting , in the repl brings up that handy menu and require-repl-utils is outstanding!#2017-12-1904:58dpsuttonbig ups for such a small simple change#2017-12-1912:48jmayaalvdidnt’ know about this! cool!!!#2017-12-1915:22Drew VerleeSomeone should do a quick and dirty Cider Emacs/spacemacs video on how they develop with clojure. I’m always worried im missing helpful features because i dont know what i dont have 🙂 Of course, there are probably 10 of them out there i haven’t watched…#2017-12-1918:24daveliepmannIt's not a screencast, but several folks are doing precisely that (for CIDER as well as other tools) over on ClojureVerse: https://clojureverse.org/t/share-the-nitty-gritty-details-of-your-clojure-workflow/1208 Lots to learn! 😄#2017-12-2111:20jumarI have a few of them: https://www.youtube.com/channel/UCD_9SmDPrAe-sZAfSB9tjdg
Mostly this one: https://www.youtube.com/watch?v=4ecC3jqHooc#2017-12-1916:10benedek@drewverlee @magnars zombie themed game development is exactly that http://www.parens-of-the-dead.com#2017-12-1916:11benedekprobably not the most up to date but still an eye opener#2017-12-1918:03bozhidar@drewverlee https://www.youtube.com/watch?v=aYA4AAjLfT0#2017-12-1918:04bozhidarNot sure if you’ve seen this one, but it covers a lot of ground.#2017-12-1918:24daveliepmannIt's not a screencast, but several folks are doing precisely that (for CIDER as well as other tools) over on ClojureVerse: https://clojureverse.org/t/share-the-nitty-gritty-details-of-your-clojure-workflow/1208 Lots to learn! 😄#2017-12-1921:13dominicm@bozhidar I just tested the xref.clj code, it works verbatim fwiw. But I don't really see the value given that it works on a symbol not a var for cross-referencing.#2017-12-1921:13dominicmI got different sets of results for clojure.core/map and map, for example.#2017-12-1921:19dominicmI guess I'm questioning the purpose of the code, before I go any further.#2017-12-1921:24bozhidar@dominicm I’m not saying there’s not room for improvement there. 🙂 Ideally potential matches should be resolved to make sure they are really the var you’re looking for, but that’s relatively easy to do.#2017-12-1921:25bozhidarI think this would solve the problem you’ve observed.#2017-12-1921:38dominicmIt does, although input becomes harder for clients.#2017-12-1921:38dominicmNot sure that's a problem though#2017-12-1921:43dominicmFalls over for shadowing of course 😕#2017-12-1921:44dpsuttoncan anyone try cider-browse-ns ? i'm not sure its working right now#2017-12-1921:44dominicme.g. #'clojure.core/ns is shadowed in #'clojure.core/keyword with it's ns parameter.#2017-12-1921:45bozhidar@dpsutton It works for me. What problem are you experiencing?#2017-12-1921:46dpsuttonNot an nREPL dict#2017-12-1921:46bozhidar> It does, although input becomes harder for clients.
Isn’t the input always a var? Not sure how it becomes harder for clients.#2017-12-1921:46dpsutton(cider-sync-request:ns-vars-with-meta namespace) is coming back nil#2017-12-1921:47bozhidarI don’t recall any changes recent changes there.#2017-12-1921:47dpsuttoni'll check it tonight. just wondering if it was me or in general. i think someone did some work on the nrepl side recently, but also i may not have restarted emacs since pulling#2017-12-1921:47dpsuttonoh i thought the resources listing stuff was changed#2017-12-1921:47dpsuttonbut i didn't follow along closely. might be unrelated#2017-12-1921:47bozhidar@dominicm worked on some things, but nothing related.#2017-12-1921:47dpsuttonok. i'll dig later. thanks for confirming it is working#2017-12-1921:48bozhidar> e.g. #'clojure.core/ns is shadowed in #'clojure.core/keyword with it’s ns parameter.#2017-12-1921:49bozhidarYeah, that’s true, but few things are ideal and I’m happy to settle for something that’s useful. 🙂#2017-12-1921:50bozhidarTo deal properly with locals we need to parse the code and even then, there would be some potential for mistakes.#2017-12-1921:51dominicmAt that point, we're building what refactor-nrepl does already 😄#2017-12-1921:51dominicmWhy is it that you want this over what refactor-nrepl offers?#2017-12-1921:53bozhidarBecause building the AST for the project is ridiculously slow and you have to keep rebuilding it after changes for each file.#2017-12-1921:54dominicmHow slow is ridiculously slow?#2017-12-1921:55bozhidarDepends on how big the project is. It was slow enough to decide I don’t want anything related to parsing code in CIDER itself.#2017-12-1921:55bozhidarDon’t recall the exact details.#2017-12-1921:55bozhidarAnd I seem to recall there were a ton of bugs related to the parser, at least in the early days.#2017-12-1921:56bozhidarI’ve always liked the simplicity of relying on just the application state - felt very Lispy to me.#2017-12-1921:57dominicmIt just occurred to me that I do recall seeing a 2 minute AST on a project in the past. We've not reached that scale on my current project yet though.#2017-12-1922:01dominicmThe xref code would need some tweaking to integrate the locations where the match was found#2017-12-1922:06bozhidarAnd maybe a bit of general cleanup. 😄 I seem to recall it was written in the era of Clojure 1.2 or something like this.#2017-12-1922:06dominicmyeah, it didn't read idiomatic at all#2017-12-2115:10jfntnIs there a way I could hook into the repl buffer to alter how an eval’d form is presented after cider-repl-return but in such a way that marking and killing the altered form would kill the original?#2017-12-2200:03gonewest818Can someone help figure out what’s going on? I’m trying to experiment with lib-grimoire in a repl, but I’m getting errors in a CIDER repl that don’t occur if I lein repl in a terminal.#2017-12-2200:04gonewest818With lein repl:#2017-12-2200:05gonewest818Neils-MBP:grimtest neilo$ lein repl
nREPL server started on port 61404 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.13
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_112-b16
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (load "grimtest/core")
nil
user=> (in-ns 'grimtest.core)
#namespace[grimtest.core]
grimtest.core=> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
grimtest.core=> #2017-12-2200:05gonewest818In a CIDER repl:#2017-12-2200:06gonewest818;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.13
;; Clojure 1.8.0, Java 1.8.0_112
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
#2017-12-2200:07gonewest818C-c C-k to load grimtest/core.clj, and then C-c M-n to switch namespaces#2017-12-2200:07gonewest818and then#2017-12-2200:07gonewest818grimtest.core> (gt/->Group "org.clojure")
AbstractMethodError Method guten_tag/core/ATaggedVal.iterator()Ljava/util/Iterator; is abstract guten-tag.core.ATaggedVal (core.clj:-1)
grimtest.core>
#2017-12-2200:08gonewest818Same project.clj, same code, etc. What’s going on?#2017-12-2200:09arrdemWhat Java version?#2017-12-2200:09arrdemI'm the Grimoire author fyi#2017-12-2200:09gonewest8181.8.0_112-b16#2017-12-2200:09arrdemHuh#2017-12-2200:09gonewest818And yes, nice to chat with you!#2017-12-2200:10arrdemSoooo it may well be that guten tag is incomplete#2017-12-2200:10arrdemNever seen that before#2017-12-2200:11gonewest818… “incomplete” in what way?#2017-12-2200:15arrdemThat method may actually not be implemented#2017-12-2200:16gonewest818… even if that were so, why would the exception occur only in a CIDER repl?#2017-12-2200:19arrdemLooking.#2017-12-2200:19arrdemI'm guessing that CIDER may be doing some code reloading, and since the ATaggedVal type is defined in Clojure that could mess things up.#2017-12-2200:19arrdemBut that could be changed.#2017-12-2200:20arrdem@gonewest818 can you publish your scratch repo somewhere?#2017-12-2200:20arrdemyeaaaaah looking at that error message I bet this is code reloading.#2017-12-2200:21gonewest818You can reconstruct the repo easily… it’s just lein new grimtest#2017-12-2200:21gonewest818(defproject grimtest "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]])#2017-12-2200:22gonewest818and src/grimtest/core.clj:#2017-12-2200:22gonewest818(ns grimtest.core
(:require [grimoire.api.web :as g]
[grimoire.things :as gt]))
#2017-12-2200:22gonewest818Literally, that’s it.#2017-12-2200:22arrdemargh 😕#2017-12-2200:22gonewest818I know, right?#2017-12-2200:24arrdem;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.9.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean?
user> (require '[grimoire.api.web :as g]
'[grimoire.things :as gt])
nil
user> (gt/group "foo")
CompilerException java.lang.RuntimeException: No such var: gt/group, compiling:(*cider-repl lib-grimoire*:15:7)
user> (gt/->group "foo")
IllegalArgumentException Multiple methods in multimethod 'simple-dispatch' match dispatch value: class guten_tag.core.ATaggedVal -> interface clojure.lang.IPersistentMap and interface clojure.lang.ISeq, and neither is preferred clojure.lang.MultiFn.findAndCacheBestMethod (MultiFn.java:178)
user>
#2017-12-2200:24arrdemwell#2017-12-2200:24gonewest818and for the record: Emacs 25.3, CIDER 0.15.1, nrepl 0.2.13 and Java 1.8.0_112#2017-12-2200:24arrdemApparently I'm not Clojure 1.9 friendly at any rate.#2017-12-2200:27arrdemOh no that's a pprint thing.#2017-12-2200:31arrdem@gonewest818 works on my machine?
;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.9.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
user> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
user> (gt/->group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure"}]
user> (print (slurp "project.clj"))
(defproject me.arrdem/scratch "0.1.0-SNAPSHOT"
:description "Bits and bats. More bats than Detritus."
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]]
:profiles {:dev {:source-paths ["dev"]}})
nil
user>
#2017-12-2200:32arrdemClojure 1.9... trying on 1.8#2017-12-2200:33arrdem;; Connected to nREPL server -
;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_144
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
user> (gt/->Group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure", :grimoire.things/url "org.clojure"}]
user> (gt/->group "org.clojure")
#g/t [:grimoire.things/group {:name "org.clojure"}]
user> (print (slurp "project.clj"))
(defproject me.arrdem/scratch "0.1.0-SNAPSHOT"
:description "Bits and bats. More bats than Detritus."
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure-grimoire/lib-grimoire "0.10.9"]]
:profiles {:dev {:source-paths ["dev"]}})
nil
user>
#2017-12-2200:33arrdem1.8 same#2017-12-2200:33gonewest818I’ll try dropping back to nREPL 0.2.12, or upgrading Java to 1.8.0_144… ?#2017-12-2200:36gonewest818nREPL 0.2.12:#2017-12-2200:36arrdemSo this is definitely a bug in guten-tag#2017-12-2200:36arrdemthat method is abstract#2017-12-2200:37arrdemand unimplemented.#2017-12-2200:37arrdemunclear how you're encountering it tho#2017-12-2200:37arrdemare you using fipp or something as a pretty-printer?#2017-12-2200:37gonewest818actually, yes
;; pretty printing (via fipp, the default)
(setq cider-repl-use-pretty-printing 't)
(setq cider-pprint-fn 'fipp)
#2017-12-2200:38arrdemYep. That'll do it.#2017-12-2200:38arrdemSo fipp sees that the guten-tag ATaggedVal is in theory java.lang.Iterable and so tries to call .iterator which isn't implemented and boom#2017-12-2200:39gonewest818Yep, that was it. (setq cider-repl-use-pretty-printing nil)#2017-12-2200:40arrdemLemme implement that method and push rl quick#2017-12-2200:40arrdemyou'll have to depend on guten-tag explicitly to bump the depended version but it'll work#2017-12-2200:40gonewest818cool. thanks.#2017-12-2200:42arrdem@gonewest818 can you throw me an issue https://github.com/arrdem/guten-tag#2017-12-2200:42arrdemI have a patch I just want to do the book keeping around this#2017-12-2200:50arrdem@gonewest818 [me.arrdem/guten-tag "0.1.7"] done.#2017-12-2200:56gonewest818was afk for a few minutes… do you still need the issue?#2017-12-2200:56arrdemNope.#2017-12-2200:58gonewest818ok, patch is confirmed, thanks!#2017-12-2200:59arrdemsure!#2017-12-2200:59arrdemSorry about that, lemme know if you have any trouble with lib-grim or notice any particular design flaws.#2017-12-2201:00arrdemI'm not working on it right now but it's high on my list once I circle back from trying to shave the doc writing yak.#2017-12-2201:05gonewest818ok, will do. The reason I’m looking at this is because of an earlier discussion in this channel. Someone asked if it would be possible to modify cider-grimoire.el to read from a cached copy of the docs to make the lookups more responsive. bbatsov suggested doing that as nrepl middleware so that the same feature would be (at least in theory) accessible to atom and vim etc. And I thought I would have a try at that.#2017-12-2201:05arrdemYeah so you're gonna have to touch most of this then.#2017-12-2201:13gonewest818grimtest.core> (-> ""
grimoire.api.web/->Config
grimoire.api/list-groups)
IllegalArgumentException No method in multimethod '-list-groups' for dispatch value: :grimoire.api.web/Config clojure.lang.MultiFn.getFn (MultiFn.java:156)
#2017-12-2201:14arrdemHave you loaded the web backend?#2017-12-2201:14arrdemthe curse of multimethods >.>#2017-12-2201:14arrdem(require 'grimoire.api.web) ;; purely for side-effects >.>#2017-12-2201:14gonewest818[grimoire.api.web :as web]#2017-12-2201:15arrdemyou do have to require grimoire.api.web.read for side-effects. sorry, web is just a couple ctors.#2017-12-2201:16gonewest818ah, got it.#2017-12-2201:16gonewest818thanks.#2017-12-2201:54zlrthis it the case that one cannot (cider-debug-defun-at-point) (i.e. instrument) core.async code? and is the most up-to-date workaround ztellman's riddley[0]?
my context for this is this github issue: https://github.com/clojure-emacs/cider/issues/1775
[0] https://github.com/ztellman/riddley#2017-12-2207:57bozhidar@mfm Yeah, unfortunately no one has worked on this for a while.#2017-12-2207:58bozhidar@gonewest818 Happy to see you’re working on this!#2017-12-2209:03dominicm@gonewest818 Really excited to see progress on this also!#2017-12-2213:10bherrmannstarting a fresh 1.9 project. " $ lein repl " works fine. Updated cider. Get an error when doing 'cider-jack-in'
Starting nREPL server via /home/bob/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.16.0-SNAPSHOT\"\] -- with-profile +jetty repl...
...
error in process filter: cider--connections-refresh: Invalid function: (buffer (get-buffer cider--connection-browser-buffer-name))
error in process filter: Invalid function: (buffer (get-buffer cider--connection-browser-buffer-name))#2017-12-2214:02bherrmannThis was because I was running cider from "melpa" (aka cider 20171220.135) and not "stable.melpa" (aka cider 0.15.1).#2017-12-2214:50bozhidarHmm, 0.16 works for me just fine. Normally you’d get such an error if there was some issue on the Elisp side of things. You can also toggle nREPL message logging in CIDER and try to connect again to see what’s happening in the log.#2017-12-2214:52bherrmannok, I'm game... stable is for the weak.#2017-12-2214:57bozhidar😄#2017-12-2214:57bherrmannInstall package ‘cider-20171220.135’? (y or n) y#2017-12-2214:58bherrmannHuh. Damn if it didnt just start up fine.#2017-12-2220:49arrdemMeanwhile, progress on some docs-as-data ideas https://twitter.com/arrdem/status/944294272496410625#2017-12-2221:54bozhidar@bherrmann That’s a pretty common scenario. 😄#2017-12-2221:54bozhidar@arrdem Looks cool!#2017-12-2221:55bozhidarThat would make it much easier to properly format the docs in editors.#2017-12-2316:25dpsuttondo people still use gradle for clojure? I've never heard of anyone using it so just wondering#2017-12-2316:36dpsuttonalso, it looks like the default cljs repl invocation is piggieback on rhino. I'm wondering if it's a good idea to uipdate this to the figwheel sidecar choice#2017-12-2321:55bozhidar> do people still use gradle for clojure? I’ve never heard of anyone using it so just wondering#2017-12-2321:56bozhidarNo idea. Probably relatively few people are using it. I recall the support for this was added relatively recently (e.g. 2 years ago).#2017-12-2321:56bozhidar> also, it looks like the default cljs repl invocation is piggieback on rhino. I’m wondering if it’s a good idea to uipdate this to the figwheel sidecar choice#2017-12-2321:56bozhidarI think we chose this as the default because it just works without having the users do anything themselves.#2017-12-2321:57bozhidarWe we start auto-injecting cljs deps this will no longer be a big concern.#2017-12-2322:07dpsuttonyeah that's what i was looking into when i thought about it. Which is the default. One stickler is keeping figwheel client and server together. if they are mismatched the whole thing shuts down#2017-12-2411:12dominicmAnd the fact that using it with boot is very painful#2017-12-2405:54johanatanhi, it seems that the cider debugger can only print locals for the current top (or bottom depending on your view) of the call stack. is there any way to get at the values of locals some frames below (or above) that one?#2017-12-2409:04bozhidarI don’t think that’s possible right now.#2017-12-2422:02johanatanhmm, do you know if it is possible to edit library code (in this case alpha.clj from clojure.spec) to insert a breakpoint at those earlier frames? [the buffer that popped open in emacs after running cider-doc and clicking the link to view source is read-only]. is there another way to edit this library code?#2017-12-2519:32jumar@U0E98NQG2 Why not just use cider-debug-defun-at-point?
Moreover, if you want to modify source of 3rd party code, you can navigate to the source, disable read-only mode (e.g. C-x C-q) and then modify source code and re-eval.#2017-12-2520:51johanatanBecause the function one frame below the one I’m interested in gets called a lot and only under rare circumstances calls the other.#2017-12-2520:52johanatanAh, yes, disabling read-only should work. Thx!#2017-12-2504:09johanatan[i think i found a method that may work: a) copy the entire alpha.clj buffer into a local file b) edit the file to have #break statements as desired c) load the buffer for this edited file w/ cider (after having loaded everything else in my project).#2017-12-2504:10johanatan[on the principle that the last version of a particular ns:symbol combo to be loaded "wins"]#2017-12-2508:32bozhidar@dominicm Just came across https://github.com/SevereOverfl0w/vim-replant randomly and was very amused by#2017-12-2508:33bozhidar> 1. Only *-nrepl though, of course. The emacs part is just crazy#2017-12-2508:33bozhidar😄#2017-12-2511:49dominicm@bozhidar You caught me! 😉#2017-12-2513:55bozhidarFunny enough VimScript was the primary reason I switched to Emacs many years ago. (yeah, yeah - I used to be a vim user 😄 ) I simply couldn’t stand this crazy language and I felt much more comfortable extending my editor with Emacs Lisp. Although Emacs Lisp was definitely an acquired taste. 😄#2017-12-2607:19dominicm@bozhidar I actually used the code for docs from cider in my plugin, it's quite beta and required tweaking. I found a lisp to lua converter, and neovim loves lua.#2017-12-2607:19dominicmVimscript is a total pain, agree#2017-12-2613:57dpsuttonok. i saw that lisp there and i couldn't figure out what was going on 🙂#2017-12-2816:15naomarik@bozhidar are you using evil mode then? if not, how do you find emacs editing compared to vim?#2017-12-2816:46scriptorI use emacs+evil for clojure, it works pretty well#2017-12-2816:47scriptoralthough there's a small number of commands that I use the original emacs bindings for#2017-12-2817:03bozhidar> @bozhidar are you using evil mode then? if not, how do you find emacs editing compared to vim?#2017-12-2817:05bozhidarI tried using it for a while, but eventually I dropped the idea as I didn’t like to constantly remap some things for evil-mode. I guess that is what made Spacemacs so popular initially - it does a lot of the grunt work for you. I also tried god-mode, which is a somewhat similar concept, but it was pretty buggy.#2017-12-2817:07bozhidarOverall, I’m a happy user of the standard Emacs editing commands augmented a bit my some extensions of my own, and some nifty 3rd party packages like avy and easy-kill.#2017-12-2817:20naomariknice — and yeah spacemacs is what enabled me to transition over easily from vim#2017-12-2818:07bozhidarI definitely think when it comes to editing keybindings vim is better than Emacs, but evil-mode and Spacemacs show that ultimately it’s more important what you can do, not what your default are. Many people are fond of joking that Emacs is a better vim than vim. 🙂#2017-12-2818:08bozhidarPerhaps Neovim is going to change this one day, but I guess that moment is pretty far away into the future.#2017-12-2818:14naomariki definitely found emacs to be a better vim than vim. enough to deal with the crashes and now occasional slowdowns that persist until i restart. i feel that i’d have a better experience using a clean installation but at the moment all my time is spent working on making things trying to make a living 😉#2017-12-2819:04bozhidarHey everyone,
Here’s one (a bit overdue) Christmas present for all of you - a major update to CIDER, the popular Clojure interactive development environment, built on top of Emacs and nREPL.
The big news is that CIDER 0.16 starts much faster when you use cider-jack-in (due to deferred loading of most of the nREPL middleware that CIDER uses internally to power its features).
As usual - there are other small new features, improvements and bugfixes. Go over the release notes for all the details!
Enjoy CIDER 0.16 (ir)responsibly and have an awesome New Year!
P.S. Special thanks to ClojureX’s team for helping me find the energy and the resolve to finish the work on this release and to all the amazing people who contributed to it! You’re awesome! Keep rocking! 🙂
P.P.S. We’ve got plenty of small newcomer-friendly tickets that you can help with here https://github.com/clojure-emacs/cider/issues?q=is%3Aissue+is%3Aopen+label%3A%22low+hanging+fruit%22
### New Features
* [#2082](), [cider-nrepl#440](): Add specialized stacktraces for clojure.spec assertions.
* [#2111](): Add `cider-pprint-eval-last-sexp-to-comment` and `cider-pprint-eval-defun-to-comment`.
* Add a REPL shortcut for `cider-repl-require-repl-utils` (this makes it easy to require common functions like `doc`, `source`, etc. in REPL buffers).
* [#2112](): Add a new interactive command `cider-find-keyword` (bound to `C-c C-:`).
* [#2144](): Create a Docker image to mimic the Travis CI environment.
### Changes
* `cider-switch-to-last-clojure-buffer` switches to most recent relevant Clojure(Script) buffer instead of the last "remembered" buffer.
* [cider-nrepl#438](): Improve startup time by deferring loading CIDER's middleware until the first usage.
* [#2078](): Improve startup time by bundling together sync requests during startup.
* `cider-rotate-default-connection` will warn if you use it with only a single active connection.
* `cider-format-buffer` tries to preserve the point position.
### Bugs Fixed
* [#2084](): Select correct REPL type (clj or cljs) in `cider-switch-to-repl-buffer` conditional on the current buffer.
* [#2088](): Fix functions defined with `def` being font-locked as vars instead of functions.
* [#1651](), [cider-nrepl#445](): Fix `cider-expected-ns` returns `nil` on boot projects.
* [#2120](): Fix Travis CI build errors for Emacs versions >25.2.
* [#2117](): Ensure `cider-repl-result-prefix` is only inserted before the first result chunk.
* [#2123](): Process properly the Java version in Java 9.
#2017-12-2819:06bozhidar@naomarik Hmm, I’ve never had issues with crashes and slowdowns in Emacs. At least not on stable releases. And I’ve been using it for a very long time. 🙂#2017-12-2819:38naomarik@bozhidar yea i think it’s from the spacemacs bloat 😉 it seems when I update it something breaks and I have to deal with new quirks. i do get a lot of great use out of it so not a big deal for me at this point#2017-12-2819:38naomarikif i can take a long vacation i’d spend time with my own config#2017-12-2820:08vinaiThis sounds great! (Emacs + cider) noob question: how do I upgrade cider. Any pointer?#2017-12-2820:15vinaiCan I just install the new package? Should I remove the old one first?#2017-12-2820:46bozhidar@vinai Just upgrade (provided you’re using MELPA Stable, that is). No need to remove the old package.#2017-12-2820:50vinaiThanks, seems to have worked... trying it out#2017-12-2900:38rickmoynihan@bozhidar: Amazing!!!! It’s like christmas all over again!#2017-12-2900:39rickmoynihanThe spec assertions are great!#2017-12-2909:17benedeknice work @bozhidar and contributors #2017-12-3019:38jsa-aerial@bozhidar I've been thinking of upgrading - but I'm on 0.12.0 (and been very happy). Any bombs or gotchas going from 12 to 16?? Many thanks in advance!#2017-12-3019:39bozhidarShould be a smooth sailing IMO. Nothing really major changed in the past few releases, but you’d certainly get plenty of goodies and bugfixes.#2017-12-3019:41bozhidarI’d suggest just going over the “Changes” sections of the changelog https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md to be prepared for… changes 🙂#2018-12-3113:45pabloreHello! Is there any linting tool for cider?#2018-12-3113:55dominicm@pablore https://github.com/clojure-emacs/squiggly-clojure/#2018-12-3115:26pablorethanks#2018-01-0118:06twashingLet’s say I have i) a system of components, ii) with an nrepl component in it.#2018-01-0118:06twashingIf I iii) have an active repl connection, and iv) restart the system, v) my repl connection will be lost.#2018-01-0118:06twashing… Is there a cider function for retrying a repl connection?#2018-01-0119:35bozhidar@twashing Since 0.15 cider-restart will reconnect to the same remote server https://github.com/clojure-emacs/cider/pull/1905#2018-01-0119:37bozhidarThere’s also this ticket, which is relative simple to implement https://github.com/clojure-emacs/cider/issues/1961#2018-01-0119:39twashing@bozhidar Ah, just tried it - works like a charm. Thanks 👍:skin-tone-5:#2018-01-0119:40bozhidarYou’re welcome!#2018-01-0119:41bozhidarAny volunteer to land a hand and move a bit of legacy third party code into CIDER-proper https://github.com/clojure-emacs/cider/issues/1993 ? That’s a fun and easy task, but unfortunately I don’t have time for right now.#2018-01-0119:41bozhidarI do think, however, it’d be nice to have a profiler in CIDER#2018-01-0120:04dominicm@bozhidar How does CIDER scope connections? I've assumed it works like fireplace, and it might not.#2018-01-0120:04dominicmOh, way OT from that question, but you probably didn't see this: https://github.com/SevereOverfl0w/vim-replant/blob/5d6e56974fbe3aebfbd85497201d74fc9bfe8e57/docs/CIDER.adoc It's an attempt at documenting the CIDER middleware. I've already fallen a little behind though 😄.#2018-01-0120:06dominicmRE the scoping, I've guessed it's scoped relative to the .nrepl-port on a project I'm working on w/ embedded cider.#2018-01-0120:27bozhidar> Oh, way OT from that question, but you probably didn’t see this: https://github.com/SevereOverfl0w/vim-replant/blob/5d6e56974fbe3aebfbd85497201d74fc9bfe8e57/docs/CIDER.adoc It’s an attempt at documenting the CIDER middleware. I’ve already fallen a little behind though 😄#2018-01-0120:27bozhidarGreat initiative! It’s clear cider-nrepl needs better documentation. 🙂#2018-01-0120:28bozhidar> RE the scoping, I’ve guessed it’s scoped relative to the .nrepl-port on a project I’m working on w/ embedded cider.#2018-01-0120:28bozhidarNot sure what you mean by scoping, but if you mean how we bind a connection to a project - we used the project’s root folder (identified by something like project.clj).#2018-01-0122:06dominicmI don't think that will work for me. I've got folders on my classpath, which are sibling projects.
I might need to find some fu to use, or contribute a priority on .nrepl-port for the root folder finding.#2018-01-0207:22bozhidarSo, you want one connection for two projects?#2018-01-0208:12dominicmI have one connection, and two projects are on the classpath. Yep.#2018-01-0120:30bozhidar.nrepl-port is something optional, but it’s unlikely there won’t be a project file.#2018-01-0122:06dominicmI don't think that will work for me. I've got folders on my classpath, which are sibling projects.
I might need to find some fu to use, or contribute a priority on .nrepl-port for the root folder finding.#2018-01-0207:52rmuslimovHave anybody hacked cider-test to make working with clojurescript tests? Or may be currently work in progress and we need just wait for newer version of cider?#2018-01-0207:55rmuslimovI’m playing with nodejs application, and running tests inside of cider will be very helpful. Same way as it works for clojure development.#2018-01-0207:57bozhidar@rmuslimov The middleware needs to be updated to support ClojureScript as well, but no one ever expressed interest in working on this.#2018-01-0207:57bozhidarIt shouldn’t be hard, as the Java usage in the test middleware is minimal.#2018-01-0207:58bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/test.clj#2018-01-0208:02rmuslimov@bozhidar thanks for quick answer#2018-01-0208:03bozhidarYou can check the https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/macroexpand.clj middleware as an example of something that has a Clojure and ClojureScript support.#2018-01-0212:47benedek@pablore highly recommend joker too https://github.com/candid82/flycheck-joker#2018-01-0213:23pablorewoah joker looks great#2018-01-0213:23bozhidarYeah, joker is a cool project. I just wonder how mature is it. I also think that once parseclj is a ready for general consumption, building linters in Emacs will become pretty simple.#2018-01-0214:14jmayaalv@bozhidar i have been using joker for about a year and i have 0 complains. It works really well with cider.#2018-01-0215:15benedekuh nice, forgot about parseclj. re joker: apart from occasional false positives it is pretty cool catching all kind of stuff with the added benefit of not even needing a repl process.#2018-01-0216:15bozhidarYeah, that’s true. But a Elisp parser would not need a repl process as well. Then you could have some linting done in clojure-mode with 0 external deps.#2018-01-0216:22benedekyeah very tempting to go crazy and do something cljr like with it.#2018-01-0217:05richiardiandrea@bozhidar what do you think we are missing for an inf-clojure release?#2018-01-0221:25bozhidar@richiardiandrea You’ve got it. Just tagged a new release.#2018-01-0221:47richiardiandrea@bozhidar awesome, we should make a survey on inf-clojure usage at some point 😄 I feel I am the only one using it lol#2018-01-0221:54bozhidarI see 5000 downloads on MELPA, so I guess you’re not the only user. 🙂#2018-01-0222:25dpsuttonI'd really like to see a nice screen cast. Sometimes inf would be perfect for me so I don't have to modify deps and start up#2018-01-0222:26richiardiandreaI am planning on writing a series of blog posts if time allows it#2018-01-0222:26richiardiandreanew year resolution so take it with a grain of salt 🙂#2018-01-0301:15romainIs it possible to debug/inspect middleware when using a web app? I have an app generated with luminus, and I would like to inspect the middleware chain#2018-01-0301:17jcburleyIs there a good tutorial on overall CIDER workflow somewhere? From cider-jack-in through using Ctrl-Alt-X to reload changed functions, I think I understand -- but how best to "recompile" my source code (to make sure my hand edits and reloads are complete) and start afresh has not been clear to me, and I suspect my current tactic of using Ctrl-C Ctrl-Q (to quit and exit the server) and redoing cider-jack-in isn't ideal....#2018-01-0301:21rymndhngthere's a command called cider-refresh that reloads changed namespaces for you without having to restart the REPL.#2018-01-0301:22jcburleyAh, that seems helpful, thanks!!#2018-01-0301:22jcburleyI'm still interested in a tutorial that walks through various typical workflows, if anyone has one. Or, maybe I should create one, if there's enough interest....#2018-01-0301:24jcburley(I've enjoyed watching https://youtube.com/clojuretv videos -- some interesting stuff in there!)#2018-01-0307:12bozhidar@james-clojure Check out http://emacsredux.com/blog/2017/12/31/into-to-cider/ and http://cider.readthedocs.io/en/latest/additional_resources/#2018-01-0307:12bozhidar> Is it possible to debug/inspect middleware when using a web app? I have an app generated with luminus, and I would like to inspect the middleware chain#2018-01-0307:13bozhidarYeah, it is. CIDER doesn’t really care about the type of the app - the debug workflow remains the same - you instrument something and you end up with the debugger when it’s invoked.#2018-01-0307:15bozhidarAnd try again my luck with:
Any volunteer to land a hand and move a bit of legacy third party code into CIDER-proper ? That's a fun and easy task, but unfortunately I don't have time for right now.
Enlist in this adventure! It’s going to be fun! 😉 (I’m trying to solicit more contributions from the broader CIDER community - that’s my NY’s resolution for CIDER)#2018-01-0308:42jmayaalv@bozhidar i would love to help but i have not much experience with elisp. where can i start to learn? (another NY’s resolution)#2018-01-0308:45bozhidar@jmayaalv Some good resources are listed here http://emacsredux.com/blog/2015/05/16/learning-emacs-lisp/#2018-01-0308:47bozhidarFor this particular task you don’t need to know a lot of Elisp. The Elisp code exists and just has to be updated when it’s moved to CIDER proper, as it’s depending on some API functions that changed since it was written. And for the Clojure part - it just incorporating the existing middleware into cider-nrepl.#2018-01-0308:47jmayaalvgreat! thanks a lot i will then start to look into it#2018-01-0308:51bozhidarGreat! That’s the code that should go into CIDER https://github.com/thunknyc/nrepl-profile/blob/master/cider-profile.el and that’s the code that should go into cider-nrepl https://github.com/thunknyc/nrepl-profile/blob/master/src/nrepl_profile/core.clj#2018-01-0312:46tomayerstIs there any way of checking which Java version CIDER is using?#2018-01-0312:47tomayerstI am trying to jack in to a clojurescript repl and getting:#2018-01-0312:47tomayersterror in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Error loading cemerick.piggieback: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(cljs/util.cljc:1:1)
Exception in thread “main” java.lang.RuntimeException: Unable to resolve var: cemerick.piggieback/wrap-cljs-repl in this context, compiling:(/private/var/folders/rx/cvhnsdg94n557wkzh0xtfqdh0000gn/T/form-init13475918382944489824.clj:1:13139)#2018-01-0312:47tomayerstWhich I believe is a Java 9 issue, but my default JVN is 1.8 (I have both installed though, hence the question)#2018-01-0313:24bozhidarJust do in Emacs M-! RET java -version#2018-01-0313:24bozhidar@tomayerst ^^^#2018-01-0313:53tomayerstThanks @bozhidar#2018-01-0313:54tomayerstAs I thought, Cider is using Java 9#2018-01-0313:57tomayerstWell, or emacs is is using Java 9#2018-01-0313:57bozhidarExactly. You should adjust Emacs’s exec-path to account for this.#2018-01-0313:58tomayerstThank you!#2018-01-0313:58bozhidarhttps://www.emacswiki.org/emacs/ExecPath#2018-01-0314:00tomayerstThank you, twice!#2018-01-0314:36romain@bozhidar (edit). Well I think the workflow is broken. I tested on a smaller example and it works well! I have to check my project.#2018-01-0315:16tomayerstIts a MacOS/Spacemacs thing I think. Spacemacs has exec-path-from-shell but I had set the path in the wrong shell config 😞#2018-01-0318:43grzmAnyone here getting on board the tools.deps train? I'd really like to get out of the business of sticking dependencies in project.clj/`build.boot` so I can potentially use either tool (and others for cljs toolchains) and have my deps in a common place. Looking at https://github.com/seancorfield/boot-tools-deps right now and have it working for a number of tasks, but haven't figured out how to get it to work with cider-jack-in#2018-01-0318:48grzmI've tried defining a cider task in build.boot that calls (deps), but that doesn't seem to be picked up at all (when I've replaced the body of that task with (/ 1 0), it happily completes). I've also tried updating cider-boot-parameters to deps repl -s -H :: wait: I can see that gets picked up from the call I see in messages, but (System/getProperty "java.class.path") in the subsequent repl only shows my boot directory (`"/Users/grzm/homebrew/bin/boot"`): nothing else is getting picked up.#2018-01-0318:51dominicm@grzm my suggestion is to use load-deps at the top of the buildbuild.boot#2018-01-0319:24richiardiandreawasn't there a fake.class.path in boot?#2018-01-0319:27grzm@dominicm interesting. If I do that, that's going to affect my build as well, correct? For example, if I want to include my tests in the repl, but not in my build. Thinking out load here, haven't really thought it through.#2018-01-0403:40grzm@richiardiandrea yeah, I should be looking up "fake.class.path" Thanks!#2018-01-0405:33grzmLooks like I'll be making .dir-locals.el files to specify cider-boot-parameters and add the appropriate deps there.#2018-01-0405:55dpsuttonOh not good. Cljc usage is in a poor state. Anytime a connection is determined by cider other connection it returns a random connection of that type that just happens to often be the correct one. Example you jack into fipp which has cljc files. You have another clojure script project open. Trying to load any file loads that file into your fipp clj repl and the cljs repl for your other project. #2018-01-0406:55grzmI've also noticed that C-c C-z doesn't always bring me to the appropriate repl. I wonder if they're related.#2018-01-0408:29bozhidar@dpsutton As I think you know we have a solution in the works https://github.com/clojure-emacs/cider/pull/2069#2018-01-0408:30bozhidarIt was postponed for a while due to my desire to get 0.16 out of the door first, before making API changes, but for 0.17 that’s definitely on the table. Now it’s mostly up to @vspinu to get this to mergeable state.#2018-01-0409:43dominicmOh, cider doesn't support multiple connecitons at once right now? I thought I'd seen my colleagues do that :thinking_face:#2018-01-0409:44dominicmFwiw, Fireplace has a term it calls "scope", and you scope a connection to a directory/file. It doesn't expose it much, except for when you do a manual :Connect . By default it scopes to the auto-detected .nrepl-port on first action (e.g. when you do your first :Doc defn or similar)#2018-01-0413:49bozhidar@dominicm It does support them, it just doesn’t scope them very well.#2018-01-0413:51bozhidarThat’s what this PR is about - a new way to bundle related connection together. When CIDER was created it didn’t support ClojureScript and cljc didn’t exist. The support for both of those was added on the simple connection API we had since day one and the result was a bit messy. Streamlining this in the next release is going to be huge everyone who’s doing more than Clojure development.#2018-01-0413:55dominicmThe fireplace design for cljs ended up ok, but I think it was difficult to get where we are.
I'll have to look through this PR and see if there's any ideas to take.#2018-01-0413:57mikerodI always have multiple REPL buffers open, one for CLJ and one CLJS in Cider against the same nREPL server. I also, often have other nREPL servers I’m connected to in other REPL buffers. I have never seen an issue with that.#2018-01-0414:08dpsuttonIt often behaves correctly. However if you jack into a cljc problem without clojurescript it will eval that clojurescript in a random cljs buffer from another project#2018-01-0414:09mikerodah ok#2018-01-0414:11dpsuttonI only found it last night. But the toggling isn't great either. And could be broken on account of this. I'll have to see. I might need to update it to be project aware#2018-01-0422:29aganyone else having trouble to get cider-find-ns to work?#2018-01-0422:30agoh, I guess it simply doesn't work with neither cljs or cljc#2018-01-0422:30ag;(#2018-01-0422:36jcburleySo, here's a silly question: how do I redirect stdin (`*in*`) to a file so my little program's read-line function invocations come from the file instead of my command line?#2018-01-0422:36jcburley(I don't want to change the function -- I want the equivalent of sh's < test-file-0.txt.)#2018-01-0422:47jcburleyFor now, I'll use , use the bound result in a binding [*in*] construct, .close the bound result afterwards, and maybe just wrap up all that stuff in a namespace of my own having such handy tools.#2018-01-0423:17jcburleyFWIW, here's what I whipped up to address my immediate concern (it's probably horrible but I wanted to play around with macros, so...):
(ns com.burleyarch.bash)
(defmacro <
"Evaluate body with *in* bound to file"
[p & body]
`(let [my-in# ( ~p)
my-res# (binding [*in* my-in#] (do ~@body))]
(.close my-in#)
my-res#))
Use case:
(require ['com.burleyarch.bash :as 'bash])
(bash/< "path-to-file" (print (read-line)) (print (read-line)) (print (read-line)))
That should print the first three lines of the file.#2018-01-0423:25jcburleyBut I'm not sure whether I should really be using with-open in lieu of that first let's binding -- the macroexpansion suggests binding takes care of wrapping body in try...`finally`, so maybe the above is okay?#2018-01-0423:26jcburley(Using with-open, I'd be able to forego the .close, of course....)#2018-01-0423:27dominicm@james-clojure if code ever threw an exception, you'd leave an open file. Which is bad afaik#2018-01-0423:29jcburleyYou mean if body threw an exception? Yes, that's what I'm worried about.#2018-01-0423:29dominicm@james-clojure that's why to prefer with-open :) it's a good macro to rely on#2018-01-0423:30jcburleyOkay, will refactor accordingly. What I noticed is that binding expands to include this:
...try (do (quote body)) (finally (clojure.core/pop-thread-bindings))))...
But I'm not sure that means an exception in body will both pop the thread bindings and continue on to run .close outside the let.#2018-01-0423:31jcburleyIn any case, I agree I shouldn't count on that behavior, and my macro is "obviously wrong" to anyone looking at it!#2018-01-0423:33dominicm@james-clojure it doesn't have a catch, which means it's just doing it's clean-up, and then throwing the exception again.#2018-01-0423:33jcburleyAh, okay.#2018-01-0423:34jcburleyHow's this?
(defmacro <
"Evaluate body with *in* bound to file"
[p & body]
`(with-open [my-in# ( ~p)]
(binding [*in* my-in#] (do ~@body))))
#2018-01-0423:34dominicmThe brevity is beautiful. I don't think you need the (do) fwiw#2018-01-0423:35jcburleyAh, of course, thanks!#2018-01-0423:38jcburleyNow I need to look up how to avoid the "WARNING: > already refers to..." diagnostic I get when first defining these macros. 😉#2018-01-0508:25dominicmYou need (:refer-clojure :exclude [>]) in your ns definition#2018-01-0423:41jcburleyHmm, looks like it's an Open issue:
https://dev.clojure.org/jira/browse/CLJ-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#2018-01-0508:01bozhidar@ag Did you check the implementation? I don’t recall if we had just something Java-specific there or not, but I think getting this to work with cljs shouldn’t be hard.#2018-01-0508:01bozhidarYou might want to file a ticket on the subject.#2018-01-0605:23stardivinerWhen I use command cider-profile-toggle. Got error:
user-error: ‘cider-profile-toggle’ requires the nREPL op "toggle-profile". Please, install (or update) cider-nrepl 0.17.0-SNAPSHOT and restart CIDER
How to check out my current cider-nrepl version? (I thought CIDER handle those dependencies version to latest by itself.)#2018-01-0605:30stardivinerI found variable cider-jack-in-lein-plugins. Its value is (("cider/cider-nrepl" "0.17.0-SNAPSHOT")). Then why cider-profile reports this error?#2018-01-0607:10dpsutton@stardiviner what version is your CIDER? CIDER should default to using a cider-nrepl that matches it's own version. I'm not sure how plugins will work with that if they differ#2018-01-0607:18stardiviner@dpsutton 0.17.0-snapshot#2018-01-0607:54dpsuttoni don't see a cider function by that name at all#2018-01-0609:16bozhidar@dpsutton it’s from this outdated package https://github.com/thunknyc/nrepl-profile#2018-01-0609:17bozhidar@jmayaalv is working to update and integrate this in CIDER itself.#2018-01-0609:18bozhidar@stardiviner - you’re getting this error because you installed only the Elisp package, without the matching middleware.#2018-01-0609:20stardiviner@jmayaalv Thanks, @bozhidar I see, I will add middleware and try again. Thanks too.#2018-01-0708:08stardivinerStill does not work. Seems have to wait for new cider-profile integrate into CIDER.#2018-01-0709:18bozhidar@stardiviner I was about to say this yesterday, but it slipped my mind. It won’t work even with the middleware, because the API calls on the client side where changed a bit since 0.10 (which it depends on).#2018-01-0709:48stardivinerI see, Thanks.#2018-01-0810:13chrisblomis it possible to mark a function for debugging without jumping to the definition first?#2018-01-0810:30chrisblomnevermind, now using this: (defun my/cider-debug-var-at-point ()
(interactive)
(save-excursion
(cider-find-var)
(cider-debug-defun-at-point)))#2018-01-0819:02bozhidarWe never implemented some completing selection of all vars, it would have been a nice way to solve your issue.#2018-01-0819:03bozhidarI guess we can also add something like this to the ns browser.#2018-01-0822:45arrdemWhat all would it take to font-lock “```clj” blocks in docstrings?#2018-01-0907:28bozhidarI’ve never seen such blocks in docstrings, but it should be feasible. Are you talking CIDER doc buffers or in general?#2018-01-0913:34pabloreHello, is there a way to have midje autotest in cider repl?#2018-01-0916:17daveliepmanncider-test-run-project-tests messages "Running tests in all project namespaces..." then hangs indefinitely. I'm on 0.16.0. Does this ring any bells for anyone? I'd like to see if there's something easy I'm missing before reporting the issue.#2018-01-0916:20bozhidar@daveliepmann Check the nREPL messages buffer first http://cider.readthedocs.io/en/latest/troubleshooting/#2018-01-1115:51daveliepmann@bozhidar thanks, I enabled the nREPL messages buffer but it doesn't seem to say much. The issue seems to be that the results (1 or 2 very small maps) of a complex Datomic query somehow cause a complete hang when running tests from CIDER but not when the functions are run manually or when running tests from the command line. Is there some resource I can read about how to interpret nREPL messages, or to understand better what CIDER is adding to the testing/evaluation process?#2018-01-1117:27daveliepmannnevermind, it seems to be caused by venantius/ultra plugin in my lein user profile#2018-01-0916:20bozhidarIt might give you some insight.#2018-01-0916:21bozhidar@pablore They have to implement the clojure.test protocol and midje would work with CIDER.#2018-01-0916:21bozhidarThere’s a ticket I filed, but they need someone to work on it https://github.com/marick/Midje/issues/356#2018-01-0919:05arrdem@bozhidar clojure-mode docstrings was my thinking.#2018-01-1000:49richiardiandrea~ups, is the function ~ will verify my claim#2018-01-1007:38bozhidarGuess it’s not. 🙂#2018-01-1007:39bozhidar@arrdem No idea if this is feasible or not. If someone has seen some mode doing it we can certainly borrow some inspiration from there.#2018-01-1012:49rickmoynihanWhat’s the best way to do the equivalent of (set! *print-length* 16) on connection with cider?#2018-01-1012:53rickmoynihanshould I add a cider-connected-hook?#2018-01-1012:56rickmoynihanok following seems to work:
(add-hook 'cider-connected-hook (lambda ()
(cider-interactive-eval
"(set! *print-length* 16)\n")))
#2018-01-1013:01dpsuttondoes it work? also don't need that newline in it#2018-01-1013:01dpsuttonah, there are refresh functions that might work for you#2018-01-1013:01dpsuttoni'm not sure if the initial before refresh function is run at start up?#2018-01-1013:01rickmoynihanyeah looks like it works#2018-01-1013:02rickmoynihanthere is a \n in there… or do you mean something else?#2018-01-1013:02dpsuttonyeah that's what i meant. but i was thinking of something other than cider interactive eval so i see why you did it#2018-01-1013:03rickmoynihanwell I’m asking because I was expecting there to be a better way (or a config option for this)#2018-01-1013:04rickmoynihanso open to alternatives#2018-01-1013:06dpsuttoni was looking. there's a cider-refresh-after-fn that i was wondering was called on start up#2018-01-1013:07dpsuttonnot sure if you use cider-refresh much, but maybe you could (setq cider-refresh-after-fn "(set! *print-length*16)") and then add a cider connected hook to eval that function. and then if you refresh it will be called again for you#2018-01-1013:12rickmoynihanI do on some projects… guessing what you’re saying is that a refresh will reset the *print-length*#2018-01-1013:13dpsuttonyeah. there are pre and post hook functions on refresh. so if you set this as a post refresh function and then also call it at jack in you should have it at all times#2018-01-1013:14dpsuttonnot sure if its just as good though, but there is cider-repl-pretty-print-width#2018-01-1013:39bozhidarIsn’t it simpler to just use something like Lein’s :repl-options?#2018-01-1013:40rickmoynihan@bozhidar: I have that set, but it doesn’t seem to be picked up in cider…#2018-01-1013:40bozhidarPerhaps we can have those as defcustoms in CIDER and pass the to lein/`boot` on jack-in, if they support it.#2018-01-1013:41bozhidarThat’s odd - I thought this was something global for the REPL. After all it’s not like CIDER creates some different REPL.#2018-01-1013:41rickmoynihanahh there’s a syntax error in my profiles.clj#2018-01-1013:42bozhidarFile some ticket and let’s discuss how we can improve the situation there.#2018-01-1013:42rickmoynihanI had :repl-options { *print-length* 100 }#2018-01-1013:42rickmoynihaninstead of having an inner :init#2018-01-1013:42rickmoynihandoh#2018-01-1013:42bozhidarSo, this works now?#2018-01-1013:43rickmoynihanchecking…#2018-01-1013:45rickmoynihanyes it works 🙂#2018-01-1013:45rickmoynihanthanks#2018-01-1013:51bozhidarAnyways, file some issue on the subject - we can certainly make this a bit more comfortable to set/change.#2018-01-1014:06rickmoynihancool#2018-01-1014:09rickmoynihanhttps://github.com/clojure-emacs/cider/issues/2160#2018-01-1015:19bozhidarThanks!#2018-01-1110:58qqq(let [a 1
b 2]
(+ a b) ;; cursor here, is there a way to make C-x C-e work?
(+ 2 3))#2018-01-1111:16genmeblogdebugger?#2018-01-1111:33bozhidarYeah, probably that’d be the only option as you’d need to step through the code to evaluate this expression.#2018-01-1111:35bozhidarAnother idea was suggest here https://github.com/clojure-emacs/cider/issues/2113 and it’s pretty great, but it also requires some parsing of the containing forms to figure out if something is local or not.#2018-01-1111:38qqqhere's a dumbass idea I have in mind: contextful-eval which behaves at follows:#2018-01-1111:38qqq1. p = (point)
2. go backwards until first "^("
3. count how many unbalanced "([{" we got
4. append right number of "}})" to balance
5. evl
#2018-01-1111:40qqqor, instead of step 2, do "get parent sexp until no parent exists"#2018-01-1111:52bozhidarYeah, that’s a simpler version of what’s discussed in the ticket - there the idea is to find all local variables, get prompted for them and replace them in the expression that will get evaluated.#2018-01-1111:52bozhidarYou idea would work for simple scenarios, but if there’s a local coming from a higher-level let this would break.#2018-01-1111:54qqqI don't understand. My naive reasoning is:
(let [...]
(expr I want to eval) ;; cursor here
(stuff I don't care about))
basically, I want to "find the outer most sexp", then I want to, while preserving balanced (), kill everything after the cursor
then I want to eval the modified "outermost sexp"#2018-01-1112:02bozhidarAh, now I get it. I thought you wanted to find the first outer let. Should have paid more attention.#2018-01-1112:03bozhidarThat’s actual much simpler as we already have the code that finds the top-level expression and the only thing needed it just terminate the expression after the current sexp. Should be trivial to implement.#2018-01-1112:05qqqthe only thing needed it just terminate the expression after the current sexp <-- precisely what I had in mind, even better explanation! any chance this makes it into 0.18 ? 🙂#2018-01-1113:21dpsutton@qqq i made a function that will grab the locals from a debugging session#2018-01-1113:21dpsutton(defun cider-debug-create-local-let (start end)
"During debugging, grab the locally bound vars and create a let
binding. Place this let binding in the kill ring for future use."
(interactive "r")
(if cider--debug-mode-response
(nrepl-dbind-response cider--debug-mode-response (locals)
(let* ((code (buffer-substring-no-properties start end))
(bindings (apply #'append locals))
(formatted-bindings (mapconcat 'identity bindings " ")))
(kill-new (format "(let [%s]\n %s)" formatted-bindings code))
(message "copied let form to kill ring")))
(message "No debugging information found.")))
#2018-01-1113:22dpsuttonwhile debugging, highlight some code and invoke this function. it will copy the forms you have highlighted and create a let binding binding all of the local vars in a debugging session#2018-01-1113:22dpsuttonso in that example earlier, step through it and then highlight (+ a b) and call that function.#2018-01-1113:25dpsutton(defn stuff []
(let [a 1
b 2]
(+ a b)
(+ 2 3)))
and debug it. highlight (+ a b) and run cider-debug-create-local-let will yank#2018-01-1113:25dpsutton(let [a 1 b 2]
(+ a b))
into your kill ring#2018-01-1116:29daveliepmannCIDER install instructions say that "Starting with version 0.11, When cider-jack-in (C-c M-j) is used, CIDER takes care of injecting [nREPL] and its other dependencies." https://cider.readthedocs.io/en/latest/installation/#ciders-nrepl-middleware Yet, I'm seeing nrepl version-string "0.2.13" in nrepl-messages while on CIDER 0.16.0. Could this indicate a problem?#2018-01-1116:34daveliepmann(This is related to debugging an issue where running tests from CIDER hangs indefinitely when a function returns a map that has a decimal value but runs fine with an integer value in the map.)#2018-01-1116:36dominicm@daveliepmann I don't think so, isn't that just the version of nrepl being injected?#2018-01-1116:37daveliepmannnot sure, it definitely could be—but I would expect version 0.16.0 to be injected, right?#2018-01-1116:39daveliepmann@dominicm#2018-01-1116:39dominicm0.16.0 is cider version#2018-01-1116:40daveliepmannyes, but aren't CIDER versions supposed to match nREPL versions? and nREPL repo says 0.16.0 is most recent and recommended https://github.com/clojure-emacs/cider-nrepl#2018-01-1116:42dominicm@daveliepmann 0.2.13 is the tools.nrepl version 🙂#2018-01-1116:43daveliepmannoverloaded names are always a delight#2018-01-1116:44daveliepmannthanks for the clarification#2018-01-1116:52bozhidarcider-nrepl -> CIDER nREPL middleware 🙂#2018-01-1116:54bozhidar@qqq file a ticket and put there our conversation highlights. Then everything is possible.#2018-01-1116:54bozhidar🙂#2018-01-1116:54bozhidar@dpsutton Cool utility!#2018-01-1117:13johnjdoes cider support the new 'clj' command?#2018-01-1117:21johnjlike, can I run cider without lein or boot and just clj ?#2018-01-1117:25dominicm@lockdown- only if you cider-connect#2018-01-1117:54bozhidarIndeed. CIDER simply needs some nREPL server to connect to. It doesn’t care how exactly it was started. Not sure how you can start a server with clj, though - I though it just starts a REPL with all deps you specific.#2018-01-1117:59dominicm@bozhidar I put my nrepl start into user.clj#2018-01-1117:59dominicm(don't put it into your component system, else a reset will disconnect you!)#2018-01-1118:26johnj@dominicm is user.clj a NS inside your src project?#2018-01-1118:26dominicm@lockdown- yes#2018-01-1120:11bozhidarInteresting idea.#2018-01-1120:27dominicmIt does work, not followed it extensively.#2018-01-1120:28dominicmI'm working out some kinks in tools.deps.alpha stopping us from using clj for an internalish project (the JUXT website)#2018-01-1120:30dominicmhttps://github.com/mrroman/devtools/ this works too#2018-01-1120:39bozhidarThat’s pretty cool!#2018-01-1120:40dominicmOnce clj adds support for a command line edn file https://dev.clojure.org/jira/browse/TDEPS-19 you can probably have a jack in like clj -G'{:extra-deps {cider-nrepl {}}}' -m cider.main cider.nrepl/middleware …#2018-01-1120:45bozhidarYeah, that’s how I hope we can use this down the road.#2018-01-1121:07qqq@bozhidar https://github.com/clojure-emacs/cider/issues/2161 ticket filed!#2018-01-1122:00genmeblogHas anything changed in the last hour in cider-nrepl snapshot (0.17.0)?#2018-01-1122:00genmeblogError loading refactor-nrepl.middleware: java.lang.IllegalAccessError: err-info does not exist, compiling:(refactor_nrepl/middleware.clj:1:1)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context#2018-01-1203:53callum@tsulej I’m getting the same issue#2018-01-1204:19callum@tsulej Just fixed this issue by pulling cider from melpa-stable instead of melpa. Hope that helps!#2018-01-1207:13vinai@callum Same issue here - how did you switch to melpa-stable?#2018-01-1207:24bozhidarHmm, seems refactor-nrepl using a function we made obsolete and removed in cider-nrepl. This was superseded by with-safe-transport which handles unexpected errors automatically.#2018-01-1207:25bozhidarThe quick fix would be to just put this temporary in refactor-nrepl itself, but ideally it should adopt with-safe-transport as well for the sake of consistency with the core CIDER middleware. //cc @benedek#2018-01-1207:32vinai@bozhidar Sounds good 🙂
Do you maybe have a suggestion how I can jack-in again short term? I'm still a newbie but willing to learn.#2018-01-1207:34bozhidarJust remove the refactor-nrepl dependency (which I assume is auto-injected by clj-refactor) and CIDER will work just fine.#2018-01-1207:35bozhidarThis means you either have to remove the package clj-refactor.el or put the following in your config:#2018-01-1207:35bozhidar(setq cljr-inject-dependencies-at-jack-in nil)
#2018-01-1207:38vinaiThanks!#2018-01-1208:21theeternalpulseHi, after updating my boot.properties clojure version to 1.9, when I try to boot the cider repl I get error in process sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0 already loaded, NOT loading version 1.2.0. I refreshed the .m2 folder and it still occurs. here's my boot properties file
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.9.0
BOOT_VERSION=2.7.2
#2018-01-1208:22theeternalpulsebefore it was on the alpha version#2018-01-1208:43bozhidarProbably you should exclude the Clojure 1.2 that’s a dependency of nREPL.#2018-01-1208:47theeternalpulsehmm, is there a separate version variable in emacs I set?#2018-01-1209:16bozhidarNo, it has nothing to do with Emacs. You’re having some problems with the dependency resolution of your Clojure project. I haven’t used boot, so I can’t give you concrete advice what to do.#2018-01-1209:42benedek@here re. refactor-nrepl breakage: new snapshot version is on clojars. please give it spin and shout if still have problems#2018-01-1209:43benedekthanks bug for the merging btw#2018-01-1209:44bozhidar@benedek Thanks for the fast response. Look into using with-safe-transport when you have time. I was hoping you had already adopted it, as it’s quite nice and simplifies the error handling a lot.#2018-01-1209:44bozhidarAny time! You’re welcome!#2018-01-1209:45benedeknot yet unfortunately. will do tho. this incident kinda points to the direction of merging refactor-nrepl into cider-nrepl i guess#2018-01-1209:45benedekthey are too close 😉#2018-01-1209:53bozhidarYeah, that’s true.#2018-01-1209:54bozhidarOn a related note - the problem happened as I plan to move everything non-nREPL related from cider-nrepl to this library https://github.com/clojure-emacs/orchard, so the core functionality can be shared with non-nREPL tools.#2018-01-1209:55bozhidarEventually this will make it easier for us to support socket repls (for instance).#2018-01-1209:56bozhidarThis extraction process might affect refactor-nrepl short-term as well. And ideally we should move the core functionality from refactor-nrepl to orchard as well.#2018-01-1209:57bozhidarI’m also extending an invitation to everyone will to help move logic across the projects - that’s an easy way to get involved with the CIDER eco-system.#2018-01-1210:00benedeksounds cool. are we adopting tools.deps style git based deps resolution for these? when lein support arrives I mean...#2018-01-1210:01bozhidarProbably yes.#2018-01-1211:17genmeblogI can confirm that bug with err-info in refactor-nrepl is solved (ie. there is no exception and env works as previously). Thanks for solving it so fast.#2018-01-1221:24pyrdo I understand it correctly that orchard paves the way for lein-free cider?#2018-01-1221:31dominicmcider is already lein-free. Orchard is about an nrepl-free cider.#2018-01-1222:04normanHaving lots of trouble with the latest cider for embedded nrepl (works ok using cider-jack-in)#2018-01-1222:05normantimeouts from cider-connect on an op-describe and#2018-01-1222:05normanjava.lang.IllegalArgumentException: Cannot resolve cider.nrepl.middleware.pprint/handle-pprint-fn
at cider.nrepl$resolve_or_fail.invokeStatic(nrepl.clj:25)
at cider.nrepl$resolve_or_fail.invoke(nrepl.clj:23)
at cider.nrepl$run_deferred_handler$fn__81560.invoke(nrepl.clj:38)#2018-01-1222:05normanInvestigating, but I thought I’d check and see if anyone else is seeing lots of problems with 0.17#2018-01-1222:06norman(this is after resolving the err-info)#2018-01-1222:38normanWell, I guess this one is on me somehow. A clean test nrepl server works fine (at least for non-uberjar/AOT)… hmmm#2018-01-1223:13normanIf anyone is curious, it looks like the culprit was com.cemerick/austin. Having that on the classpath seems to have made cider nrepl very unhappy#2018-01-1300:44qqqDue to http://wiki.c2.com/?LazinessImpatienceHubris I have decided to hack on https://github.com/clojure-emacs/cider/issues/2161 myself.#2018-01-1300:44qqq(Right now). Anyone interested in helping?#2018-01-1300:44qqqWith the right people, this should seem doable in a 15 mnin live coding session.#2018-01-1300:47qqqfor starters, what is the "get parent sexp" function in cider? I have seardhed cider.parent. and cider.outer. but not seeing it#2018-01-1301:44dpsutton@qqq i'm totally down for a CIDER hack session tomorrow but can't tonight. not sure when you'll have time to work on it again but if i'm available id love to pair with you#2018-01-1302:19qqq@dpsutton: I'd love to collaborate. I'm hacking on it at the moment, but making very slow (zero) progress. If I solve it, I'll post a solution here; if not, looking forward to tomorrow's collaboration.#2018-01-1302:32qqq(defun magic-yank ()
(interactive)
(save-excursion
(let ((start-loc (save-excursion
(lispy-left 99)
(point))))
(lispyville-yank start-loc (point)))))
this almost works, except lispyville-yank is REMOVING ('s instead of adding )'s#2018-01-1304:21qqq=== more progres ===
(defun find-outer ()
(let ((last-loc (point)))
(save-excursion
(lispy-left 1)
(message "%s %s" (point) last-loc)
(while (not (= last-loc (point)))
(setq last-loc (point))
(lispy-left 1)
(message "%s %s" (point) last-loc)))
(message "%s" (buffer-substring last-loc (point)))
last-loc))
(defun magic-yank ()
(interactive)
(let ((start-loc (find-outer)))
(message "%s %s" start-loc (point))
(buffer-substring start-loc (point))))
#2018-01-1304:24mikerodI’m using the newest Cider 0.16.0 and one thing I noticed, when I do cider-connect now to connect to an nREPL process I’ve started from another process, Cider seems to spontaneously put me in some seemingly arbitrary buffer I have open#2018-01-1304:24mikerodNot even recently accessed buffers. It used to put me right in the REPL prompt. Now I have to nav back to that myself#2018-01-1304:24mikerodIt’s a minor thing, but I find it odd#2018-01-1306:30qqq@bozhidar @dpsutton :
(defun find-outer ()
(let ((beg-loc (point))
(end-loc (point)))
(save-excursion
(lispy-left 1)
(while (not (= beg-loc (point)))
(setq beg-loc (point))
(lispy-left 1)
(message "%s %s" (point) beg-loc ))
(message "%s %s" (point) beg-loc )
(lispy-right 1)
(setq end-loc (point))
(list beg-loc end-loc))))
(defun magic-yank ()
(interactive)
(let* ((lst (find-outer))
(beg-loc (car lst))
(mid-loc (point))
(end-loc (cadr lst))
(ss (buffer-substring beg-loc end-loc)))
(with-temp-buffer
(insert ss)
(message "%s" ss)
(let ((s (- mid-loc beg-loc))
(e (point-max)))
(message "delete: %s %s" s e)
(lispyville-delete s e ))
(message "%s" (buffer-substring (point-min) (point-max))))))
so I basically have the string constructed in a temp buffer#2018-01-1306:30qqqnow the remaining part is executing this string, and having the result show up in th eoriginal buffer (while having line numbers match up)#2018-01-1306:47qqqdoes cider always want a REGION of a buffer instead of just a string when I'm calling eval ?#2018-01-1308:02bozhidar@qqq cider-defun-at-point returns the source of the surrounding top-level expression. One simple approach would be to just get it, find the cursor position there, append the matching closing delimiter of the first one and do a cider-interactive-eval on the result.#2018-01-1308:04bozhidarYou can also use something like beginning-of-defun to find the start of the top-level form and get the text between it and the (point). There are multiple ways to approach this.#2018-01-1308:05qqq@bozhidar: but I doh't want to modify the underlying buffer#2018-01-1308:05bozhidar@mikerod Please, file a ticket on GitHub and we’ll investigate.#2018-01-1308:05qqqalso, just isnerting )]} would cause unbalanced ()'s#2018-01-1308:06bozhidar@qqq And you want. You just need to get the text as a string, modify that string, not the buffer and evaluate it.#2018-01-1308:06bozhidarModifying the buffer would be a bad idea. 🙂#2018-01-1308:06qqqmagic-yank already gets me the strikng I want to execute#2018-01-1308:06qqqhow do I execute it?#2018-01-1308:06qqqI ahve a with-temp-buffer which contains the FULL sexp I want to execute#2018-01-1308:07qqqbut I can't call cider-edval-buffedr or cider-eval-last-sexp on it, as it gibvesme various errors unhappy that it's a no name temp buffer#2018-01-1308:08bozhidarYou don’t need to put this text in a buffer - you need in a variable you can just pass to cider-interactive-eval.#2018-01-1308:16qqqah, ikt's almost working#2018-01-1308:16qqqthere's some other problems, but it's with my code, not with calling cider#2018-01-1308:20qqqfor anyone else following along:#2018-01-1308:20qqq(defun find-outer ()
(let ((beg-loc (point))
(end-loc (point)))
(save-excursion
(lispy-left 1)
(while (not (= beg-loc (point)))
(setq beg-loc (point))
(lispy-left 1)
(message "looking for start: %s %s" (point) beg-loc ))
(lispy-right 1)
(setq end-loc (point))
(list beg-loc end-loc))))
(defun magic-yank ()
(interactive)
(let* ((lst (find-outer))
(beg-loc (car lst))
(mid-loc (point))
(end-loc (cadr lst))
(ss (buffer-substring beg-loc end-loc)))
(with-temp-buffer
(insert ss)
(message "full expr: %s" ss)
(let ((s (- mid-loc beg-loc))
(e (point-max)))
(lispy-mode 1)
(lispyville-mode 1)
(lispyville-delete s e ))
(setq ss (buffer-substring (point-min) (point-max))))
(message "sub exp: %s" ss)
(cider-interactive-eval ss)))
almost works, except lispyville-delete, sudd3enly, is no longer keeping matching ()'s while deleting#2018-01-1309:01qqqI'm getting the w3eirest bug. If I exec the above from init.el-buffer, lispyv8ille-delete gets matching ()'s#2018-01-1309:01qqqif I execute the above in a *.cljc buffer, lispyville-delete does NOT give me matching ()'s (it just deletes the entire region)#2018-01-1309:15qqq@dpsutton @bozhidar: I have no idea why this works, but this works for me (TM):
(defun find-outer ()
(let ((beg-loc (point))
(end-loc (point)))
(save-excursion
(lispy-left 1)
(while (not (= beg-loc (point)))
(setq beg-loc (point))
(lispy-left 1)
(message "looking for start: %s %s" (point) beg-loc ))
(lispy-right 1)
(setq end-loc (point))
(list beg-loc end-loc))))
(defun magic-yank ()
(interactive)
(let* ((lst (find-outer))
(beg-loc (car lst))
(mid-loc (point))
(end-loc (cadr lst))
(ss (buffer-substring beg-loc end-loc)))
(with-temp-buffer
(clojurec-mode)
(lispy-mode)
(lispyville-mode)
(insert ss)
(message "full expr: %s" ss)
(lispyville-delete (- mid-loc beg-loc) (point-max))
(setq ss (buffer-substring (point-min) (point-max))))
(message "sub exp: %s" ss)
(cider-interactive-eval ss)))
#2018-01-1310:28bozhidar@qqq I originally meant something like this:
(defun cider-eval-to-point ()
(interactive)
(let* ((code (buffer-substring-no-properties (beginning-of-defun) (point)))
(code (concat code ")")))
(cider-interactive-eval code)))#2018-01-1310:29bozhidarObviously has to be polished to get the right closing delimiters, but I think that fundamentally it’s pretty simple and reliable.#2018-01-1311:02qqq@bozhidar: how do you now there's only one mising ")" and that the outer form is a defun, not a let ?#2018-01-1311:08bozhidarThat can be considered just pseudo code - the right closing delimiters have to be computed additionally. Just wanted to give you an idea how surrounding source can be extracted easily.#2018-01-1311:09bozhidarKeep in mind that in CIDER we can’t use something like lispy or paredit, as they are not package deps there (and there’s little reason they should be).#2018-01-1311:11qqqRight, I guess we have slightly different objectives. You need the 'right way to do it in cider', I need something that works now so I can go back to hacking Clojure. 🙂#2018-01-1311:13bozhidarhehe#2018-01-1311:14bozhidarFair enough. 🙂#2018-01-1311:16bozhidarBut even for your case it’d be much simpler to just copy the defun to a temp buffer and kill the region from the point to the end of the buffer with paredit-mode enabled.#2018-01-1311:16qqqPS: if Toptal had implemented "clojure expert on demand", how much do you think it would have cost to have someone else do the work?#2018-01-1311:16bozhidar(as it would preserve the expression balanced)#2018-01-1311:16qqqI'm not convinced "start of defun is enough"#2018-01-1311:17qqq(let [x 20]
(defn foo [y] (+ x y))
(ct/is (= (foo 3) 23)) ;; cursor here
;; blah blah blah
)
we need to hit the start of the let, why would begin of defun help us ?#2018-01-1311:17bozhidarDepends on the rate of the expert per hour. People in our network have different rates.#2018-01-1311:18bozhidar> we need to hit the start of the let, why would begin of defun help us ?#2018-01-1311:18bozhidardefun in Emacs means top-level expression, not necessary a defn.#2018-01-1311:18bozhidarThe terminology is a bit confusing.#2018-01-1311:19qqq@bozhidar: does Toptal offer "fixed cost / i.e. payment per project" rather than "payment per hour" ?#2018-01-1311:19qqqah, you're right on 'beginning-of-defun'#2018-01-1311:20bozhidarWe have something like this, but I don’t know what exactly are the terms there https://www.toptal.com/projects#2018-01-1311:21bozhidarI know this is a for fixed-budget projects, but I’m not familiar with the exact terms.#2018-01-1311:21qqqhere's the thing: for this particular problem, I feel the 'work' is about the size of a dgood StackOverflow answer#2018-01-1311:21qqqand I'm also okay with the answer being public domain,#2018-01-1311:22qqqso I'd love to have a system where I can pay $50/$100 and have these questions / "mini projects" done by people who know elisp/clojure/whatever-else-domain better than I do#2018-01-1311:22qqqnot sure if toptal is a good match for this#2018-01-1311:53qqqcider-browse-spec-all is nice, I like it.#2018-01-1312:20qqqbesides copying/pasting the following code, is there a way to pass a regex to a function (instead of having it queried interactively)#2018-01-1312:20qqq(defun cider-browse-spec-all (&optional arg)
"Open list of specs in a popup buffer.
With a prefix argument ARG, prompts for a regexp to filter specs.
No filter applied if the regexp is the empty string."
(interactive "P")
(cider-ensure-connected)
(cider-ensure-op-supported "spec-list")
(let ((filter-regex (if arg (read-string "Filter regex: ") "")))
(with-current-buffer (cider-popup-buffer cider-browse-spec-buffer t)
(let ((specs (cider-sync-request:spec-list filter-regex)))
(cider-browse-spec--draw-list-buffer (current-buffer)
(if (string-empty-p filter-regex)
"All specs in registry"
(format "All specs matching regex `%s' in registry" filter-regex))
specs)))))
#2018-01-1315:09bozhidar> so I’d love to have a system where I can pay $50/$100 and have these questions / “mini projects” done by people who know elisp/clojure/whatever-else-domain better than I do#2018-01-1315:09bozhidarI’m guessing you can just post tickets to CIDER and place bounties on them at BoutySource (or some similar service).#2018-01-1315:10bozhidar> besides copying/pasting the following code, is there a way to pass a regex to a function (instead of having it queried interactively)#2018-01-1315:10bozhidar@qqq Not right now, but we can always extract the body if there’s a good reason to do so. What’s your use case for this?#2018-01-1321:01qqq@bozhidar: I havea hot key bound to this:
;; ("h" (my-cider-browse-ns (cider-current-ns)))
(defun my-cider-browse-spec-all (filter-regex)
(interactive "P")
(cider-ensure-connected)
(cider-ensure-op-supported "spec-list")
(with-current-buffer (cider-popup-buffer cider-browse-spec-buffer t)
(let ((specs (cider-sync-request:spec-list filter-regex)))
(cider-browse-spec--draw-list-buffer (current-buffer)
(if (string-empty-p filter-regex)
"All specs in registry"
(format "All specs matching regex `%s' in registry" filter-regex))
specs))))
which does "browse all specs in current namespace"#2018-01-1322:05bozhidarI see. I never thought of specs as something belonging to a namespace, because of the central registry for them, but I guess that makes some sense.#2018-01-1322:05bozhidarWe can certainly tweak this function.#2018-01-1322:06bozhidarBtw, I got cider-eval-defun-to-point to work pretty well with the following code, that needs some polish before I can commit it:
(defun cider--calculate-opening-delimiters ()
"Walks up the list of expressions to collect all sexp opening delimiters.
The result is a list of the delimiters."
(interactive)
(let ((result nil))
(save-excursion
(condition-case nil
(while t
(backward-up-list)
(push (char-after) result))
(error result)))))
(defun cider--matching-delimiter (delimiter)
"Get the matching delimiter for DELIMITER."
(pcase delimiter
(?\( ?\))
(?\[ ?\])
(?\{ ?\})))
(defun cider--calculate-closing-delimiters ()
"Calculate the list of closing delimiters to make the defun before point valid."
(mapcar #'cider--matching-delimiter (cider--calculate-opening-delimiters)))
(defun cider-eval-defun-to-point ()
"Evaluate the current toplevel form up to point."
(interactive)
(let* ((beg-of-defun (save-excursion (beginning-of-defun) (point)))
(code (buffer-substring-no-properties beg-of-defun (point)))
(code (concat code (cider--calculate-closing-delimiters))))
(cider-interactive-eval code)))
#2018-01-1322:06bozhidarNot my finest work, but it gets the job done. 🙂#2018-01-1322:07bozhidar(and has 0 external dependencies)#2018-01-1322:22qqq@bozhidar: TIL, the way to get @bozhidar to implement new cider functionality is to
1. implement it yourself
2. in a hacky way
3. using lots of external dependencies
then, @bozhidar will implement it cleanly 🙂#2018-01-1322:23qqq==
the problem I was running into with spec ... was that it was showing me all types of specs from clojure core + external libraries#2018-01-1322:23qqqif there was a "cider-spec-browse-all-in-my-src", that would probably be fine too#2018-01-1322:23qqqeven for that, I'd need a regex match, to name all my hnamespaces
qqq.*
then, set the regex as qqq#2018-01-1409:31bozhidar> then, @bozhidar will implement it cleanly 🙂#2018-01-1409:31bozhidar😄#2018-01-1409:32bozhidarI’m afraid this happens rather infrequently, but I do like the workflow.#2018-01-1409:32bozhidar> the problem I was running into with spec ... was that it was showing me all types of specs from clojure core + external libraries#2018-01-1409:33bozhidar@qqq Yeah, that totally makes sense. We should add some filtering for the specs that come outside the project. Please, file a ticket for this. Should be easy to do IMO.#2018-01-1410:16qqq@bozhidar: https://github.com/clojure-emacs/cider/issues/2163#2018-01-1415:21dpsuttonthe other day yall were looking for a function that would close all delimiters. it's already written in CIDER apparently
(defun cider-repl-closing-return ()
"Evaluate the current input string after closing all open parenthesized or bracketed expressions."
(interactive)
(goto-char (point-max))
(save-restriction
(narrow-to-region cider-repl-input-start-mark (point))
(let ((matching-delimiter nil))
(while (ignore-errors (save-excursion
(backward-up-list 1)
(setq matching-delimiter (cdr (syntax-after (point))))) t)
(insert-char matching-delimiter))))
(cider-repl-return))
#2018-01-1416:47bozhidar@dpsutton Yeah, what I ended up implementing for cider-eval-defun-to-point is similar, but a bit more generic.#2018-01-1416:48dpsuttoni only discovered that because i messed with enter in a repl. I've really been enjoying changing it so that enter gives a new line and control enter sends for evaluation. makes the repl more easy to play with before evaluating#2018-01-1416:49dpsutton(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
#2018-01-1416:50bozhidar@dpsutton I think you might want to add this to the manual. It’s an useful tip for many people.#2018-01-1416:50dpsuttoncan do. it really changed my interaction with the repl#2018-01-1416:51bozhidar:thumbsup:#2018-01-1417:15dpsuttondone#2018-01-1417:20bozhidarThanks! Merged.#2018-01-1419:36bozhidar@qqq cider-eval-defun-to-point is live. I’ve also added a couple of more commands you might find useful - cider-eval-last-sexp-in-context and cider-eval-sexp-at-point-in-context.#2018-01-1420:53qqq@dpsutton @bozhidar: noted; thanks!#2018-01-1506:23callumHow would I go about fixing an issue where cider-test-run-project-tests runs zero assertions, but running lein test runs all of my (11) assertions?
Running , classpath in the cider repl yields an empty buffer. cider-load-all-project-ns loads zero namespaces as well#2018-01-1506:28callumThis is with Cider 0.16.0#2018-01-1506:53bozhidar@callum It’s best to file a ticket on GitHub and add some repro steps there.#2018-01-1506:57qqq@bozhidar: does toptal give you 20% time to work on cider, or is all your cider work still 100% volunteer ?#2018-01-1506:58qqq(if it's off topic, that's a valid response too 🙂 )#2018-01-1506:58bozhidar100% volunteer. That’s why things are happening relatively slowly - I’ve got many OSS projects and little free time.#2018-01-1507:00bozhidarI started work on the project prior to joining Toptal, when I had the desire to switch my career from Ruby to Clojure. For good or bad, however, Toptal is mostly a Ruby company therefore my only drive to improve CIDER are the people who actually use it. 🙂#2018-01-1507:02qqqyou need to do a CIDER ICO#2018-01-1507:03qqqlike other ICOs, the 'investors' will get nothing back, but unlike other ICOs, this will make the world a better place#2018-01-1507:43bozhidarYeah, that’d be nice. I have doubts there would be a lot of support for an initiative like this, but I plan to do it eventually if I decide to take some creative leave. Unfortunately most jobs pay a lot better than even successful fundraisers. Magit’s was as good as an Emacs fund-raiser can get I guess and it raised less than an average annual dev salary.#2018-01-1507:50qqqThere was something called the million dollar homepage a while back. On startup, you can have cider render a 1000x1000 pixel image ... and charge people $1/month to rent a pixel. 🙂#2018-01-1513:46bozhidar😄#2018-01-1513:48bozhidarBtw, today I also added two more new CIDER commands if anyone is interested in checking those out - cider-repl-set-type (to manually change the type of a REPL between Clojure and ClojureScript; Normally this shouldn’t be needed but if the type detecting doesn’t work well for some reason you’ve got the option to use this) and cider-connect-clojurescript (basically a version of cider-connect that sets the new REPL type to cljs once connected).#2018-01-1517:31richiardiandreabohzidar I was wondering whether some of the structural editing commands could be added to clojure-mode instead so that inf-clojure users could use them as well#2018-01-1517:32richiardiandreamaybe a clojure-mode-eval-string defcustom could decide what to do with the payload if it needs to be evaluated#2018-01-1517:32richiardiandrea(just brainstorming as usual)#2018-01-1513:48carkhwe'll have to get emacs to compile with image support#2018-01-1513:49carkhbetter sell per character on an ascii art image#2018-01-1514:42jmayaalvor start using the “quoutes” shown on jack-in for profit!#2018-01-1516:27carkhthis quote brought to you by cognitec !#2018-01-1517:21gonewest818Too funny. I configured my “repl is connected” quote to be pulled from the http://adafruit.com website (online store for hobby electronics, embedded micro controllers, wearables, robotics, etc). They’ve always had a nicely curated set of quotes in the footer of their website. #2018-01-1517:23gonewest818https://melpa.org/#/adafruit-wisdom#2018-01-1517:23gonewest818Maybe I should get a sale / affiliate commission for that. #2018-01-1517:56bozhidar@gonewest818 Cool! Feel welcome to submit some of those to CIDER. I’m always opening to adding more of those, so people don’t get bored with them.#2018-01-1518:01gonewest818Ok. I was thinking about generalizing the code so that other sites could be easily added. At the end of the day it’s just fetching a URL (or consulting a cached one), parsing, and choosing one at random.#2018-01-1619:32qqqfor those who use code folding, what code folding toolkit do you use?
I'm using yafolding, but it seems laggy on files with > 500 lines#2018-01-1705:40qqq(ct/deftest test-a!
(ct/is (thrown? Error (a! nil)))
(ct/is (thrown? AssertionError (assert false)))
(ct/is (thrown? java.lang.ArithmeticException (/ 1 0)))) ;; cursor is here
C-x C-e defines the test
I know about 'cider-run-tests'
However, I don't always want to run all tests.
Is there a way to say "run only the test right in front of the cursor" ?#2018-01-1705:45gonewest818C-c C-t t (or equivalently C-c C-t C-t) is bound to cider-test-run-test which runs the test at point. I believe in your example it would run all three is clauses in test-a!.#2018-01-1706:12qqq@gonewest818 :
1. cider-test-run-test is great
2. this may be cause I'm using evil/lispy/lispyville
cider-test-run-test seems to want the cursor to be on the "(" whereas cider-eval-last-sexp seems to want cursor to be on the ")"#2018-01-1706:12qqqoh, I guess I should be comparing cider-test-run-test with cider-eval-sexp-at-point#2018-01-1706:17qqq@gonewest818: I just defined
(defun my-cider-test-run-test-last-sexp ()
(interactive)
(save-excursion
(evil-backward-char 1)
(lispy-left 1)
(cider-test-run-test)))
and it works beautifully now; thanks! 🙂#2018-01-1708:47bozhidar> cider-test-run-test seems to want the cursor to be on the “(” whereas cider-eval-last-sexp seems to want cursor to be on the “)”#2018-01-1708:48bozhidarI thought it was supposed to work anywhere within the test definition. File a ticket about this, maybe it’s worth adding some other way to run a single test.#2018-01-1708:57qqq@bozhidar: https://github.com/clojure-emacs/cider/issues/2168 -- done#2018-01-1708:57qqqthis looks like another case of "solve problem use lispy, @bozhidar solves it correctly" 🙂 🙂 🙂#2018-01-1709:13bozhidarhaha#2018-01-1709:13bozhidarPerhaps 🙂#2018-01-1709:40qqq(foo (+ 2 3) # (* 4 5))
# = my cursor
is there a command which will transform the above into
foo (+ 2 3) # (* 4 5)
what I want is: find smallest 'parent ()', remove the ()#2018-01-1709:42qqqah, got it (lispy-left 1) (lispy-splice) 🙂#2018-01-1715:29gonewest818in paredit M-s for paredit-splice-sexp#2018-01-1800:38gonewest818@bozhidar: do you expect the tests for cider-nrepl to work when invoked in cider itself? In particular, I’m getting failures in cider.nrepl.middleware.debug-integration-test if I visit the file and C-c C-k followed by C-c C-t C-n. The failing cases all sit inside step-in-to-function-in-current-project-test.#2018-01-1800:43gonewest818The failures look very similar (might be identical?) to the test failures when run with cloverage. Tests in that namespace do not fail when run like lein with-profile +1.8,+test-clj test#2018-01-1800:46dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/issues/390#2018-01-1800:47dpsuttonalso to be aware of. the tests don't run correctly independently of each other#2018-01-1800:59gonewest818@dpsutton, thanks, I’ll keep that in mind but it doesn’t seem to be the same issue.#2018-01-1801:02gonewest818Running just the one namespace’s tests fails like so…
$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-debug in this context, compiling:(cider/nrepl/middleware/debug_integration_test.clj:29:3)
but if I edit (:require [cider.nrepl :refer [wrap-debug]]) in that namespace, then
$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test
lein test cider.nrepl.middleware.debug-integration-test
Ran 11 tests containing 181 assertions.
0 failures, 0 errors.
#2018-01-1801:08dpsuttonsounds good. hadn't looked through it, just saw it was problems with testing#2018-01-1801:11gonewest818Actually, the problem might be a classpath thing. I could probably use a hint on this… This test step-in-to-function-in-current-project-test describes its purpose as
;; We want to ensure that the debugger can find and instrument the code of a
;; function that lives in a regular file on the classpath (as opposed to,
;; for example, in a jar, which is tested later).
#2018-01-1801:12gonewest818And the first case to fail is
(--> :eval "(ns user.test.step-in
(:require [cider.nrepl.middleware.debug-integration-test.fn :as test-fn]))")
(<-- {:ns "user.test.step-in"})
#2018-01-1801:13gonewest818The ns fails because Message: {:ex "class java.io.FileNotFoundException", :id 486, :root-ex "class java.io.FileNotFoundException", :session "2e4b5c11-8c2c-4f98-b5f5-3c568568b077", :status ["eval-error"]}#2018-01-1801:14gonewest818Which I am interpreting as (maybe?) a failure to find cider/nrepl/middleware/debug_integraton_test/fn.clj#2018-01-1801:18gonewest818There’s a comment in the code that says literally “you cannot use the cider debugger to debug these tests :(” because the debugger has mutable global state that makes it impossible to isolate the debugging session’ from the tests.#2018-01-1802:00gonewest818Nevermind. I wasn’t specifying the right profiles for cider-jack-in.#2018-01-1807:04bozhidarA problem that solves itself I guess. 🙂#2018-01-1807:06bozhidarAnd way too many Lein profiles - I don’t even remember at this point why the default lein profile for cider-nrepl isn’t including anything. As I told you - there’s a ton of potential for cleanup and improvement there.#2018-01-1809:03wopeersHi, I'm working on a project which uses http-kit. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?#2018-01-1810:57qqqhow do I tell cider-doc to ignore cider-prompt-for-symbol and just always use the symbol under point ?#2018-01-1810:57qqqI want two separate hydra bindings, one for under symbol, one for prompting#2018-01-1811:01qqq(cider-doc-lookup (cider-symbol-at-point))#2018-01-1811:01qqqthis function is amazing, saves all the chrome -> google -> clojuredocs "func name" searches#2018-01-1811:40bozhidar> how do I tell cider-doc to ignore cider-prompt-for-symbol and just always use the symbol under point ?#2018-01-1811:41bozhidarThere’s a defcustom called cider-prompt-for-symbol - just set it to nil.#2018-01-1811:41bozhidarJust keep in mind that’s going to affect all commands, not just cider-doc. Generally people want to same behavior across all similar commands.#2018-01-1811:43bozhidar> Hi, I’m working on a project which uses http-kit. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?#2018-01-1811:43bozhidar@wopeers I think that was some known, but inconsistent bug. If you can reproduce it reliably feel free to file a ticket.#2018-01-1811:44bozhidarPerhaps de-instrumenting the function and instrumenting it again will work as some workaround.#2018-01-1811:44bozhidar> I want two separate hydra bindings, one for under symbol, one for prompting#2018-01-1811:45bozhidarYou can just define some wrapper function like this:
(defun my-cider-doc ()
(let ((cider-prompt-for-symbol nil))
(cider-doc...#2018-01-1811:46bozhidarJust a vague sketch using dynamic bindings to change the behaviour of the function you wrap - might be odd for Clojure devs, but it’s very common in Emacs Lisp.#2018-01-1812:04qqq@bozhidar: (cider-doc-lookup (cider-symbol-at-point))`` works fine for my needs#2018-01-1812:42bozhidarFair enough. 🙂#2018-01-1812:44bozhidarBtw, @qqq take a look at my response here https://github.com/clojure-emacs/cider/issues/2168#2018-01-1812:52qqq@bozhidar: this may take a while, I'm new to the 'elisp debugger'#2018-01-1813:07bozhidar@qqq See this page http://cider.readthedocs.io/en/latest/troubleshooting/#2018-01-1822:19bozhidarBtw, while debugging this I noticed that we weren’t highlighting test assertions that were defined interactively and failed, so at least I fixed this. 😄#2018-01-1822:26qqqevil keys is screwing up my ability to use edebug#2018-01-1822:26qqqthis is going to take longer than expected, I ca nset the brea point and on executing cider-test-run-test, have it load up cider-test.el at the (let ((ns ...#2018-01-1822:26qqqbut can't get it to step through lines yet#2018-01-1905:18qqq@bozhidar: hey, sorry, not going to be able to debug this soon -- 'my-cider-test-on-test-last-sexp' works fine for me, and too lazy to learn how edebug works#2018-01-1907:25bozhidarOK, no problem. I was just really wondering how you and me could be getting a different behavior.#2018-01-1908:53iperdomohi all, i was browsing the code in cider-nrepl (https://github.com/clojure-emacs/cider-nrepl/tree/v0.16.0) and I tried to follow the section "Or (if you know what you're doing) add cider-nrepl to your :dev :dependencies vector plus specific middleware to :nrepl-middleware under :repl-options" ... but my repl always fail to start with Unable to resolve var: cider.nrepl.middleware.out/wrap-out in this context#2018-01-1908:54iperdomomy goal was to see if i can use the wrap-out nrepl middleware from a Cursive Remote REPL#2018-01-1908:54iperdomois that possible? 😕#2018-01-1909:10bozhidarYeah, that should be completely possible.#2018-01-1909:11bozhidarCan you try the same with 0.15? I’m curious if that’s some problem caused by the deferred middleware loading we introduced in 0.16.#2018-01-1909:15iperdomoha! 0.15.0 works 😄#2018-01-1909:15iperdomowell, the repl starts#2018-01-1909:15iperdomomy project.clj#2018-01-1909:32iperdomothe same applies to version 0.15.1 the repl starts .... but now when I connect from Cursive via a Remote REPL, the *out* is not redirected to the Cursive output, do i need to do something extra?#2018-01-1909:33iperdomobtw, this setup just works with CIDER ... we're just a team where some people use Cursive and others CIDER, we get this nice feature and I was trying to make it work for the others 🙂#2018-01-1910:06bozhidarWell, there’s nothing specific about CIDER in any of the middleware, so I’m really puzzled by this.#2018-01-1910:07bozhidarPerhaps the real difference is that CIDER handles some messages it gets from nREPL differently.#2018-01-1910:08bozhidarCan you file a ticket about this in cider-nrepl. I guess we might reconsider whether to provide some eagerly loaded versions of the middleware to address point 1 and think a bit more what’s wrong with the output handing in Cursive.#2018-01-1910:09iperdomowill do, many thanks for your support#2018-01-1910:12qqq@bozhidar: because the horse isn't dead enough:
I recently switched to:
(defun my-cider-test-run-test-last-sexp ()
(interactive)
(save-excursion
(search-backward-regexp "ct/deftest")
(evil-backward-char 1)
(cider-test-run-test)))
so basically, my last version wasn't very stable either, I had to ahve the cursor right after the ")" otherwise, it had problem finding it too
now, this new version is: search back regex for most recent ct/deftest ... run that 🙂#2018-01-1910:17bozhidarBut your version will fail if you don’t have the ct ns alias.#2018-01-1910:17bozhidarJust saying.#2018-01-1910:18bozhidarGenerally regexp search is bad idea, because sooner or later you run in a situation where this matches a text in a string or something like this.#2018-01-1910:18qqqyeah, the correct way is probably:?
search back for 'deftest"
search back for "("#2018-01-1910:18bozhidarBut I guess this will work for you most of the time.#2018-01-1910:18qqqoh right, by "correct" I meant "less hacky"#2018-01-1910:19qqqi guess here's the thing; I can get away with this regex hack because the rest of cider is robust; if all of cider was based on regexes, we'd be f*cked#2018-01-1910:19bozhidarI would just check the current form as a list and see what’s the first item in it.#2018-01-1910:20qqqso I have situations where I do:
(do
...
(do ...
(defn ...
(ct/deftest ...)));;cursor here
so now, my "last sexp" is the outer do, not the ct/deftest#2018-01-1910:20bozhidarBut my general puzzlement continues to be you need to do something like this, as the current code works fine for me in the end of the test form and reading its code it was designed to work this - see the usage of clojure-find-defun.#2018-01-1910:21bozhidar(defun cider-test-run-test ()
"Run the test at point.
The test ns/var exist as text properties on report items and on highlighted
failed/erred test definitions. When not found, a test definition at point
is searched."
(interactive)
(let ((ns (get-text-property (point) 'ns))
(var (get-text-property (point) 'var)))
(if (and ns var)
;; we're in a `cider-test-report-mode' buffer
;; or on a highlighted failed/erred test definition
(progn
(cider-test-update-last-test ns var)
(cider-test-execute ns (list var)))
;; we're in a `clojure-mode' buffer
(let ((ns (clojure-find-ns))
(def (clojure-find-def)))
(if (and ns (member (car def) cider-test-defining-forms))
(progn
(cider-test-update-last-test ns (cdr def))
(cider-test-execute ns (cdr def)))
(message "No test at point"))))))
#2018-01-1910:22qqqdamn it, you've dragged me into this tarpit, I'll learn edebug, hang on 🙂#2018-01-1910:22bozhidarThat’s why I really wanted just to see a stepping of this in the debugger to see what’s different for you.#2018-01-1910:23qqqwhat do you need from me? a screen capture / video? does it also need to show key presses#2018-01-1910:23bozhidarIt’s really easy, btw - just C-u C-M-x in the body of this function and then n, n, n once it gets triggered.#2018-01-1910:23bozhidarCIDER’s debugger works exactly the same, as we copied the design of edebug.#2018-01-1910:24qqqso I don't know how to use debuggers, I just use unit tests / print statements, but let me try edebug, brb 5 mins#2018-01-1910:24bozhidar> what do you need from me? a screen capture / video? does it also need to show key presses#2018-01-1910:24bozhidarThat would be ideal, but you just tell me what happens at this lines:#2018-01-1910:24bozhidar> (def (clojure-find-def)))#2018-01-1910:24bozhidar> (if (and ns (member (car def) cider-test-defining-forms))#2018-01-1910:25bozhidar> (cider-test-execute ns (cdr def)))#2018-01-1910:36qqq@bozhidar: https://imgur.com/a/UfPSJ#2018-01-1910:36qqqokay this is wher eI get lost#2018-01-1910:36qqqhow do I "step" because pressing "n" does not next step#2018-01-1910:39qqq@bozhidar: here is a sequence of screen shots of me pressingn lots of times: https://imgur.com/a/QxCI6#2018-01-1910:55qqq@bozhidar: is this enough: should I generate more / create a video ?#2018-01-1911:47bozhidar@qqq You got the stepping working, right?#2018-01-1911:55qqq@bozhidar: https://imgur.com/a/QxCI6 <-- I have this set of images is this what you mean by 'stepping' ?#2018-01-1912:20bozhidar@qqq I saw what I needed. For some reason for you clojure-find-def is returning nil. Post this to the ticket and I’ll try to reproduce it with your code.#2018-01-1912:21bozhidarThat seems to be caused either by the alias or the dos around the deftest.#2018-01-1912:31qqq@bozhidar: remove do / alias , it still breaks#2018-01-1912:31qqqshould I step through clojure-find-def ?#2018-01-1912:34qqq@bozhidar: here's a set instrumenting clojure-find-def
https://imgur.com/a/RZoAv#2018-01-1912:34qqqdebugging elisp is almost sorta kinda fun 🙂#2018-01-1912:44qqq@bozhidar: should I produce a minimal init.el ?#2018-01-1912:44qqqyou're basically debugging 'blind' as you can't replicate the issue#2018-01-1913:03qqq@bozhidar: I posted a 58 line init.el replicating the prolblem at https://github.com/clojure-emacs/cider/issues/2168
let me know if there's anything else I can provide#2018-01-1913:33bozhidarSeems might really be some problem with clojure-find-def, but I wonder why this works for me.#2018-01-1913:34bozhidarOn the bright side - seems now you’re comfortable with edebug. 😄#2018-01-1913:34qqqyeah, if anyone else wants to learn edebug, just post a but @bozhidar can't replicate, and he'll teach you edebug for free 🙂#2018-01-1913:35qqqI also attached a 58 line init.el (most of it use-package), may be of use if you want to replicate issue locally#2018-01-1915:15qqq@bozhidar: still haven't fixed it? do I need to ship you a VM with a emacs replicating the bug? 🙂#2018-01-1915:16qqqactually, now that I mention it, funnily enough, ikt's possible to create a $5 digital ocean droplet, save the image, and share it, fasicnating how cloud changes things#2018-01-1915:44bozhidarI’ll look into this a bit more when I find some time. Locally I tried some things quickly, but I still can’t find a way to reproduce this.#2018-01-2001:58macrobartfastwhen trying to use cider-20180118.1416 in emacs 24.5.1 I'm getting a 'Symbol's value as variable is void: help-mode-map' error at the prompt.#2018-01-2001:58macrobartfastany thoughts?#2018-01-2003:52qqqTwo cider questions:
1. is there a wa to tell cider to HIDE "Java" b ydefault for the stackframes
2. When I click on line numbers / file name, I don't wnat it to repalce the "stack frame window", I want it to open in a pre-existing window#2018-01-2004:27dpsuttonYes to the first. At the top of the stack frame are buttons. Click the java one#2018-01-2004:28dpsuttonI think you can hit j. Not sure exactly which key. I know p will finger to just project frames#2018-01-2004:37qqq@dpsutton: I meant doing it via init.el so the button is "always auto pressed"#2018-01-2008:12bozhidar> when trying to use cider-20180118.1416 in emacs 24.5.1 I’m getting a ‘Symbol’s value as variable is void: help-mode-map’ error at the prompt.#2018-01-2008:13bozhidarThat’s pretty odd. help-mode is a built-in and this should work just fine.#2018-01-2008:13bozhidarIs this just some warning you get when you install the package?#2018-01-2008:17bozhidar> 2. When I click on line numbers / file name, I don’t wnat it to repalce the “stack frame window”, I want it to open in a pre-existing window#2018-01-2008:17bozhidarI don’t think we’ve made this configurable.#2018-01-2008:53qqq@bozhidar: can you please explain what the solutioh to https://github.com/clojure-emacs/cider/issues/2170 is ?#2018-01-2008:53qqqthe 's' key does nothing for me#2018-01-2008:55bozhidarJust tested this and it works fine for me. You simply have to go to some line in the browser and press it s. It does the same thing s does in the doc buffers.#2018-01-2010:15qqq@bozhidar: can you tell me what C-h k s returns for you ?#2018-01-2010:30bozhidars runs the command cider-browse-ns-find-at-point (found in
cider-browse-ns-mode-map), which is an interactive compiled Lisp
function in
'~/projects/emacs.d/elpa/cider-20171216.707/cider-browse-ns.el'.
It is bound to s.
(cider-browse-ns-find-at-point)
Find the definition of the thing at point.
#2018-01-2010:32qqqoh wow, this works; nice; thanks!#2018-01-2010:32bozhidarIt was bound to something else for you?#2018-01-2010:33qqqyeah, hh-s/body (hydra s -key) ; mostly likely due to evil/lispyville (which I overwrote) having higher priority than cider#2018-01-2013:57qqqthe context here is: sending stuff to clojure repl, getting response back, and how to display it:
the handler I want: dispalys it in buffer, does NOT insert it, vanishes when I type
what I found from digging into the source: (cider-eval-print-handler)
unfortunately, when I use that handler, it appears to INSERT INTO BUFFER (modifying the buffer), I don't want that#2018-01-2013:58qqqwhat is the handler I should be using?#2018-01-2015:47dpsutton@qqq (setq cider-stacktrace-filters '(java)). options are clj, java, repl, tooling and dup in that list#2018-01-2022:22donmullenHave been working on development environment and updated basic dev tools, including emacs packages. Now getting the following on cider-jack-in : Starting nREPL server via /usr/local/bin/boot -i "(require 'cider.tasks)" -d org.clojure/tools.nrepl\:0.2.13 -d cider/cider-nrepl\:0.17.0-SNAPSHOT cider.tasks/add-middleware -m cider.nrepl/cider-middleware cider repl -s -H :: wait...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Classpath conflict: org.clojure/clojure version 1.9.0 already loaded, NOT loading version 1.2.0
#2018-01-2022:23donmullenUsing boot - not quite sure where the conflict is.#2018-01-2023:32donmullenSeems 17-SNAPSHOT was the problem - rolled back to v16 and pinned cider to melpa-stable.#2018-01-2106:46bozhidar@donmullen I don’t get how this can be happening to begin with. None of the deps of cider-nrepl has changed recently and the only thing I see depending on 1.2 is nREPL itself.#2018-01-2108:33dominicmThis is actually a boot thing, because clojure hadn't been specified in boot.properties and build.boot#2018-01-2112:33donmullen@dominicm - the strange thing was that I had specified clojure version in build.boot and boot.properties and was still getting that error. At any rate - is working with 16 stable.#2018-01-2112:38dominicmhuh, odd#2018-01-2108:33dominicmThis is actually a boot thing, because clojure hadn't been specified in boot.properties and build.boot#2018-01-2109:15dominicm@bozhidar we might not want to Mr Anderson in orchard, and instead have users do that themselves? So that they can load multiple versions of orchard.#2018-01-2112:20bozhidar@dominicm This makes sense for cider-nrepl, but doesn’t make sense for people who’d want to use it directly.#2018-01-2112:21bozhidarI’ll think about it, it’s not a big deal right now.#2018-01-2112:21bozhidarI also think there was some issue with dynapath and MrAnderson. I think that’s the reason we had used MrAnderson on it in cider-nrepl.#2018-01-2112:47bozhidarAt any rate - at least now a lot of cider-nrepl is in orchard. I had a surprisingly productive day yesterday. Unfortunately now we’re left with the really hard work - solidifying a client API and documenting it. 😄#2018-01-2112:48bozhidarThere’s mode code to be extracted from cider-nrepl as well, it’d be nice to also extract some things from refactor-nrepl (//cc @benedek), but the foundation is here.#2018-01-2118:48benedek@bozhidar i think ,classpath command is broken under java9 because of https://dev.clojure.org/jira/browse/CLASSPATH-8#2018-01-2118:51benedekwant me to file an issue against orhcard i guess, or?#2018-01-2118:52bozhidarYeah, sure. I’m guessing a lot of things are broken on Java 9, because of this. We use the classpath library at several places.#2018-01-2207:28qqq(defun my-eval-outer-helper (handler)
(let ((beg-loc (point))
(mid-loc (point))
(end-loc (point))
(ss ""))
(save-excursion
(search-backward-regexp "(do \"[*]") (setq beg-loc (point))
(setq ss (cider-sexp-at-point))
(with-temp-buffer
(clojure-mode) (lispy-mode) (lispyville-mode) (insert ss)
(lispyville-delete (- mid-loc beg-loc) (point-max))
(setq ss (buffer-substring (point-min) (point-max)))
(message "sub exp: >>>\n%s\n<<<" ss)))
(cider-interactive-eval ss handler )))
(defun my-cider-eval-outer ()
(interactive)
(my-eval-outer-helper (cider-eval-print-handler) ))
This almost works, except that cider-eval-print-handler INSERTS RESULT INTO BUFFER, MODIFYING IT.
How do I get the default behaviour of "displays it in an overlay that vanishes on keypress" ?#2018-01-2207:29qqq@bozhidar: ^ insights ? 🙂#2018-01-2208:20qqqfigured it out, bounds needs to be no nikl#2018-01-2210:17jmayaalv@bozhidar i’m working on https://github.com/clojure-emacs/cider/issues/1993 and pretty close to complete, but i’m now facing some issues on cider. I getting this error:
cider-profile-display-stats: Wrong number of arguments: ((cider-special-mode-truncate-lines cider-buffer-ns cl-struct-nrepl-response-queue-tags t) (request connection &optional abort-on-input tooling) "Send REQUEST to the nREPL server synchronously using CONNECTION.
Hold till final \"done\" message has arrived and join all response messages
of the same \"op\" that came along.
If ABORT-ON-INPUT is non-nil, the function will return nil at the first
sign of user input, so as not to hang the interface.
If TOOLING, use the tooling session rather than the standard session." (let* ((time0 (current-time)) (response (cons (quote dict) nil)) (nrepl-ongoing-sync-request t) status) (nrepl-send-request request (function (lambda (resp) (nrepl--merge response resp))) connection tooling) (while (and (not (member "done" status)) (not (and abort-on-input (input-pending-p)))) (setq status (nrepl-dict-get response "status")) (if (member "need-input" status) (progn (cider-need-input (current-buffer)) (setq time0 (current-time))) (if (and nrepl-sync-request-timeout (> (car (cdr (time-subtract ... time0))) nrepl-sync-request-timeout)) (progn (error "Sync nREPL request timed out %s" request)))) (nrepl-dict-put response "status" (remove "need-input" status)) (accept-process-output nil 0.01)) (if (member "done" status) (progn (let ((ex (nrepl-dict-get response "ex")) (err (nrepl-dict-get response "err")) (eval-error (nrepl-dict-get response "eval-error")) (pp-stacktrace (nrepl-dict-get response "pp-stacktrace")) (id (nrepl-dict-get response "id"))) (if (and ex err) (progn (cond (eval-error (funcall nrepl-err-handler)) (pp-stacktrace (cider--render-stacktrace-causes pp-stacktrace ...))))) (if id (progn (save-current-buffer (set-buffer connection) (nrepl--mark-id-completed id)))) response))))), 1
#2018-01-2211:39bozhidarSeems the signature of some function got changed, but I it’s hard for me to tell which one when the stacktrace is formatted this way.#2018-01-2211:40bozhidarCan you send me a link to the source?#2018-01-2212:40bozhidarOr some better formatted backtrace?#2018-01-2212:41jmayaalvThis is the code:
cider-nrepl: https://github.com/jmayaalv/cider-nrepl/tree/feature/profile
cider: https://github.com/jmayaalv/cider/tree/feature/profile#2018-01-2212:42jmayaalvhow can i get a better stacktrace? i am just pasting what i got on the messages buffer (sorry, really a newbie on emacs/elips dev)#2018-01-2212:53bozhidar@jmayaalv I meant better formatted. I simply can’t tell apart the stack frames in this.#2018-01-2212:53bozhidarI also can’t figure out where exactly si the problem happening.#2018-01-2212:54jmayaalvok, let me clean in it up a bit manually then. 🙂#2018-01-2212:55bozhidarBtw, also feel free to open PRs even now and we can discuss some things on the diff.#2018-01-2212:57bozhidarIf I had to guess - either the signature of nrepl-send-sync-request or cider-nrepl-send-request is outdated. Just consult the current CIDER code to see what’s the proper signature there.#2018-01-2213:00jmayaalvGreat, thanks, i will look into those and open the PR.#2018-01-2213:16bozhidar:thumbsup:#2018-01-2309:11stardivinerI got an error in CIDER REPL buffer when CIDER try to complete.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/stardiviner/.m2/repository/org/slf4j/slf4j-nop/1.6.2/slf4j-nop-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/stardiviner/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
SLF4J: The following set of substitute loggers may have been accessed
SLF4J: during the initialization phase. Logging calls during this
SLF4J: phase were not honored. However, subsequent logging calls to these
SLF4J: loggers will work as normally expected.
SLF4J: See also
SLF4J: clojure.tools.nrepl.server
#2018-01-2309:11stardivinerhttps://www.slf4j.org/codes.html#substituteLogger#2018-01-2309:14stardivinerMaybe it is not CIDER issue. Curious how to debug this issue?#2018-01-2309:27stardivinerBased on this: https://www.slf4j.org/codes.html#multiple_bindings Should I remove logback-classic or slf4j-nop ?#2018-01-2309:29stardivinerAfter I remove logback-classic, and launch lein repl. It is installed back again. How can I find out which package is depending on logback-classic?#2018-01-2309:35jmayaalv@stardivineryou can run lein deps :tree. and that would give you a tree view of your dependencies.#2018-01-2309:36jmayaalvyou can then check where logback-classic is being used.#2018-01-2309:36stardiviner@jmayaalv I'm using global Leiningen dependencies. not in a project.#2018-01-2309:36stardivinerIf so, might I need to bisect all Leiningen :deps ?#2018-01-2309:38jmayaalvit’s a better practice to avoid global dependencies. it’s very easy to forget what you have on there. so yes, i think it would be better to divide them.#2018-01-2309:39stardiviner@jmayaalv I see. Thanks for your help.#2018-01-2311:20carkhhum when i C-x C-e in a cljc file, with a clojurescript repl, i get the result nicely pretty-printed in an overlay in my source file....but when i do this in a clojure repl, it's not pretty-printed ... any idea how to have it looking nice ?#2018-01-2311:53bozhidar@carkh I need a bit more context, but this sounds like some bug. The results should look the same regardless of the REPL type.#2018-01-2311:53bozhidarYou might want to report this upstream together with some repro steps.#2018-01-2311:53carkhis the overlay output supposed to be pretty printed ?#2018-01-2311:55carkh(i'm pretty new to this workflow ... i've been using the repl exclusively for years when doing evaluations)#2018-01-2311:57bozhidarI don’t think it is supposed to be pretty-printed.#2018-01-2311:57bozhidarWithout consulting the code I don’t remember to be honest.#2018-01-2311:58carkhbah that's no big deal anyways =) looks like c-c c-p opens a window with a pretty printed output...so I'm good#2018-01-2311:59bozhidarI’m just curious where you’re getting those differences from, as this certainly shouldn’t be happening.#2018-01-2311:59carkhprobably somethign in the chain for clojurescript does the pretty printing...there are quite a few moving parts between sidecars figwheel devcards re-frame etc#2018-01-2312:03carkhBunch of stuff in my project.clj
:plugins [[lein-figwheel "0.5.14"]
[lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]]
....
{:dev {:dependencies [[binaryage/devtools "0.9.8"]
[figwheel-sidecar "0.5.14"]
[com.cemerick/piggieback "0.2.2"]
[re-frisk "0.5.3"]
[devcards "0.2.4"]
[org.clojure/test.check "0.10.0-alpha2"]]
:source-paths ["src" "dev"]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
:clean-targets ^{:protect false} ["js/compiled"
:target-path]}}
#2018-01-2312:15bozhidarhttp://cider.readthedocs.io/en/latest/configuration/#pretty-printing#2018-01-2312:16bozhidarhttp://cider.readthedocs.io/en/latest/using_the_repl/#pretty-printing-in-the-repl#2018-01-2312:45carkhah but pretty-printing works in the repl without issue#2018-01-2312:46carkhthat's only when evaluating inside my source file with C-x C-e (cider-eval-last-sexp)#2018-01-2313:11genmeblog@bozhidar looks like current (today's) snapshot is not working, after lein repl I have tons of stacktrace#2018-01-2313:12genmeblogI mean cider-nrepl#2018-01-2314:17orlandowI'm getting this:#2018-01-2314:17orlandowSEVERE: Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session 112e0813-ae55-42ce-b46c-df3c40783c07, :id 8}
java.lang.RuntimeException: No such var: ns-find/sources-in-jar, compiling:(orchard/namespace.clj:98:48)
#2018-01-2314:26bozhidarSeems the latest snapshot of orchard didn’t get downloaded or something like this.#2018-01-2317:34mhcatlooks like cider still injects a non-alpha version of tools.namespace. That didn't stop this error disappearing when I changed the version of tools.namespace already in my :dev profile deps to 0.3.0-alpha4 to match - doing that made my repl start correctly#2018-01-2314:27bozhidarThat’s the relevant PR https://github.com/clojure-emacs/cider-nrepl/pull/486/files#2018-01-2314:27bozhidarI don’t have time to check what went wrong now, though.#2018-01-2314:28bozhidarBasically some code was moved from cider-nrepl to orchard.#2018-01-2314:29bozhidar(we’ve got this initiative to extract the core logic from cider-nrepl to orchard, so other clients can use it and we can eventually use it via the socket repl, which we hope to support one day in CIDER)#2018-01-2314:36genmeblog@bozhidar in my problem it looks that dependency to net.littleredcomputer/sicmutils started to causing problem...#2018-01-2314:37genmeblogso it's not directly related to nrepl...#2018-01-2314:39andrea.crottianyone got this error
ERROR clojure.tools.nrepl.server - Unhandled REPL handler exception processing message {:op eval, :ns user, :code (do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl)), :session 1d155db9-57f2-47ac-baeb-277b45f7f7fe, :id 12}
clojure.lang.Compiler$CompilerException: java.lang.Exception: namespace 'orchard.namespace' not found, compiling:(orchard/meta.clj:1:1)
?#2018-01-2314:39andrea.crottiI upgraded cider today but I can't find any reference of orchard anywhere#2018-01-2314:39pabloreI’m having this problem with the latest cider package update on elpa:
java.lang.Exception: namespace 'orchard.namespace' not found, compiling:(orchard/meta.clj:1:1)
When trying to evaluate some code in the repl#2018-01-2314:39andrea.crottiah yes same thing @pablore#2018-01-2314:39pablorewoah#2018-01-2314:39dpsuttonthere seem to be some issues right now, @andrea.crotti#2018-01-2314:40dpsutton#2018-01-2314:40pabloreIs this happening with the latest package version?#2018-01-2314:40andrea.crottiI can try to downgrade if I remember how to do it#2018-01-2314:40dpsuttonprobably best to install cider from melpa-stable right now#2018-01-2314:40dpsuttonthis will ensure you have a non snapshot version#2018-01-2314:41pabloreHow do i do that? Im a emacs noob. Using spacemacs developer branch#2018-01-2314:42dpsuttoni have no idea in spacemancs#2018-01-2314:46jmayaalvno idea how to do it in spacemacs, but if u use use-package you can do somethng like: (use-package cider
:ensure t
:pin melpa-stable)#2018-01-2314:48jmayaalvremove the existing package from the ~/.emacs.d/elpa and then exeucute that expression or restart emacs and the stable version would be installed#2018-01-2314:48dpsuttonit looks like spacemacs is built on use-package
https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Blang/clojure/packages.el#L19#2018-01-2314:48dpsuttonif you can find where this code is in your init directory you can add that :pin code#2018-01-2315:07bozhidar@andrea.crotti I’m really puzzled by this failure.#2018-01-2315:08bozhidarBoth the latest snapshot of orchard and cider-nrepl are on clojars, so the deps should be fine.#2018-01-2315:08dpsuttoni just changed the cider-version back to 0.16.0 until the snapshots are updated
(defconst cider-version "0.16.0"
"Fallback version used when it cannot be extracted automatically.
Normally it won't be used, unless `pkg-info' fails to extract the
version from the CIDER package or library.")
#2018-01-2315:09bozhidarI’m guessing for some reason lein/`boot` is not pulling the latest snapshots. I recall there was a way to force this (maybe lein -U).#2018-01-2315:09dpsuttonyes -U will get latest snapshots#2018-01-2315:09bozhidar@dpsutton There’s nothing to be updated though. 😄#2018-01-2315:09dpsuttonwhen i jacked in just now for work eval would just spin and not complete#2018-01-2315:09dpsuttonno error message or anything, just spinning#2018-01-2315:10bozhidarHmm, that’s odd. I see all the tests are passing for both projects.#2018-01-2315:13dpsuttoni've been out of work with the flu recently so its my first day back otherwise i would have spent some time looking at the nrepl logs#2018-01-2315:13dpsuttongotta get things done this morning 🙂#2018-01-2315:20andrea.crottiyeah also quite puzzled, the last commits in cider don't seem related at all#2018-01-2315:21andrea.crottibut it only happened today for me at least @bozhidar#2018-01-2315:28bozhidarThat doesn’t puzzle me at all - today I pushed an updated version of cider-nrepl to clojars. 🙂#2018-01-2316:00bozhidarWhen it rains it pours - something odd’s happening with my Emacs and I can’t update my installed packages. 😄#2018-01-2316:15bozhidarIs someone having problems with MELPA right now? I consistently get “Failed to download MELPA archive.”#2018-01-2316:16pabloreI switched from spacemacs develop to master branch and Cider is now working as intended. But the parinfer layer is not available in this branch :C#2018-01-2316:17pablore@bozhidar have you tried a mirror?#2018-01-2316:18bozhidarI didn’t even know there was a mirror.#2018-01-2316:22pablorethere are several https://github.com/melpa/melpa#2018-01-2317:09bozhidarBy the time I saw this the standard MELPA started working for me.#2018-01-2317:09bozhidarA mystery…#2018-01-2317:26bozhidar@andrea.crotti @dpsutton I tried reproducing your problems, but I couldn’t. The latest snapshot works just fine for me. I guess adding a -U to your jack-in commands will fix those dep issues.#2018-01-2317:27dpsuttoni'll try again over lunch break and let you know#2018-01-2317:27dpsuttonthanks for looking into it#2018-01-2317:38mhcatI noticed that orchard master branch has a dependency on tools.namespace version 0.3.0-alpha4. I had a project dependency for a non-alpha version in my :dev profile which I think caused my problem here#2018-01-2317:39bozhidarOps, let me rebuild cider-nrepl with an obfuscated version of the orchard.#2018-01-2317:39mhcatwhen I updated it to the alpha version, my startup exception (not finding the var (see @orlandow's thing)#2018-01-2317:39mhcatwent away#2018-01-2317:39mhcateven though cider seems to be trying to inject the non-alpha version still#2018-01-2317:39mhcat(maybe injected deps are lower precedence?)#2018-01-2317:43bozhidar@j0ni yeah, my bad. Just pushed a new build which processes orchard with MrAnderson, so such problems won’t occur.#2018-01-2317:44mhcatah cool, so I can revert my dep back to non-alpha?#2018-01-2317:44mhcat(not that I'm concerned lol)#2018-01-2319:31xiongtx@bozhidar I’m getting
Caused by java.lang.ClassNotFoundException
com.sun.javadoc.ClassDoc
When trying to evaluate orchard.java. This is Java 1.8.0_151.#2018-01-2320:02xiongtxLooks like I needed to use https://github.com/pallet/lein-jdk-tools to add tools.jar to the path#2018-01-2320:27bozhidarhmmm, that’s odd - was working just fine for me in my “initial” tests. To my knowledge tools.jar is bundled with the JDK, or at least it was bundled back in the day when I was still a Java developer. 🙂#2018-01-2320:36xiongtxCan someone on a Linux machine verify that (System/getProperty "java.io.tmpdir") returns a value w/out a trailing slash?
B/c on OS X it gives something like /var/folders/rb/7tf4fbvs0f941dbsl1kwctbj1cz9rj/T/, which does have a trailing slash.#2018-01-2320:40dpsutton(System/getProperty "java.io.tmpdir")
/tmp
#2018-01-2320:40dpsutton@xiongtx#2018-01-2320:59xiongtx@bozhidar I wonder if Orchard should more clearly separate clj and cljs functionality. From https://github.com/clojure-emacs/orchard/pull/7 it seems that the cljs stuff is heavily tied to nREPL / Piggieback, whereas the clj stuff isn’t.#2018-01-2321:33xiongtx:thinking_face: Presumably a cljs client for e.g. unREPL would need to have a Piggieback-like wrapper that, also exposes the cljs compiler state.#2018-01-2321:05jfntnI don’t understand in which cases does the implementation of cider-test-ediff does the right thing
Running this test:
(t/deftest =-test
(t/is (= (range 0 10) (range 0 11))))
Gets me the following report:
Fail in =-test
expected: (= (range 0 10) (range 0 11))
actual: (not (= (0 1 2 3 4 5 6 7 8 9) (0 1 2 3 4 5 6 7 8 9 10)))
All good, but cider-test-ediff tries to diff (= (range 0 10) (range 0 11)) against (not (= (0 1 2 3 4 5 6 7 8 9) (0 1 2 3 4 5 6 7 8 9 10))), which seems useless since we’d want to diff the actual expressions inside the = form.
Am i missing something?#2018-01-2321:12xiongtxYes, you’re missing this: https://github.com/clojure-emacs/cider/pull/2172
And my take on why cider-test-ediff is not useful: https://github.com/clojure-emacs/cider/pull/2172#issuecomment-359522009#2018-01-2414:39jfntn@xiongtx awesome PR and great timing, except I had to revert to melpa-stable yesterday because I was experiencing some breakage with the orchard refactoring. Will give it another shot#2018-01-2415:30jfntn@xiongtx tried melpa and it worked this time, however the new diff functionality introduced a regression in case where the test throws with Uncaught exception, not in assertion the actual error is now swallowed#2018-01-2415:31jfntnCider stable instead shows error: clojure.lang.ExceptionInfo: ... and hit can hit e to see the stacktrace, both of which are critical to resolving these kinds of issues#2018-01-2418:26xiongtxYikes…coding is harder than I thought 😉#2018-01-2419:35xiongtxActually, this is a pretty easy fix: https://github.com/clojure-emacs/cider/pull/2179#issue-291332761
It’s small enough that you can apply it yourself to cider-test.el until the PR is merged.#2018-01-2421:27xiongtxPR is now merged.#2018-01-2321:18xiongtx@benedek It seems this issue is b/c I removed the ^:source-dep on clojure.java.classpath. But we no longer use clojure.java.classpath directly in cider-nrepl. So what’s going on?
https://github.com/clojure-emacs/cider/issues/2176#2018-01-2321:19benedeklet me have a look#2018-01-2321:23benedekhm… @xiongtx looks a bit weird. suppose both orchard and tools.namespace are using clojure.java.classpath and somehow mranderson got confused#2018-01-2321:24benedekjust guessing here really. did @bozhidar’s latest commit (mrandersoning orchard) fix this tho?#2018-01-2321:25xiongtx@bozhidar Have you released the latest changes in Orchard to clojars?#2018-01-2321:26benedekwow nice icon for clojars 🙂#2018-01-2321:46dominicmCider could now do a jack in for clj/deps.edn. The parameters are there.#2018-01-2322:17bozhidar@dominicm which are those?#2018-01-2322:25dominicm-Sdeps is deps.edn as a string to be merged in#2018-01-2322:19bozhidar@xiongtx Yes, I did. I see on tickets like https://github.com/clojure-emacs/cider/issues/2176 people are submitting backtraces with inlined deps. Seems something went wrong with the MrAnderson step - maybe because cider-nrepl still depends on c.t.n. and something got messed up with the namespace rewriting.#2018-01-2322:20bozhidar> @bozhidar I wonder if Orchard should more clearly separate clj and cljs functionality. From https://github.com/clojure-emacs/orchard/pull/7 it seems that the cljs stuff is heavily tied to nREPL / Piggieback, whereas the clj stuff isn’t.#2018-01-2322:21bozhidarThere’s very little cljs code in cider-nrepl - most of it just deals with piggieback and can’t really be extracted. A long time ago we’ve created cljs-tooling, but it didn’t get far and it should probably be merged into orchard, as back in the day cljc didn’t exist yet.#2018-01-2322:24bozhidarI think the only thing that we extract of the piggieback session is the cljs compiler environment, which is used here and there.#2018-01-2322:25dominicm-Sdeps is deps.edn as a string to be merged in#2018-01-2322:26bozhidarThere’s also a bit of cljs code for macroexpansion and I think that’s pretty much all of it. Lots of things were never implemented for it, as most of the maintainers (like me) don’t know much about cljs.#2018-01-2322:26bozhidarI’m pretty sure that’s not hard, but it still requires someone to do it. 🙂#2018-01-2322:33andrea.crotti@bozhidar just upgraded everything on my Linux box and it doesn't give the same orchard error#2018-01-2322:33andrea.crottithe other machine is a Mac#2018-01-2322:34andrea.crotti(even if don't think that's the actual cause of the problem)#2018-01-2322:34andrea.crotti(well Emacs sucks on OSX sadly compared to Linux, but should not make a difference in this case in theory)#2018-01-2322:40benedek@bozhidaractually if you put back ^:source-dep [org.clojure/java.classpath "0.2.3"] that should fix it#2018-01-2322:41benedeksee my comment on 2176#2018-01-2322:55bozhidar@benedek Thanks. I’ve shipped a new snapshot and I’m off to bed.#2018-01-2322:55bozhidarToo much CIDER drama today! 🙂#2018-01-2322:55bozhidarI need to drink a lot more cider tomorrow. 😉#2018-01-2322:59genmeblogMore wine#2018-01-2400:17xiongtx@bozhidar I’m going to split orchard.complete/complete into two fns, one for clj and the other for cljs. For one thing, they take different parameters.#2018-01-2400:30xiongtxOrchard also doesn’t know if the completion environment is clj or cljs; it relies on the client to tell it (by passing in cljs-env parameter).
So TBH I’m not sure what value orchard.complete provides. The client might as well use compliment and cljs-tools directly.#2018-01-2404:26richiardiandreaI think the latter is better. In particular for completions the REPL itself could provide specific implementations. Lumo, Planck or closh all provide their own completions.#2018-01-2404:28richiardiandreaI think that orchard is really just a container of small utils and therefore I would do the split there and let client code decide how to hook it up.#2018-01-2404:55xiongtxWhat do you mean by “latter”?#2018-01-2405:22dpsuttoni think he meant the latter of the two choices to let orchard.complete handle completitions or just let the client code directly ask compliment or cljs-tools. ie, just let cider ask compliment or cljs-tools rather than go through orchard#2018-01-2405:34richiardiandreaYes I meant let the tool call the right thing. This actually is valid not only for cider but for inf-clojure 😄 as well.
There was a mini-debate to define whether the "platform" dispatch should be inside orchard or not. My 2c opinion is no ...but it is 2c of course.#2018-01-2406:37bozhidarI don’t think wrapping compliment in orchard adds a lot of value as well, but in general I do believe that cljs-tooling should simple be merged with it. Even at this point you can say that cider-nrepl doesn’t really have completion code in itself.#2018-01-2406:42bozhidar@U0C8489U6 I disagree with the “small utilities” part, though. The goal at the end of the day is to provide an API to provide CIDER-like functionality for any client, regardless of how they decide to wrap orchard. E.g. if this was on the classpath for inf-clojure it could just eval a ton of functions optimized for dev tools directly and provide many extra features easily. Right now this would be just a matter of injecting it transparently when inf-clojure is invoked inside of a project (and the REPL is a Clojure one). I do want to provide more cross-platform functionality in it, though.#2018-01-2415:03richiardiandreaAgree with you, small utilities was wrongly worded 😉 #2018-01-2409:39benedekhaha bug sorry for that. we should consume some of that cider together at some point #2018-01-2410:38qqqwhat is triggering the cider warning face, and how do I disable it?#2018-01-2410:38qqqhttps://imgur.com/a/cf4JN#2018-01-2411:20mgrbyte@qqq I'm guessing your're using flycheck? If so then it'll be clojure-mode/cider's integration with that. If so, you could look at the variable flycheck-enabled-checkers to see what it's currently set to#2018-01-2411:28qqq@mgrbyte: I'm not using flycheck.#2018-01-2411:28qqqApparently, if I execute via C-x C-e, and the repl has a warning, then the expr gets the yellow squiggly line.#2018-01-2411:58bozhidarYeah, that’s true.#2018-01-2411:59bozhidarIf compilation produces warnings the line in questions gets highlighted.#2018-01-2411:59bozhidarI not sure if this was something configurable or not.#2018-01-2412:02bozhidarFYI - the relevant code is here https://github.com/clojure-emacs/cider/blob/be2341d93870a1f95321aa72b25516b71bb04fe5/cider-interaction.el#L1087#2018-01-2412:02bozhidarIf you want you can simply unset the warnings face I guess.#2018-01-2412:03bozhidarGenerally highlighting errors and warnings seemed desirable for everyone, therefore the lack of configuration options for this.#2018-01-2417:09benedeki am getting this error when trying to run cider-nrepl tests (clj) locally
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/apropos__init.class or orchard/apropos.clj on classpath., compiling:(cider/nrepl/middleware/apropos_test.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7239)
at clojure.lang.RT.loadResourceScript(RT.java:371)
#2018-01-2417:09benedeksame on travis#2018-01-2417:09benedekperhaps cider-nrepl and orchard out of sync?#2018-01-2417:10benedekor just orchard latest in not on clojars?#2018-01-2417:14benedeknope, not that. cider-nrepl tests are referring to orchard namespaces. don’t think that will work when you are running lein with-profile +1.8,+plugin.mranderson/config,+test-clj test or similar as orchard stuff is inlined#2018-01-2417:14benedekthose tests referring to orchard namespaces should go to orchard i guess?#2018-01-2417:31benedeki suppose you can’t really reach into depencies from tests if you use mranderson#2018-01-2417:31bozhidarMy bad. I generally run the tests without MrAnderson. I’ll fix it in a bit.#2018-01-2417:32benedekno worries#2018-01-2417:32bozhidarThe test is not actually specific to orchard, it just rebinds one of the deps.#2018-01-2417:33benedekthe good news that after commenting out all orchard related tests and playing with mranderson a bit to inline a not “resolved” dep graph (so transient deps are duplicated all over the graph) the tests are passing#2018-01-2417:33bozhidarIsn’t there just one of those?#2018-01-2417:33benedeki have not checked how much bigger the uberjar gets or how slower cider-nrepl gets either#2018-01-2417:33benedekhave not checked that either 😉#2018-01-2417:33bozhidarThe bad news is that even if I remove the explicit ns in this test you mentioned it still fails, which puzzles me.#2018-01-2417:33benedekalso have not tested with refactor-nrepl#2018-01-2417:34benedekthere is a reference to orchard in the body of the ns too 😉#2018-01-2417:34bozhidarBut that’s normal.#2018-01-2417:34bozhidarI keep referring to all sorts of libraries in test bodies - not sure how I’m supposed to avoid it if I need those functions in the tests.#2018-01-2417:35benedekunfortunately you can’t refer anything from orchard anywhere#2018-01-2417:35benedekit is just not there with mranderson becuase of the prefixing#2018-01-2417:36bozhidarIsn’t it supposed to just be there with a changed namespace?#2018-01-2417:36benedekmodified: test/clj/cider/nrepl/middleware/apropos_test.clj
modified: test/clj/cider/nrepl/middleware/classpath_test.clj
modified: test/clj/cider/nrepl/middleware/info_test.clj
modified: test/clj/cider/nrepl/middleware/inspect_test.clj
modified: test/clj/cider/nrepl/middleware/refresh_test.clj
modified: test/clj/cider/nrepl/middleware/track_state_test.clj
modified: test/clj/cider/nrepl/middleware/util/instrument_test.clj
#2018-01-2417:36benedekright#2018-01-2417:36benedekbut mranderson does not rewrite the test namespaces#2018-01-2417:36benedekabove the list of offending test namespaces#2018-01-2417:37benedektbh you can argue that your tests should not know about your library’s dependencies and should only use the API of your lib#2018-01-2417:37benedekbut i understand you are redefing and the like#2018-01-2417:38bozhidarYeah, I get this, but this would mean just adding dummy API to stub. 🙂#2018-01-2417:39benedekyeah, true. can’t you kinda move those tests or the gist of them to orhcard itself. have not really tried to understand them to be fair#2018-01-2421:07xiongtxSeems to me that CIDER should only test the transport. Functionality should be tested in Orchard.#2018-01-2417:40bozhidarIt will require some work. It’s completely doable, but I just won’t have time for this soon.#2018-01-2417:42benedekfair. i managed what i wanted: have a running test set which i can use to prove that mranderson changes are good#2018-01-2417:42benedekso no rush on my side really#2018-01-2417:43benedekand i will also have refactor-nrepl tests for the same thing. so i am good. no pressure#2018-01-2417:53bozhidarBtw, why doesn’t MrAnderson rewrite the test namespaces as well?#2018-01-2417:54dpsuttonthey aren't in a production build?#2018-01-2417:54dpsuttonno reason to shield from other people's code if they aren't ever going to touch other people's code?#2018-01-2417:56benedekyeah why should it?#2018-01-2417:57bozhidarAh, yeah - silly me.#2018-01-2417:58dpsuttonah, we should have a dir locals file that cranks CIDER up with the right profiles for testing when developing so the CIDER test runner can run them#2018-01-2417:58dpsuttonthen we wouldn't have to worry about all of the people wondering why there don't seem to be any tests run with lein test#2018-01-2418:09bozhidarMine lein mojo is bad, but I guess it’s not hard to specify some default profile.#2018-01-2418:10dpsutton((nil . ((cider-lein-global-options . "with-profile dev")
)))
for my work project#2018-01-2418:10dpsuttonah misread that#2018-01-2418:10bozhidarI meant this should be fixed in project.clj.#2018-01-2418:20bozhidarI’ve fixed 3/8 of the failing tests, but I have to wrap it for today and I’d love to solicit some help from all of you https://github.com/clojure-emacs/cider-nrepl/issues/489 Fixing those shouldn’t be hard/take long. Thanks in advance!#2018-01-2419:50benedekthanks#2018-01-2419:51benedekjust for the curios. here is cider-nrepl’s not resolved deps graph (without org.clojure/java.classpath as a first level dependency)#2018-01-2419:51benedek{[cider/orchard
"0.1.0-20180123.122522-8"
:exclusions
[[org.clojure/clojure]]]
{[org.clojure/java.classpath
"0.2.3"
:exclusions
[[org.clojure/clojure]]]
nil,
[org.clojure/tools.namespace
"0.3.0-alpha4"
:exclusions
[[org.clojure/clojure]]]
{[org.clojure/java.classpath "0.2.3"] nil,
[org.clojure/tools.reader "0.10.0"] nil},
[org.tcrawley/dynapath "1.0.0" :exclusions [[org.clojure/clojure]]]
nil},
[cljfmt
"0.5.7"
:exclusions
[[org.clojure/clojure] [org.clojure/clojurescript]]]
{[org.clojure/tools.reader "1.0.0-alpha4"] nil,
[rewrite-clj "0.5.2"] nil,
[rewrite-cljs "0.4.3"] nil},
[cljs-tooling "0.2.0" :exclusions [[org.clojure/clojure]]] nil,
[compliment "0.3.5" :exclusions [[org.clojure/clojure]]] nil,
[fipp "0.6.12" :exclusions [[org.clojure/clojure]]]
{[org.clojure/core.rrb-vector "0.0.11"] nil},
[mvxcvi/puget "1.0.2" :exclusions [[org.clojure/clojure]]]
{[fipp "0.6.10"] {[org.clojure/core.rrb-vector "0.0.11"] nil},
[mvxcvi/arrangement "1.1.1"] nil},
[org.clojure/tools.namespace
"0.3.0-alpha4"
:exclusions
[[org.clojure/clojure]]]
{[org.clojure/java.classpath "0.2.3"] nil,
[org.clojure/tools.reader "0.10.0"] nil},
[org.clojure/tools.reader "1.1.1" :exclusions [[org.clojure/clojure]]]
nil,
[org.clojure/tools.trace "0.7.9" :exclusions [[org.clojure/clojure]]]
nil}
#2018-01-2419:56benedekwhoops, pasted the wrong graph first. this should be the right one now#2018-01-2420:56bozhidar@benedek what’s the difference in the final artefact in terms of size?#2018-01-2421:10benedekhave not checked yet#2018-01-2421:32xiongtx@bozhidar @benedek I’m not sure why we can’t use Orchard in the tests. Why not run tests w/out the mranderson profile?#2018-01-2421:34xiongtxBut I do think that, as a long-term goal, CIDER should only test client functionality: https://clojurians.slack.com/archives/C0617A8PQ/p1516828054000552?thread_ts=1516815558.000036&cid=C0617A8PQ#2018-01-2422:20benedeku can run them w/o mranderson ofc. but running them w/ it makes sure that it will work as it is distributed to its users#2018-01-2500:04xiongtxWe’ve a sort of 🐔-and-🥚 problem here: many namespaces, e.g. info, have not been ported to Orchard. Their tests, therefore, include tests for things that should be moved into Orchard. We can’t very well remove Orchard dependency when some of the functionality is in Orchard and some in cider-nrepl.
My vote is for running tests w/out mranderson, at least until the Orchard port is complete. I can’t think of any reason why this’d be a problem. @benedek What is a scenario in which not testing w/ mranderson could lead to tests passing on CI but the artifact not working for the user?#2018-01-2500:10xiongtxPhilosophically, there should be nothing we cannot use in the tests that we use in the src. mranderson’s impact should purely be on the distribution of the artifact--we apply it to prevent tooling deps from affecting user’s project deps. For mranderson to impact the way we develop and test the project is an anti-pattern.#2018-01-2505:33benedekwhat you really test if you test w/ mranderson is that everything works fine with inlined deps. there are corner cases mranderson does not handle (well). re. antipattern: I hear you, you have a point there, on the other hand this forces you to only refer to your lib's API in your tests, makes stubbing more difficult these are essentially good things ;)#2018-01-2509:38xiongtxI don't get the "making stubbing more difficult is good" part. Yes, cider-nrepl tests should only test cider-nrepl API--that doesn't mean the tests shouldn't be able to make use of functions in a dep.#2018-01-2509:40xiongtxThe other option would be to have mranderson rewrite the namespaces in test files. In any case, src and test should have access to the same deps.#2018-01-2519:25xiongtxI’ve created https://github.com/clojure-emacs/cider-nrepl/pull/493 to remove mranderson from test profiles.#2018-01-2911:50benedekfair. but extra care is needed at release time so no broken inlined version of the artifact gets shipped#2018-01-2421:55zlrthwhat workarounds do people have for cider/emacs freezing when printing long-sequences of data?
disabling font-lock-mode only goes so far for me. it takes ~20 very-long-feeling seconds to print 2 megabytes of data to the terminal.
cider-interrupt doesn't seem to work for printing long strings.
things like this? https://github.com/clojure-emacs/cider/issues/1934#2018-01-2421:56zlrthit'd be pretty cool to have the repl output a link to an html file that has the large output.
or a global variable for the maximum number of characters printed per eval#2018-01-2422:22benedekthere is such a global var for the REPL not cider specific I think#2018-01-2422:24benedekhttps://cider.readthedocs.io/en/latest/using_the_repl/#2018-01-2422:25benedeksearch for print-length#2018-01-2422:35zlrthoy! thanks @benedek. it says print-length sets the length of the number of items in a collection to be printed. if each of those items is large, the repl would still lock up. i wonder if there's a way to set it to a number of characters?#2018-01-2505:34benedekyou can use it combined it with print-level#2018-01-2505:35benedekalso check out unrepl (if you are interested) it does some amazing things in this department afaik#2018-01-2507:00bozhidarElided collections?#2018-01-2507:01bozhidarI think they are still based on the number of items in a collection. Anything else would be pretty controversial and technically speaking there’s 0 preventing us from doing this with nREPL - it just never came up/there was never time to work on this.#2018-01-2507:03bozhidar@mfm Nothing like this currently exists, but it’s definitely doable. Just a matter of time, which I don’t have much of. If someone’s interested in working on it - I can provide tips and help. Ideally this should handled in the middleware level - hooking into eval and modifying its behaviour, but it can also be handled in Emacs directly - by just counting the size of the response chunks and truncating them after some point.#2018-01-2507:11lemonsnevermind. figured it out#2018-01-2508:17dominicmNot on github to "claim" this, but I'll take on the nrepl part of cider jack in for clojure tools#2018-01-2510:01bozhidar@dominicm Great!#2018-01-2513:04qqqhttps://github.com/clojure-emacs/cider/issues/2180 <-- gift to you, @bozhidar#2018-01-2516:34hlolliHow does one tell cider to print the stacktrace into the repl buffer instead of opening *cider-error*?#2018-01-2516:41dpsuttoni don't think you can right now#2018-01-2516:43dpsuttonalthough it looks like it would be easier to modify#2018-01-2516:43dpsutton(defun cider-default-err-handler ()
"This function determines how the error buffer is shown.
It delegates the actual error content to the eval or op handler."
(if (cider-nrepl-op-supported-p "stacktrace")
(cider-default-err-op-handler)
(cider-default-err-eval-handler)))
#2018-01-2516:43hlolliok, maybe there's a trick that q quits the buffer. Haven't used cider for a while, generally dislike haveing many buffers opened.#2018-01-2516:44dpsuttonthe default err-eval-handler will just print the stacktrace. if you wanted to create a defcustom so that logic was stacktrace op is supported and desired then ...#2018-01-2516:45hlolliok nice, so I guess I can use this function to overwrite. Will do 🙂 thanks#2018-01-2516:46dpsuttoncider#2018-01-2517:35qqqI can't believe the name of cider is cider -- is it a slack default, or a clojurians custom ?#2018-01-2517:47dpsutton... 🙂#2018-01-2521:34xiongtx@bozhidar I’m not getting notifications for issues filed against helm-cider: https://github.com/clojure-emacs/helm-cider/issues
Maybe b/c I’m not a member of that organization? Can you fix that?#2018-01-2522:04dominicm@U2J7JRTDX do you watch the repository?#2018-01-2522:05xiongtxOh, that should work :thumbsup:#2018-01-2521:40richiardiandreaHelm cider is awesome - thanks for working on it#2018-01-2611:14bozhidar@xiongtx Are you watching the repo?#2018-01-2611:17bozhidarI see you’re both a member of the organization and watching the repo. Might be something to do with your personal settings.#2018-01-2618:04xiongtxI wasn’t watching it before, but now I am.#2018-01-2611:52bozhidarBtw, a few random notes on helm-cider:
* it’d be nice if it had some changelog
* there hasn’t been a stable release in a while
* perhaps we should merge with clojure-cheatsheet which is now abandonware and uses helm to render the cheatsheet.
Originally I planned to make the cheatsheet something that could be used with with other selection framework, but sadly I never found the time for this. Just something like a list of hashmaps mapping categories to the functions in them. With something other then helm you first select the category and then one of the vars inside. Anyways, not a big deal - I just got reminded about a past idea.#2018-01-2620:34xiongtxIsn’t it just a matter of copying clojure-cheatsheet-hierarchy into CIDER and letting each front-end process the data as it sees fit?#2018-01-2620:50xiongtxPersonally, I’m not sure how the clojure-cheatsheet as it stands is useful. You can’t easily navigate between sections, for example. It’s not scannable like the online cheatsheet at all.#2018-01-2613:15stardivinerThis is a great idea.#2018-01-2615:37bozhidarUnfortunately many great ideas remained just ideas due to lack of time on my side, and the desire of others to drive them forward. Let’s hope at some point we’ll make this one happen - I really want us to make newcomer experience better and this certainly ties into this overarching idea.#2018-01-2615:51qqq@bozhidar: have I told you how amazing cider-doc is yet?#2018-01-2615:51qqqit's fucking amazing#2018-01-2615:51qqqno more popping up a new chrome tab, googling clojuredocs#2018-01-2615:51qqqand typing in the function name#2018-01-2615:51qqqnow, it's just S-h c in emacs, type in function name, and it's all in the popup buffer#2018-01-2615:54qqqcider-javadoc is cool too, but why is it a safari windows instead of a emacs popup ?#2018-01-2615:55dpsuttongrimoise is the bees knees#2018-01-2615:56qqqdo you mean https://github.com/clojure-grimoire/grimoire or somethign else? s <-> r#2018-01-2615:56qqq@dpsutton ^#2018-01-2615:56bozhidar> cider-javadoc is cool too, but why is it a safari windows instead of a emacs popup ?#2018-01-2615:57bozhidarcider-doc shows javadoc as well within Emacs, cider-javadoc was meant to take you to the JavaDoc page for something online.#2018-01-2615:58bozhidarI know this is a bit confusing, but I never got to improving it.#2018-01-2615:58qqqhttps://imgur.com/a/Fk5J8 <-- it says "Not Documented"#2018-01-2615:58qqqdo I have something misconfigured ?#2018-01-2615:58dpsuttoncider-grimoire is the command#2018-01-2616:00qqq@dpsutton: I like how I can copy/paste sample code from grimoire window#2018-01-2616:01dpsuttonmy favorite thing to do is copy/past out of the kill ring buffer. it's so meta. what have i recently copied? scroll through and copy a substring out of my copies#2018-01-2616:01qqqthere needs to be a cider tricks wiki page somewhere#2018-01-2616:01qqqthere's all these cool things that I don't know how to do#2018-01-2616:19michalhey there, if I wanted to turn off tags regeneration for one specific project (and keep in on for the rest), is it enough to add ((nil . ((projectile-enable-idle-timer nil)))) to .dir-locals.el? I think projectile tries regenerate tags anyway 😞#2018-01-2616:38codeasone@qqq https://github.com/justbur/emacs-which-key is great for discovery#2018-01-2616:40codeasoneand I agree a cider tricks wiki would be great#2018-01-2616:41bozhidar@michal Likely currently it just walks the list of known projects or something like this if this doesn’t work. I have to consult the actual implementation to know this for sure.#2018-01-2616:51michal@bozhidar thanks. what bothers me a bit (and most likely this is the cause of my problem) is that having .dir-locals.el set as above I still see projectile-enable-idle-timerswitched on. I started wondering if the syntax of my .dir-local.el is correct.#2018-01-2617:00bozhidarLooks correct to me, but frankly I never bothered to remember it - I always google for it. 😄#2018-01-2617:03bozhidarLooked at the code and the dir locals should work - that functionality operates on the current project.#2018-01-2617:04bozhidarSeems you overdid the parens.#2018-01-2617:04bozhidar((nil
(bug-reference-url-format . "")))
#2018-01-2617:04bozhidarI saw this in CIDER’s code and I know it’s correct.#2018-01-2617:05michalwell, that's what I googled 🙂#2018-01-2617:06michalbut I will try your version#2018-01-2617:15michalseems like there is some other magic behind. i'm still getting tags regenerated. anyway, thanks @bozhidar for sorting out the syntax of .dir-locals.el 😉#2018-01-2617:31richiardiandrea.dir-locals.el is amazing, I need to write some small post about it#2018-01-2617:32richiardiandreaI worked on a fix for inf-clojure yesterday that correctly loads it for all the non-file buffers (/cc @bozhidar)#2018-01-2617:37bozhidar> seems like there is some other magic behind. i’m still getting tags regenerated. anyway, thanks @bozhidar for sorting out the syntax of .dir-locals.el 😉#2018-01-2617:37bozhidarI’d suggest using the Elisp debugger to see what exactly is going on.#2018-01-2617:39michalok, got it. this should work: ((nil
(eval when
(require 'projectile)
(setq projectile-enable-idle-timer nil))))#2018-01-2617:46michalthe funny thing is that it also can be used to have per-project repl history: ((nil
(eval when
(require 'projectile)
(setq cider-repl-history-file (concat
(projectile-project-root)
".nrepl-history")))))#2018-01-2619:04richiardiandreahow does cider handles keyword completions?
(thing-at-point 'symbol) does not return anywhing when point is at |:foo#2018-01-2619:32Matthew Davidson (kingmob)Is anyone else having issues getting load-file to work in a browser REPL? It keeps sending goog.addDependency calls with out in the path, even though that’s not my :output-dir#2018-01-2619:34Matthew Davidson (kingmob)The piggieback readme says
> When using Piggieback to enable a browser REPL: the ClojureScript compiler defaults to putting compilation output in out, which is probably not where your ring app is serving resources from (resources, target/classes/public, etc). Either configure your ring app to serve resources from out, or pass a cljs-repl :output-dir option so that a reasonable correspondence is established.
Is there some other :output-dir option I need to set somewhere?#2018-01-2621:34dominicm@bozhidar is orchard/cider broken right now?#2018-01-2621:34dominicm> CompilerException java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath., compiling (cider/nrepl/middleware/pprint.clj:1:1)#2018-01-2703:32gonewest818The latest Travis CI job for cider-nrepl has some failures, but they’re cljs tests on jdk9, and the eastwood check.#2018-01-2703:38gonewest818Otherwise the master branch seems to be building and testing. I’m not sure when the most recent snapshot was pushed to clojars.#2018-01-2703:39gonewest818There is work going on in cider-nrepl and orchard to auto-publish snapshot jars (if the tests are clean). But that’s not quite done yet.#2018-01-2708:24bozhidarIt’s working for me. Are you sure you’re using the latest snapshots?#2018-01-2708:30dominicmI'll try now#2018-01-2708:39dominicmso, using latest snapshots, now refactor-nrepl is unhappy, but that's not surprising.#2018-01-2708:39dominicm> Exception in thread "main" java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/misc__init.class or
cider/nrepl/middleware/util/misc.clj on classpath., compiling:(refactor_nrepl/middleware.clj:1:1)#2018-01-2708:59dominicmGot it working, thanks!#2018-01-2709:33bozhidarYeah, refactor-nrepl needs some updates at this point.#2018-01-2622:10dominicmI have a working init fn for clj anyway 🙂#2018-01-2622:12dominicmI'll publish once I can do an end-to-end test with cider & everything#2018-01-2622:52dominicmfwiw: clj -Sdeps '{:deps {refactor-nrepl {:mvn/version "2.3.1"} com.gfredericks.dominic/debug-repl {:mvn/version "0.0.1"} cider/cider-nrepl {:mvn/version "0.17.0-MYFORK"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.gfredericks.debug-repl/wrap-debug-repl"])' -r is the CLI I've ended up with.#2018-01-2622:53richiardiandreawoah nice#2018-01-2622:54dominicm(vim jack in will get this before emacs 😉 )#2018-01-2622:55richiardiandreamaaaaaaan, you are single single-handedly doing it 😉 Good job! I am fighting my battle on the inf-clojure side#2018-01-2708:25bozhidar@richiardiandrea See what cider-find-keyword is using.#2018-01-2716:48richiardiandreaThanks a lot found and PR-ed inf-clojure 😃 #2018-01-2716:59richiardiandreaI copied the function there but now that I think about it maybe it should go in clojure-mode. It is something that is shared across all Clojure-emacs plugins I guess...thoughts?
It is this guy: https://github.com/clojure-emacs/inf-clojure/pull/129/files#diff-6264d22fc9d63a6499f1027f6330d982R1333#2018-01-2708:26bozhidarI don’t remember it off the top of my head.#2018-01-2708:26bozhidar> Is anyone else having issues getting load-file to work in a browser REPL? It keeps sending goog.addDependency calls with out in the path, even though that’s not my :output-dir#2018-01-2708:27bozhidarI don’t quite get this, because my cljs knowledge is pretty basic. @cichli was our resident cljs ninja back in the day, if he’s around I guess he might be able to shed some light on this.#2018-01-2909:48benedek@bozhidar I am tracking the thread on the clj mailing list on orchard and tools.dev between you and alex#2018-01-2909:49benedekmranderson does remove the source dep marked deps from the dependency graph. as it should as they are inlined#2018-01-2909:57bozhidarYeah, I figured as much, but I don’t get why are rewritten namespaces trying to load orchard namespaces.#2018-01-2909:58bozhidar@dominicm had this problem as well, and when I played with this I saw that an explicit dependency fixed things.#2018-01-2909:58bozhidarMaybe this was just a some bad build, I don’t know.#2018-01-2910:07benedekmay be the same/similar issue we had with java.classpath last week?#2018-01-2910:08benedekis there any specific I shall look at this evening?#2018-01-2910:54bozhidarI think this issue was just pertaining to the tests. Maybe you can just try to locally reproduce the problem and see if you can figure out what’s wrong with the rewriting.#2018-01-2918:25xiongtxAnyone want to test out https://github.com/clojure-emacs/helm-cider/pull/10 before I merge it?
You’ll need https://github.com/clojure-emacs/cider/pull/2183#2018-01-2918:50bozhidarNice timing!
I just added a basic cider-cheatsheet command to CIDER itself.#2018-01-2919:15xiongtxSee: https://github.com/clojure-emacs/cider/pull/2185#2018-01-2918:51bozhidarI’ll take a look at the PR when I can. It’s already 2 am here and I’m barely awake.#2018-01-2919:15xiongtx:thinking_face: Huh. I was under the impression you’re actually the alias of a 12-person team 😆 .#2018-01-3009:37bozhidar😄 😄 😄#2018-01-2919:17xiongtxcider-font-lock-as-clojure doesn’t use CIDER’s extra font lock rules. What’s the easiest way to make it do that?#2018-01-2919:32qqqnot sure if this is a cider problem:
anyone running into issues where on *.cljc files of > 800 lines, emacs becomes really slow ?#2018-01-2920:41xiongtxDo you have aggressive-indent-mode on? It’s very slow for large forms (though not necessarily large files).#2018-01-2921:04qqqI don't believe so, it's not anywhere in ~/.emacs.d/init.el, nor is it in C-h v / M-x -> match on agress#2018-01-3003:18xiongtxThis only happens for .cljc files? Not .clj or .cljs?#2018-01-3006:09qqqnot sure; 99% of my code is in *.cljc files#2018-01-3006:10qqqI'm starting to suspect it's something like the emacs message buffer getting too large over time or something else like that, i.e. some type of a mem leak#2018-01-3009:39bozhidarHmm, normally something like this shouldn’t be a problem. I never restart my Emacs for months at a time.#2018-01-3009:39bozhidarYou can check with the Emacs Profiler what’s going on - it’s easy to use and quite helpful.#2018-01-3009:39bozhidar> cider-font-lock-as-clojure doesn’t use CIDER’s extra font lock rules. What’s the easiest way to make it do that?#2018-01-3009:40bozhidarHmm, I never thought about this to be honest. Probably you’d need to enable cider-mode in some temp buffer and evaluate the code there to get the right font-locking.#2018-01-3018:39xiongtxI ended up making cider-var-info calls for each Var. This is slow but we only need to do build the source once (well, except for a little trickiness involving whether CIDER was jacked in or not).
Unfortunately cider-var-info doesn’t return a type the way cider-apropos does, so I had to resort to some hack: https://github.com/clojure-emacs/helm-cider/blob/27a773d1477449605d463333de378531caa681da/helm-cider-util.el#L95-L101. This works 👌 for most things but not for e..g multimethods, which don’t return arglists for some reason.#2018-01-3112:43carkhI remember being quite pissed when slime became cider. I upgraded to it back then, then left my setup alone for years (was it so long really?)... I recently upgraded to the latest because of incompatibilities with latest emacs . And i must say cider is now so much better... I want to give thanks to bozhidar and contributers. You guys really made the very best dev environment I could imagine.#2018-01-3112:47carkhIt went from rickety to dependable, with so many feature ... awesome !#2018-01-3113:01bozhidar@carkh Happy to hear this! And thanks for the kind words! 🙂#2018-01-3113:03bozhidarThe project definitely had a rocky start, and getting to a point of stability took us a while, but at least we got there eventually. 😉#2018-01-3113:07carkhIt's the little things ... for instance it's now ok to close a repl in windows, no dangling java process. Cider is now way faster. syntax coloring is better too. And i'm not mentioning the big features like automated testing, datastructure inspection etc#2018-01-3113:07carkhanyways, back to my grumpy self =)#2018-01-3113:12bozhidar😄#2018-01-3114:57qqqcider must have one of the highest (net productivity gain of clojure community) / ($s donated) ratios of all time#2018-01-3115:58jfntnShouldn’t CIDER disable undo in the REPL while it’s appending text? I’m getting buffer undo limit warnings from verbose logs (e.g. starting datomic with logback set to DEBUG).#2018-01-3116:32daveliepmannA colleague is getting an error cider-jack-in on a freshly lein new'd project using spacemacs and CIDER 0.16.0. Error is nREPL server started on 50309
[nREPL] Establishing direct connection to localhost:50309 ...
error in process filter: nrepl--direct-connect: [nREPL] Direct connection to localhost:50309 failed
error in process filter: [nREPL] Direct connection to localhost:50309 failed
Does this ring any bells for anyone? I found a great number of tickets pre-v0.16.0 but nothing recent.#2018-01-3116:42daveliepmannDeleted everything and got the same error with out of the box emacs/spacemacs/cider 0.17.0-snapshot#2018-01-3117:15daveliepmannAnd now it seems to be happening with a rather bare-bones emacs install#2018-01-3117:48dpsuttonis there any more information in the *Messages* buffer?#2018-01-3121:13daveliepmannthat's everything#2018-01-3121:13daveliepmannticket here: https://github.com/clojure-emacs/cider/issues/2189#2018-01-3121:15daveliepmannI wonder if it could be something similar to https://github.com/clojure-emacs/cider/issues/1945 but that appears well fixed by the Riga release#2018-02-0106:09bozhidar@daveliepmann Yeah, likely that’s the case.#2018-02-0106:10bozhidarYou should check where exactly is the nREPL listening on.#2018-02-0106:11bozhidarI recall there was some problem with the original fix for this upstream. It was only applied in the new nREPL repo, but there’s still no release from there.#2018-02-0106:54bozhidarAs no one else has reported anything similar, I can only imagine it’s something to do with the setup of your colleague.#2018-02-0110:37daveliepmannyou were right! your question helped put us on the right track. all set now with a fixed /etc/hosts file. sorry for the false alarm.#2018-02-0108:24bozhidar> cider must have one of the highest (net productivity gain of clojure community) / ($s donated) ratios of all time#2018-02-0108:25bozhidarFeel free to change this - https://www.patreon.com/bbatsov 😉#2018-02-0218:47twashingDone. Thanks for all your work on cider. It’s a huge part of my tooling 👍:skin-tone-5:#2018-02-0522:12xiongtxYou can also donate to CIDER itself: https://opencollective.com/cider
Though I’m not sure what the money is actually used for. @bozhidar Have you cashed out any?#2018-02-0601:31bozhidarNot yet. I was planning to use them for conference trips or for funding some important features if someone was interested in working on them. Unfortunately the money raised so far are little - something like $2k so far (for about one year).#2018-02-0601:33bozhidarI’ve noticed that speaking about CIDER at conferences was often getting people excited about it and that even brought up some contributors to the project. And if someone says they’ll implement socket server support or a cljs debugger for 2k I’d be happy to give them the money once this is done. 🙂#2018-02-0601:37xiongtx:thumbsup: Good idea. But if you want the 💰 to be motivation, you should make this policy clearer. Maybe put something on Bountysource? https://www.bountysource.com/#2018-02-0602:00bozhidarYeah, I was hoping some users would offer bounties themselves - perhaps we should nudge them to do so in the ticket template as well. As for making things clearer - I have so many idea, yet so little time for them. Only love and passion drive CIDER forward. 🙂#2018-02-0602:00bozhidarBtw, one more time - a big thanks for helping out with so many things lately!#2018-02-0108:25bozhidar> Shouldn’t CIDER disable undo in the REPL while it’s appending text? I’m getting buffer undo limit warnings from verbose logs (e.g. starting datomic with logback set to DEBUG).#2018-02-0108:26bozhidar@jfntn File a ticket for this and let’s discuss it there.#2018-02-0108:26bozhidar@jmayaalv How’s that PR coming along?#2018-02-0108:37jmayaalv@bozhidar didn’t have time this last week. Plan to finish it this weekend.#2018-02-0108:57bozhidar:thumbsup:#2018-02-0118:06dpsutton@gganley what are you trying to do? specify which cljs connector to use? like figwheel, rhino, etc?#2018-02-0118:08gganleyyes I was thinking of seeing if digging into cljsbuild -> builds -> compiler -> target would be consistent enough to suggest a switch of REPL backends#2018-02-0119:19shooodookenIn CIDER, is it possible to interact around with the code being evaluated during debug?
My emacs windows (code, debug, repl) - visual at https://imgur.com/a/S1nRq
I started repl using cider-jack-in and could see that started a repl server at port xyz.
So, I sent a form (with breakpoint set) for evaluation, and it appears in debug.
so, i then tried to set/interact with the debug window but it didn't do what i wanted (change value of num when debugging for example)
I then sent a command from the repl (which I'm guessing was also paused as the repl was using the (now paused) JVM thread.#2018-02-0208:45bozhidar@shooodooken The way to interact with the code being debugged is usually by injecting some values from the debugger itself.#2018-02-0208:45bozhidarEvery time you change the code definition the debugger no longer can map what the current code to what was actually instrumented by it.#2018-02-0208:46bozhidarTake a look at the manual for more details http://cider.readthedocs.io/en/latest/debugging/#2018-02-0211:35dominicm@bozhidar My colleague just used my snippet to cider-connect to an nrepl.
2 things of note:
- deps.edn needs adding to the project root finder
- Someone needs to write a jack-in builder for clj in elisp#2018-02-0211:37bozhidar@dominicm I know. That’s trivial to do, I just didn’t have time to address it recently.#2018-02-0211:37bozhidarI did open a ticket, so I won’t forget about it.#2018-02-0211:39dominicmah, wasn't sure there was a ticket, wanted to make sure.#2018-02-0211:40dominicmBut yeah, really excited that it worked for him (when I copied the jack in command from vim 😈 )#2018-02-0211:42dominicmOh, something else @bozhidar, he had to add an explicit dependency on tools.nrepl to the project. I thought that cider-nrepl had one, so I didn't mention it anywhere.#2018-02-0211:52bozhidar@dominicm tools.nrepl or orchard? There’s an explicit dependency to tools.nrepl, but for some reason I needed to add a dependency to orchard, even though it should have been inlined.#2018-02-0211:52dominicm@bozhidar tools.nrepl, 100%. It couldn't require clojure.tools.nrepl.server (or similar)#2018-02-0211:52dominicmNo explicit orchard dependency was needed for us.#2018-02-0211:52dominicm(maybe orchard brought in tools.nrepl?!)#2018-02-0211:53bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/project.clj#L9#2018-02-0211:53bozhidarThat’s our only non-inlined dependency.#2018-02-0212:03dominicmExactly, so I was really confused by it. Could be t.d.a bug I guess?#2018-02-0212:04bozhidarI don’t know. Sounds like a potential bug.#2018-02-0212:04dominicm❯ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"} }}' -Spath
src:/home/dominic/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/home/dominic/.m2/repository/cider/cider-nrepl/0.17.0-SNAPSHOT/cider-nrepl-0.17.0-SNAPSHOT.jar:/home/dominic/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/home/dominic/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
Definitely missing.#2018-02-0212:12bozhidarI wonder how something like this can happen…#2018-02-0214:07dominicmAlex is looking into it 🙂#2018-02-0219:13andrzejsliwait it's only me? or my emacs configuration? or formatting is broken?#2018-02-0219:15andrzejsliwahmm looks like problem on my side, I just opened same file in cursive and looks correct#2018-02-0219:18twashingOye, currently, whenever I include cider-nrepl (`:plugins [[cider/cider-nrepl "0.17.0-SNAPSHOT"]`), lein gives me a TLS warning.
$ lein repl
Tried to use insecure HTTP repository without TLS.
This is almost certainly a mistake; however in rare cases where it's
intentional please see `lein help faq` for details.
#2018-02-0219:18twashingI totally see cider on clojars, so I don’t understand the error.
https://clojars.org/repo/cider/cider-nrepl/0.17.0-SNAPSHOT/#2018-02-0219:20gonewest818That came up in #clojure a few hours ago:
https://clojurians.slack.com/archives/C03S1KBA2/p1517581266000633#2018-02-0219:27twashing@gonewest818 Ah ok. I have an HTTP repository configured. But cider-nrepl comes from clojars. So does that qualify as a bug?#2018-02-0219:30gonewest818No, you can use https to access clojars. In Leiningen the url would be .#2018-02-0219:32twashingOk, explicitly setting “https://clojars.org/repo” as a repo, does the trick. Cheers!#2018-02-0219:33gonewest818:thumbsup:#2018-02-0219:49gonewest818Although, I don’t understand what happened in your case. If I do this:#2018-02-0219:51gonewest818$ lein new foo
$ cd foo
$ vi project.clj
# (in vi, insert ":plugins [[cider/cider-nrepl "0.17.0-SNAPSHOT"]]" and save)
$ lein repl
Retrieving cider/cider-nrepl/0.17.0-SNAPSHOT/cider-nrepl-0.17.0-20180131.161649-9.pom from clojars
Retrieving cider/cider-nrepl/0.17.0-SNAPSHOT/cider-nrepl-0.17.0-20180131.161649-9.jar from clojars
nREPL server started on port 53908 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_112-b16
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> Bye for now!
#2018-02-0219:51gonewest818no problems.#2018-02-0219:52gonewest818and I didn’t have to do anything with repo settings. That was leiningen 2.8.1.#2018-02-0219:55agI don't like that cider functions open things in other-window all the time. jack-in, cider-scratch, etc. I want them to open in the current window. Is there a straightforward way of setting that?#2018-02-0219:56aglike a var or something?#2018-02-0219:58twashing@gonewest818 Right. That was also my confusion. Maybe it’s because I had those profile settings in my ~/lein/profiles.clj ? I dunno.#2018-02-0220:01gonewest818@twashing let me try that.#2018-02-0220:01twashingHey @ag :)#2018-02-0220:03aghey hi Tim! #2018-02-0220:02twashingI think the other-window configuration happens on a case by case basis. So window behaviour on repl connection, is described here: https://cider.readthedocs.io/en/latest/using_the_repl/#repl-configuration#2018-02-0220:03agI'll check it out#2018-02-0220:04twashingMaybe type M-x customize-group cider and see what options you have.#2018-02-0220:09gonewest818@twashing with the following inserted into ~/.lein/profiles.clj#2018-02-0220:09gonewest818;;; note: CIDER injects its own dependencies these days
:repl
{:plugins
[[cider/cider-nrepl "0.17.0-SNAPSHOT"]]
:dependencies
[[org.clojure/tools.nrepl "0.2.13"]]}
#2018-02-0220:11gonewest818and deleting the same from my “foo” project from before, and deleting ~/.m2/repository/cider/cider-nrepl/0.17.0-SNAPSHOT, I still have no problem launching the repl:#2018-02-0220:11gonewest818$ lein repl
Retrieving cider/cider-nrepl/0.17.0-SNAPSHOT/cider-nrepl-0.17.0-20180131.161649-9.pom from clojars
Retrieving cider/cider-nrepl/0.17.0-SNAPSHOT/cider-nrepl-0.17.0-20180131.161649-9.jar from clojars
nREPL server started on port 56102 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.13
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_112-b16
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> Bye for now!
#2018-02-0220:12twashingHmm, I didn’t have the tools.nrepl dependency. Let me try that.#2018-02-0220:14twashing@gonewest818 Ok, starts for me too. Don’t know what I did wrong then.#2018-02-0220:14twashingSorry for the hub-bub.#2018-02-0220:15gonewest818not a problem!#2018-02-0220:57dominicm@gonewest818 there was a thread, tools.nrepl is test scoped in the pom, and it shouldn't be.#2018-02-0303:34bozhidar@dominicm See https://github.com/clojure-emacs/cider/issues/2191#2018-02-0303:35bozhidarI’ve hacked together some (ugly) support cider-jack-in with clj, but it seems you can’t run clj from Emacs which is absurd.#2018-02-0303:35bozhidarclojure: error: My terminal reports width=0 (is it emacs?) I can't handle this, sorry!
#2018-02-0304:58richiardiandreaWat?#2018-02-0304:59richiardiandreaIt is prolly cause the clj is trying to launch a REPL... probably some env car needs to be set#2018-02-0305:01richiardiandreaIt might be rlwrap as well: https://github.com/clojure/brew-install/blob/master/src/main/resources/clj#2018-02-0308:21dominicmYou could run clojure instead of clj, which is exactly the same, but without rlwrap#2018-02-0400:37bozhidarYeah, you were right - the error was coming from rlwrap. I didn’t know about that difference between clj and clojure.#2018-02-0407:21bozhidar@ag Many of were configurable, but I don’t remember which ones.#2018-02-0407:21bozhidar😄#2018-02-0407:22bozhidarFeel free to open a ticket about this. At least we can finally document this better.#2018-02-0407:25bozhidarUnfortunately the manual was created after most of the code and doesn’t many of the configuration options, just because I din’t have enough time to do it right.#2018-02-0407:32tianshuIs there a feature that inspect the spec at current point?#2018-02-0522:13xiongtxThere’s a spec browser: https://github.com/clojure-emacs/cider/blob/master/doc/miscellaneous_features.md#spec-browser#2018-02-0409:57dominicm@bozhidar
dominic@bianca2 ~/s/g/j/m/c/fatjar (master)> cat /usr/bin/clj
#!/usr/bin/env bash
if type -p rlwrap >/dev/null 2>&1; then
rlwrap -r -q '\"' -b "(){}[],^%3@\";:'" clojure "$@"
else
echo "Please install rlwrap for command editing or use \"clojure\" instead."
fi
yeah, clj is lightweight to say the least 😄#2018-02-0412:06bozhidar> Is there a feature that inspect the spec at current point?#2018-02-0412:07bozhidarInspect in what sense?#2018-02-0412:07bozhidar@dominicm Yeah, I went over the entire repo. 🙂#2018-02-0414:03kingcode@bozhidar Is it possible to do form-wise navigation? I couldn’t find an answer in Cider manual..e.g. from the current cursor, how do I ask to “go to the start of the previous global form”, or “go 2 sibling forms down”?
I have looked at paredit commands, but they seem quite primitive, as I can never get past the end of the current form when trying to jump..
Thanks for any advice, and for all your fabulous work!#2018-02-0416:57bozhidar@kingcode What you need is not generally in the scope of CIDER, as it doesn’t require REPL connection. You can take a look at some built-in commands (which are also available in clojure-mode).#2018-02-0416:57bozhidarhttps://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-by-Defuns.html#2018-02-0418:59matanHi Guys, I've acclimated (for the first time) with emacs, and cider. Is it normal that the cider menu doesn't always show? I currently only get a Clojure menu at the menu bar. How would I troubleshoot this?#2018-02-0418:59matanAnd second question if I may, when I run tests or a main from within emacs (how?) will it jump to the crashed line of code if the code crashes?#2018-02-0419:11matanI tried reinstalling the package, which didn't produce any error. But now it is no longer showing for me in the package list, and it even seems no longer available to me through package-install although I do have melpa-stable in my .emacs#2018-02-0419:13matanAll I did in between was install dark-theme packages and make minor changes through the Options menu#2018-02-0419:14matanthe messages buffer looks benign.
it includes Contacting host: #2018-02-0419:15gonewest818What happens if you M-x cider-mode in that clojure buffer?#2018-02-0419:16matanworks like wonder#2018-02-0419:16matanCIDER menu shows#2018-02-0419:18matanbut when I restart emacs, I need to retype that command again to get the menu#2018-02-0419:18matanis that very normal?#2018-02-0419:23matancan't this be perpetualized somehow? 🙂#2018-02-0419:23matanwithout this command I am not in Clojure cider mode but only in clojure mode when opening a .clj file as a buffer#2018-02-0420:14gonewest818Yes, you can persist that in your config.#2018-02-0420:14gonewest818Um, let me dig up a link.#2018-02-0420:15gonewest818(add-hook 'clojure-mode-hook #'cider-mode)#2018-02-0420:35matan@gonewest818 just add that to the .emacs file as a new line?#2018-02-0420:36matanI wonder why it is not the default, but thanks!#2018-02-0421:24gonewest818Most likely to avoid tight coupling where it isn’t strictly necessary. There is code in CIDER that anticipates having clojure-mode without cider-mode. In that case a small subset of autoloaded CIDER commands apparently get added to the Clojure menu.#2018-02-0423:15matanSounds like a design issue, if I get you right, some stuff will fail if clojure mode entails cider mode#2018-02-0522:26xiongtxCIDER doesn’t (and shouldn’t) presume that the user will want CIDER whenever they use clojure-mode. This is why CIDER does not modify clojure-mode-hook itself, but leaves it up to the user.#2018-02-0506:21gonewest818No, I only meant clojure-mode and cider-mode can work together but they’re intentionally not tied together. You can use clojure-mode without a repl at all (as you just saw), You can use clojure-mode with inf-clojure rather than CIDER.#2018-02-0508:30bozhidarIndeed. clojure-mode doesn’t have any REPL-specific features and can be used with any REPL-powered mode (like CIDER). It just provided basic font-locking and code navigation commands.#2018-02-0508:54benedekand some structural editing too ;)#2018-02-0516:35kingcodeNavigation question: I use cider-find-var to hop from one place to another in my source code and other libraries.
1) How do I navigate back to the previous jump and eventually to my starting point (or all at once to the start)?
2) Using cider-find-var replaces the buffer in the current window with the sought location…how would I have it go to another window, and can it be configured? Thanks for any comment…#2018-02-0516:50dpsuttonM-. will navigate to the source and M-, will pop the stack back to where you came from @kingcode#2018-02-0516:50dpsuttonperiod and comma if its difficult to read#2018-02-0516:51dpsuttoncider-pop-back is the function it invokes#2018-02-0516:52kingcode@dpsutton Thank you! Will look into that.. M-, works fine, but I use evil-mode which overrides M-. but I have key for cider-find-var - will also look into cider-pop-back#2018-02-0516:53dpsuttonsounds good.#2018-02-0516:53kingcode@dpsutton is it possible to do the same but have the target open in another window? Thx…#2018-02-0516:57dpsuttondo you mean cider-find-var will always open a new buffer?#2018-02-0516:57dpsuttoni think cmack answered your question in #emacs#2018-02-0516:58kingcode@dpsutton indeed, it replaces whatever I am looking at with the new location#2018-02-0516:58kingcode@dpsutton you’re right….thx!#2018-02-0516:59dpsuttoncider--open-other-window-p is a variable you can customize#2018-02-0516:59dpsutton(defun cider-find-var (&optional arg var line)
"Find definition for VAR at LINE.
Prompt according to prefix ARG and `cider-prompt-for-symbol'.
A single or double prefix argument inverts the meaning of
`cider-prompt-for-symbol'. A prefix of `-` or a double prefix argument causes
the results to be displayed in a different window. The default value is
thing at point."
(interactive "P")
(cider-ensure-op-supported "info")
(if var
(cider--find-var var line)
(funcall (cider-prompt-for-symbol-function arg)
"Symbol"
(if (cider--open-other-window-p arg)
#'cider--find-var-other-window
#'cider--find-var))))
#2018-02-0517:02kingcode@dpsutton Thank you very much…sorry, I should rely more on emacs help#2018-02-0517:03dpsuttonno problem at all#2018-02-0517:03dpsuttoni just bring it up because seeing the source is so trivial in emacs#2018-02-0517:03dpsuttonits a wonderful environment. and i like showing people that the CIDER source code is easily understandable and modifiable 🙂#2018-02-0517:04kingcodeTrue…C-h f, then entering over the file name, will do that 🙂#2018-02-0517:04kingcodeI love emacs, it’s really worth digging into#2018-02-0601:47xiongtx@bozhidar @cichli How can we evaluate some code in the cljs buffer from within CIDER? Seems like that’d be the easiest way to fix https://github.com/clojure-emacs/cider/issues/2099.#2018-02-0602:03bozhidarLooking at your research and the question I’m a bit confused - isn’t the problem that the wrong thing is passed to macroexpand?#2018-02-0602:04xiongtxI’ve no idea how to get the “right thing”. So the easiest thing to do seems to be to evaluate the macroexpand form in the cljs context and grab the result.#2018-02-0602:06xiongtxB/c we know that calling macroexpand in the cljs REPL does the right thing#2018-02-0602:14bozhidarA source buffer with a cljs connection would yield the same eval results.#2018-02-0602:14bozhidarThe only difference is that for REPLs the connection type is always static, but for other buffers it’s inferred dynamically.#2018-02-0602:32xiongtxI don’t understand. Clearly there is some context for cljs that is not there for clj. Maybe some dynamic vars need to be bound?
What I mean is that there’s no need to call cljs.analyzer/macroexpand-1. cljs.core/macroexpand-1 should work, if we provide the right context.#2018-02-0609:24bozhidarProbably you’re right, but keep in mind that in the middleware everything is Java code and that’s why everything we can do there is just use the cljs compiler state. That’s also how completion is implemented for Cljs. I’m not sure how we can evaluate real ClojureScript code there. Maybe looking to piggieback’s code would be informative?#2018-02-0602:04bozhidarFor the evaluation - what we always do is to leverage piggieback in the underlying nREPL connection + whatever cljs REPL the user decide to start on top of it.#2018-02-0611:24xiongtx@bozhidar @cemerick Had some thoughts on CLJ-1146 and clojure-emacs/cider#1372: https://github.com/clojure-emacs/cider/issues/1372#issuecomment-363392344
I'd ❤️ to get this fixed. The Unmatched delimited: ) message has driven me up the wall a few times.#2018-02-0612:13bozhidarYeah, seems to me this can be fixed in nREPL, but I guess it should happen after the compatibility 0.3 release we’re waiting for right now.#2018-02-0621:04xiongtxAnything that can be done in cider-nrepl? Or does it have to be nREPL itself?#2018-02-0612:14bozhidarOnce https://github.com/cemerick/nREPL/issues/1 is done we can finally start hacking freely on nREPL and make some awesome improvements.#2018-02-0618:39pabloreHow can I connect figwheel repl to cider’s. Google search only gives me paid clojure courses as results#2018-02-0618:55justinbarclay@pablore Have you tried this: https://cider.readthedocs.io/en/latest/up_and_running/#using-the-figwheel-repl-leiningen-only#2018-02-0619:13pablore@emoarmy thanks#2018-02-0710:14xiongtx@bozhidar Maybe some of the cider contributions can go towards a paid TravisCI plan. I'd expect there'd be greater reliability and increased parallelism. Haven't investigated what's possible; perhaps @gonewest818 would have a better 💡?#2018-02-0710:16bozhidarThat’s an option, but I’m not sure that this latest failure has anything with Travis, though. Generally I know virtually nothing about the advantages of the paid Travis plans as I’ve never used/needed them.#2018-02-0710:18xiongtxCircleCI offers more parallelism w/ paid plans; I'm not sure whether Travis does.
In any case, that job passed: https://github.com/clojure-emacs/cider-nrepl/pull/502#issuecomment-363721795, but maybe another one'll fail. The non-determinism is annoying.#2018-02-0711:02bozhidar> The non-determinism is annoying.#2018-02-0711:03bozhidarYou don’t say. 🙂 I re-ran this 3 times before posting the comment on the ticket… I guess you have the magic touch.#2018-02-0711:04bozhidarAnyways, I’ve merged the first version of our new integrated profiler. Big thanks to @jmayaalv who worked on this. We should polish the UI a bit before releasing this, but we’re off to a good start!#2018-02-0711:05jmayaalvThanks to you guys!#2018-02-0712:21dominicmThis is cool, gonna have to integrate this into my own toolset now 😄#2018-02-0713:49stardiviner@jmayaalv Thanks.#2018-02-0715:06gonewest818@xiongtx aren’t you in SF somewhere? Running CI jobs at 🕑?#2018-02-0715:09gonewest818As for subscriptions, I think that gets you priority support from Travis and perhaps a segregated set of infrastructure but I haven’t seen anything to indicate the feature set is any different behind the velvet rope. #2018-02-0715:11gonewest818I did recently (and for the first time) use Circle CI in relation to a pull request for cloverage because that project runs both services side by side.#2018-02-0715:18gonewest818The free CircleCI plan is a single builder at a time and there’s cap on usage per month. Adding money gets you more. But Circle CI tasks are “true” docker containers you can specify rather than the 10GB behemoth container Travis CI uses. Jobs are more configurable and launch directly into your test script without spending time in “before_install” “”install” “after_install” “before_script” etc #2018-02-0715:19gonewest818So that thing we do with libnettle and gnutls-clj would just be container config in Circle CI. #2018-02-0715:28gonewest818Before working with Circle CI I mistakenly estimated required build time per month based on the duration Travis CI jobs, but that isn’t the right comparison. #2018-02-0715:30gonewest818Circle CI ought to be more efficient, spending majority of the time on your tests rather than on environment setup. #2018-02-0715:53dpsutton@gonewest818 do you know of a way to estimate a year of Circle CI costs?#2018-02-0715:57dpsutton> We offer a total of four free linux containers ($2400 annual value) for open-source projects. Simply keeping your project public will enable this for you!
> We also offer the Seed plan free for OS X open-source projects. Contact us at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> for access. If you are building a bigger open-source project and need more resources, let us know how we can help you!#2018-02-0715:59gonewest818I suppose it’s best to demo the free plan and extrapolate?#2018-02-0716:02gonewest818Possible 1500 build minutes per month (if that’s the cap for OSS projects, unclear) might still be a problem in spite of what I just said above about efficiency.#2018-02-0716:02dpsuttonif it was about $800 for a year i was gonna look at donating the money but it's quite pricey it seems#2018-02-0716:03dpsuttonbut it seems like it could be quite a bit more expensive#2018-02-0716:06gonewest818That’s generous. I like the people at both companies, by the way, lest any of this comes across as a slanted endorsement.#2018-02-0716:08gonewest818btw happy to take this discussion over to #devops if channel ops prefer to keep #cider on topic.#2018-02-0720:52xiongtx@bozhidar Can you tweak cider's configs to allow contributors to request reviewers?#2018-02-0723:32xiongtx> I think I got it sorted with circleci customer support. A project admin (bbatsov or you) would need to email a request to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> to request an open source discount.
@bozhidar From @gonewest818. Let's give CircleCI a try. Perhaps it'll be more reliable than Travis.#2018-02-0802:19bozhidar> @bozhidar Can you tweak cider’s configs to allow contributors to request reviewers?#2018-02-0802:19bozhidar@xiongtx Sure. I didn’t even know this was possible. I always found the default behaviour very annoying.#2018-02-0815:24donmullenI am giving fulcro video tutorials sample app a test drive and trying to setup emacs/cider. Fulcro uses a custom (start-figwheel) in src/dev/user.clj. How can I set configure cider to run that when using cider-jack-in-clojurescript? Evidently normally one would set up the cider-cljs-lein-repl: (setq cider-cljs-lein-repl
"(do (require 'figwheel-sidecar.repl-api)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl))")#2018-02-0815:29bozhidarYep.#2018-02-0815:30bozhidarI’m planning to change this, though, but for now you just have to pick what form to evaluate to start the cljs repl fron the clj repl.#2018-02-0815:32dpsuttonand its probably best to set it as a dir local variable so that other clojurescript projects can set their own initialization steps#2018-02-0815:32bozhidarThat’s why I want to change this actually.#2018-02-0815:33bozhidarThis was a really dumb idea initially - tying forms to the build systems. What I actually want to do is to just inspect what cljs repls are available and asking the user to select one of them.#2018-02-0815:34bozhidarThis would also mean there will be just one var to configure if you want to force the default, instead of one form per build tool.#2018-02-0815:35donmullenso setting cider-cljs-lein-repl to (do (require 'user)
(start-figwheel)) seems to be working - thanks.#2018-02-0815:36donmullen@dpsutton - yes - thanks - lazy ask : what is the location of the dir local variable?#2018-02-0815:36bozhidarhttp://endlessparentheses.com/a-quick-guide-to-directory-local-variables.html#2018-02-0815:36dpsuttonmake a file at the root of your project called dir-locals.el with contents
((nil . ((cider-cljs-lein-repl . "(do (require 'user) (start-figwheel))")
)))
#2018-02-0815:36dpsuttonand always look to @malabarba blog posts for information about emacs#2018-02-0815:37dpsutton(which is what bozhidar posted)#2018-02-0816:13bozhidarArtur is a true Emacs legend - it’s a pity he’s not that active in the OSS realm these days, but I guess that happens to everyone eventually when life catches up with us.#2018-02-0818:01gganleyI’m not sure if anyone is interested but I made a quizlet set for CIDER keybindings https://quizlet.com/_3dr21m#2018-02-0919:10Denis GHey guys, I have a problem connecting to the repl using cider on spaceemacs. I've just started with emacs so I am kinda confused and didn't know where to write, so here I am. Any ideas why connection to the repl is not established?#2018-02-0919:13justinbarclayHave you used either the cider-jack-in or cider-jack-in-clojurescript commands?#2018-02-0919:13Denis Gcider-jack-in#2018-02-0919:13Denis Gthe repl server is started but no connection has been made. When I close the spacemacs, he's asking me, whether or not I want to kill other processes too, showing me to the repl-server which I've created but didn't connect to#2018-02-0919:42Denis GSorry for bothering, wanting to tell that this was a code problem. I tried to start it in intellij and got the same problem, but a more descriptive error#2018-02-0919:44Denis GThis piece of code: (doseq [_ (range (Integer/parseInt (read-line)))] ... ) got me a
[{:type clojure.lang.Compiler$CompilerException
:message java.lang.NumberFormatException: null, compiling:(test_project/core.clj:215:1)
:at [clojure.lang.Compiler load Compiler.java 7526]}
Does anybody have a clue why this is happening?#2018-02-0920:20gonewest818You’re feeding parseInt something that isn’t an integer.#2018-02-0920:47Denis G@gonewest818 what do you mean by that? I didn't have a chance to give the input. I just wrote the code and wanted to start repl. I didn't provide any input, or did I get you wrong?#2018-02-0920:48dpsuttonwhat's at line 215 of test_project/core.clj?#2018-02-0921:11Denis GNow I've already changed the code, being doing some stuff, now I have regex in my code, and I once again can not start the repl
Error message:
[{:type clojure.lang.Compiler$CompilerException
:message java.lang.NullPointerException, compiling:(test_project/core.clj:217:1)
:at [clojure.lang.Compiler load Compiler.java 7526]}
{:type java.lang.NullPointerException
:message nil
:at [java.util.regex.Matcher getTextLength Matcher.java 1283]}]
Code:
(let [[n k] (->> (clojure.string/split (read-line) #" ")
(map #(Integer/parseInt %)))
... )
#2018-02-0921:15tanzoniteblack@denisgrebennicov if you're having problems starting a repl, it generally means that you have code that's throwing errors at compile time rather than run time. Generally this means you have code as a def or just directly in the body that you'd be better off putting behind a defn#2018-02-0921:18wiseman…it would be kind of awesome if cider handled this situation a little better.#2018-02-0921:19Denis Ghmmmm... I guess you are right 😅#2018-02-0921:19wisemani run into it frequently, and it seems a great opportunity to show a useful error message.#2018-02-0921:19tanzoniteblackI believe that whenever I've run into this case, an error message has been printed in the *Messages* buffer#2018-02-0921:24wisemanhm yeah maybe that’s enough--just tried it and i see a big stack trace in the minibuffer, and i can go to messages to see more. though it is very easy to accidentally clear the message from the minibuffer (any keypress), and be left with no indication that an error occurred unless you happen to have *Messages* open.#2018-02-0921:26tanzoniteblackor...you just get so used to the cider eco system that you know where to go look when a repl fails to load. So yeah, some improvement in user friendliness in these situations could definitely be had#2018-02-0922:18chris_johnsonI’m a super newbie but I struggle to think what you could really do other than maybe have the error in the minibuffer just say “Your repl has had a bad problem and will not go to space today. See *Messages* for more information.”#2018-02-0922:18chris_johnsonthere isn’t a good place to stick a “modal” (thank the maker) in an emacs session#2018-02-0922:38tanzoniteblackmaybe throwing it into a new attention grabbing buffer, like is what happens with the *cider-repl <project>* buffer?#2018-02-0923:43wisemani mean, cider pops open a nice buffer with an error message and stack trace when there’s a runtime error, right?#2018-02-0923:49tanzoniteblack@wiseman you are indeed a wise man#2018-02-1006:32bozhidar@chris_johnson suggestions for improvements are always welcome. Just file some ticket about this and we’ll take a look.#2018-02-1008:06bozhidarJust keep in mind that errors during REPL boot time are a bit different as not everything is working properly at this point.#2018-02-1015:11tianshucan I make the file readonly when cider debugger is active?#2018-02-1015:12chris_johnsonIt’s not like “there was an error during system startup; I won’t tell you what it is, but here is the name of a Java exception class that got thrown with no other context” is a problem unique to Cider; that is one of the small prices we all gladly pay to be in the Clojure ecosystem hehe#2018-02-1105:45bozhidar@doglooksgood Why do you want to do this?#2018-02-1107:13tianshuemacs lisp debugger do like this, I think it's good. the commands in debugger are all single key command, if I press a wrong key, the buffer will change.#2018-02-1112:37bozhidarI see your point. We’ve borrowed a lot of the design from Edebug, but I don’t recall how exactly did we came to the current state of affairs. I have some vague memory that in the beginning this was working more or less like edebug, but we ha some reason to change this. @malabarba might remember more and there might also be something in the commit logs.#2018-02-1117:32zalkyHi, does anyone know how to turn off the printing of namespaced maps in the cider repl? I've tried the following hack recommended elsewhere, and it seems inconsistent:
(defmethod print-method clojure.lang.IPersistentMap
[m, ^java.io.Writer w]
(#'clojure.core/print-meta m w)
(#'clojure.core/print-map m #'clojure.core/pr-on w))
Is there a way to configure what bindings the cider repl re-binds? Specifically *print-namespace-maps*? I find they make the output really difficult to read.#2018-02-1117:49dpsuttoni don't believe that CIDER has anything to do with this. it certainly isn't formatting the output once it comes back from the middleware. in a clojure 1.9 project, both lein repl and CIDER act the same:
{:a/a 1 :a/b 2}
; ==> #:a{:a 1, :b 2}
#2018-02-1117:50dpsuttonprobably best to ask in #clojure or #clojure-dev#2018-02-1118:01dpsuttonalso
clj -e "{:a/a 1 :a/b 2}"
#:a{:a 1, :b 2}
#2018-02-1118:23zalky@dpsutton: thanks for the response. I was aware of *print-namespace-maps*, and I guess my problem is that I don't know how to prevent what the doc-string says, which is that the repl re-binds it to true. I thought that maybe in cider there is some control over this, though I admit I don't have great insight into how cider and the repl work together.#2018-02-1118:24zalkyOtherwise, I'm not sure where else the point of control would be to prevent the repl from doing this, or to just re-binding it back to false.#2018-02-1118:26dpsuttonmight be able to use this var
(defcustom cider-connected-hook nil
"List of functions to call when connected to Clojure nREPL server."
:type 'hook
:group 'cider
:package-version '(cider . "0.9.0"))
#2018-02-1118:28dpsuttoni'm guessing its pretty low down that it gets rebound to true by the repl (out of CIDER's control) and you would just need to rebind to false manually#2018-02-1118:30zalkyHmm, thanks for the help, I assume the above hook loads elisp fns, and I'd have to figure out how to load clojure code?#2018-02-1118:32dpsuttoncorrect. her's an example from cider-create-sibling-cljs-repl (the callback to startup that creates the second repl for cljs
(cider-nrepl-send-request
`("op" "eval"
"ns" ,(cider-current-ns)
"code" ,cljs-repl-form)
(cider-repl-handler (current-buffer)))
#2018-02-1118:33dpsuttonand here "code" would just be whatever form sets the dynamic var to false#2018-02-1118:35dpsuttoncheck out cider-interactive-eval#2018-02-1118:35zalkyAwesome, thanks, this is a great option if I can't figure out an more idiomatic way to set *print-namespace-maps* at outside cider.#2018-02-1118:36dpsuttonare you using lein? doesn't lein have some config for this as well?#2018-02-1118:37zalkyI'm using boot#2018-02-1118:37zalkyhmm, maybe that's another avenue#2018-02-1118:37dpsuttoni don't know boot well but my mental model of it makes me think you just put this form in one of your repl tasks#2018-02-1118:38dpsuttonok if you are working in lein it looks like this option exists
:global-vars {*warn-on-reflection* true
*assert* false}
for boot it should be pretty simple but i don't know#2018-02-1118:39zalkyThanks for pointing me in the right direction!#2018-02-1118:40dpsuttonfor sure. happy coding#2018-02-1118:41dpsuttoni think $BOOT_HOME/.profile.boot can handle this for you and make all of your projects behave as you want them#2018-02-1118:41dpsuttonand it won't add this to the repo to disturb other's workflow so its a win win#2018-02-1118:51gganleyI saw Alex amending a bunch of github repos with “deps.edn”. I assume that is for project depenedencies. Could anyone point me to a resource explaining this?#2018-02-1118:51dpsuttonhttps://clojure.org/guides/deps_and_cli#2018-02-1119:05gganleyThank you#2018-02-1201:21bozhidarWe’re recently added support for using deps.edn with CIDER and inf-clojure.#2018-02-1201:23bozhidar@dpsutton @zalky CIDER currently does nothing about this indeed, but we can add it to the list of global vars you can init via CIDER.#2018-02-1201:26dpsuttonI need to sit down and learn inf-clojure. I haven't taken the time to see how to start it up and really work with it#2018-02-1201:27bozhidarIt just binding the input and output of terminal process to a REPL buffer (very simply put). There’s not much to learn, it doesn’t get any simpler than this.#2018-02-1201:28bozhidarInitially it had very basic features, but @richiardiandrea has been improving it steadily for quite a while now and it’s quite powerful at this point.#2018-02-1201:29dpsuttonYeah I need to learn how to crank it up. I've gotten confused in the past about how to init it with the correct arguments#2018-02-1201:31dpsuttonYeah I got to meet him at one of the conj but didn't get to spend much time with him. I want to meet up with people at clojure sync and have a hack session if people are gonna be there#2018-02-1201:40bozhidarI would have love to come, but I’m traveling in Asia these days. Hopefully this year I’ll make it to the conj or something. It’s a pity they killed my preferred conference Clojure/west.#2018-02-1201:41bozhidarIn general I’d love to do more Emacs-live hacking sessions and enlist more people to our noble cause. 🙂#2018-02-1201:44richiardiandreaI have scheduled some time on an inf-clojure blog post#2018-02-1201:45richiardiandreaI want to improve on the init part first though#2018-02-1201:54bozhidar@jmayaalv You asked for some other simple task you might tackle and I can suggest this one https://github.com/clojure-emacs/cider-nrepl/issues/489#2018-02-1201:56bozhidarAnd perhaps https://github.com/clojure-emacs/cider-nrepl/issues/453 and https://github.com/clojure-emacs/cider-nrepl/issues/464#2018-02-1201:56bozhidarI guess you’ll feel pretty comfortable with the Clojure-related tasks.#2018-02-1208:47jmayaalvthanks @bozhidar will check them.#2018-02-1221:13gonewest818@jmayaalv I’ve started looking at #489, the mranderson issue, and will update in the ticket with what I find. I’m not “claiming” it per se as it seems likely the work can be divided up. #2018-02-1221:49danielcomptonDoes someone know what the <find> key is in emacs?#2018-02-1221:50danielcomptonI'm looking at my keyboard and I don't think I have one of those#2018-02-1221:52mhcatheya, trying to cider-jack-in and seeing this error: Recursive load: "/home/joni/.emacs.d/elpa/cider-20180211.538/cider.el", "/home/joni/.emacs.d/elpa/cider-profile-20141120.625/cider-profile.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider-mode.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider.el", "/home/joni/.emacs.d/elpa/cider-profile-20141120.625/cider-profile.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider-mode.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider.el", "/home/joni/.emacs.d/elpa/cider-profile-20141120.625/cider-profile.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider-mode.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider.el", "/home/joni/.emacs.d/elpa/cider-profile-20141120.625/cider-profile.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider-mode.el", "/home/joni/.emacs.d/elpa/cider-20180211.538/cider.el"
- worth an issue, or is this a problem with my setup?#2018-02-1222:04mhcathuh, reproduced on another computer, so I guess it's real#2018-02-1222:13mhcatHuh, can't submit an issue to the cider repo - the submit button is greyed ou#2018-02-1222:13mhcat@bozhidar fyi#2018-02-1222:14mhcatoh nvm, submitted it#2018-02-1222:46mhcataaand closed it - seems like that cider-profile package is obsolete and was leftover in my config#2018-02-1222:58dpsuttoni think it moved into CIDER like 2 days ago, @j0ni#2018-02-1222:59dpsuttonhttps://github.com/clojure-emacs/cider/pull/2197 6 days ago#2018-02-1222:59mhcatohhh cool, so I wasn't that out of date#2018-02-1222:59dpsuttonnope. you're on the bleeding edge my friend#2018-02-1302:27bozhidarSorry about that @j0ni - I don’t have control over the original repo, otherwise I would have marked it as deprecated.#2018-02-1307:17xiongtxCreate an issue for thunknyc/nrepl-profile to put a notice in the README that its functionality is now in CIDER: https://github.com/thunknyc/nrepl-profile/issues/14#2018-02-1307:22xiongtxAnd a PR: https://github.com/thunknyc/nrepl-profile/pull/15#2018-02-1302:38mhcatOh no worries @bozhidar I choose the melpa life after all #2018-02-1302:38bozhidar🙂#2018-02-1302:39bozhidar@gonewest818 Happy to hear this! It’s one of the few outstanding things holding off the release of 0.17 (when it comes to orchard it’s just that and extracting a bit more functionality into it).#2018-02-1302:39bozhidar@j0ni On the bright side - now you have a profiler which actually works. 😉#2018-02-1306:28gonewest818Having debugged a mranderson-ed project I can confidently say… not my favorite way to work.#2018-02-1308:14benedekhaha sorry about that @gonewest818 #2018-02-1308:14benedekI am working on some improvements but have very little time :/#2018-02-1311:06bozhidar> Having debugged a mranderson-ed project I can confidently say… not my favorite way to work.#2018-02-1311:06bozhidarI guess a lot of people share your frustration, but unfortunately the problem of isolating tooling deps from project deps in not an easy one to solve…#2018-02-1311:31chrisblomis there a way to set custom indent rules when a symbol has a certain namespace?#2018-02-1311:33chrisblomI can set it individual symbols using put-clojure-indent, but now i'd like to configure the indentation rules for om-style dom builder function#2018-02-1311:34chrisblomIs there something like (put-clojure-indent-prefix "dom/" 'defun)?#2018-02-1311:53bozhidarIt’s not possible right now, but it’s possible to do so in general.#2018-02-1315:17gonewest818@benedek @bozhidar I know! Sorry, that was just a bit of snark. The utility of mranderson is unquestionable.#2018-02-1315:38stardivinerIs there other solution for my need? Like redirect file to other path or use a Clojure function to move the file to another path?#2018-02-1315:39stardivinerClick on the "Posted in #jvm" to get more followed details. I posted more info below.#2018-02-1316:00benedek@gonewest818 other option would be class loader separation in the JVM we played with that around the time mranderson was introduced but no avail#2018-02-1316:11gonewest818An interactive mode to sync changes between src and target/srcdeps would have prevented a few of my stumbles.#2018-02-1316:12benedekyou can start a repl with mrandersoned source as modify stuff in the repl#2018-02-1316:12benedeksame way as you run the tests with mranderson#2018-02-1316:13benedekperhaps help with the workflow. but tbh mranderson does not really support a quick feedback workflow#2018-02-1316:14gonewest818Yes, in fact that’s the workflow I landed on eventually.#2018-02-1317:12gonewest818I think the source of my frustration is M-. resolves to the srcdeps copy of the file. You have to pay attention.#2018-02-1318:53arrdemDoes refactor-nrepl expose any machinery for changing the ns sorting order?#2018-02-1318:54arrdemIn python-landia there were some conventions about sorting imports into “standard library”, “1stparty”, “3rdparty” and sorting those blocks alphabetically. Wondering if something similar is achievable here.#2018-02-1405:52wisemanI think about this every time I sort my imports.#2018-02-1322:29ghadiIs the cider nrepl port configurable via dir-locals?#2018-02-1405:52wisemanI think about this every time I sort my imports.#2018-02-1400:22gganleyI believe so, I’ll look at http://cider.readthedocs.io#2018-02-1400:26gganleyhttps://github.com/clojure-emacs/cider/blob/a433741df98c5b583ba79beb6d8c69149bd55683/cider-repl.el#L1628#2018-02-1400:27gganleyUnfortunately I don’t know how to help you from here. Clearly it loads dir-locals when it loads cider-repl-mode but from there I don’t know#2018-02-1400:29dpsutton@ghadi what are you trying to do?#2018-02-1400:30dpsuttonCider reads the port that nrepl is listening on from the output so it doesn't need to be configured. #2018-02-1400:33dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/nrepl-client.el#L1050#2018-02-1400:34dpsuttonit looks like there's
(defcustom cider-lein-parameters
"repl :headless :host ::"
"Params passed to Leiningen to start an nREPL server via `cider-jack-in'."
:type 'string
:group 'cider
:safe #'stringp)
where you could maybe specify a port? not really sure about advanced startup stuff like that but if so CIDER will see the value#2018-02-1404:07bozhidar@ghadi For cider-jack-in or cider-connect?#2018-02-1408:14benedek@arrdem @wiseman there used to be when sorting was done in elisp. I don't think it is configurable in the newer versions. feel free to file an issue or do a PR tho I would not mind at all to resurrect the feature#2018-02-1411:46andrea.crottimm just restarted my emacs and getting#2018-02-1411:47andrea.crottia recursive require just by doing simply (require cider)#2018-02-1411:59andrea.crottimoved back to melpa-stable in the meanwhile, should I raise an issue on github (unless it's something trivially wrong with my setup somehow, seems strange that such a problem could go undetected)#2018-02-1412:55jumarDo you guys have a reasonable workflow when dealing with 3rd party java libs in Emacs/Cider?
I mean jumping to the java source files and, perhaps, showing the docstrings.#2018-02-1412:55jumarI'm mostly interested in exploration part - quickly going to the source of the java class and perhaps showing the javadoc.#2018-02-1412:58jumarI tried to add "sources" artifact to the project.clj but cider still cannot reliable find the source file (using jump-to-definition).
One good example is https://www.ldap.com/unboundid-ldap-sdk-for-java
I can use cider-open-classpath-entry to list contents of "*sources.jar" and navigate to the class but that's not very comfortable.
Also, I need to add sources jar to the dependencies for every java lib on the classpath if I want to look into its source files.#2018-02-1412:59jumarI think that Cursive/IDEA is much better in this case, but I got so used to Emacs/Spacemacs that I have a hard time to switch back 🙂#2018-02-1414:16dominicmThere is a lein plugin which fetches all of the source versions of jars.#2018-02-1416:48bozhidarIf the source of some artefact is the classpath the source lookup is going to work in CIDER. It’s as simple as that.#2018-02-1419:04jumar@U051BLM8F well my experience is somewhat different. It doesn't seem to work reliably. Moreover, I was asking if that's something the other guys really use because it seems to be a bit tedious.
@U09LZR36F I guess you're talking about https://github.com/puppetlabs/lein-ubersource - I'll try that!#2018-02-1419:08jumarbtw. one variant that I've tried was to add it as a dependency to :repl profiles:
:repl {:dependencies [[com.unboundid/unboundid-ldapsdk "4.0.0" :classifier "sources"]]}
I guess that should be it.
It's definitely visible in the output of cider-open-classpath-entry and I can navigate to the class manually. However, cider (at least in my configuration - more or less standard spacemacs) doesn't seem to be able to jump to most of the definitions (e.g. LDAPConnectionPool class from that artifact)#2018-02-1419:11jumarAd lein-ubersource plugin: it seems that it's useful mostly for manual grep through all the java sources. I don't immediately see how to use it to automatically add all source jars to the classpath.#2018-02-1419:35dominicm@U06BE1L6T https://github.com/clojure-emacs/cider-nrepl/issues/64 brought out this plugin: https://github.com/vise890/lein-pocketbook#2018-02-1419:41jumarI will check it out - thanks!#2018-02-1415:15dpsutton@andrea.crotti someone had this same issue and it turned out they had reference to cider-profile. This was recently absorbed into CIDER and now createsa circular reference. Try that and I think you'll be fine#2018-02-1415:24bbrinckcider-eval-last-sexp is super valuable, but when I encounter threading macros like ->, I find I need to refactor my code into nested sexps to use cider-eval effectively. Is there a way to eval parts of a threading macro or display the results after each step, somewhat like https://github.com/JoshCheek/seeing_is_believing ?#2018-02-1415:25bbrinckOr do people have other strategies for interactively inspecting the results of threading macros?#2018-02-1416:22bhaumanIt's probably easier to create a script that launches nrepl than to attempt connecting cider to a Socket Repl correct?#2018-02-1416:22bhaumani'm trying a clojure cli tool only setup#2018-02-1416:22ghadiI was doing this for coworkers for clj + cider:#2018-02-1416:22ghadi#!/bin/bash
clj -A:cider:test - <<EOM
(require 'cider-nrepl.main)
(cider-nrepl.main/init ["cider.nrepl/cider-middleware"])
EOM
#2018-02-1416:23ghadi(where the cider alias had the dependencies listed)#2018-02-1416:23bhaumanwell dang son that's what I was looking for#2018-02-1416:23bhaumanperfect!#2018-02-1416:23ghadiyou'll need 0.17-snapshot i think#2018-02-1416:23bhauman16 should work right?#2018-02-1416:24bhaumanits just nrepl#2018-02-1416:24ghadii don't know. i don't think it has the cider-nrepl.main namespace#2018-02-1416:24bhaumanoh gotcha#2018-02-1416:24bhaumanmakes sense#2018-02-1416:24ghadiit's certainly possible to do it in 0.16 -- just need to change the code a bit#2018-02-1416:25bhaumanthanks much#2018-02-1416:38dpsuttonand i was asking about lein. should have known 🙂#2018-02-1416:50bozhidar> It’s probably easier to create a script that launches nrepl than to attempt connecting cider to a Socket Repl correct?#2018-02-1416:51bozhidar@bhauman You can just see what we’re using in 0.17 for deps.edn cider-jack-in#2018-02-1416:51bhaumanThat's good to know!#2018-02-1416:51bhaumanthanks#2018-02-1416:52bozhidar> It’s probably easier to create a script that launches nrepl than to attempt connecting cider to a Socket Repl correct?#2018-02-1416:53bozhidarYeah, the socket repl support is a work in progress, which is going on very slowly due to lack of someone with the time to do the necessary refactorings.#2018-02-1416:54bhaumanit's not a big deal to me, I was just looking for the simplest way#2018-02-1416:54bozhidar:thumbsup:#2018-02-1416:55bozhidar@andrea.crotti @dpsutton is right. Just remove the old cider-profile package you’ve installed at some point.#2018-02-1419:36arrdem@benedek cool! thanks for the answer. I may take a pass at it later, although seems like some of the stdlib / 1stparty / 3rdparty bits would be hard to infer#2018-02-1422:53dpsuttonIf you're going to clojure sync I'm trying to organize an into to contributing to cider. Check #cider in the slack for the conference#2018-02-1423:58gonewest818@dpsutton can you get someone to record that session for those who can’t be there?#2018-02-1423:58dpsuttondon't think its gonna be a session. more an unsession.#2018-02-1423:58dpsuttonhoping to get more people to work on http://www.hackingcider.com#2018-02-1423:59gonewest818cool#2018-02-1423:59dpsuttoni'm just going over with a few interested people how to debug, how to start working on it, general layout etc#2018-02-1423:59dpsuttonhoping that we have some new collaborators soon#2018-02-1500:01gonewest818Well, one big thing would be publicity. I just found http://hackingcider.com today, everything else I’ve done has been through trial and error, and tenacity.#2018-02-1500:01dpsuttonshould be a link to the repo. always looking for more contributions#2018-02-1500:02dpsuttonhttps://github.com/clojure-emacs/hackingcider#2018-02-1500:02dpsuttonand submit posts to https://github.com/clojure-emacs/hackingcider/tree/master/resources/templates/md/posts#2018-02-1500:03dpsuttoni'd love for you to write up some of the infrastructure stuff. maybe a way to test locally and then how to run the "gauntlet" of tests with docker#2018-02-1500:15gonewest818Happy to. One thing I’d like to propose, however, is switching Cider away from evm as the functionality it provides is subsumed by docker if one is willing to adopt docker in one’s daily development workflow. I also have my eye on cask because what it provides (dependency management, launching emacs with its own isolated packages and init) can be done in other ways. [Edit] Also the cask project has been seeking a new maintainer for quite a while.#2018-02-1500:58xiongtx👏 A Docker-based workflow sounds much more attractive than emacs-specific versioning tools.#2018-02-1500:16gonewest818Oh, and completing the trifecta would be moving from Travis CI to CircleCI which is sort of connected to the docker workflow.#2018-02-1500:16gonewest818Because CircleCI has much saner docker support in the builds.#2018-02-1500:16dpsuttoni would read the hell out of that blog post 🙂#2018-02-1502:44bozhidarI’m completely fine with starting the switch to Cicle CI for CIDER and friends. My patience with Travis CI is wearing pretty thin these days.#2018-02-1502:44bozhidarWe can start with the free plan and take it from there.#2018-02-1522:24qqHello, I just started to use Cider (w/ spacemacs), got a message saying that cider doesn’t support running Clojurescript tests 😞. I know there are other options such as phantom, karma, etc. Just wonder what is the normal workaround if someone wants to use Cider and running some specific cljs tests (not all tests)#2018-02-1605:30rmuslimov@qq yeah, it doesn’t#2018-02-1605:38qqit’s quite unexpected to me, I’d started writing code in Clojure (with the Clojurescript transition in mind) and cider provides the very useful way of writing, repl, and tests iteration. 😞#2018-02-1605:43rmuslimovsorry, there is no refunds for this product 😞#2018-02-1605:58qqI get your hilarity 😄, still tinkering with lein and lein-doo, hope to see the light cljs#2018-02-1613:18bozhidarWell, it’s just a matter of someone making it possible to do so. As clojure.test exists for cljs I’m assuming that the changes to the test running middleware should not be significant.#2018-02-1613:20bozhidarAs I’ve told many people in the early days of the project when I had a lot of time, cljs was not really a thing, and by the time it became a thing my ability to work on big features was greatly reduced due to significantly more time-consuming work. It’s a pity no one has stepped up in quite a while to work on the missing cljs features. 😞 Much of what we have was hacked by @cichli and @gtrak, but unfortunately they haven’t been active on CIDER in a couple of years now.#2018-02-1613:23gtrakI haven't really done clojure in years either. But quick fixes are probably possible. Some things like the debugger seemed way harder.#2018-02-1613:36gtrakLast time I tried cljs, it seemed like it was all still overly complicated. Not sure how we can expect tooling to be easy to build on top of that.#2018-02-1613:37gtrakEg figwheel is nice but also complex.#2018-02-1616:13echristophersonIs there some way of predicting whether C-x 4 C-o will change the buffer displayed in the current window vs. another window?#2018-02-1718:19Karol WójcikHello what is a status of cider? Will it be abandoned in favour of inf-clojure?#2018-02-1718:30cjsauerHey all, is there a way in cider to evaluate-last-sexp, but keep the result as a comment in the source file? I'm working through the examples in a book, and it'd be great to see results right next to the examples as I run them.#2018-02-1718:31Karol WójcikWell the output should stay as it is as long as you don't type anything#2018-02-1718:31Karol WójcikIf you want to create a comment you should probably write your own emacs-lisp funciton#2018-02-1718:32Karol WójcikIs not hard since the output of the evaluation is in the messages buffer#2018-02-1718:36cjsauer@kwcharllie379 I found the command: C-c M-x: cider-eval-defun-to-comment 🙂#2018-02-1723:39gonewest818There are also pretty-print versions of those “eval to comment” functions.#2018-02-1718:36Karol WójcikWow#2018-02-1718:38cjsauerI've seen a few other Clojurists do this in videos, so I imagined it was a built-in#2018-02-1718:40Karol WójcikNice good job#2018-02-1718:44Karol WójcikI am asking about cider because I do not know whether is worth switching to the inf-clojure. The main benefit for me is that the inf-clojure has integrated lumo REPL. Is there a plan to allow cider use lumo?#2018-02-1719:28rymndhngI think they target different use cases:
- cider is action-packed batteries-included environment for exploring clojure code that needs support through middleware to get all the amazing features
- inf-clojure is minimalistic (moving text between stdin/out) and easier to work in all the clojure/clojurescript environments
As for integrating into cider, i'll leave that to someone else to answer, b/c i don't have context.#2018-02-1721:00Karol WójcikIs there is something in cider which inf-clojure lacks of?#2018-02-1721:20richiardiandreaI can answer that, inf-clojure will never be as feature packed as cider but my goal would be one day to have it very configurable so that you can basically hook any library/custom elisp for achieving what you wish. Of course things like completion will be provided (I have a patch for compliment but I need to refine it).#2018-02-1721:20richiardiandreaWell it is already very configurable and compliment is basically just a thin wrapper of elisp on top of what the lib returns#2018-02-1721:21richiardiandreaI took most of the code of course from cider but the original idea was to use cider functions directly#2018-02-1721:39richiardiandrea@kwcharllie379 the lumo repl is a simple socket repl so when cider will support socket repls it will be basically the same.#2018-02-1721:40richiardiandreaWhen that happens I think I will switch to cider as well :) however I still feel inf-clojure gives me more control over the editor so ... dunno#2018-02-1723:50dpsuttonFrom what I've seen inf-clojure adds emacs bindings to common operations but essentially everything is just a straight command to the repl itself. Cider has code running in nrepl that allows it to do more than what you can do through just interacting with a bare repl#2018-02-1723:53dpsuttonI really like that notion. (of inf clojure) #2018-02-1801:00richiardiandrea@dpsutton yeah well you might say that they essential do the same thing, except that cider exposes functionality by hijacking the main medium of communication and wrapping in bencode while inf-clojure does not. With orchard out now in theory inf-clojure could call those functions directly. #2018-02-1801:01dpsuttoni was thinking of the cider-nrepl middleware. inside of the that we can do quite a bit of reasoning that isn't exposed by a repl#2018-02-1801:02dpsuttoni like inf-clojure specifically for not putting anything additional into the project. no dependencies, just clever interaction with the repl#2018-02-1801:04richiardiandreaAt some point you need deps for more complicated features, one solution is to load them server side.. #2018-02-1801:05richiardiandreaunrepl loads them from the client instead, which is very interesting...sending a packaged up payload that gets evaluated repl side and adds functionalities#2018-02-1812:00bozhidar@dpsutton Old versions of CIDER didn’t use any middleware and were just evaluating some complex snippets of code to get stuff down, but although as a client this seems simple, it’s both extremely brittle and extremely hard to maintain after a certain point.#2018-02-1812:03bozhidarAny complex editor support requires a ton of logic and you need to put it somewhere. Whether you’re upgrading an existing REPL and you setup a special REPL doesn’t matter that much in the end of the day - in both cases you needed someone to augment what the REPL can do so, so it’s actually useful to the editor/whatever.#2018-02-1812:05bozhidarIn general if people are happy with the feature set of the inf-clojure they should probably stick with it, as it was created with simplicity in mind. If you end up needing more features (e.g. tracing, debugging, whatever) you’ll need CIDER.#2018-02-1812:06bozhidarI do hope that CIDER will get to a point where we’ll support REPLs like lumo and planck, but that’s not going to happen any time soon as first we need to implement some support for socket repl and then reconcile the differences between hosted and self-hosted cljs repls.#2018-02-1812:25bozhidarAnd to answer the original question…#2018-02-1812:25bozhidar> Hello what is a status of cider? Will it be abandoned in favour of inf-clojure?#2018-02-1812:27bozhidarNever. 🙂 I’ve always viewed them as complementary projects, otherwise I wouldn’t have created both of them. I guess it’s time for me and @richiardiandrea to finally created some comparison table for them and extend the readme to answer some of the FAQ regarding the differences between them.#2018-02-1814:45ghadiIs it possible to have inf-clojure use two connections so that *1 doesn't get lost in a repl?#2018-02-1816:10richiardiandrea@ghadi can you give me an example of what you would like to have, I don't quite get it 😄 #2018-02-1816:20ghadiWhen completion queries run, you lose the previous contents of *1#2018-02-1816:21ghadiIf user-submitted forms and inf-clojure submitted forms were on different sockets, there would be no problem#2018-02-1816:22ghadi*1 is thread local#2018-02-1816:48Karol WójcikThanks @bozhidar for the answer. 🙂#2018-02-1817:05richiardiandrea@ghadi I see now, so inf-clojure shouldn't probably care about this problem, as you know unrepl keeps a session. If I had to add support in inf-clojure I would basically a inf-clojure-cmd-preamble that executes some session saving code each and every command. Other ideas and an issue open are more then welcome ;)#2018-02-1817:09richiardiandreaAlso, the completion command is completely configurable so you can wrap it in custom code, I think there is an example in the code base #2018-02-1817:09dpsuttoncan you do session saving code like that? can you tell a repl not to let this expression clobber *1?#2018-02-1817:11richiardiandreaFor lumo we do some wrapping already: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L899#2018-02-1817:11dpsuttonCIDER gets around this by running two sessions to each repl. there's a tooling session alongside the user session#2018-02-1817:11richiardiandreaYes that is the classic approach inf-clojure does not have#2018-02-1817:14richiardiandreaThere is a lot more to discover in here: https://dev.clojure.org/display/design/Socket+Server+REPL#2018-02-1817:15richiardiandreaSo @ghadi if you use the socket repl, probably a wrapper could get stored session data#2018-02-1817:17ghadiThat last point I don't follow#2018-02-1817:21richiardiandreaIf I understand correctly the socket repl stores the *1, but I am not 💯% sure #2018-02-1817:21richiardiandreaI would need to try that out on mobile now#2018-02-1817:21ghadiOn mobile too#2018-02-1817:22ghadiSocket repl doesn't do anything special than the Clojure main repl#2018-02-1817:24ghadi*1 2 3 are dynamic variables that are freshly bound for every repl connection#2018-02-1817:24ghadiinf-clojure doesn't have to save any session state at all#2018-02-1817:25ghadiI think separating into a command stream and a user stream is useful - the preamble idea is a hack (sorry)#2018-02-1817:25richiardiandreaIt is a hack :)#2018-02-1817:25ghadiI wonder how hard that would be - I'd love to try writing some emacs lisp for once :)#2018-02-1817:26ghadiBoth repls would operate in the same way#2018-02-1817:26ghadiJust have to dispatch which one you send to#2018-02-1817:26richiardiandreaGhadi, happy to help with the code base, keep in mind that that same code could already be in cider or spiral in some way or another#2018-02-1817:27ghadiIt is in some way or another but honestly both of those projects are approaches that are not as simple as inf-clojure could be#2018-02-1817:27richiardiandreaInf-clolure was born as simple wrapper over comint which unfortunately is a limitation#2018-02-1817:28ghadiCan you open two comints?#2018-02-1817:28richiardiandreaI know I know, just putting all the cards on the table simple_smile #2018-02-1817:28richiardiandreaYes you can iirc#2018-02-1817:28ghadiYou already do it for multiple inf-clojure sessions no?#2018-02-1817:29richiardiandreaFor the "tooling" connection there is a comint redirection#2018-02-1817:29richiardiandreaTo a hidden buffer#2018-02-1817:30richiardiandreaBut yes iirc multiple REPL buffers use a new comint connection/process call#2018-02-1817:30richiardiandreaThe redirection is obviously a hack as well 😃 #2018-02-1817:33richiardiandreaI never had this need because probably lumo saves those for me btw...which is interesting as well#2018-02-1817:36richiardiandrea@ghadi
I also wanted to past this excerpt here:
Socket sessions
To allow a tool to share repl context with a user's repl, we want to have two repl client connections that share a "session", essentially the dynamic context in which they evaluate things. This allows an internal tool repl to get access to dynamic variables like \ns or potentially any other dynamic variable binding state.
To record binding state:
After every eval in the socket repl, get and store the current bindings in the server map
To use binding state:
Allow a socket client repl to attach to a different session - this is done by recording the attached session id in this session's state
Before every eval, if client is attached
Get attached session's bindings
Replace the stream bindings (in/out/err) with the client repl's bindings (don't want to hijack those)
Push the attached session's bindings
After every eval, if client is attached
Pop the bindings#2018-02-1821:00ghadiI guess I disagree with the premise that tooling and user input need to share anything#2018-02-1821:01ghadikeep inf-clojure inferior#2018-02-1821:04ghadiyou can build something nearly as sophisticated as unrepl or cider with a simpler approach#2018-02-1821:05ghadifor some value of nearly#2018-02-1821:07richiardiandreaI am neutral on that, as long as we keep productivity high and we keep things simple I am open to anything...I switched to inf-clojure because of the ease in debugging potential problems with "middleware" (which in inf-clojure are just repl functions)#2018-02-1821:08ghaditwo sockets, share nothing == bliss to me#2018-02-1821:09richiardiandreaI think that's what spiral is doing no?#2018-02-1821:09ghadiI look at the experience from the perspective of the core LangServer API -- (code completion, hover, jump to definition, find references). While it would certainly be easy to want to share *ns* across user + machine sockets, it is not necessary to properly support those features/APIs#2018-02-1821:12richiardiandreafirst time I am looking at this: https://github.com/Unrepl/spiral/blob/master/spiral-socket.el#2018-02-1821:12richiardiandreait is good, I am not an elisp expert, didn't event know that Emacs could use a socket like that#2018-02-1821:13richiardiandreacomint gives you history search and low-level response facilities though, so I don't know if it can be dropped#2018-02-1821:15ghadiwhat would be very useful is something like clojure.core.server/remote-prepl but in elisp#2018-02-1821:15richiardiandreayeah#2018-02-1821:15richiardiandreaI dreamed about that for long time#2018-02-1821:15richiardiandrea😄#2018-02-1821:16richiardiandreaedn.el can transform back and forth and I started doing something in inf-clojure towards that#2018-02-1821:16richiardiandreasee https://github.com/clojure-emacs/inf-clojure/pull/124#2018-02-1821:17ghadiyou could save your repl sessions on the emacs side, including out/err/ret stream separation#2018-02-1821:17ghadiand choose what to display, without relying on comint's history#2018-02-1821:17richiardiandreayeah that would be doable as well#2018-02-1821:17richiardiandreamore work 😅#2018-02-1821:17richiardiandreanice#2018-02-1821:17richiardiandrea😄#2018-03-0516:46mikerodI think a long while ago I used to have issues with it. So I just started a habit of starting a headless lein nrepl server and connecting via cider-connect for a long time. One day I finally decided to give it a shot again with jack in and it is nice#2018-03-0516:46mikerodcuts down so many steps I was taking hah#2018-03-0516:47dpsuttongive it a whirl and file any issues you run into. if you run into any i bet they are easily solved and it gets better for everyone#2018-03-0516:48mikerodI’d like to start paying a bit closer attention to cider internals (and nrepl middleware) to be able to contribute back better. Especially since there are frequent request here for more contribution.#2018-03-0516:48mikerodThe worst aspect for me is still the elisp stuff. I’m just not that used to it#2018-03-0516:48dpsuttoncheck out http://hackingcider.com for some info on the internals, readthedocs and always ask in here!#2018-03-0516:48mikerod(haven’t spent that much time on it really)#2018-03-0516:49mikerodoh, cool. I don’t think I’ve read this#2018-03-0516:49dpsuttonno biggie. should come naturally a bit after looking at some of the code around your changes#2018-03-0516:49mikerodYep#2018-03-0516:50mikerodI’m not completely ignorant with elisp either. I’ve done some research before. Just not super proficient. I can still track through cider code more or less I believe. Thanks for the advice and link too.#2018-03-0517:40gonewest818I’ll be the first to admit not being super proficient with elisp. But one can still get things done. The PR feedback and guidance from the project goes a long way.#2018-03-0604:22bozhidar> My recent pattern has been cider-jack-in (for clj), then cider-create-sibling-cljs-repl#2018-03-0604:23bozhidar@mikerod Btw, cider-jack-in-clojurescript just start a regular Clojure REPL and then invokes cider-create-sibling-cljs-repl.#2018-03-0604:24bozhidarThe biggest problem right now is that we haven’t implemented injection of the ClojureScript deps. Unfortunately that’s a bit tricky as you can’t be certain which REPL variant the user will want to start and they have different deps.#2018-03-0604:25bozhidarOne cool idea would be to add hotload-deps from refactor-nrepl to CIDER itself - then we can just hotload on demand the cljs REPL deps.#2018-03-0604:28mikerodThanks @bozhidar I tried it today and it was working. Was nice to merge both steps into one for me. I guess I had enough setup to not get any issue. It does sound tricky in general.
I wanted to go through
https://github.com/clojure-emacs/cider/issues/2202 to see what was happening there #2018-03-0604:32bozhidarNot much still. I mostly focused on decoupling the cljs repl from build tools and some saner error reporting.#2018-03-0604:33dpsutton@bozhidar did you see that your cljs repl checking didn't work? the ns-find check isn't sufficient#2018-03-0604:33bozhidarUnfortunately I managed to mess up even this - for some reason I thought find-ns works for unrequired namespaces, and took this shortcut.#2018-03-0604:33dpsuttondon't mean to harp on it if you did 🙂 but i'm surprised we haven;'t had more bug reports#2018-03-0604:33bozhidarYeah, yeah - I saw it.#2018-03-0604:34dpsuttoni assumed the same. i couldn't fathom why it wasn't working#2018-03-0604:34bozhidarI guess we need to expand the ns middleware to have one ops for finding namespaces.#2018-03-0604:35dpsuttonyeah orchard has something that we can use. just need to expose it#2018-03-0604:35bozhidarI think nrepl-refactor has something to deal with libraries directly - that might be even better. @benedek#2018-03-0604:35bozhidarI really hate it that there’s no unified API to just check what are libs that are currently present and you always have to jump through some hoops.#2018-03-0604:36dpsuttonif cljstays fast we could probably in the future just ask for a copy of the class path#2018-03-0604:36dpsuttonyeah. i saw that we already do this in orchard already though#2018-03-0604:37bozhidarIn a way it’s exposed even now - ns-list returns all namespaces if memory serves, so all you need is to check that list.#2018-03-0604:38bozhidarThe big problem is that you still don’t know the metadata for the library - you might have added the wrong version of some library or whatever and ideally we need a way to check this.#2018-03-0605:48bozhidarA few days about @xiongtx asked me to create some basic roadmap document for CIDER, so that collaborators can know what to focus on - here’s the first cut https://github.com/clojure-emacs/cider/blob/master/ROADMAP.md#2018-03-0605:49bozhidarI hope some of you are going to find it useful. As you can see there’s plenty of work to go around, so we need all the help we can get. 🙂#2018-03-0605:54richiardiandrea@bozhidar may I ask you why the choice of parseclj? I think I saw way more tests in edn.el...it is because of the different representation?#2018-03-0606:06bozhidarMostly because I’m worried about edn.el’s main dependency - peg.el was last updated 10 years ago and it’s officially hosted on EmacsWiki.#2018-03-0606:25xiongtxpeg is on GitHub: https://github.com/ellerh/peg.el/tree/081efeca91d790c7fbc90871ac22c40935f4833b
And MELPA: https://melpa.org/#/peg
Btw, since late Jan., MELPA stopped hosting Emacs Wiki packages: https://github.com/melpa/melpa/issues/2342#issuecomment-360023727#2018-03-0614:43bozhidarI missed this part. It certainly wasn’t there last time I checked. 🙂#2018-03-0606:07bozhidarThat’s why CIDER never picked it up, even though it really could benefit from some Clojure parser. parseclj is too young, but I hope it can become the parser we all need. 🙂#2018-03-0606:07bozhidarOf course, I might be wrong and peg.el might be engineered to perfection. Who knows?!? 😄#2018-03-0606:22xiongtx> replaces usages of Elisp's read with parseclj
Can you elaborate on this? Are we using Elisp's read to read clj ? If so, I'd guess that read is limited to shard data structures b/t Elisp and clj (e.g. lists). What's the advantage to using parseclj in that case?#2018-03-0606:43richiardiandreaI think one of the most basic ways to convert lists to elisp is to read them. Inf-clojure employs the same trick yes.
I have started introducing edn.el and so far it seems pretty solid. I haven't used in performance-critical things though, and the PR has not yet been merged but "it works on my machine" 😄#2018-03-0606:44richiardiandreaedn.el or parseclj convert edn to elisp data structures. I think with a slightly different representation of edn in elisp data#2018-03-0614:41bozhidarThe main advantage of using a proper parser is that we won’t be limited to using in results things that exist in Elisp. Some APIs return suboptimal things just because that’s what we can process.#2018-03-0614:42bozhidarVery simple example - you can’t process directly booleans, as they don’t existing in Elisp.#2018-03-0606:36xiongtx> basic refactoring stuff (potentially related to the merger of stuff from clj-refactor.el)
Is it a goal to move the entirety of clj-refactor into CIDER? Is that wise, given the large number of dependencies clj-refactor has? https://github.com/clojure-emacs/clj-refactor.el/blob/408ab1f13b8d956dd8d2c839bea5197175ef5a93/clj-refactor.el#L35-L49#2018-03-0614:45bozhidarJust simple stuff that don’t depend on parsing the code. hotload deps depends just on dynapath, the ns cleanup doesn’t have external deps if I recall correctly.#2018-03-0614:46bozhidarMy concern with the massive deps and the complexity added by the use of the Clojure parser are the main reason this ended up being a separate library in the beginning.#2018-03-0610:34stardivinerDoes Clojure has flycheck support in Emacs?#2018-03-0610:36manuelthere's this: https://github.com/candid82/flycheck-joker#2018-03-0610:38stardivinerI did a search in MELPA, what about flycheck-clojure? compare this two packages.#2018-03-0611:04manuelif you're asking me, I don't know. I only answered your question "Does Clojure has flycheck support in Emacs?" with the one I remembered. 🙂#2018-03-0612:01bozhidar@stardiviner https://github.com/clojure-emacs/squiggly-clojure#2018-03-0614:11gganley@bozhidar After my meeting today I’ll be working on [#2203] if you want to throw me down as an assignee. #2018-03-0614:18stardiviner@bozhidar I got error with flycheck-clojure package (means squiggly-clojure) Here is the error:
Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 0)
#f(compiled-function (buffer ex rootex sess) #<bytecode 0xc28c55d>)()
#f(compiled-function (response) #<bytecode 0xc28c5c1>)((dict "ex" "class java.io.FileNotFoundException" "id" "201" "root-ex" "class java.io.FileNotFoundException" "session" "690bc29a-26d8-41c4-856b-64cb809d8853" "status" ("eval-error")))
nrepl--dispatch-response((dict "ex" "class java.io.FileNotFoundException" "id" "201" "root-ex" "class java.io.FileNotFoundException" "session" "690bc29a-26d8-41c4-856b-64cb809d8853" "status" ("eval-error")))
nrepl-client-filter(#<process nrepl-connection> "d2:ex35:class java.io.FileNotFoundException2:id3:2017:root-ex35:class java.io.FileNotFoundException7:session36:690bc29a-26d8-41c4-856b-64cb809d88536:statusl10:eval-erroreed3:err235:FileNotFoundException Could not locate squiggly_clojure/core__init.class or squiggly_clojure/core.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. clojure.lang.RT.load (RT.java:463)\n2:id3:2017:session36:690bc29a-26d8-41c4-856b-64cb809d8853ed2:id3:2017:session36:690bc29a-26d8-41c4-856b-64cb809d88536:statusl4:doneeed18:changed-namespacesde2:id3:2019:repl-type3:clj7:session36:690bc29a-26d8-41c4-856b-64cb809d88536:statusl5:stateee")
#2018-03-0614:18stardivinerAnd my config#2018-03-0614:20gganleytwo questions, is root-ex your file and did you follow the instructions on the readme page?#2018-03-0614:21stardivinerYes, I followed instructions on README. And no, root-ex is not my file, my file is core.clj.#2018-03-0614:22gganleyAlright#2018-03-0614:22gganleyLet me read the README lol#2018-03-0614:24gganleyI’m on my iPad so I can’t test it myself but did you try just running the sample project? https://github.com/clojure-emacs/squiggly-clojure/tree/master/sample-project#2018-03-0614:28stardivinerI will take a try on that.#2018-03-0614:29dpsuttonits because the signature of the error handler has changed. flycheck-clojure has a dependency on cider 0.8.1 which would call the error handler like so:
(funcall (or eval-error-handler nrepl-err-handler)
buffer ex root-ex session)
#2018-03-0614:29dpsuttonline 832 of nrep-client.el if you check out the release tag of 0.8.1 of cider#2018-03-0614:30dpsuttonand now its a thunk:
(when (member "eval-error" status)
(funcall (or eval-error-handler nrepl-err-handler)))
#2018-03-0614:30dpsuttonwhich is why the error is saying wrong number of arguments. you gave me 4 and I expect 0#2018-03-0614:31dpsuttonand how the default one works:
(defun cider-default-err-op-handler ()
"Display the last exception, with middleware support."
;; Causes are returned as a series of messages, which we aggregate in `causes'
(let (causes)
(cider-nrepl-send-request
(nconc '("op" "stacktrace")
(when (cider--pprint-fn)
`("pprint-fn" ,(cider--pprint-fn)))
(when cider-stacktrace-print-length
`("print-length" ,cider-stacktrace-print-length))
(when cider-stacktrace-print-level
`("print-level" ,cider-stacktrace-print-level)))
(lambda (response)
;; While the return value of `cider--handle-stacktrace-response' is not
;; meaningful for the last message, we do not need the value of `causes'
;; after it has been handled, so it's fine to set it unconditionally here
(setq causes (cider--handle-stacktrace-response response causes))))))
so now its a thunk because the handler reaches back for exception information#2018-03-0614:32dpsuttonand this comment in flycheck clojure probably explains the change:
;; If the evaluation completes without returning any value, there has
;; gone something wrong. Ideally, we'd report *what* was wrong, but
;; `nrepl-make-response-handler' is close to useless for this :(,
;; because it just `message's for many status codes that are errors for
;; us :(
the response had almost no information. which is why its a thunk because you have to recreate that information anyways#2018-03-0614:44stardiviner@dpsutton So flycheck-clojure linters need to update? If yes, will you create an PR for this?#2018-03-0614:49dpsuttonYeah it will need to adapt to the new signatures in the response handler#2018-03-0615:06justinbarclayI use Figwheel to run cljs, and it looks like that CIDER is in a known broken state when it comes to cljs repls. I am wondering, is there a work around for this issue or should I revert to a previous version of CIDER?#2018-03-0615:08manuelyes, see here: https://github.com/clojure-emacs/cider/issues/2230#issuecomment-370681369#2018-03-0615:09justinbarclayAwesome, thanks!#2018-03-0615:19dpsuttongot a PR to suppress those checks until we implement them better https://github.com/clojure-emacs/cider/pull/2231#2018-03-0615:23bozhidar@dpsutton I could have committed this immediately, but I didn’t do it because otherwise I won’t really have a motivation to fix the problem.#2018-03-0615:24bozhidarThe workaround is trivial, and a relatively simply fix that came to mind mind was grepping the classpath entries.#2018-03-0615:25bozhidarI know people are frustrated, but in general I never commit commented out code. 🙂#2018-03-0615:28dpsuttonI agree on the commented out code. I think I would disagree on leaving cider unable to run clojurescript projects as a motivational to fix the issue though. But it is dev and not the stable release#2018-03-0615:30bozhidarI don’t want to keep it broken, but I also don’t have time to fix it and it seems no one else has time as well.#2018-03-0615:30bozhidarI’ll see what I can do.#2018-03-0615:30dpsuttonI know your time is tight so I was just offering a potential one click fix while the real solution was in the works#2018-03-0615:30bozhidarI just know how temp solutions often remain permanent, therefore my wariness to just make the validation a no op.#2018-03-0615:30dpsuttonI don't have the time either right now otherwise I would tacklw it#2018-03-0615:31dpsuttonSuper valid concern#2018-03-0615:31dpsuttonAnd I think a very valid priority for a maintainer to impose on projects :)#2018-03-0617:00bozhidar@dpsutton Fix away.#2018-03-0617:00bozhidarTested it with Weasel, I assume it will be fine for everything else as well.#2018-03-0617:00dpsuttoni'll pull it now and check it on work#2018-03-0617:01bozhidarI also noticed there was no validation for the presence of ClojureScript, so I added that as well.#2018-03-0617:05dpsuttonworking for me @bozhidar#2018-03-0617:05dpsuttonthanks for the fix.#2018-03-0617:07bozhidarYou’re welcome! 🙂 I’m just sorry for the breakage I caused before. Down the road it’d be nice to enhance those verifications with some version checking, etc, but this will do for now.#2018-03-0617:07dpsuttonno worries. i was fine with going into the codebase and changing it to work for me pending a fix. but that's quite an annoyance to someone who enjoys it and just wants to work#2018-03-0617:08dpsuttoncljs is just so tricky to work around#2018-03-0617:54agso apparently cider-cljs-lein-repl is now deprecated and cider-defaul-cljs-repl needs to be used. But that broke my workflow. Where I can read about this change, to adjust my .dir-locals ?#2018-03-0617:57agmy old setup was:
((nil . ((cider-cljs-lein-repl .
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"))))
simply replacing cider-cljs-lein-repl with cider-default-cljs-repl did not work as I hoped it would#2018-03-0618:08dpsutton@ag you actually have a special case not considered in the code. it was changed to accept "Figwheel" or something similar and it would look up how to start a figwheel repl. however, you have a custom one and it does not allow for a custom repl now (I don't think)#2018-03-0618:10dpsuttonbut you could try
(add-to-list 'cider-cljs-repl-types
`("Figwheel+Integrant"
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"
nil))
in your init and then setting cider-default-cljs-repl to "Figwheel+integrant" in your dir locals#2018-03-0618:10dpsuttonthe reason it might not work is i'm not sure how defconst works with add-to-list#2018-03-0618:25agI think that worked... now, I'm wondering if I can put the thing above into .dir-locals.el#2018-03-0618:30manuelactually, I was just about to ask: how do we set cider-default-cljs-repl in .dir-locals.el? I tried:
((nil
(cider-refresh-before-fn . "mount.core/stop")
(cider-refresh-after-fn . "mount.core/start")
(cider-default-cljs-repl . "Figwheel"))
(emacs-lisp-mode
(flycheck-disabled-checkers . "emacs-lisp-checkdoc")))
but the prompt is still there on cider-jack-in-clojurescript.#2018-03-0618:31qqq@bozhidar: very nice talk: https://www.youtube.com/watch?v=1YCkOo5Y4Oo#2018-03-0619:31richiardiandreaindeed, just watched it!#2018-03-0618:31dpsutton@ag i know you can execute code in dir locals but that stuff gets a little janky. You could use a name that's inoffensive outside of your project. instead of Figwheel+Integrant just call it "<Project-name>startup" and then it doesn't matter that tis visible to other things#2018-03-0618:32dpsuttonand this may not be a proper dir locals thing anyways. you are modifying cider's notion of startup invocations#2018-03-0618:34agI was hoping people don't have to do anything "special" to start working on our project. dir-locals is one way#2018-03-0618:36dpsuttonah i got you. they could just have the checked out dir locals and it would work?#2018-03-0618:37dpsuttonhave you seen this page on how to eval code in dir locals? You could put the add-to-list call in there
https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs#2018-03-0618:44dpsuttonyeah that stuff is super murky and has no good feedback#2018-03-0618:45dpsuttonhonestly i would probably keep everyone on stable until the new api here settles down. i think we're missing one more knob and the logic to check each in turn and then it would be good to go#2018-03-0618:47agso I did this in .dir-locals.el
((nil . ((eval . (add-to-list 'cider-cljs-repl-types
`("Figwheel+Integrant"
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"
nil)))
(cider-default-cljs-repl . "Figwheel+Integrant"))))
#2018-03-0618:48agand that set the vars correctly, cider-jack-in-clojurescript worked, but... it also prompted for the REPL, I thought it wouldn't#2018-03-0618:48agbut it did work#2018-03-0618:50dpsutton@ag i don't think changing the CIDER code would be that difficult at all. it might be easier to do a PR than muck with side-effecting dir locals#2018-03-0618:50dpsuttonjust add a var that allows for a custom repl invocation and some logic that does: if custom repl invocation, use that, if type is set, look up how to use it, else ask#2018-03-0618:50dpsuttonbut up to you 🙂#2018-03-0618:51agI need quick-n-dirty solution right now... ain't got time for PRs, sorry#2018-03-0619:09dpsuttonI'm in the same boat. No worries#2018-03-0620:22wusticalityhey all, quick question#2018-03-0620:23wusticalityat my new gig they use clojure on the backend and clojurescript on the frontend#2018-03-0620:23wusticalityi’m curious whether it’s possible to run a regular cider repl -and- some kind of clojurescript repl at the same time#2018-03-0620:23wusticalityit’s really tough to not be able to jump to definition / namespace / etc. in cljs code#2018-03-0620:24dpsuttonthat's actually the default. when you run cider-jack-in-clojurescript you're gonna end up with two repls. one clj and one cljs#2018-03-0620:24wusticalityoh!#2018-03-0620:25wusticality@dpsutton I think I’m running into some gross issues because they use IntelliJ internally and seem to be loading some Intellij-related clsj in their IDE#2018-03-0620:25wusticalityso jacking in totally barfs#2018-03-0620:25wusticalityguess i’ll have to debug that on my end#2018-03-0620:25dpsuttonwhat does it say?#2018-03-0620:25dpsuttonwhen it barfs#2018-03-0620:27wusticality@dpsutton https://gist.github.com/it3ration/acac2d08b5ffc115ede4a18b3e98bb68#2018-03-0620:31dpsuttonIt's saying it's not finding piggie back. Typically this is included on one of the profiles in the project clj file. Cursive is much better at profile support#2018-03-0620:32dpsuttonCheck and see if you see any references to piggieback in there#2018-03-0620:35dpsuttonthat's just a dependency for nrepl to talk to cljs in general#2018-03-0620:43wusticalityI wonder if it will require editing the config, they might not be happy with me checking something like that in 😕#2018-03-0620:43dpsuttonis there not a reference in there?#2018-03-0620:43dpsuttoni think cursive does some static analysis so they might not need the nrepl stuff#2018-03-0620:50justinbarclayIf you have to edit the config, why not just stash that change as needed? That’s how I do it on my projects so I don’t conflict with my team.#2018-03-0621:48wusticality@emoarmy that’s a workable idea#2018-03-0621:48wusticalityyet-another-question#2018-03-0621:57wusticalityI have the cider repl running just fine, but jumping to ns et al don’t work#2018-03-0621:58wusticalityit’s odd as it lists all the namespaces, but selecting one just says that it’s not found#2018-03-0622:00dpsuttonwhat do you mean "jumping to ns"#2018-03-0622:00dpsuttonwhat cider function are you invoking#2018-03-0622:03wusticalitycider-find-ns#2018-03-0700:11wusticalityi’m going to try and rebuild to see if that fixes things#2018-03-0700:17wusticalityno luck, man I’m sure this used to work in this big project#2018-03-0700:22justinbarclay@iwannaseethelight if you're using figwheel, have you opened up your app in a browser?#2018-03-0700:23wusticalitythis is clj#2018-03-0700:23wusticalitycider-find-ns works in one project but not another, I don’t see anything unusual in *Messages*#2018-03-0700:24wusticalityit will show all the namespaces, but navigating to any of them just says “unable to find …”#2018-03-0700:24justinbarclayahh sorry, I'm not much help then#2018-03-0700:43wusticalityis there some kind of “find uses of” functionality in cider?#2018-03-0700:55bozhidarNope.#2018-03-0700:55bozhidarBut there’s find-usages in clj-refactor.el (which is an extension of CIDER).#2018-03-0700:56bozhidar> but the prompt is still there on cider-jack-in-clojurescript.#2018-03-0700:56bozhidarThat’s very odd.#2018-03-0700:59bozhidarhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L618#2018-03-0701:03bozhidarSeems I found the problem.#2018-03-0701:03bozhidarhttps://github.com/clojure-emacs/cider/commit/b460bbc7168ad4bd390d8fb9ca257b5c54a76378#2018-03-0701:03bozhidar(and fixed it)#2018-03-0704:07xiongtx@gonewest818 What the cljfmt error here? The output doesn't make that clear.
https://travis-ci.org/clojure-emacs/orchard/jobs/350143199#2018-03-0704:09gonewest818 — just getting home from a long day. Will look in a little while. #2018-03-0704:16gonewest818The output shows a diff of what’s currently in the file versus what cljfmt produces. The former is prefixed with “-“ and the latter with “+”. Specifically I think the keyword :doc is indented one character to the left of :name on the line above, and subsequently the rest of that map also needs to shift right. #2018-03-0705:12xiongtx@bozhidar Seems that orchard:
- Allows merge before CI has finished running
- Creates a merge commit by default, which differs from cider (which does a rebase and merge by default)
You can fix these in the GitHub settings.#2018-03-0706:10gonewest818I see settings to allow a fast-forward merge (rather than a merge commit) for pull requests, but I don’t see any way to declare a default.#2018-03-0708:05bozhidarI didn’t even know there was a setting for that. I just rebase PRs when I merge them, as that’s my preference.#2018-03-0705:45xiongtxSeems that the Deps Versions badge for orchard is broken; https://versions.deps.co/clojure-emacs/orchard/status.svg gives Deps Internal Server Error
Perhaps @danielcompton can help?#2018-03-0721:32danielcompton@U2J7JRTDX the issue is coming up because the Orchard project.clj uses a read-eval which is disabled in Deps Versions for security reasons#2018-03-0721:33xiongtx☝️ @gonewest818 Do we need the #=(eval ...)?#2018-03-0721:35danielcomptonI've opened https://github.com/deps-app/versions/issues/19 to track this#2018-03-0721:40gonewest818It’s not critical for right now. It’s just used to direct codox output to named directories for instance when there are tagged releases and “master” versions having different APIs. I would stop using the read-eval if Leiningen offered more generalized access to :env/variable_name syntax, but at the moment I’m pretty sure that’s hard coded to specific map keys in project.clj.#2018-03-0818:24xiongtx> if Leiningen offered more generalized access to :env/variable_name syntax
@U050S6S0J ☝️ is this possible? I’m not familiar w/ this aspect of leiningen at all.#2018-03-0819:01hypirionI don't think this is possible in general as mentioned, but I don't remember why we ended up doing it for only some keys.#2018-03-0819:15gonewest818I touched that code when I implemented unsupervised gpg signatures (e.g. for lein deploy), and all I saw was support for specific keys. All I did was add another special case for :env/gpg_passphrase. It wasn’t obvious to me why that wasn’t general already.#2018-03-0705:46danielcomptonHey I saw that come through the exception tracker recently. I think it’s an issue with the dependency parser#2018-03-0706:31manuel@bozhidar latest CIDER gets the value of cider-default-cljs-repl from .dir-locals.el correctly. Thank you!#2018-03-0706:36stardivinerI found command cider-doc on (. clojure.lang.RT (next x))'s clojure.lang.RT open URL http://www.clojure.com/lang/RT.html is invalid. Where to find doc for this clojure.lang.RT ?#2018-03-0706:49arrdem@stardiviner there are no docs for RT#2018-03-0706:49arrdemthat is unfortunately the official answer#2018-03-0706:49arrdemthat is however probably a bug in cider-doc that it even tries to do that.#2018-03-0706:52stardivinerIt's not a bug, seems cider-doc provide "Java doc" link for all similar functions. I guess CIDER can improve on this. If it is not available, shouldn't show it.#2018-03-0706:52arrdemJava does not retain javadocs as source metadata in any remotely usable form, so there’s not really a good way for CIDER to answer that in general.#2018-03-0706:53arrdemhummm got an example that works for?#2018-03-0707:00stardivinerNot found workable example yet.#2018-03-0707:01arrdemYeah there’s probably shouldn’t be. cider-javadoc should work, cider-doc is designed only for Cloure vars AFAIK#2018-03-0708:02bozhidar> Yeah there’s probably shouldn’t be. cider-javadoc should work, cider-doc is designed only for Cloure vars AFAIK#2018-03-0708:02bozhidarOriginally yes, at some point we augmented it to work with Java classes as well.#2018-03-0708:03bozhidarI guess that’s a bug that we should look into. I was under the impression that we were rendering this link only if if was part of the metadata.#2018-03-0720:30gganley@bozhidar I’ve been reading through cider-interaction.el and went into subr-x.el and found the following#2018-03-0720:30gganley> ;; NB If you want to use this library, it’s almost always correct to use:
> ;; (eval-when-compile (require ’subr-x))#2018-03-0720:31gganleyis there a reason that CIDER doesn’t use this convention?#2018-03-0801:54bozhidarI’ve wrote that library in Emacs, so I can tell you that’s not a big deal. 😄#2018-03-0801:58bozhidarIt’s a bit more efficient to do it as mentioned there, but it’s confusing for many people reading the code afterwards. The reason for the recommendation is that everything’s implemented in terms of macros and inline functions that are expanded during the compilation phase, so in the end you don’t really end up including any new definitions from there.#2018-03-0801:58gganleyOK#2018-03-0801:58gganleyThank you for the explanation#2018-03-0805:19macrobartfastwhen M-x cider-grimoire getting "Bad url: /" ... help#2018-03-0805:19macrobartfastcan't seem to resolve the issue.#2018-03-0805:23bozhidarWorks just fine for me. How are you getting this error?#2018-03-0805:26macrobartfastin a clojure file, while pointer is in, say, the word conj, invoking cider-grimoire via M-x cider-grimoire, which causes "Grimoire doc for (default conj):" to appear in the minibuffer... accepting the default by hitting enter produces in the minibuffer "Bad url: /" .#2018-03-0805:27macrobartfastI didn't find this error mentioned much while searching online, so not sure what's up.#2018-03-0805:27macrobartfastif I supply a different string for it to search grimoire for at the prompt, I get the same result.#2018-03-0805:35macrobartfasthttps://github.com/emacs-mirror/emacs/blob/bb1309f1eb7651b41f2b6b7fb97ddb86bb82160c/lisp/url/url.el#L193#2018-03-0805:39bozhidarWhat’s your Em. acs version? I’m on 25.2#2018-03-0805:44macrobartfastI'm on 24.5.1#2018-03-0805:44macrobartfastgrimoire did work once, if I recall right#2018-03-0805:45macrobartfastin this version, I mean.#2018-03-0806:08macrobartfastwell, an obscure one relating to some strange state in my system, no doubt.#2018-03-0806:09macrobartfastand no really critical, as I can just look it up in a browser.#2018-03-0806:09macrobartfastbut thought I'd bounce it off #cider to see if anything sprang to mind here.#2018-03-0807:15bozhidarI don’t know - seems to me something like this should work just fine on 24.5 as well.#2018-03-0820:10xiongtxHere’s an interesting 🐛: https://github.com/clojure-emacs/cider/issues/2233
We may even kill 2 🐦s w/ 1 🥌 if this is the cause of #1936 as well: https://github.com/clojure-emacs/cider/issues/1936#2018-03-0900:37xiongtx@U051BLM8F @gonewest818 If you could reproduce and confirm, that’d be great. Want to make sure I’m not 🔩s#2018-03-0900:43gonewest818confirmed. I can reproduce that too. I’m using Emacs 25.3 and cider 0.17.0-snapshot.#2018-03-0821:27mathpunkI'm interested in trying to use custom/multiple REPLs to interact with processes, after a Stuart Halloway talk last year. It appears that's not possible in my current dev environment due to https://github.com/clojure-emacs/cider/issues/2017#2018-03-0821:27mathpunkis there anything I can do to help with this bug? or, should I be looking into changing up my environment, like using inf-clojure or something?#2018-03-0821:28mathpunkfor the record, I'm getting identical behavior#2018-03-0822:10richiardiandreaInf-clojure might be a better tool for that because it does not assume anything I guess, have you tried with that?#2018-03-0822:27mathpunk@richiardiandrea Not yet. Since my spacemacs/CIDER set-up "Just Works" for most stuff I've been trying to avoid getting into devtooling#2018-03-0822:27mathpunkbut, it can't always be avoided 🙂#2018-03-0822:28richiardiandreaAh! Especially with Emacs 😺#2018-03-0823:32gonewest818I can’t quite tell if this accomplishes what you need, but you can start a tools.nrepl server on a different port and get a second repl connection using M-x cider-connect.
user> (require 'clojure.tools.nrepl.server)
nil
user> (clojure.tools.nrepl.server/start-server :bind "localhost" :port 9999)
#clojure.tools.nrepl.server.Server{:server-socket #object[java.net.ServerSocket
"0x6200214e"
"ServerSocket[addr=localhost/127.0.0.1,localport=9999]"],
:port 9999,
:open-transports #object[clojure.lang.Atom
"0x3af6099b"
{:status :ready,
:val #{}}],
:transport #object[clojure.tools.nrepl.transport$bencode
"0xf75b0f8"
"clojure.tools.nrepl.transport$bencode@f75b0f8"],
:greeting nil,
:handler #object[clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__5306
"0x69ee663f"
"clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__5306@69ee663f"],
:ss #object[java.net.ServerSocket
"0x6200214e"
at this point you can M-x cider-connect to port 9999 and have two separate repls into your server process. In practice you need to keep the object returned from start-server (I let it print to the repl so you could see), because that’s the object you pass to stop-server when done.#2018-03-0823:57mathpunk@gonewest818 Cool thanks! I will at the very least file it with my notes on the topic, as I haven't exactly decided what I'm going to do with sub-repls, just that they seem like an interesting way to attack a class of problems#2018-03-0903:48bozhidar@mathpunk I’ve meant to look into this bug for a while, but unfortunately lately I’ve had very little time for OSS projects. As this works in clients like reply (lein repl) I assume the fix should be simply, but someone should do the debugging first.#2018-03-0905:10xiongtx@gonewest818 What is the purpose of this :robot_face:? https://github.com/clojure-emacs-cider-ci#2018-03-0905:11xiongtxJust a placeholder account for registering CI?#2018-03-0905:19gonewest818It’s a Github account from which I generated an API token that only has enough permissions to commit and push changes to the repo (the document generation). That way, if the token gets compromised somehow (it’s theoretically possible) the attacker doesn’t get any more privileges than are absolutely necessary. Compare to just encrypting my GitHub password which would theoretically give the attacker admin access to the repo if the token were compromised.#2018-03-0906:17xiongtxMaybe the ☝️ description could be added to the :robot_face:'s profile?#2018-03-0907:32gonewest818Done. There’s a limited character count but I got the gist.#2018-03-0912:19bozhidarWell, I guess we can add some notes about the CI in the readme or something. But maybe after the proposed migration to CircleCI.#2018-03-0915:48benedekI have a weird thing on a project where I can run test at point and tests for ns with cider but test loaded nses or all project tests return "no assertions or no tests were run" I will debug it further but does this ring a bell for anybody?#2018-03-0915:48benedekmy nses are loaded ofc#2018-03-0915:49dpsuttoni've seen that before, @bendek#2018-03-0915:49dpsuttoni think it was that the test paths aren't on the classpath for the profile you are using#2018-03-0915:49dpsuttonbut when you eval them manually they are "seen"#2018-03-0915:50dpsuttonhappens in cider-nrepl#2018-03-0915:50dpsuttonmight be something else but i've seen it with that before i think#2018-03-0915:51benedekso if I C-c C-k the test file it should be run by loaded or project?#2018-03-0915:53benedekyeah I am looking at the middleware code and I can see the filter checking the meta data on ns-interns...#2018-03-0915:54dpsuttonyeah i was rooting around in cider-nrepl and realized i need to fork and clone orchard ot see#2018-03-0915:54benedekso C-c C-k does not fix for me#2018-03-0915:54benedekwill dig further#2018-03-0915:55dpsutton(defn project-namespaces
"Find all namespaces defined in source paths within the current project."
[]
(->> (filter (memfn isDirectory) (cp/classpath (class-loader)))
(filter #(.startsWith (str %) project-root))
(mapcat ns-find/find-namespaces-in-dir)))
so i don't think it matters that you've loaded it manually. it's what i thinks "should" be loaded#2018-03-0915:59benedekhm... ok#2018-03-0915:59benedekthanks for the hint#2018-03-0916:01dpsuttonalso could be a bug. i orginally wrote that code to look for a common namespace prefix. but i didn't use project-root because there are examples where the namespace root is different from the project root. cider-nrepl itself was an example#2018-03-0916:48benedekI am on windows (don't ask :/) and paths are absolute on my classpath#2018-03-0916:49benedekcould that be the problem b/c of starts-with?#2018-03-0916:50benedekcould we do contains instead?#2018-03-0916:58dpsuttonah nevermind. it's looking at the file paths. are you sure your test dirs are on your classpath?#2018-03-0917:04benedekI added the test dir to the source dirs in dev (talking leiningen here)#2018-03-0917:05benedekand yeah I run both cp/classpath from the repl and cider classpath#2018-03-0917:05benedekessentially the same I guess...#2018-03-0917:11benedekoff from the office now and no win machines at home so back on this on Monday. thx @dpsutton again for looking at it#2018-03-0917:16bozhidar@benedek Btw, it’d be nice to check what exactly the middleware calls are returning for loaded and project namespaces.#2018-03-0917:18benedekwill do Bug#2018-03-0917:45dcjI haven't been able to jack-in for awhile....
Error loading refactor-nrepl.middleware: clojure.lang.ExceptionInfo: Alembic can not manipulate specified ClassLoader. {:classloader #object[jdk.internal.loader.ClassLoaders$AppClassLoader 0x4f8e5cde "jdk.internal.loader.ClassLoaders$AppClassLoader@4f8e5cde"], :reason :not-addable-with-dynapath}, compiling:(mranderson047/alembic/v0v3v3/alembic/still.clj:65:1)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/private/var/folders/nr/8vbdczz90ps9zfrklvm8jfwm0001yl/T/form-init5367904295233548109.clj:1:7964)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010)
at clojure.lang.Compiler.analyze(Compiler.java:6773)
lein version
Leiningen 2.8.1 on Java 9.0.1 Java HotSpot(TM) 64-Bit Server VM
find . -name user.clj -print
./dev/user.clj
cat dev/user.clj
(ns user
(:require [ :as io]
[clojure.string :as str]
[clojure.pprint :refer (pprint)]
[clojure.repl :refer :all]
[com.walmartlabs.system-viz :refer [visualize-system]]
[com.walmartlabs.datascope :as ds])
[reloaded.repl :refer [system init start stop go reset]]
[clojure.tools.namespace.repl :refer (refresh refresh-all)]
))#2018-03-0917:47bozhidar@dcj What happens on jack-in for you?#2018-03-0917:48dcjplease see edited message above with more details#2018-03-0917:49bozhidar@dcj Remove the injection of refactor-nrepl (or delete clj-refactor) and everything will work.#2018-03-0917:49bozhidarSeems the last stable release is no longer compatible with CIDER.#2018-03-0917:51dcjwhere am I injecting that?#2018-03-0917:52dcjOIC: .emacs#2018-03-0917:56dcj@bozhidar removing clj-refactor from my .emacs did not help. Looking for other places where this might be injected...#2018-03-0917:56bozhidarDid you restart Emacs afterwards?#2018-03-0917:57bozhidarAlso - it might be in your profiles.clj.#2018-03-0917:57dcjyes#2018-03-0918:05dcj@bozhidar It is clearly being injected, but I haven't yet found where/why. Still searching#2018-03-0918:24dpsuttonThere's an elisp variable that gets set to remember to inject refactor that doesn't get reset when you uninstall refactor#2018-03-0918:24dpsuttonIt's bitten me in the past but I can't remember what it's called#2018-03-0918:25dpsuttonJack in dependencies or something like that#2018-03-0918:28dcj@dpsutton do elisp variables persist after exit/restarting emacs? Where are they persisted?#2018-03-0918:29dpsuttonIt's sounding weird to me too but I'm almost positive I've dealt with this before#2018-03-0918:29dpsuttonI'm on the road but I can look it up after lunch#2018-03-0918:32dcj@bozhidar here is the complete story of Messages https://pastebin.com/aWUG9h9T#2018-03-0918:42dcj@bozhidar @dpsutton Problem solved! Removing all mention of clj-refactor from .emacs NOT GOOD ENOUGH. Had to actually delete the file from .emacs.d#2018-03-0918:43dcj@bozhidar @dpsutton thanks for your help!#2018-03-0918:46dcjOK, now I am going to ask a very embarrassing question: From a buffer of clojure code, I jack-in, eventually another window opens, with the user> prompt. How can I automatically or simply be in the namespace of the file I was editing? Basically get Cider to do the (use 'foo) and (ns foo) for me?#2018-03-0919:01dpsuttonHere's the code that breaks it for you from cljr#2018-03-0919:01dpsuttondefun cljr--inject-jack-in-dependencies ()
"Inject the REPL dependencies of clj-refactor at `cider-jack-in'.
If injecting the dependencies is not preferred set `cljr-inject-dependencies-at-jack-in' to nil."
(when (and cljr-inject-dependencies-at-jack-in
(boundp 'cider-jack-in-lein-plugins)
(boundp 'cider-jack-in-nrepl-middlewares))
(add-to-list 'cider-jack-in-lein-plugins `("refactor-nrepl" ,(cljr--version t)))
(add-to-lis#2018-03-0919:05dcj@dpsutton wow, thanks!#2018-03-0919:06gganley@dcj My fingers do things without me thinking, I think “switch to buffer while loading file and switching to namespace” might be something like C-u C-c M-z but now I’m doubting myself#2018-03-0919:07gganleyin any case, http://cider.readthedocs.io/en/latest/using_the_repl/#2018-03-0919:07dcj@gganley reading now, thx#2018-03-0919:09gganley@dcj np, btw if you’re like me and prefer route memorization to documentation I constantly create Quizlet sets for this sort of thing https://quizlet.com/270049605/cider-repl-flash-cards/#2018-03-0919:09gganleyis that how you use route? I’ve only heard it spoken, never written#2018-03-0919:10gganleyIt is actually rote not route#2018-03-0919:12dcj@gganley C-u C-c M-z is correct, thanks! That is going to make life much better 🙂#2018-03-0919:18gganley@dcj Throwing the book at you wasn’t meant to be dismissive, http://cider.readthedocs.io is ESSENTIAL#2018-03-0919:20dcj@gganley I haven't gone through it in several years. Doing so now, and editing .emacs as I go...#2018-03-0919:22dcj@gganley This also looks interesting:
Normally the CIDER REPL will start with the user namespace. You can supply a default value for REPL sessions via the repl-options section of your Leiningen project's configuration.
:repl-options {:init-ns 'my-ns}#2018-03-1003:02xiongtx@gonewest818 Have you started work on CircleCI integration for CIDER?
I started taking a crack at it, but noticed that CircleCI's config doesn't really have the concept of a build matrix, resulting in much repetition: https://github.com/CircleCI-Public/circleci-demo-workflows/blob/parallel-jobs/.circleci/config.yml#2018-03-1003:05xiongtxAnother thing we could do is use emacs docker images instead of relying on EVM: https://hub.docker.com/r/silex/emacs/
It'd be nice if we could eliminate use of external tools like EVM and Cask.#2018-03-1003:16gonewest818I have started some of this. I’m contributing to a project that has the emacs docker images. Silex/docker-emacs#2018-03-1003:17gonewest818There is a yaml syntax that can reduce some of the repetition. I have examples in other projects. See elisp-lint.el for example https://github.com/gonewest818/elisp-lint#2018-03-1003:20gonewest818I have an emacs init that does most of the rest. #2018-03-1003:23gonewest818Well, there’s a Makefile too. We’d be “kickin’ it old-skool” in terms of tooling but it works.#2018-03-1018:52xiongtxWow, that's interesting--I've never seen that syntax before. TMYK.#2018-03-1006:07arrdem@xiongtx I was able to play some games with YAML's anchors and references at work to clamp down on CircleCI's build repetition but yeah it's not great.#2018-03-1018:51xiongtxIs this the same thing as what @gonewest818 suggested? https://clojurians.slack.com/archives/C0617A8PQ/p1520651849000009?thread_ts=1520650976.000066&cid=C0617A8PQ#2018-03-1018:55gonewest818Yes, in terms of using YAML anchors to reduce repetition. The part where he says he parameterized with environment variables goes a step beyond what I did.#2018-03-1006:08arrdemEg, use an anchor to select a bunch of tasks which are parameterized by environment variables and then set up a bunch of workflow steps which are the same tasks re-parameterized just with different env settings#2018-03-1621:55mikerodbasically, I have a test like:
(t/is (= foo (run-thing bar)))
the diff compares
"expected buffer"
(t/is (= foo (run-thing bar)))
"actual buffer"
(= <foo-evaled> <fn-result-evaled>)
#2018-03-1621:56mikerodIt is like it is trying to use the actual test code form as the expected and the evaled stuff as the actual. not comparing the args across the =#2018-03-1714:10wusticalityquick question - whenever I run cider-apropos-documentation, it shows the docstring in the buffer but hitting RET just shows Symbol clojure.core/defn not resolved - any ideas?#2018-03-1716:43bozhidarHave you compiled the current buffer?#2018-03-1716:44bozhidar@mikerod I’m not sure I understand the problem. What do you expect to see?#2018-03-1716:48mikerod@bozhidar it should be compiled yeah#2018-03-1716:48mikerodIt just wasn’t a useful diff#2018-03-1716:48mikerodIt just showed me my un-eval’ed code (expected) vs evaluated forms (actual)#2018-03-1716:48mikerodmaybe that’s it is all its meant to do, but it was like 2 big maps#2018-03-1716:49mikerodso my expected buffer was nothing but what I already had in the code#2018-03-1716:49mikerodthe actual was 2 big evaluated maps in the = form. I guess just like standard clojure.tset#2018-03-1716:50mikerodI was thinking maybe something more like humane-test clj lib where I think it does something like a data diff on big things like that. It’s fine. I just wasn’t sure what this feature was for and couldn’t find any examples out there demonstrating it being used#2018-03-1716:55bozhidarHmm, didn’t @xiongtx already do this in 0.17?#2018-03-1716:55bozhidarI tested this locally now and the output has just values for me.#2018-03-1718:46mikerodI can dig a bit more #2018-03-1719:18xiongtxI cannot reproduce @mikerod's strange outcome. Is there a minimal reproducible repo? Also make sure you're using latest CIDER to reproduce, and that you don't have anything in your .lein/profile.clj that could be modifying the test output.
There is, however, a 🐛 w/ the interaction b/t cider-test-ediff and the diffing functionality. With all comparisons besides = (which we treat specially), the expected and actual are something like:
expected: (> 1 2)
actual: (not (> 1 2))
The cider-test-ediff logic will look for the second form in actual, expecting the first to always be not.
W/ =, however, we've modified the expected and actual. E.g. for (= 1 2 3):
expected: 1
actual: (2 3)
This means that cider-test-ediff doesn't work properly in case of =.
However, this seems to have nothing to do w/ @mikerod's result.#2018-03-1719:27xiongtx@bozhidar It seems that the cider-test-ediff functionality is really only designed w/ (= a b) in mind. It doesn't handle (= a b c), (> a b), etc. gracefully.
W/ (> 1 2), for example, it will display (> 1 2) in both buffers, which isn't very useful.#2018-03-1719:31xiongtxOh, I'm able to reproduce @mikerod's result by using
(def a 1)
(def b 2)
(deftest foo-test
(is (> a b)))
Given this, it's not clear that cider-test-ediff was ever useful :face_with_rolling_eyes:.
From clojure.test's own documentation: https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/test.clj#L40-L42
> The "expected:" line shows you the original expression, and the "actual:" shows you what actually happened.#2018-03-1719:43xiongtx@mikerod You should be able to see the diff in the *cider-test-report* buffer directly if you are using latest CIDER. That's what https://github.com/clojure-emacs/cider/pull/2172 added.#2018-03-1720:39xiongtx@mikerod https://github.com/clojure-emacs/cider/pull/2241 should now ediff the proper values. Give it a try.#2018-03-1720:52mikerod@xiongtx Sorry for the delayed response. I am actually still using Cider 0.16.0. My case was with = and 2 maps. I never messed with it enough yet to have a minimal repro. I will look at what you have linked here and I’ll see if I can give it a shot. The one thing that was holding me back from Cider 0.17 was that it broke with cljs or something (I just heard, didn’t experience), so I delayed since I’m still using it with a good amount of both clj and cljs.#2018-03-1721:01mikerodThanks for taking a look at it by the way!#2018-03-1721:38xiongtx@gonewest818 What's wrong here w/ elisp-lint? https://travis-ci.org/clojure-emacs/cider/jobs/354827509#2018-03-1722:07gonewest818Indentation in cider-test.el is the error — but on my iPhone it’s difficult to see exactly what the complaint is.#2018-03-1722:53xiongtxDon't know what indentation error there is--`indent-defun` isn't changing anything.#2018-03-1723:00gonewest818The diffs in Emacs 25+ are a little more instructive.#2018-03-1723:00gonewest818See https://travis-ci.org/clojure-emacs/cider/jobs/354827513#L1510-L1522#2018-03-1723:04gonewest818It wants the conditions aligned with cond rather than indented 2 spaces. I’m getting the same indenting in the *scratch* buffer.#2018-03-1723:36xiongtxI'm using default Emacs Lisp indentation. cond should be indented 2 spaces.
(cond
(foo bar)
(baz quux))
#2018-03-1723:42gonewest818If that’s the case then I wonder how am I not getting the default, and neither is elisp-lint… ?#2018-03-1800:16xiongtxAh, sorry. I had lisp-indent-function set to common-lisp-indent-function.#2018-03-1800:19xiongtxHowever, the CL version looks nicer, and matches that of clj :man-shrugging:#2018-03-1801:23gonewest818I definitely see the appeal.#2018-03-1802:22bozhidarBut we should stick to the mainstream Elisp indentation conventions - otherwise a lot of people would have trouble while contributing.#2018-03-1722:55wusticalitycurious if anyone has any ideas on my issue#2018-03-1723:02wusticalityselecting any documentation via cider-apropos et al just says the symbol is unresolved#2018-03-1723:36xiongtxTry cider-refresh.#2018-03-1723:09gonewest818Do you mean the symbol whose documentation you are selecting is unresolved?#2018-03-1723:10gonewest818So, for instance if I cider-apropos I get this#2018-03-1723:11gonewest818clojure.core/cond
Macro: Takes a set of test/expr pairs.
clojure.core/cond->
Macro: Takes an expression and a set of test/form pairs.
clojure.core/cond->>
Macro: Takes an expression and a set of test/form pairs.
clojure.core/condp
Macro: Takes a binary predicate, an expression, and a set of
clauses.
clojure.core/reader-conditional
Function: Construct a data representation of a reader conditional.
clojure.core/reader-conditional?
Function: Return true if the value is the data representation of a
reader conditional
clojure.core/second
Function: Same as (first (next x))
clojure.tools.reader.impl.utils/second'
Function: (not documented)
cljs-tooling.util.misc/cond-let
Macro: An implementation of cond-let that is as similar as possible
to if-let.
#2018-03-1723:12gonewest818And selecting, e.g. the first entry gets me the docs for “cond”. But you are saying, you select the first entry and you get “Symbol clojure.core/cond not resolved” …. is that accurate?#2018-03-1800:05wusticalityhey @gonewest818 - that’s right, the documentation list pops up as your image shows, but hitting RET on anything just says the symbol is unresolved#2018-03-1800:24gonewest818What happens if you do cider-doc on a symbol? That should look up the documentation, it’s the same thing apropos does when you RET on a line.#2018-03-1800:47wusticality@gonewest818 that works fine#2018-03-1800:50gonewest818well, that’s odd. What function are you looking up?#2018-03-1800:51wusticalityodd, after calling cider-doc once it works again#2018-03-1801:18gonewest818Well, keep an eye on it. If it goes sideways again then maybe (nrepl-toggle-message-logging) will reveal something in the logs.#2018-03-1903:57wusticalityIs there a setting to force the *cider-inspect* window to update it’s values when you’re debugging in another window? Gets frustrating having to navigate to it to refresh it. I’m sure there is and I’m not finding it, thanks in advance. 🙂#2018-03-1904:05theeternalpulseI'm using the boot cider repl -s wait command and when I go to use cider-connect I have to manually enter the port. I remember it used to detect the running repl instance.#2018-03-1904:06bozhidar> Is there a setting to force the *cider-inspect* window to update it’s values when you’re debugging in another window? Gets frustrating having to navigate to it to refresh it. I’m sure there is and I’m not finding it, thanks in advance. 🙂 (edited)#2018-03-1904:06bozhidar@iwannaseethelight No, there’s no such way currently. How do you use the inspector and the debugger together?#2018-03-1904:10bozhidar@theeternalpulse I think there was some port detection logic only for leiningen, that was parsing the the output of ps or something like this. See https://github.com/clojure-emacs/cider/blob/master/cider.el#L871#2018-03-1904:27theeternalpulseI'd love to take a look at that when I have the time. I'm a bit less fluent in lisp than I am in clojure, so I need to get set up with testing and the lisp environment, but would like to take a look. Do you need an issue first @bozhidar#2018-03-1904:47bozhidarIt’s easier than it looks. 🙂 No need for a ticket, but you can always file one if you want.#2018-03-1904:58theeternalpulsecool, do you usually just test something like this eval'ing with certain arguments piece by piece?#2018-03-2015:16theeternalpulseSo I looked into it deeper last night, the boot process sadly doesn't emit the parent directory, so finding the .nrepl port can not be found. I was wondering if it would be too out of scope for me to do a secondary look up the parent project path, up to the home path for the .nrepl-port file if the initial file ends up empty?#2018-03-2015:17theeternalpulse3638 24.5 4.9 7822492 801312 pts/2 Ssl+ 08:12 0:57 java -Dboot.app.path=/usr/local/bin/boot -jar /usr/local/bin/boot -i (require 'cider.tasks) -d org.clojure/tools.nrepl:0.2.13 -d com.billpiel/sayid:0.0.15 -d refactor-nrepl:2.4.0-SNAPSHOT -d cider/cider-nrepl:0.17.0-SNAPSHOT cider.tasks/add-middleware -m com.billpiel.sayid.nrepl-middleware/wrap-sayid -m refactor-nrepl.middleware/wrap-refactor -m cider.nrepl/cider-middleware repl -s -H :: wait#2018-03-2015:17theeternalpulsethat's an example of the boot process#2018-03-2015:20theeternalpulselearned a handful of lisp along the way so thanks for that lol#2018-03-1904:10bozhidarhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L270#2018-03-1904:11bozhidarThis and the regexp after it have to tweaked to support boot as well., which should be super simple.#2018-03-1904:12bozhidar(or boot can write an .nrepl-port file)#2018-03-1904:16wusticalityHey @bozhidar - I have a split window in emacs, displaying local vars on one side and the code I’m debugging on the other. The ideal use case would be for the local vars to update as I step in the debugging window. Currently I have to type l and then C-x o back to my code to refresh the buffer.#2018-03-1904:19bozhidarI see. Well, you can file a feature request ticket and we can see what we can do about this.#2018-03-1904:26wusticalityFor sure, will do#2018-03-1904:26wusticalityI’d also like to point out that cider is fucking awesome 😉#2018-03-1904:26wusticalityIt’s allowed me to stay inside emacs, thank god#2018-03-1904:36bozhidar@iwannaseethelight Happy to hear this!#2018-03-1904:36bozhidarIt was my plan for myself when I started working on it, but I never actually got to using Clojure professionally. 😄#2018-03-1905:01wusticalityYeah I took a gig down under writing clojure but f*ck IntelliJ 😉#2018-03-1905:45bozhidar😄#2018-03-1909:21mitchelkuijpersIs there something changed in how cider detects piggieback? I have been using shadow-cljs happily for the past few months but after an upgrade it gives me:
error in process filter: Piggieback is not available. See for details
Btw shadow-cljs shims piggieback#2018-03-1909:51bozhidarYeah, I realized this just yesterday.#2018-03-1909:52bozhidarI’ll update the detection to not be global. I had no idea there was another cljs nREPL eval middleware.#2018-03-1909:53bozhidar@mitchelkuijpers Btw, how exactly do you start the cljs repl with shadow-cljs?#2018-03-1909:53bozhidarHave you added a new entry to the list of known cljs repls or what?#2018-03-1910:15mitchelkuijpersI have this in my dir-locals:
(setq cider-cljs-lein-repl "(start-cljs-repl)")
#2018-03-1910:15mitchelkuijpersBut I am not sure how to configure this anymore#2018-03-1910:41bozhidarI’ve just committed a fix for the piggieback check.#2018-03-1910:42bozhidarAs for the rest - you’ll have to update the list of known cljs repls and add there some entry for shadow-cljs.#2018-03-1910:43bozhidar(defconst cider-cljs-repl-types
'(("Rhino" "(cemerick.piggieback/cljs-repl (cljs.repl.rhino/repl-env))"
nil)
("Nashorn" "(cemerick.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))"
cider-check-nashorn-requirements)
("Figwheel" "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
cider-check-figwheel-requirements)
("Node" "(do (require 'cljs.repl.node) (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
cider-check-node-requirements)
("Weasel" "(do (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \"127.0.0.1\" :port 9001)))"
cider-check-weasel-requirements)
("Boot" "(do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
cider-check-boot-requirements))
"A list of supported ClojureScript REPLs.
For each one we have its name, the form we need to evaluate in a Clojure
REPL to start the ClojureScript REPL and functions to very their requirements.")
#2018-03-1910:43bozhidarYou can use add-to-list to extend this.#2018-03-1910:44bozhidarAnd finally - set cider-default-cljs-repl to whatever name you decide to give to this new entry you’ve added.#2018-03-1910:44mitchelkuijpersAh ok the hard part is that you have to choose the build for shadow-cljs#2018-03-1910:44mitchelkuijpersBut I will try it out thank you so much @bozhidar#2018-03-1910:45bozhidarI’m afraid I have no idea what this is. 🙂 I recently revamped the cljs support, but at the time I didn’t even know what shadow-cljs was.#2018-03-1910:46mitchelkuijpersNo problem, I'll try it out. Maybe you would like a PR to add shadow-cljs support?#2018-03-1910:47bozhidarYeah, I’d love this!#2018-03-1910:47bozhidarYou can also see this related ticket - https://github.com/clojure-emacs/cider/issues/2239#2018-03-1910:47mitchelkuijpersAh cool thnx#2018-03-1910:47bozhidar(that’s why I learned about shadow-cljs just yesterday)#2018-03-1911:00mitchelkuijpersVery cool @bozhidar this works:
(add-to-list 'cider-cljs-repl-types '("Shadow CLJS" "(do (shadow.cljs.devtools.server/start!) (shadow.cljs.devtools.api/watch :app) (shadow.cljs.devtools.api/nrepl-select :app))" nil))
But the problem is that I specified the build :app which you cannot know beforehand#2018-03-1911:02bozhidarWhat are those builds?#2018-03-1911:02bozhidarIf we can read them from somewhere maybe we can prompt the user to select one?#2018-03-1911:05mitchelkuijpersYes there is a shadow-cljs.edn with a :builds key and the a map#2018-03-1911:06mitchelkuijpersLike this: https://shadow-cljs.github.io/docs/UsersGuide.html#_build_configuration#2018-03-1911:08thhellerhey everyone!#2018-03-1911:10mitchelkuijpers@bozhidar @thheller is the creator of shadow-cljs#2018-03-1911:10mitchelkuijpersBut you maybe already know that#2018-03-1911:10thhellerhe knows 😉#2018-03-1911:11bozhidarI do! 🙂#2018-03-1911:11bozhidarHey Thomas!#2018-03-1911:11thhellerHey Bug 😉#2018-03-1911:12thhelleris there some way to configure what cider-jack-in calls?#2018-03-1911:13thhellerie. not lein?#2018-03-1911:14bozhidarYeah. It tries to detect your project type, in the absence of a project it uses clojure (tools.deps) Let me find the relevant section of the manual.#2018-03-1911:15bozhidarAnd you can also override the command invoked for each project type.#2018-03-1911:15bozhidarhttp://cider.readthedocs.io/en/latest/up_and_running/#2018-03-1911:16thhellermy emacs knowledge pretty much ends at starting it so I wouldn't even know where to start configuring it#2018-03-1911:17thhellerI only used cider-connect so far since I couldn't get cider-jack-in to work#2018-03-1911:17bozhidarWhat’s the problem you’re encountering with it?#2018-03-1911:18thhellerits probably my weird project setup in shadow-cljs. I usually start a seperate process via lein with-profiles +cljs repl#2018-03-1911:18bozhidarAs for configuration - simply put you need to add entries like (setq some-var some-value) in your init.el configuration file.#2018-03-1911:19thhellerand then just connect remotely with cursive/cider-connect#2018-03-1911:20bozhidardoesn’t seem that weird to me 🙂#2018-03-1911:20bozhidarat least the invocation bit that is#2018-03-1911:22thhellerI don't know that I did ... but I can't for the life of me figure out why things appear in the line below M-x cider- and I can't edit the command anymore?#2018-03-1911:22bozhidarSpacemacs?#2018-03-1911:23thhelleryes.#2018-03-1911:23bozhidarThat looks odd indeed.#2018-03-1911:23thhellerrestart fixed it ... but this happens frequently so its really annoying#2018-03-1911:24bozhidarTrust me, it’s not a standard Emacs thing. 🙂#2018-03-1911:25bozhidarI haven’t used Spacemacs, I don’t like using a setup I haven’t crafter myself, because that means I don’t know what exactly’s going on there.#2018-03-1911:25thhellerits probably a key binding I'm used to using from Cursive but I can't figure out how to get out of it 😛#2018-03-1911:26thhelleremacs is great because you can do everything. its also horrible because you have to do everything.#2018-03-1911:26bozhidarControl+G most likely.#2018-03-1911:26thhellergot tired of my setup breaking constantly that I moved on years ago#2018-03-1911:26bozhidarIf you want something simpler - you might look into my one-file config https://github.com/bbatsov/emacs.d/blob/master/init.el#2018-03-1911:27bozhidarAt leat it’d be easier for me to tell you what to modify and where.#2018-03-1911:29thhellercan I get evil-mode easily this way?#2018-03-1911:29bozhidarGenerally all the config you need is:
(require 'package)
(add-to-list 'package-archives
'("melpa" . "") t)
;; keep the installed packages in .emacs.d
(setq package-user-dir (expand-file-name "elpa" user-emacs-directory))
(package-initialize)
;; update the package metadata is the local cache is missing
(unless package-archive-contents
(package-refresh-contents))
(use-package cider
:ensure t
:config
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'eldoc-mode))#2018-03-1911:29thhellererror: Package ‘use-package-’ is unavailable#2018-03-1911:30bozhidarWhat’s your Emacs version?#2018-03-1911:30thheller25.3.1#2018-03-1911:31bozhidarCan you do M-x package-refresh-packages?#2018-03-1911:31bozhidarOps#2018-03-1911:31bozhidarI now see the problem#2018-03-1911:31bozhidarDo M-x package-install RET use-package and restart.#2018-03-1911:32bozhidarI have installed it manually and forgot to add a check to install it if it’s missing.#2018-03-1911:32thheller"No match"#2018-03-1911:33thhellerSetting ‘package-selected-packages’ temporarily since "emacs -q" would overwrite customizations
For information about GNU Emacs and the GNU system, type C-h C-a.
Contacting host:
gnutls.c: [1] (Emacs) GnuTLS library not found
Contacting host:
Opening TLS connection to ‘’...
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443 ’...failed
Opening TLS connection with ‘gnutls-cli --x509cafile nil -p 443 --protocols ssl3’...failed
Opening TLS connection with ‘openssl s_client -connect -no_ssl2 -ign_eof’...failed
Opening TLS connection to ‘’...failed
Package refresh done
Failed to download ‘melpa’ archive.
#2018-03-1911:34thhellerI guess thats why nothing works 😛#2018-03-1911:34bozhidarAh, yeah.#2018-03-1911:34bozhidarJust edit the file I sent you and change https to http.#2018-03-1911:35bozhidarThose lame ssl problems lately have been killing me.#2018-03-1923:18xiongtx@U4PUTN69G I thought this was fixed on the ELPA side?#2018-03-1923:19gonewest818? where? travis?#2018-03-1923:28gonewest818Oh, now I see the @thheller discussion. It looks like Emacs was installed, maybe, without gnutls support compiled in nor the gnutls-cli available… ?#2018-03-1923:34gonewest818Oh, interesting. I#2018-03-1923:38gonewest818I’m not able to resolve http://melpa.org
$ ping
PING (198.105.244.130): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
#2018-03-1923:40gonewest818and now I can:
Neils-MBP:~ neilo$ ping
PING (104.239.207.44): 56 data bytes
64 bytes from 104.239.207.44: icmp_seq=0 ttl=44 time=55.442 ms
64 bytes from 104.239.207.44: icmp_seq=1 ttl=44 time=56.520 ms
64 bytes from 104.239.207.44: icmp_seq=2 ttl=44 time=55.828 ms
^C
#2018-03-1923:41gonewest818Different IP addresses, mind you. There is some round robin thing going on, and one of the servers is unresponsive.#2018-03-2001:55xiongtxMaybe report this to the ELPA maintainers?#2018-03-2014:51gonewest818I’ll check again later and report. That was Melpa, by the way, not Elpa. So that’s Steve Purcell et al. #2018-03-1911:36thhellerok now its installing stuff#2018-03-1911:37bozhidar:thumbsup:#2018-03-1911:44thhellercan I pin a version somehow? I'm not a fan of using SNAPSHOT deps#2018-03-1911:46thhellerhttps://gist.github.com/thheller/37318e42e91da6c8a0c15dc2859222da this is what I get on cider-jack-in#2018-03-1911:55bozhidaris this in a clean project?#2018-03-1911:56bozhidarSeems that for some reason one of the deps in not downloaded or something, but I can’t imagine why.#2018-03-1911:56bozhidarDid the project use clojure to start?#2018-03-1911:57thhellerno its my shadow-cljs project via project.clj#2018-03-1911:57thhellerit asked if I wanted to use lein or clojure#2018-03-1911:57thhellerpicked lein then the error above happened#2018-03-1911:58bozhidarCan you create one test project with lein new and see if jack-in will work there?#2018-03-1915:12dpsuttonis anyone having trouble with cider-default-cljs-repl not being read from the dir-locals?#2018-03-1915:18bozhidarI think this was a problem I fixed shortly after introducing it.#2018-03-1915:18bozhidarOne call to hack-dir-local-variables was misplaced.#2018-03-1915:19dpsuttonwas this recently? i pulled last night and re-eval'd just now and now its working.#2018-03-1915:19dpsuttonbut looks like a false alarm either way#2018-03-1915:40bozhidarhttps://github.com/clojure-emacs/cider/commit/b460bbc7168ad4bd390d8fb9ca257b5c54a76378#2018-03-1916:10manuelCIDER ruling the world here: http://blog.cognitect.com/blog/2017/1/31/clojure-2018-results 😉#2018-03-1916:54bozhidarThat’s nice. Seems finally Cursive stopped growing this year. Guess now we know how many people actually enjoy using Emacs, as opposed to having been forced to use it. 😄#2018-03-1916:55bozhidarAnd I find it funny that there’s a mention of Spacemacs. 😄#2018-03-1917:32bozhidarLooking at this data it seems to me we can drop support (or at least remove the CI builds for Clojure 1.7 and Java 1.7).#2018-03-1918:29mikerodNo more Java 7 so soon? 😧#2018-03-1920:26wusticalitymorning from nz all#2018-03-2003:48bozhidarMorning from Vietnam! 🙂#2018-03-2003:50bozhidar@mikerod I just noticed it seems no one’s using it these days. I don’t plan for us to do anything special to drop support for Java 7, we’ll likely just remove it from the build matrix once we ship out CIDER 0.17, which should happen at the end of the month / beginning of next month if everything goes well.#2018-03-2006:27arrdemMidnight greetings from San Francisco, does CIDER make any attempt to expose it’s “pick the machinery with which to start an nREPL” server logic to other systems like say vim-fireplace?#2018-03-2007:14dominicm@arrdem I don't understand the question, but as a vim user, I can probably answer.#2018-03-2007:18arrdem@dominicm I think the answer is no - the emacs CIDER client has a bunch of smarts which figure out how to run a CIDER repl using deps.edn or boot or lein or what have you.#2018-03-2007:18dominicmyeah, that's too early for it to be shared. The shared area is in the nrepl. Fortunately the logic isn't too complex, and was replicated in https://github.com/clojure-vim/vim-jack-in#2018-03-2007:19dominicmvim-jack-in had deps.edn jack-in before cider infact.#2018-03-2007:19arrdemMy question was whether that logic is (or could be) packaged outside of emacs such that fireplace or other tools could use it too, specifically because I’m toying with writing a new build tool which would need its own incantation support.#2018-03-2007:19arrdemAnd it’d be really neat of that could be fully shared etc.#2018-03-2007:20dominicmFor the cost of https://github.com/clojure-vim/vim-jack-in/blob/master/autoload/jack_in.vim#L47-L63 15loc I will gladly support your build tool 😛#2018-03-2007:20arrdemheh#2018-03-2007:21arrdemThanks, I’ll keep that in mind. I suspect I’m gonna try to build an MVP atop lein and see how that goes, which makes this a non-need for now.#2018-03-2007:21dominicmThe only thing your build tool needs to expose is a way to add deps & maybe middleware, from the cli. But having eval works too.#2018-03-2008:43bozhidarYeah, you can’t really share this, because all of this happens before booting the server.#2018-03-2008:51bozhidarUnless you package it as a Python script or something. 🙂#2018-03-2011:15bozhidarI’m considering to drop the Gradle support from CIDER. Seeing the usage results it seems that just 2% are using it https://www.surveymonkey.com/results/SM-9BC5FNJ68/ With Gradle we’re not doing deps injection, as with everything else, and it seems no one is particularly interested to make things there better, so I’d rather just kill the limited support we have for it simplicity/consistency. Any objections.?#2018-03-2011:15bozhidar(that support extends just to cider-jack-in)#2018-03-2011:18dominicmwhat's the cost of keeping it?#2018-03-2011:21hkjelsI don’t use gradle myself, but 2% is still a few people. Could it be a separate module, so that those 2% can try to keep up themselves?#2018-03-2011:35bozhidar@dominicm The cost is not high, but it doesn’t work like everything else, therefore my preference is not to have it at all (I dislike inconsistent features). Obviously gradle users can simply start the server manually in this situation and connect to it.#2018-03-2011:36bozhidar> I don’t use gradle myself, but 2% is still a few people. Could it be a separate module, so that those 2% can try to keep up themselves?
The support for gradle is just project detection, a few configuration variables and dispatch on the project type here and there. Extracting something so simple seems like an overkill, as it would complicate the existing code.#2018-03-2012:06hkjelsI see#2018-03-2012:10bozhidarJust for the protocol - if deps injection is possible with Gradle and someone wants to work on it, I’d be fine with keeping it.#2018-03-2016:49normanI find 2% surprising. I wonder how many of those represent people who actually use clojure and gradle together on a regular basis#2018-03-2016:52normanAs opposed to people who have at some time used gradle and clojure or who use gradle and use clojure together. I think a lot of people don’t answer these kinds of things honestly, especially on the fringes.#2018-03-2017:02bozhidarPerhaps. Frankly I’m more surprised about the Maven usage, but I guess those are some mixed Java/Clojure projects.#2018-03-2017:22dominicmPeople using maven are less likely to use slack, and less likely to attend conferences I suspect.
Enterprise is a silent market for clojure.#2018-03-2101:20bozhidarhaha#2018-03-2101:21bozhidarWell, I guess they are less likely to file tickets if they need something then. 😄 And less likely to be using Emacs or Vim. 😄#2018-03-2211:44ajsdo i understand that output from threads other than the main thread can go to the nrepl buffer? if I read from a socket on another thread (which is handled by the Jetty websocket library), then any logging that socket read does would go to the nrepl buffer?#2018-03-2212:14thheller@bozhidar you talked about removing gradle. how would I go about adding shadow-cljs? it supports injection via shadow-cljs -d cider/cider-nrepl:0.16.0 server?#2018-03-2212:15thhellerit writes its nrepl port to .shadow-cljs/nrepl.port (same as .nrepl-port from lein)#2018-03-2212:19bozhidar> do i understand that output from threads other than the main thread can go to the nrepl buffer? if I read from a socket on another thread (which is handled by the Jetty websocket library), then any logging that socket read does would go to the nrepl buffer?
At least when dealing with Clojure - what ends up in the nrepl buffer is output that got bound to the server’s stdout/stderr. We’ve got some logic to redirect this to the REPL buffers, so people won’t miss it, but I’m not sure what exactly’s going on in your case.#2018-03-2212:20bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj#2018-03-2212:21bozhidar@thheller So, you don’t need lein, boot or something like this? You can just spin the nREPL server with all the deps using the shadow-cljs binary?#2018-03-2212:21thhelleryep#2018-03-2212:22bozhidarAnd I assume the resulting connection is a cljs connection, which is directly ready to be used?#2018-03-2212:22thhellerwell it also works via lein or boot but has a standalone launcher as well#2018-03-2212:22thhellerno the nrepl connection always starts out as CLJ#2018-03-2212:23thhellerjust like lein#2018-03-2212:23bozhidarWe’ll need some way to know we’re in a shadow-cljs project. Is there some file marker we can rely on?#2018-03-2212:23thhellershadow-cljs.edn the config file.#2018-03-2212:24thhelleralways at the root of the project (like project.clj)#2018-03-2212:24bozhidarOK, so all of this is going to be very easy. I can hack it together myself if you’re afraid of Elisp. 🙂#2018-03-2212:25bozhidarThe only open question is how to convert the resulting repl to cljs - I was told there’s not fixed code snippet you can execute, as you had to pass some project-specific build id.#2018-03-2212:25bozhidarIt’d be nice to have some easy way to spawn a cljs repl without having the user to type anything themselves.#2018-03-2212:25thhelleryes shadow-cljs supports multiple builds and you can "select" which REPL you want to talk to#2018-03-2212:25thhellerdo you support parsing edn in elisp?#2018-03-2212:26thhellerthen you could just look at shadow-cljs.edn :builds and let the user select one#2018-03-2212:26bozhidarWe don’t currently use it, but a parser was implemented recently so we can leverage it.#2018-03-2212:26thhellerits a map of {:build-id build-config}#2018-03-2212:27thhellerhttps://github.com/shadow-cljs/quickstart-browser/blob/master/shadow-cljs.edn#2018-03-2212:27thhellerthis just defines one build named :app#2018-03-2212:28thhellerto switch the nrepl connection to this build you'd first call (shadow.cljs.devtools.api/watch :app) to start the "worker" which will recompile and all that jazz#2018-03-2212:28thhellerthen call (shadow.cljs.devtools.api/nrepl-select :app) to switch the current nrepl to this build and turn it into CLJS#2018-03-2212:29thhellersimilar to what (cemerick.piggieback/cljs-repl repl-env) does#2018-03-2212:30thhellerI could add additional helper fns/middleware that lets you query which builds exists and so on#2018-03-2212:36thhellerthe is also support for starting a browser-repl or node-repl without a build#2018-03-2212:39thhellerah I guess this is the relevant code. https://github.com/clojure-emacs/cider/blob/master/cider.el#L547-L563#2018-03-2212:40thhellerso the problem appears to be that none of these currently take any arguments#2018-03-2212:43thhellerso the quickfix would be to add a no-args version that just picks a "default" build. which is easy it there is only one.#2018-03-2212:52bozhidarYeah, that’d be nice.#2018-03-2212:53bozhidarHow do you switch between different builds?#2018-03-2213:25thheller@bozhidar you can run multiple (shadow.cljs.devtools.api/watch :build1) (shadow.cljs.devtools.api/watch :build2) in parallel. they run in the background. (shadow.cljs.devtools.api/nrepl-select :build1) switches to CLJS of build1. :cljs/quit switches back to CLJ, then call nrepl-select again to switch to either#2018-03-2213:25thhellerthe REPL actually keeps running as long as the watch is running#2018-03-2213:25thhellerjust can just connect/disconnect from it any time#2018-03-2213:27thhelleralternatively you could just call (shadow.cljs.devtools.api/browser-repl) which starts the browser repl, opens a browser, and switches the REPL to CLJS#2018-03-2213:27thhelleror (shadow.cljs.devtools.api/node-repl)#2018-03-2213:27thhellerthese aren't tied to any build so they require no config#2018-03-2213:54bozhidarInteresting.#2018-03-2213:54bozhidarSo you can have 3 different types of shadow-cljs repls?#2018-03-2214:11thhellerwell technically its just one type, the browser-repl and node-repl are just utility fns to just quickly spin up a REPL without having to configure a build first#2018-03-2214:18dpsuttonit sounds like shadow-cljs works the way we want piggieback to eventually work: with suspendable cljs repls in a single repl#2018-03-2214:18dpsuttonmaybe make a new workflow for shadow cljs and then migrate piggieback to work like that. without a sibling repl#2018-03-2214:19jmckitrickIt looks like everyone is talking about cider integration with shadow, correct?#2018-03-2214:19dpsuttonits all the latest buzz#2018-03-2214:19jmckitrickI’m interested it trying it, and I’ll document it in shadow if someone doesn’t beat me to it.#2018-03-2214:19jmckitrickLet me finish reading the guide, and then I’ll be ready to try it. What’s the quick start so far to connect cider to nREPL with shadow?#2018-03-2214:20thheller@jmckitrick easiest currently should be to run shadow-cljs server externally in a terminal and use cider-connect to connect to it#2018-03-2214:23jmckitrickIt looks like I’m connected, but jump-to-var requires op "info" via cider-nrepl. So I probably needed to start something else first….#2018-03-2214:23jmckitrickI know cider auto-injects stuff for figwheel#2018-03-2214:24thhellerright you need to add [cider/cider-nrepl <version>] to your deps manually#2018-03-2214:24thhelleror run shadow-cljs -d cider/cider-nrepl:version server in the terminal#2018-03-2214:24thhellerwe were talking about adding support in cider to launch shadow-cljs directly#2018-03-2214:25jmckitrickAh, that’s the next logical step.#2018-03-2214:25dpsutton@thheller your project is so thoughtful to its end users#2018-03-2214:25jmckitrickSo I assume I need to pick through my lein dependencies and copy the cljs ones into the shadow.edn to start @thheller#2018-03-2214:33thhelleryou can also specify :lein true and just run shadow-cljs via lein. https://shadow-cljs.github.io/docs/UsersGuide.html#Leiningen#2018-03-2214:35jmckitrickHmm. I’m trying to decide if I want to start out with lein integration or not…#2018-03-2214:35jmckitrickMaybe I’ll do that to make it easier for now.#2018-03-2214:26thheller@dpsutton I hope so 🙂#2018-03-2214:26jmckitrick@dpsutton We’ve been hearing a lot about new user experience, so this is good to hear.#2018-03-2215:51jmckitrickI’ve run cider-connect and I have a REPL running. How do I tell cider to begin using this connection for jump-to-var etc?#2018-03-2215:52jmckitrickActually, this might not be a cljs REPL.#2018-03-2215:53jmckitrickSweet! I’m connected.#2018-03-2215:54jmckitrickI just ran….#2018-03-2215:54jmckitrick(shadow.cljs.devtools.api/nrepl-select :app)#2018-03-2215:54jmckitrickTime to write some docs….#2018-03-2217:36bozhidar> it sounds like shadow-cljs works the way we want piggieback to eventually work: with suspendable cljs repls in a single repl#2018-03-2217:36tanzoniteblackI was looking at a coworker of mine who uses intellij's screen yesterday, and saw that apparently his setup puts unused variables (as in, introduced in a let, but then never actually referenced) in a different color; is there a way to do something similar in cider?#2018-03-2217:37bozhidarI don’t think you can suspend and resume a cljs session with shadow-cljs, but I might be mistaken. At any rate - @bhauman’s latest idea about piggieback would make this irrelevant (most likely), as it would enable using one REPL for both clj/cljs without the need for a second connection at all. I think everyone would agree that’d be quite handy. 🙂#2018-03-2217:38bozhidar@tanzoniteblack CIDER itself doesn’t support this, but it’s doable. clj-refactor might have some functionality for this, not sure about that.#2018-03-2217:41thheller@bozhidar it can suspend and resume thheller@beast:.../shadow-cljs$ shadow-cljs cljs-repl browser
[5:1]~cljs.user=> (def x 1)
#'cljs.user/x
[5:1]~cljs.user=> :cljs/quit
thheller@beast:.../shadow-cljs$ shadow-cljs cljs-repl browser
[6:1]~cljs.user=> (inc x)
2
[6:1]~cljs.user=>
#2018-03-2217:41jmckitrick@bozhidar I’m willing to help with the cider/shadow integration. I have it working locally. Or have you already started?#2018-03-2217:42thhellerthis is from a terminal but it works just fine over nrepl as well#2018-03-2217:43bozhidarI haven’t started, but it’s probably best for me to do this, as I already know exactly what needs to be done. But if you do it by tomorrow morning that’d be fine by me - I’m already super busy as it is. 😄#2018-03-2217:44jmckitrickIf it only takes a day, I’ll defer to you. It would take me a bit longer, lol.#2018-03-2217:44bozhidar@thheller piggieback also has :cljs/quit but I think this wipes the cljs session clean, therefore the conversation about adding :cljs/pause and :cljs/resume there.#2018-03-2217:45bozhidar@jmckitrick It’s something like an hour of work, but who has an hour these days. 🙂#2018-03-2217:45bozhidarI do think that this is pretty important, though, so I’ll try to do it as soon as tomorrow.#2018-03-2217:46jmckitrick@bozhidar I know what you mean. I’ll work on documentation, then.#2018-03-2217:47thhellerwhich conversation? are these intended as nrepl ops?#2018-03-2218:06bozhidarhttps://github.com/clojure-emacs/piggieback/issues/73#2018-03-2218:07dpsuttonif all supported cljs sessions are suspendable, we could more mimic shadow-cljs. That's why i was saying there might be some benefit in making a custom jack-in-shadow-cljs and then making the current piggieback workflow work like that. and then unify them into a cider-jack-in-clojurescript with a single repl#2018-03-2218:10bozhidarWhat exactly would be special about jack-in-shadow? After all apart from running different commands you’d be doing exactly the same thing as for piggieback - you start a clj repl and evaluate some expression in it to convert it to a cljs repl. The only difference I see is that with shadow we’ll know definitely in advance what type of REPL to start - with piggieback you can never know if the users wants rhino, nashorn, node, etc. If they have a figwheel dep that’s probably what they want, but you can never be certain. Same for weasel.#2018-03-2218:10dpsuttonthat it currently doesn't spawn a sibling repl but just changes the clj repl.#2018-03-2218:10dpsuttonthat's what i mean. it's the paradigm of a single repl for clj/cljs#2018-03-2218:11dpsuttonso if those mechanics work, if we get piggieback to be suspendable and not require a separate repl, all the other workflows would naturally just then be configuration in the shadow jack in workflow#2018-03-2218:12thheller:cljs/resume seems problematic to me#2018-03-2218:12thheller:cljs/pause is fine#2018-03-2218:13dpsuttonif you pause, how do you renter that repl?#2018-03-2218:13thhellerwhat if I start build for :build1 then pause it, start build2, pause that. how do I get back to 1 without going through 2#2018-03-2218:13dpsuttonah i see. resume needs an argument?#2018-04-1206:33arrdemNah it looks like a monster.#2018-04-1206:33arrdemUpdated the patchset to return an {:error "\java.util.Base64\` is unavailable, \`slurp\` op is disabled"}` response#2018-04-1206:33arrdemlol slack#2018-04-1206:33arrdemw/e#2018-04-1206:34arrdemAlright. New patch is pushed and I'm out of power. Will check in in the morning.#2018-04-1206:35arrdemthe CIDER side of this is gonna get a little more interesting because it has to do a second nREPL op to get the image content now, but that's doable.#2018-04-1206:41bozhidar:thumbsup:#2018-04-1206:41bozhidarGet some well-deserved rest!#2018-04-1206:42bozhidarI was offline for a few days for the Easter holidays and I now it seems I’ve got a lot of catching up to do. 😄 Spending a few days in a remote Ukrainian village without Internet was definitely refreshing!#2018-04-1206:44arrdemnice! I got to spend a couple days down at gramas for the first time in several years which was lovely. Rich may be on to something with all this hammock time talk 😉#2018-04-1206:57bozhidarHe certainly is! I confirm this every time when I spent an entire night not being able to figure something out and they after sleeping on it I come up with a much better approach in like 10 minutes. 😄#2018-04-1206:58bozhidarI think many OSS projects are pretty messed up mostly because the only time you have for them is after work when your mind is not fresh and creative. And of course then you’re fine with cutting all sorts of corners.#2018-04-1315:32theeternalpulseThis is better than coming from work and not having the mental energy to touch a damn thing lol.#2018-04-1220:47xiongtx> And of course then you’re fine with cutting all sorts of corners.
Ironically, this hurts you the next day at work when you use the OS products! 😆#2018-04-1221:08arrdemThis is why you spend work hours on OS products and convince your manager that they’re a priority!#2018-04-1221:08arrdemsharpen your :knife:#2018-04-1304:32bozhidarIndeed! :thumbsup:#2018-04-1308:17bozhidarBtw, I’ve added a couple of small things to address running custom cljs repls:
* there’s now a custom type that will just prompt you for the form to invoke to start the repl
* there’s now a function (`cider-register-cljs-repl-type`) that you can use in your init.el (or whatever) to add new repl types permanently.#2018-04-1315:56mccraigmccraigso i'm finding that when i attach CIDER to a repl running in a terminal with cider-connectthat my timbre logging stops being printed on the terminal and starts being appended to the emacs repl buffer#2018-04-1315:57mccraigmccraighas anyone figured out how to stop this happening - i'd like it to carry on being printed to the terminal but not the emacs repl buffer#2018-04-1315:57bozhidarYeah, that’s a known problem that’s easy to fix, but for some reason we haven’t fixed yet.#2018-04-1315:58bozhidarhttps://github.com/clojure-emacs/cider-nrepl/pull/474#2018-04-1315:59bozhidarBasically this patch has to be finished. In its current form it will solve your problem, but I want to make this behaviour something that can be dynamically controlled from CIDER, as opposed to hardcoded.#2018-04-1316:00bozhidarThe changes are really easy, unfortunately I’m crazy busy.#2018-04-1316:01mccraigmccraignp - it's been bugging me for ages and i only just got to querying what's going on after i killed emacs... waiting a while longer for a solution won't do me any harm 🙂#2018-04-1406:55bozhidar@mccraigmccraig I just merged the open PR and tweaked it a bit. Things should be working ok now on master.#2018-04-1409:49mccraigmccraigcool! thanks @bozhidar #2018-04-1421:16dominicmWhen running an assertion with a (testing) where does the line number jump to? For me, the line number reported is on (testing) not the assertion that threw an exception.#2018-04-1421:17dominicmThe bidi tests are failing on (testing "set patterns") if anyone can lend a hand to ensure I'm not being crazy.#2018-04-1421:32dominicmOkay, my finger tips are burning as I wipe away the holy water: yes, cider reports the line number of (testing)#2018-04-1421:34dominicmIs that a bug or expected behaviour? Looks like it's only for exceptions, that's probably relevant.#2018-04-1421:40dominicmhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/test.clj#L89 It's using the line number of the exception, not the one of the failing assertion. That feels wrong, but that might just be me.#2018-04-1422:45bozhidarYou’re right. The problem is that there’s not location information reported for something like is, so we just use it as a starting point to find the first is (or something like it) afterwards. Let me dig the related ticket.#2018-04-1422:47bozhidarhttps://github.com/clojure-emacs/cider/issues/1683#2018-04-1422:48bozhidarActually, the tickets seems different in nature, so it seems you found a bug worth reporting.#2018-04-1508:34dominicmThis seems like it might not be fixable. I'm not sure, the case isn't clear enough to me, in some cases it jumps back to deftest without the testing, I think this is actually related to assert-expr rather than a true failing test.#2018-04-1515:14dominicmI've run into an "issue" with *out* during tests. Is anyone able to confirm what I've tried to puzzle out about emacs here: https://github.com/SevereOverfl0w/vim-replant/issues/9 ? I tried looking for an open issue for this, and failed, which makes me think I'm missing something, surely the *out* is really important!#2018-04-1518:14bozhidarSome example to play with will help to narrow things down, as I’m not quite certain what exactly are you doing/trying to do.#2018-04-1518:19dominicmI'm thinking about the case where a test does something like (is (= 1 (do (println "calculcating 2") 2))). Currently that output is lost?#2018-04-1518:22dominicmFrom an nrepl level, it shows up before the test results do, so it's contextually lost. Compared with what happens when running clojure.test normally, this is a little different.#2018-04-1519:02bozhidar@mathpunk This evaluation is not really done by CIDER - it’s just a basic nREPL op. There shouldn’t be a difference in the evaluation and I’ve got no idea why you experience this problem.#2018-04-1519:17mathpunkThanks, I will take it to nREPL#2018-04-1519:09bozhidar@dominicm As you assumed - the output currently ends up in the REPL buffer. It was either this or popping some output buffer for each test run, and this seemed like an adequate solution for the time being.#2018-04-1519:15dominicm@bozhidar Interesting. I suppose solving this would be solved by making tests real-time also? https://github.com/clojure-emacs/cider/issues/696 as mentioned here.#2018-04-1519:39bozhidarYeah, it would.#2018-04-1519:41bozhidarI expected more people would be interested in this and someone would have solved it by now, but it turned out I was wrong. I know that if I was doing Clojure every day I’d certainly have fixed this myself. 🙂 For a big test suite the current behavior can be quite annoying.#2018-04-1519:43dominicmIn vim it is worse, the whole UI is locked up while tests run. Having this run real-time would be massively beneficial to me there.#2018-04-1520:52bozhidarI can imagine. I assume it won’t be hard to switch the evaluation of the tests to be reported individually and to just keep the same format for the final report data in the end. Something like this would also allow clients to show some progress indicators.#2018-04-1521:24dominicmI'll have a look into this on my next burst of work.#2018-04-1521:37bozhidar:thumbsup:#2018-04-1521:44Drew VerleeCan anyone take a guess why the require option on the ns macro wouldn't be able to detect something on the class path that the require function could find?#2018-04-1521:47Drew VerleeAsking here because I'm so confused that I'm worried this might have something Todo with cider and nrepl.
I'm using deps + boot tools deps, then starting a repl via boot deps repl and connecting to it with cider#2018-04-1521:48dpsuttonDoes it work at a repl without cider involved? Seems like an easy test to try#2018-04-1521:49dpsuttonBut straightforward code evaluation isn't much affected by CIDER#2018-04-1522:03Drew VerleeThe require function works at the repl didn't try the ns macro.#2018-04-1600:31Drew VerleeWhat does this mean?
> CIDER can also inject a Clojure dependency into your project
From https://cider.readthedocs.io/en/latest/installation/#ciders-nrepl-middleware
What does it mean for Cider to inject a clojure dep into my project? Like, the cider client sends the running process code to use via the repl socket?#2018-04-1600:51dpsuttonI'm honestly not sure what you've tried. Are there simple steps that I could try to reproduce?#2018-04-1600:52dpsuttonCider uses clojure code to do its thing. To do this it needs its dependencies which it injects at Jack in or else you provide manually#2018-04-1601:05Drew Verlee@dpsutton Well the problem is that i can’t get cider to connect to a repl that works e.g evals expressions, finds the deps specified in deps.edn via :local/root
here is the project: https://github.com/drewverlee/try-boot
1) run clj -A:nrepl
2) from emacs run cider-connect
I get no port to connect to.
If i just run cider-jack-in i get a huge stack trace error that i’m not even sure how to copy paste because it appears in a window and this disappears 😞#2018-04-1601:05dpsuttonCheck in the messages buffer. Should be in there#2018-04-1601:06dpsuttonI'm not sure how polished or even implemented deps edn support is to be honest though#2018-04-1601:10dpsuttonAlso don't know if you need to provide cider nrepl and orchard dep as well. I know we don't merge that profile into the deps so I imagine you need to provide ciders requirements#2018-04-1601:26Drew Verleewhat is orchard dep?#2018-04-1601:28Drew Verleehttps://github.com/clojure-emacs/orchard#2018-04-1601:29dpsuttonThat's the guts of what cider does so that it can be decoupled from nrepl.#2018-04-1605:48bozhidar@drewverlee You can see exactly what’s the command line string that CIDER uses to start an nREPL server after invoking cider-jack-in. Nothing really special - it just adds a few deps, so you don’t have to add them to your projects.#2018-04-1605:49bozhidarHere’s a bit of explanations about orchard - https://github.com/clojure-emacs/cider-nrepl#reusable-core-logic#2018-04-1612:25Drew VerleeSo it seems that cider-jack-in, as far as i can tell, calls this:
/usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'
which throws an exception … [let me find the actual exception]
rting nREPL server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate refactor_nrepl/middleware__init.class or refactor_nrepl/middleware.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
I see where cider is invoking this function: https://github.com/clojure-emacs/cider/blob/18a5f10021a70134310f367547c4c750e1acedba/cider.el#L529
But i’m not sure where all the deps come from, which would be useful because maybe i can adjust some of these deps. Sayid strikes me as a odd dep to include by default, so i assume thats coming from configuration i added but i can’t tell where.#2018-04-1612:45dominicmI think there's a bug where dependencies aren't added, not sure what the status of that was though. I noted it a little while ago.#2018-04-1612:42Drew Verleedoes running clj -sDeps add to the existing deps files? Other wise i’m confused about how cider running that command would achieve the desired effect as it wouldn’t pick up the deps needed for the project. Clearly it does work, so i have a misconception somewhere.#2018-04-1612:44dominicmYes, it adds.#2018-04-1613:11bozhidarYou certainly don’t need sayid or refactor-nrepl to be using CIDER. That’s certainly not coming from CIDER - likely you’ve got clj-refactor.el installed and its injecting those.#2018-04-1613:25Drew Verlee@bozhidar Can you help me understand where i can look to see if its installed?#2018-04-1613:28Drew VerleeAsking because i can’t seem to track down where this could come from:
my spacemacs config file doesn’t mention it. I dont think its in my emacs folder and i’m not sure how to search emacs for it.#2018-04-1613:44dominicmThose plugins are installed by spacemacs.#2018-04-1613:46benedekI just recently accepted a PR adding support for clj in refactor-nrepl#2018-04-1613:46benedekIf memory serves right#2018-04-1613:49benedekWell Kinda related. @mbuczko contributed it#2018-04-1613:54bozhidar@benedek That’s different.#2018-04-1613:55benedekCould be#2018-04-1613:55bozhidar@drewverlee is having issues with the command generated by cider when refactor-nrepl is around. As I’m not familair with him setup I’m puzzled by what’s going on there - seems he’s getting some extra deps added and clj is blowing up.#2018-04-1613:55benedekSayid is not done by clj-refactor tho#2018-04-1613:56bozhidar@drewverlee You can use package-list-packages to see what’s installed. If you’re using Spacemacs I guess you can take a look at its Clojure layer or whatever.#2018-04-1613:56bozhidarProbably it’s being added in Spacemacs…#2018-04-1613:56benedekEverything injects its own deps#2018-04-1613:56bozhidarNo idea what they’ve put there.#2018-04-1613:56benedekSo they should have sayid installed too#2018-04-1613:57dominicmLook at the CLI, refactor-nrepl and sayid are not being injected as a dependency, only as middleware#2018-04-1613:57benedekStrange that refactor-nrepl is not availabe acc. To the error#2018-04-1613:57benedekAh ofc @dominicm#2018-04-1613:57dominicmI think the integration with the clojure tools is incomplete.#2018-04-1613:58benedekSeems so. Good catch#2018-04-1613:58dominicmI mentioned this in a thread earlier, should have sent to channel also#2018-04-1613:59benedekSo perhaps the clj integration is not using a var it should in CIDER?#2018-04-1614:01dominicmthat's correct. I flagged this up a while ago I think.#2018-04-1614:16bozhidarThe problem is that the “real” integration relies on a lein-specific variable (namely plugins).#2018-04-1614:17bozhidarI’ve addressed @dominicm’s feedback actually (it was about the middleware stack), but as far as the deps go - it’s a bit of a mess.#2018-04-1614:17bozhidarI have to see what exactly is getting appended where.#2018-04-1614:22mccraigmccraigi tried out the latest [cider/cider-nrepl "0.17.0-SNAPSHOT"] @bozhidar - when i cider-connect to a terminal app i'm now getting logging both on the terminal and in my cider-nrepl buffer. is it possible to stop the logging to the cider-nrepl buffer entirely, leaving only the terminal logging (i find logging to the emacs buffer mostly just obfuscates my repl session) ?#2018-04-1614:25bozhidarIt’s tricky currently - that’s why I wanted to make this configurable, but didn’t have time for it.#2018-04-1614:30bozhidar@benedek I see the deps are dynamic, but I’ve hardcoded cider’s middleware as normally it comes from the odd lein plugin variable. Could it be that clj-refactor.el is actually updating it?#2018-04-1614:31benedekI think it adds to it#2018-04-1614:32benedekIf that is what you asking#2018-04-1614:32bozhidarYeah, that’s what I asking.#2018-04-1614:32benedekJust like sayid#2018-04-1614:32benedekAnd probably other plugins#2018-04-1614:33bozhidarOK, then I know how to fix this, but it seems to me we should change this to be have a separate notion of deps and lein plugins, as this is just confusing on boot, clj, etc.#2018-04-1614:33benedeksry i am confused now a bit#2018-04-1614:33benedekI thought we had separate things for those#2018-04-1614:34bozhidarWe’ve got two vars - jack-in-deps and jack-in-plugins. Seems all extensions are adding their middleware deps to the plugins var, which is currently ignore by some of the code (I thought this was lein specific).#2018-04-1614:36benedekOk well#2018-04-1614:37benedekProbably as you flagged already the name could be improved#2018-04-1614:56bozhidarhttps://github.com/clojure-emacs/clj-refactor.el/commit/b2304321c36275c54fea40560af470f9dc8de31f#diff-ad8315941dfda54547f9762bd5a52d04R4028#2018-04-1614:57bozhidarThat’s where the problem is coming from.#2018-04-1614:58bozhidarI can fix this temporary by merging the plugins with the deps for clj, but I definitely think we should do something different and consider those plugins only for lein. Unfortunately this would mean we have to subtract the plugins from the deps for lein, but I guess that’s not a big deal.#2018-04-1615:36dominicmThis is the data shape I came up with: https://github.com/clojure-vim/vim-jack-in/blob/master/plugin/jack_in.vim#L9-L16#2018-04-1615:37dominicmlein:: Needs special plugin
boot:: Explodes sequences and assumes they are all middleware
clj/`cider.main`:: Same as boot#2018-04-1615:43dominicm(Hoping to inspire you!)#2018-04-1616:21dominicmAlso - that isn't tested against sayid, which might be "weird"#2018-04-1616:47bozhidarI like the idea actually! That way we can stuff everything in the same list and just transform it accordingly for different tools.#2018-04-1617:09dominicmMy only maybe regret is that 'version' doesn't support tools.deps.alpha style dependencies, so git dependencies don't work. Hasn't been a problem so far, but I could see it eventually coming up.#2018-04-1617:25dominicm@bozhidar pr ready for review again#2018-04-1617:25dominicmOn mobile now#2018-04-1619:35bozhidar@dominicm Everything looks good. The failures seem like some Travis issue, I’ll rerun the build.#2018-04-1619:43Drew VerleeJust checking in on this, is there anything I can do help? Is there a ticket open somewhere where i can follow the changes? In case its not clear, i’m asking about the cider deps/clj integration.
I get the impression everything isn’t wired up yet. Which is cool as i might be able to help. I assume this is a fairly request feature?#2018-04-1620:17arrdemI’m gonna try to get to fixing my cider-nrepl changeset tonight. Sorry this has been so slow.#2018-04-1620:18arrdemI really wanna rewrite the cider-repl.el to use separate markers for every REPL session. Right now all output gets interleaved in the most current eval result’s space.#2018-04-1620:18arrdemBut maybe that doesn’t make sense.#2018-04-1620:19bozhidar@drewverlee Just committed a fix for this.#2018-04-1620:22bozhidar@arrdem But how can we separate this? The output goes to whatever has been determined to be the current connection/repl.#2018-04-1620:25arrdem@bozhidar it may not make sense - I think about CIDER as a code execution server, not a straight REPL. It’d be interesting to track nREPL request / response IDs and try to maintain a mapping from nREPL requests to “windows” in the buffer where results (output, print, etc.) go.#2018-04-1620:26arrdemRather than just maintaining one “end of buffer” to insert to which is what happens now.#2018-04-1620:29arrdemThe main effect would be that printing from threads would go to “old” eval “windows” not the current one#2018-04-1620:29arrdemwhich may or may not be desirable depending on how you think about it.#2018-04-1620:30bozhidarI see. Well, that makes sense and it should be hard to implement. I don’t what else it’d affect apart from output from evaluations that happened before the “effective” connection got changed.#2018-04-1620:37dominicmShould or shouldn't?#2018-04-1705:20bozhidarShouldn’t.#2018-04-1707:03bozhidarBtw, @dominic did some outstanding job extending the test filter support in cider-nrepl and I’ve just updated the code in CIDER to make use of the improve middleware capabilities. Now you can select multiple include/exclude filter selectors when running tests via CIDER.#2018-04-1716:16tianshuIt's likely if cider-shadow-cljs-command is npx shadow-cljs (default value), in cider-jack-in it will use npx, not npx shadow-cljs. and this will cause an error.#2018-04-1716:22tianshunot sure if it's my own issue, it's wired behavior#2018-04-1717:28bozhidar@doglooksgood I don’t quite follow. Why would this happen?#2018-04-1717:30bozhidarAh, now I see what you mean. We’re using just resolved command without its second part.#2018-04-1717:41richiardiandreaI have this problem with latest cider, in the REPL, I can do:
> (require '[clojure.spec.alpha :as s])
nil
#2018-04-1717:46richiardiandreanever mind#2018-04-1718:09bozhidar@doglooksgood Fixed on master.#2018-04-1720:36xiongtxI’m running into an issue where the cljs REPL dies after C-c C-c and reverts to being a clj REPL. Anyone else encounter this?#2018-04-1720:54dpsuttona long time ago it was a bug where a session and connection got out of sync.#2018-04-1720:55dpsuttonthe status is in the "done" response to an op. what op are you doing that it returns with the new erroneous repl type?#2018-04-1720:59dpsuttonback in the day it would use the cljs connection but would remember the clj session id so that it would get clj stuff back and the middleware would report that this connection was a clj connection#2018-04-1721:08bozhidar@xiongtx Monitor the message coming from track state. Might be mistaken case of identity there. Lately I’ve been wondering if we should track the REPL type via the middleware at all.#2018-04-1721:08dpsuttonare you using shadow-cljs by any chance?#2018-04-1721:21xiongtxNo#2018-04-1721:08bozhidarThe only useful case for this I can think of is cider-connect, but even then you’d need to do at least one eval for the middleware to kick in.#2018-04-1721:34xiongtxOh, I didn’t have the browser window open#2018-04-1721:34xiongtxSo I guess it never connected to cljs ¯\(ツ)/¯#2018-04-1721:45dpsuttonHaha mystery solved#2018-04-1806:06bozhidar@bhauman @thheller In a burst of unexpected productivity (and because of a dumb mistake of mine) - piggieback 0.3 is now out and it uses the updated ns cider.piggieback for consistency with the new artefact coordinates.#2018-04-1806:08bozhidarI’ll leave it up to you to decide if you want to be doing some ns check for 0.2 and 0.3, but I’ve decided to skip this, as for end users it’s just a matter of updating one dependency. I’ll add some big warning about this in the release notes for CIDER 0.17. Plus this will certainly drive up the adoption of the new piggieback. 😄#2018-04-1806:09bozhidar0.3 also drops support for rhino, as discussed in the past, so now the codebase is quite simpler.#2018-04-1806:31dominicm@bozhidar I think you just broke fireplace... Which uses rhino by default to provide functionally when you haven't done anything yet. And has the namespace hard coded.
Does this release have a different co-ordinate? Does CIDER have a default environment it connects to?#2018-04-1806:35bozhidarYes - it’s cider/piggieback now.#2018-04-1806:36bozhidarNo, CIDER prompts the user for the environment to use. vim-fireplace should just switch to the much better nashorn I guess. It’s pretty much a drop in replacement.#2018-04-1806:37dominicmTpope can be quite conservative, I wonder how hard it will be to convince him to drop those java versions.#2018-04-1806:38bozhidarWell, piggieback doesn’t support them anyways, so there’s little point in him supporting them.#2018-04-1806:39dominicmHe might just say he doesn't support cider piggyback... What are the fixes/improvements?#2018-04-1806:39bozhidarcider-nrepl will also stop support JDK 7 after the upcoming release, and in general I plan the same for nREPL once I have time to work on the long overdue 0.3 release.#2018-04-1806:40bozhidarI guess that’s the highlight https://github.com/clojure-emacs/piggieback/pull/80#2018-04-1806:40bozhidarEverything else is cleanup at this point.#2018-04-1806:41dominicmI don't understand the problem/benefit of that change?#2018-04-1806:42dominicmOh, faster. Okay.#2018-04-1806:42bozhidarEach eval used to spin a new repl which was quite inefficient.#2018-04-1806:42bozhidarAnyways, if he wants to do some changes - fine, if not - I don’t have time to deal with irrational people.#2018-04-1806:43dominicmI've got some time before I start work, I'm going to go take a stab at this.#2018-04-1806:43bozhidarI’m committing so much of my little free time for those projects, that I can’t deal with upgrade paths and stuff like this all the time.#2018-04-1806:44bozhidar(I thought of making CIDER work with the old and new version, but I decided I have more important things to do)#2018-04-1806:44dominicmIt took 6 months for my pprint pr to merge, so I'm not hopeful, but maybe he's looking at this a bit more now.#2018-04-1806:45bozhidarAlso I could have made Rhino just an alias for Nashorn and no one wold have noticed, but again - this seemed like a waste of time.#2018-04-1806:45bozhidarWow!#2018-04-1806:45bozhidarYou should join the Dark Side - as you can see the Emacs maintainers are quite responsive. 😉#2018-04-1806:46dominicm> cider.piggieback :as pback
you're all monsters.... ;)#2018-04-1806:46bozhidar(not to mention that 10 people are admins on clojure-emacs - we’ve got some very real democracy)#2018-04-1806:48dominicmI'm planning on taking on/replacing fireplace eventually. My replant plugin augments it currently, using it to manage sessions and connections. I've got a second person actively contributing, and others seem to be picking up interest. There is the clojure-vim group where there's a few of us, but that's not yet connected to replant.#2018-04-2015:52pablorewhat about AcidVim?#2018-04-2016:13dominicmWhat about it? 😛#2018-04-2016:24pabloreMaybe it would be worth working on top of that instead of fireplace. The only problem would be that Acid only works on neovim#2018-04-2016:26dominicmAcid had some novel ideas, but I don't know that it was ever sufficiently mature.#2018-04-2016:27dominicmIt could happen though, but I don't personally actively use acid.#2018-04-1807:09bozhidarMight be good for the vim community. Seems tpope has lost interest in the project to some extent. I guess he’s not open to sharing ownership of the project?#2018-04-1807:14dominicmNo idea. ¯\(ツ)/¯#2018-04-1807:15dominicmHe's a pretty busy guy, lots of vim plugins, high standards. He has made some commits over the weekend since my PR, some of them tidying up my pprint code.#2018-04-1807:25manuelhi, with latest CIDER from MELPA I get:
Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
A) not providing piggieback as a dependency and/or
B) not adding piggieback middleware into your nrepl middleware chain.
This is what I have in my project.clj, under :profiles:
{:dev
{:dependencies [[binaryage/devtools "0.9.9"]
[cider/piggieback "0.3.0"]
[day8.re-frame/re-frame-10x "0.2.1-react16"]
[figwheel-sidecar "0.5.14"]
[org.clojure/tools.nrepl "0.2.10"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
:plugins [[lein-figwheel "0.5.14"]]}}
Am I missing something?#2018-04-1807:35manuelOh wait, could it simply be that latest master is not on MELPA yet and I am to eager to live on the bleeding edge? 😄#2018-04-1807:42bozhidar@manuel I’m also reasonably certain @bhauman has to cut a new release of figwheel that’s compatible with the new piggieback (basically it has to know of the new namespace).#2018-04-1807:45manuelok cool#2018-04-1808:00dominicm@bozhidar I don't suppose this looks familiar?
javax.script.ScriptException: TypeError: Cannot load script from .cljs_nashorn_repl/goog/undefined in <eval> at line number 1
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
at cljs.repl.nashorn$eval_str.invokeStatic(nashorn.clj:46)
at cljs.repl.nashorn$eval_str.invoke(nashorn.clj:45)
at cljs.repl.nashorn$load_ns.invokeStatic(nashorn.clj:97)
at cljs.repl.nashorn$load_ns.invoke(nashorn.clj:96)
at cljs.repl.nashorn.NashornEnv._load(nashorn.clj:159)
at user.Delegatingcljs_repl_nashorn_NashornEnv._load(Unknown Source)
at cljs.repl$load_namespace.invokeStatic(repl.cljc:223)
at cljs.repl$load_namespace.invoke(repl.cljc:179)
at cljs.repl$load_dependencies.invokeStatic(repl.cljc:229)
at cljs.repl$load_dependencies.invoke(repl.cljc:225)
at cljs.repl$evaluate_form.invokeStatic(repl.cljc:512)
at cljs.repl$evaluate_form.invoke(repl.cljc:452)
at cljs.repl$evaluate_form.invokeStatic(repl.cljc:459)
at cljs.repl$evaluate_form.invoke(repl.cljc:452)
at cider.piggieback$eval_cljs.invokeStatic(piggieback.clj:214)
at cider.piggieback$eval_cljs.invoke(piggieback.clj:213)
at cider.piggieback$do_eval.invokeStatic(piggieback.clj:238)
at cider.piggieback$do_eval.invoke(piggieback.clj:221)
at cider.piggieback$evaluate.invokeStatic(piggieback.clj:261)
at cider.piggieback$evaluate.invoke(piggieback.clj:259)
at clojure.lang.Var.invoke(Var.java:381)
at cider.piggieback$wrap_cljs_repl$fn__17019$fn__17021$fn__17022.invoke(piggieback.clj:290)
at cider.piggieback$enqueue$fn__16999.invoke(piggieback.clj:196)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4190.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: <eval>:1 TypeError: Cannot load script from .cljs_nashorn_repl/goog/undefined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
at jdk.nashorn.internal.runtime.Context.load(Context.java:868)
at jdk.nashorn.internal.objects.Global.load(Global.java:1545)
at jdk.nashorn.internal.scripts.Script$Recompilation$21$34A$\^eval\_.nashorn_load(<eval>:1)
at jdk.nashorn.internal.scripts.Script$Recompilation$38$51AA$\^eval\_.CLOSURE_IMPORT_SCRIPT(<eval>:1)
at jdk.nashorn.internal.scripts.Script$Recompilation$201$189AA$\^eval\_.require(<eval>:19)
at jdk.nashorn.internal.scripts.Script$493$\^eval\_.:program(<eval>:1)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
#2018-04-1808:00dominicmthat was longer than I expected...#2018-04-1808:01bozhidarNo, it doesn’t seem familiar.#2018-04-1808:05bozhidarPerhaps you’re not using the right clojurescript or something?#2018-04-1808:08dominicmI'm on 1.9.x#2018-04-1808:12bozhidarHmm, I’m puzzle this. In piggieback there’s no nashorn specific code - it just delegates to cljs#2018-04-1808:13bozhidarhttps://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl/nashorn.clj#2018-04-1808:13bozhidarAnd that’s the case for all cljs repls.#2018-04-1808:16bozhidarhttps://github.com/clojure-emacs/piggieback/blob/master/src/cider/piggieback.clj#L162#2018-04-1808:20bozhidarI’ve tested it myself and it works just fine.#2018-04-1808:20bozhidarRan this code to start a cljs repl
(do (require 'cljs.repl.nashorn)
(cider.piggieback/cljs-repl
(cljs.repl.nashorn/repl-env)))#2018-04-1808:22dominicmSo that bit seems to work fine, but then when I run :Eval (+ 1 1) (which I think sends (ns edge.main) (+ 1 1)) I get 💥#2018-04-1808:23bozhidarFor me the rest works as well, so it must be something with the way vim communicates with nrepl.#2018-04-1808:23bozhidarAlthough the message for clj and cljs eval should be exactly the same.#2018-04-1808:24dominicmthe message is quite suspect, about what it's trying to load... :thinking_face:#2018-04-1808:30bozhidarI guess you can try on a simpler project? Edge is fancy! Might be something unrelated.#2018-04-1808:31bozhidarI’ve got just one demo project with only the bare minimum deps and I usually test cider against it, (which is what I did right now)#2018-04-1808:31dominicm@bozhidar have you got a link I can use for that?#2018-04-1808:31dominicmEverything I have is boot or deps.edn.#2018-04-1808:31dominicmboot doesn't support the cider.piggieback yet#2018-04-1808:32bozhidarYou can simply use piggieback as well.#2018-04-1808:32bozhidarI haven’t committed the other one, but I guess I should do it.#2018-04-1808:33bozhidarDoes boot have to know something about piggieback? Lein certainly doesn’t.#2018-04-1808:33dominicmboot-cljs-repl knows about piggieback, yep#2018-04-1808:33dominicmhttps://github.com/adzerk-oss/boot-cljs-repl/blob/master/src/adzerk/boot_cljs_repl.clj#L115-L116#2018-04-1808:35dominicm@bozhidar the piggieback project itself wouldn't work because there's no cljs there.#2018-04-1808:36bozhidarAre you sure about this? 🙂 Try lein with-profile 1.9 repl.#2018-04-1808:37bozhidarWe can’t really run its tests without cljs.#2018-04-1808:37dominicmhttps://github.com/clojure-emacs/piggieback/tree/master/src/cider it's all clj files?#2018-04-1808:37dominicmOh, fireplace works way different to how you're thinking#2018-04-1808:37bozhidarYep.#2018-04-1808:37dominicmI need to have a .cljs file open, to be in the context of cljs. There's no "REPL Buffer"#2018-04-1808:38bozhidarOh, got it. I just started some repl buffer and did some evaluations in it.#2018-04-1808:38bozhidarYou really need to become an Emacs user! Life without a repl is…#2018-04-1808:38bozhidar😉#2018-04-1808:42dominicmhehe. I have something "close enough".#2018-04-1808:42dominicmfwiw, I'm getting the same issues with the mies lein template.#2018-04-1808:48dominicmd4:code41:(ns cljs.user (:require hello-world.foo))2:id30:fireplace-bianca2-1524041215-92:ns9:cljs.user2:op4:eval7:session36:4fac591c-e5d0-4c02-8b96-9b22c834493ae this is what's blowing up#2018-04-1808:50dominicmd4:code49:(ns cljs.user (:require hello-world.foo :reload))2:id31:fireplace-bianca2-1524041215-132:ns9:cljs.user2:op4:eval7:session36:5d429fe2-7588-4383-af14-677724f03ac0e <-- blows up too#2018-04-1808:57dominicm@bozhidar I can reproduce without fireplace, if you open a cljs repl, and use REPL-y (basically, use lein repl).
user=> (require 'cljs.repl.nashorn)
nil
user=> (cider.piggieback/cljs-repl (cljs.repl.nashorn))
CompilerException java.lang.ClassNotFoundException: cljs.repl.nashorn, compiling:(/tmp/form-init7664251244487051022.clj:1:29)
user=> (cider.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))
To quit, type: :cljs/quit
nil
cljs.user=> (ns cljs.user (:require hello-world.foo))
<massive exception from above>
#2018-04-1808:59dominicmlein update-in :dependencies conj '[refactor-nrepl "2.4.0-SNAPSHOT"]' -- update-in :repl-options:nrepl-middleware conj refactor-nrepl.middleware/wrap-refactor -- update-in :dependencies conj '[cider/piggieback "0.3.0"]' -- update-in :repl-options:nrepl-middleware conj cider.piggieback/wrap-cljs-repl -- update-in :plugins conj '[cider/cider-nrepl "0.17.0-SNAPSHOT"]' -- repl <-- my repl start command.#2018-04-1809:01dominicm@bozhidar this might be a general nashorn bug, rhino still works with cider.piggieback.#2018-04-1809:01dominicmoh, it doesn't beyond the (ns …) form 😂#2018-04-1809:02dominicmit works for a single evaluation, 😔 okay#2018-04-1809:02bozhidarInteresting.#2018-04-1809:02bozhidarWhat works for a single evaluation - nashorn?#2018-04-1809:03dominicmrhino works for a single evaluation, and subsequent ones fail: java.lang.RuntimeException: No Context associated with current Thread#2018-04-1809:03bozhidarI deleted a lot of code to support rhino - I’d be really surprised if it worked without it. 😄#2018-04-1809:04dominicmI had wondered if it was support for "legacy rhino", I was also just curious#2018-04-1809:04bozhidarBut does something like (+ 1 1) for you in nashorn? It sure works for me.#2018-04-1809:05bozhidarAs for rhino - it hasn’t been updated in many years in the jdk, they just decided to replace it with something else. So the only rhino is the legacy one.#2018-04-1809:05dominicmby legacy rhino, I meant the cljs.repl.rhino aspect.#2018-04-1809:06bozhidarAFAIK the engine itself is the reason why the cljs support for it was so fucked up.#2018-04-1809:06dominicm(+ 1 1) works in nashorn, but not the (ns …) thing#2018-04-1809:10dominicmcljs.user=> (ns cljs.user (:require hello-world.foo)) ;; :boom:
cljs.user=> (ns cljs.user (:require cljs.core hello-world.foo)) ;; fine
#2018-04-1809:26bozhidarHmm, so it seems you found some clojurescript bug then. 🙂#2018-04-1809:32bozhidarOr perhaps the two of us know nothing about cljs - I’m reasonably certain that’s true for me. 😄#2018-04-1809:37dominicm@bozhidar I think this is still a piggieback bug, doesn't happen when using nashorn directly#2018-04-1809:38dominicmhttps://github.com/swannodette/mies using mies, modify the scripts/repl.clj to require nashorn :as node, and then run ./scripts/repl, and the above thing which throws using nrepl, is fine.#2018-04-1810:11bozhidarInteresting.#2018-04-1810:11bozhidarI wonder if it’s something to do with https://github.com/clojure-emacs/piggieback/pull/80#2018-04-1810:22dominicmmaybe#2018-04-1810:23bozhidarCan you try with 0.2.2 before we made this change?#2018-04-1810:25dominicm0.2.2 works#2018-04-1810:25dominicmuser=> (require 'cljs.repl.nashorn)
nil
user=> (cemerick.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))
To quit, type: :cljs/quit
nil
cljs.user=> (ns cljs.user (:require hello-world.foo))
true
cljs.user=>
#2018-04-1810:32bozhidarDamn, now we have our answer then. Can you please file a ticket and ping @bhauman there. I guess he knows how to fix this, as unlike me he actually knows cljs. 🙂#2018-04-1812:37bhaumanI'm looking at this now.#2018-04-1812:46bhauman@dominicm what version of clojurescript are you using?#2018-04-1812:47dominicm1.9.946 was what I used in mies#2018-04-1812:47bhaumancool#2018-04-1812:48dominicm(require
'[cljs.repl :as repl]
'[cljs.repl.nashorn :as node])
(repl/repl (node/repl-env))
^^ with this as scripts/repl.clj#2018-04-1812:48bhaumanthat shouldn't matter right?#2018-04-1812:49bhaumanthis is about nashorn loading scripts#2018-04-1812:49bhaumanoh nashorn as node#2018-04-1812:49bhaumangotcha#2018-04-1812:52dominicmSorry, I was lazily attempting to give my instructions for updating the mies template#2018-04-1812:56bhaumanso this works for me (ns hello.there (:require [goog.object :as bobj]))#2018-04-1812:57dominicmwrong person, but yeah. I think it's potentially specific to cljs.user#2018-04-1812:58bhaumanI just did this (ns cljs.user (:require hello-world.foo)) and got the right response#2018-04-1812:58bhaumanclojure.lang.ExceptionInfo: No such namespace: hello-world.foo, could not locate hello_world/foo.cljs, hello_world/foo.cljc, or JavaScript source providing "hello-world.foo" in file <cljs repl> {:tag :cljs/analysis-error}#2018-04-1812:59dominicmoh, I added hello-world/foo.cljs too, just an empty ns#2018-04-1812:59dominicm(ns hello-world.foo)#2018-04-1812:59bhaumanin the repl or in a file?#2018-04-1812:59dominicmIn the file#2018-04-1813:00dominicmuh, that's of course hello_world/foo.cljs#2018-04-1813:08dominicm@bhauman is that reproducible now?#2018-04-1813:09bhaumanyep#2018-04-1813:09bhaumanits reproduced#2018-04-1813:10bhaumanalso (require 'hello-world.foo :reload)#2018-04-1813:11dominicmGreat 🙂#2018-04-1813:40bhaumanI've confirmed that it is my eval commit#2018-04-1814:45soulflyerSeeing a small oddity with cider-nrepl 0.17.0-SNAPSHOT from emacs. M-x cider-repl-set-ns no longer works for me, although it did yesterday. I get this message, even though I just started the repl by doing C-c M-j:
‘cider-repl-set-ns’ needs a ClojureScript REPL.
If you don’t know what that means, you probably need to jack-in (‘C-c M-j’).
Doing (in-ns 'whatever) works fine though, so this is not a show stopper.#2018-04-1815:43bozhidar@soulflyer Do you see this for a Clojure or a ClojureScript REPL?#2018-04-1815:43soulflyerclojurescript repl#2018-04-1815:44bozhidarDid you update piggieback?#2018-04-1815:45bhauman@bozhidar I have a fix for piggieback#2018-04-1815:46bozhidar@bhauman Great! What turned out to be the problem?#2018-04-1815:46bhaumandefault repl options needed to be calculated when operating outside of the repl#2018-04-1815:47bhaumanAFAIK requiring is the only place that its a problem and it really only needed an output-dir#2018-04-1815:48bhauman@bozhidar when neil took the basic deps out of the project.clj, do you know the thinking there? https://github.com/clojure-emacs/piggieback/commit/7f93cdbad2776233d890a952ee088de54420c8a4#2018-04-1817:06gonewest818I was mainly offline for a few days, inconvenient timing to say the least. Main motivation was to align the travis setup similar to orchard and cider-nrepl, and which includes configuring tests to run in a matrix of clojure versions (in this case 1.9 and a snapshot of 1.10) and jvm versions. Apologies for the disruption. I did express a doubt in the PR about pulling the deps. I should have lobbied harder to get eyes on it.#2018-04-1815:53soulflyer@bozhidar I tried updating piggieback, but was getting problems similar to ones @manuel mentioned earlier so rolled it back out again. I'm now on 0.2.2 from com.cemerick#2018-04-1815:56bozhidarWell, that’s the problem - cider doesn’t work with it anymore. You’re not getting errors, but it’s just not compatible.#2018-04-1815:58bozhidar@bhauman No idea. I thought he assumed they were something to be provided and moved them to the testing profiles. @gonewest818 You around?#2018-04-1816:47gonewest818Was traveling back from a meeting... not at all caught up on this thread.#2018-04-1815:58bozhidarI noticed the problems with this when I tried to run the tests today and they weren’t working without a profile, so I just left him a comment on GitHub.#2018-04-2418:35dpsuttonSince there are presumably lots of other beneficiaries of this#2018-04-2418:42dominicmAs a vim user, I'd be supportive of a tooling consortium#2018-04-2419:31arrdemI don’t have any objections to CIDER taking nREPL. I’ve chatted with Chas about it some recently and have commit on the python client - sounds like there are some architectural decisions he’s not happy with and it’s definitely not something he’s making time for anymore.#2018-04-2419:32arrdemWould you want to have Chas move the repo for link score reasons or is there something preventing you / us just forking it into CIDER?#2018-04-2419:32arrdemmuttering about prepl goes here.#2018-04-2419:35arrdemI think @dominicm already has some work on the Python nREPL client I’d like to take a poke at and try to get merged to whatever the new “official” owner is, even if that’s just the existing repo.#2018-04-2419:36dominicmI've stopped using his one, my one works better#2018-04-2419:36dominicmHis doesn't support negative numbers 😂#2018-04-2419:36arrdemYeah I noticed you’d patched it a bunch.#2018-04-2420:51dominicmThere's more than just my PR#2018-04-2419:36arrdemIt may be worth a wire protocol breaking nREPL 3.0 change to at least include some version format information on the wire to support future changes better..#2018-04-2420:52dominicmeval2 works for me?#2018-04-2420:52dominicmOr is that not what you mean?#2018-04-2420:51bozhidar> One thing is that I’m not sure this should be namespaced under cider or emacs.#2018-04-2420:52bozhidarI agree with the point about emacs, that’s why nothing in clojure-emacs is mentioning emacs anywhere. For me CIDER has has always been a cross-platform initiative, only the Emacs client happens to be Emacs-specific. 🙂#2018-04-2420:54bozhidarIn many ways clojure-emacs is something like a tooling consortium even know. 😄#2018-04-2420:54bozhidarAnyways, I’m not opposed to hosting this somewhere else, but this move felt natural after what we did with piggieback recently.#2018-04-2420:55dominicmI'm okay with it, the readme should clear it up though#2018-04-2420:55bozhidarFrankly, I dream of a vim-cider project one day. Seems fireplace is very far what I consider a proper Lisp programming environment. 🙂#2018-04-2420:56bozhidar> Would you want to have Chas move the repo for link score reasons or is there something preventing you / us just forking it into CIDER?#2018-04-2420:57bozhidarLink score and credibility. The project needs his blessing to succeed. And, of course, I don’t want to copy the tickets over. 🙂#2018-04-2420:57dominicmVimpire is probably more like what you would expect.#2018-04-2421:20bozhidarMaybe. I should play with it one of those days. Might give me some “inspiration”. 🙂#2018-04-2517:21mhcatheya - before I dig into my setup more, does this ring any bells with anyone? Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-slurp in this context
#2018-04-2517:22mhcatcan't jack-in#2018-04-2517:46dpsuttonthat's some recent stuff that @arrdem did to handle images in the repl. Can you try removing the dowloaded cider-nrepl artifacts in ~/.m2/repository/cider and try again?#2018-04-2517:48mhcatok - I'd already tried removing the cider-nrepl snapshot - I'd dump the rest#2018-04-2517:52mhcatdidn#2018-04-2517:52mhcatthat didn't help @dpsutton#2018-04-2517:52mhcatthanks for the suggestion though#2018-04-2517:59arrdemuhhhh#2018-04-2517:59arrdemin a meeting and can't help, sorry#2018-04-2518:01mhcatit's ok - turned out to be a frozen dependency on a slightly older cider-nrepl#2018-04-2518:01mhcatall is well now#2018-04-2518:01arrdemokay phew#2018-04-2518:02mhcat🙂#2018-04-2519:40madstaperror in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Retrieving refactor-nrepl/refactor-nrepl/2.4.0-SNAPSHOT/refactor-nrepl-2.4.0-20180410.152833-6.jar from clojars
Could not transfer artifact refactor-nrepl:refactor-nrepl:jar:2.4.0-20180410.152833-6 from/to clojars (): GET request of: refactor-nrepl/refactor-nrepl/2.4.0-SNAPSHOT/refactor-nrepl-2.4.0-20180410.152833-6.jar from clojars failed
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the ’http_proxy’ environment variable.
I'm getting this error when I try to jack in. Is this a known issue? I can download other dependencies via lein, but if I try adding refactor-nrepl as a plugin to a lein project it just hangs forever.#2018-04-2519:44bozhidarSeems like some problem related to fetching the dep. I guess you can just disable clj-refactor’s injection of dependencies.#2018-04-2519:45bozhidar(setq cljr-inject-dependencies-at-jack-in nil)#2018-04-2519:56madstapThanks, that worked#2018-04-2519:57bozhidarYou’re welcome!#2018-04-2521:14danielcomptonI'm very happy to announce that Clojurists Together is funding @bozhidar to work on CIDER for Q2 2018: https://www.clojuriststogether.org/news/q2-2018-funding-announcement/#2018-04-2521:14dpsuttonJust saw!#2018-04-2521:15dpsuttonWe need someone to volunteer or create a reference clojurescript project that we can develop against#2018-04-2521:18arrdemparty-corgi partywombat parrot#2018-04-2521:28richiardiandreaAwesome. Super Awesome.#2018-04-2523:54mikerod💯#2018-04-2600:15bozhidarThanks to @danielcompton and Clojurists Together for the support! I really appreciate it! I’ll do my best to push the needle in the right direction over the next 3 months. 🙂 cider#2018-04-2601:35xiongtx@bozhidar What kind of 🕰️ would you be able to spend on it next quarter?#2018-04-2602:31bozhidarI’ll be aiming for about a week per month.#2018-04-2602:47dpsuttonWhat's the best way for community to help you be more productive?#2018-04-2602:55bozhidarHelp with some of the tasks. 😉#2018-04-2602:55bozhidarLots of the things are relatively simple, so I think many people can help with those.#2018-04-2602:58bozhidarSome ideas would be appreciated as well. I’ve been wondering how to fix the connection management and I still don’t have great ideas. My best one so far has been to kill the dynamic conn dispatch completely and start from scratch there. One thing is clear - the current approach sucks. 😄#2018-04-2603:02dpsuttonI don't think you're sold on it but I think the double dispatch for cljc isn't a good idea#2018-04-2603:02dpsuttonBut that's one vote from me#2018-04-2603:03dpsuttonI've got a dispatch patch that I've been using that has made it better for me. I have had bad results with the last repl heuristic#2018-04-2603:08dpsuttonAre you going to focus on clj integration?#2018-04-2603:09dpsuttonMaybe I'm a minority in that but it's not a high priority for me :)#2018-04-2603:16bozhidarclj as the command? I think I already added whatever I planned about it. Apart from this - the whole jack-in codebase needs to be cleaned up and simplified.#2018-04-2603:19dpsuttonSounds good to me. I'm excited you get paid to work on this :)#2018-04-2603:25bozhidar> I don’t think you’re sold on it but I think the double dispatch for cljc isn’t a good idea#2018-04-2603:27bozhidarI’m ambivalent on the subject. Probably this should be configurable.#2018-04-2603:33richiardiandreaI will follow this closely and help as well whenever I can. I have a dream, use cider against Lumo, even if it is basically just sending forms a-la inf-clojure. Will see 🙂#2018-04-2603:40dpsuttonJust seems to simplify the code so much. Else everything has to work on all connections#2018-04-2603:40dpsuttonI'm also a little confused about things that have side effects. You wouldn't want those to run twice unless you really really meant it to#2018-04-2603:42dpsuttonYeah I would love if I could "cider lite" and just get convenient wrap of a repl#2018-04-2603:44richiardiandreaLumo for me has been a game changer, a fast REPL startup - scheme fast - seems nothing but changes lives 😃#2018-04-2603:45bozhidarWell, CIDER actually works without any middleware as well, but the experience there is pretty basic.#2018-04-2603:46richiardiandreaOh I thought you always had nRepl protocol in the way#2018-04-2603:46bozhidarFor someone like this to happen all that’s needed is a pure cljs implementation of the nREPL protocol, which shouldn’t be hard IMO.#2018-04-2603:46richiardiandreaAh yeah ;)#2018-04-2603:47richiardiandreaShadow has that and I could just adopt it I guess#2018-04-2603:47bozhidarYeah, nREPL is hard requirement, but the extra middleware is not. This means that something basic to replace the real nREPL can get you reasonably far.#2018-04-2603:47bozhidarI think shadow just uses nREPL normally.#2018-04-2603:48bozhidarBut it has its own cljs middleware instead of piggieback.#2018-04-2603:49richiardiandreaUhm ok#2018-04-2614:45bozhidarI’ve been thinking about connections and I’m leaning towards changing things in the following manner:
* the central object becomes a thingy called “connection-group”, which is basically a mapping of a project to a list of connections. Within a connection group there’s one default clojure and cljs connection which will be used to dispatch requests for this projects. You’ll have to explicitly decide which one is the default, but the last created connection for a project would become default normally.
* this would mean the end of the current static and dynamic dispatch, also the end of dual dispatch for cljc files, which was probably misguided indeed.#2018-04-2615:32richiardiandreaThis feels sensible. I was wondering whether you should also specify the transport layer (http/socket) and the protocol (nRepl/chars/prepl)#2018-04-2614:59mikerod@bozhidar so if in a cljs file and do something like cider-repl-set-ns it’d still know to use the cljs connection?#2018-04-2615:01mikerodI don’t know enough about what static/dynamic dispatch means I guess. Just trying to understand how it affects these sorts of behaviors#2018-04-2615:01bozhidarIn theory this should work even now. 😄 I don’t remember when was the last time I tried whether this is truly the case, though.#2018-04-2615:01mikerodCider seemed to be able to run various commands in the “repl I expect” fairly often as it is#2018-04-2615:02mikerodWhen I’m in a cljc buffer, I think cider-eval-buffer always sends to the clj repl#2018-04-2615:02mikerodwhen I’m in a cljs buffer though, the commands all send to the cljs repl (when having both clj and cljs open)#2018-04-2615:02mikerodbut there are others#2018-04-2617:44bozhidarWell, the problems currently happen mostly when you have multiple repls for the same project (e.g. 2 clj repls, etc). For cljc we actually eval everything in both repls if available, but at this point I believe this was probably a mistake.#2018-04-2617:45bozhidarIt seems better to just be able to quickly toggle between a clj/cljs connection in the context of a cljc buffer.#2018-04-2619:23richiardiandreaI like the former better for sure#2018-04-2619:47bozhidarEvaluating always in the two repls?#2018-04-2620:31richiardiandreaSorry the second, former latter always confuses me :)#2018-04-2620:32richiardiandreaSo the switch of context to be precise#2018-04-2620:01arrdem@bozhidar maybe my use case is weird, but if there’s a concept of connection groups it’d be nice to be able to send the same request to multiple REPLs in one go.#2018-04-2620:02arrdemEg if I just want to load-file, being able to tee that request to many targets would be nice - see programming against a remote nREPL#2018-04-2620:04bozhidarI see. So you’re basically proposing that instead a default connection in the group, we should have “target connections” or something like this.#2018-04-2620:06arrdemThat’s at least how I think of it.#2018-04-2620:07arrdem(sorry for the @, I forgot about the time offset)#2018-04-2620:46bozhidar@arrdem No worries. I’m in Mexico. 😉#2018-04-2620:46bozhidarI see we’re in the same TZ now. 😄#2018-04-2620:47dpsuttonI'm just thinking of the error handling across 4 repls. Keeping track of which one is in a busted state, which ones succeeded etc#2018-04-2620:48dominicm@arrdem I've come to the policy that @ is always fine, most use do not disturb in slack#2018-04-2620:48dpsuttonBut I don't have the same use case as arrdem. Maybe I would feel different if I had that use case#2018-04-2620:58bozhidar@dpsutton Well, that’s the beauty of his idea - you either do it or not. You get to decide how many REPLs to use simultaneously.#2018-04-2620:58bozhidarI guess most people would just use 1.#2018-04-2620:58arrdem@dpsutton argh yeah if one has an error and the others don’t that’s gnarly… but that’s the user’s problem not CIDER’s?#2018-04-2620:59arrdemJust aggregate all the responses to a single REPL 😉#2018-04-2712:45manuelhi guys, question: is it already possible to switch to cider/piggieback as explained in the manual (https://cider.readthedocs.io/en/latest/up_and_running/)?#2018-04-2713:44dominicm@manuel yep#2018-04-2713:46manuelok thanks, I'll try asap and come back if I have problems.#2018-04-2713:48bozhidarJust see if @bhauman has cut a version of figwheel supporting it yet. He added recently support on master, but I don’t know if some stable release happened afterwards.#2018-04-2713:49bhauman@bozhidar @manuel 0.5.16-SNAPSHOT#2018-04-2713:49manuelgreat#2018-04-2715:22manuelfantastic, using latest snapshot from @bhauman makes everything work smoothly. Thanks again.#2018-04-2716:14bozhidarGreat!#2018-04-2719:19bhauman@bozhidar I'm going to do a bit of piggieback tweaking, specifically I'm going to respect some of the cljs repl-options like :caught :wrap#2018-04-2719:20bhaumanand I might add one called :caught-warning#2018-04-2719:22bhauman@bozhidar also I think a huge win would be to parse file positions for cljs-compiler eval errors in a way that's helpful for cider.#2018-04-2719:23bhaumanI've already done the work for parsing file line column info from cljs compile syntax errors, and warnings#2018-04-2719:23bozhidarOh, yeah - that’d be amazing!#2018-04-2719:25bhaumanalso JavaScript Env runtime errors could work as well#2018-04-2719:26bozhidarBtw, in a similar line of thought - I was wondering what to do with https://github.com/clojure-emacs/cljs-tooling#2018-04-2719:27bozhidarI haven’t given it much thought it a while, but it has served us well for completion and var info for quite a while. Is this still the best way to go?
Should we fold this into orchard? Is someone using it outside of CIDER?#2018-04-2719:27bhaumanI'm using it!#2018-04-2719:27bhaumanI'd keep it as is#2018-04-2719:28bhaumanand add functionality to it#2018-04-2719:28bhaumanYou are wanting a unified API for CLJS and CLJ?#2018-04-2719:29bozhidarYeah, this was the original plan, but it’s maintainers stopped working on the project and it remained with just 2 functionalities out of the many that were planned (originally it was planned to support everything CIDER needed to match the CLJ functionality).#2018-04-2719:30bozhidarWell, I want the users to get a similar experience, an unified API would be a small bonus for me, but it’s not important. The underlying features, however, are quite important.#2018-04-2719:31bhaumangotcha#2018-04-2719:31bozhidarI just don’t know how far can this approach of inspecting the compiler state get us - I’m assuming for many things eventually we’ll have to evaluate some code, the way we do for Clojure.#2018-04-2719:32bhaumanthey really are different worlds#2018-04-2719:35bozhidarI figured as much. 😄#2018-04-2720:01richiardiandreaI have a WIP germ of a PR for porting cljs-tooling to self-host so I think it should stay#2018-04-2720:01richiardiandreaSelf-host has the cljs env available so that lib is awesome for lumo#2018-04-2720:02richiardiandrea(just a data point)#2018-04-2720:25clojerAdding a new library with , r a p crashes beginning with:
cljr--get-error-value: Error in nrepl-refactor: clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: sun.misc.Launcher, compiling:(mranderson048/alembic/v0v3v2/dynapath/v0v2v3/dynapath/defaults.clj:29:3)#2018-04-2720:29benedekAre you using java9 @clojer?#2018-04-2720:30clojerJava 10 actually#2018-04-2720:31benedekadd proj dependency is not supported in java9 unfortunately because of the changed class loader hierarchy in java9#2018-04-2720:31benedekHaha well since java9 then#2018-04-2720:31benedekNo workaround atm apart from downgrading to java8#2018-04-2720:32clojerGreat. Look like it’s Cursive then 😞#2018-04-2720:33benedekI investigated this a while back and we need to rewrite the feature essentially for java9 and above#2018-04-2720:34benedekAdd project dep is the killer feature for you? ;)#2018-04-2720:35benedekI mean rest of cider and clj-refactor should be fine with java9+#2018-04-2720:35clojerWell, I watched someone on YouTube using it and I thought …. I must have that.#2018-04-2720:36clojerSaves a lot of time not having to reload lein/repl.#2018-04-2720:36benedekHaha ok. Fair. Apart from riding the edge what keeps you on java10?#2018-04-2720:37clojerLearning new stuff. Always useful.#2018-04-2720:37benedekI know i use it a lot specially on newish projects#2018-04-2720:38clojerBut my Clojure project is picking up steam so maybe I’ll just drop back to Java 8.#2018-04-2720:38benedekWell as i said you have multiple OPTIONS: downgrade, use emecs wo / this particular feature, do PR for me ;)#2018-04-2720:38clojerI’m no expert but isn’t the new frequency of Java updates going to pose problems for Clojure?#2018-04-2720:38benedekAnd yeah cursive too#2018-04-2720:39clojerThis is where hosted languages become a pain.#2018-04-2720:40clojerI imagine something like Kotlin having an easier time with Java upgrades.#2018-04-2720:40benedekDon't think so. For prod projects the least as companies tend to be very conservative in upgrading. But don't think clojure as such has anything breaking in newer versions#2018-04-2720:41benedekAnd then clojurescript is ofc a completely independent story#2018-04-2720:41clojerNot so much breakage but not being able to take advantage of new features.#2018-04-2720:41benedekThis particular feature is a very specific corner case really#2018-04-2720:42benedekLike?#2018-04-2720:42clojerI mean does Clojure 1.9 even take advantage of Java 8's lambdas?#2018-04-2720:42benedekwhy should it?#2018-04-2720:43clojer… or it’s stream API?#2018-04-2720:43clojerI’m speculating but if Clojure functions were defined as Java 8 lambdas wouldn’t they gain something?#2018-04-2720:45benedekI may be wrong here but clojure is a functional language from the beginning with lambdas, anon fns and the like. Also with immutability and lazy seqs#2018-04-2720:46clojerAs time goes by I also imagine there will be parts of the new SDK which are defined in terms of the new Java features making them inaccessible to Clojure if it’s based on Java 8, no?#2018-04-2720:46benedekJava is catching up to all this in a sense (and all the stuff in scala ofc)#2018-04-2720:47benedekNow it is possible that the clj complier could/can benefit from new java features if they go deep enough eg. to a bytecode level#2018-04-2720:47clojerAlthough Clojure is functional, as you say, it’s implemented in Java classes as far as I’m aware and it’s creation predates Java 8 lambdas and streams so your typical Clojure function is probably a plain old Java class behind the scenes.#2018-04-2720:49benedekperhaps i am no @reborg to know the compiler internals on a friday night ;)#2018-04-2720:51clojerHehe. Gotta go now. Cheers.#2018-04-2720:51benedekNw#2018-04-2722:17bozhidar@clojer Clojure targets Java 6(!!!), so it’s not taking advantage of anything introduced in Java 7+.#2018-04-2722:17bozhidar@richiardiandrea Nice!#2018-04-2722:19richiardiandreait will be when finished 😅#2018-04-2722:19bozhidarLately I’ve been more interested in ClojureScript, therefore me wandering how we can improve the related libs.#2018-04-2722:21richiardiandreajust because you never know how it is going to end up, I opened a WIP PR there#2018-04-2722:22richiardiandrea(not working at the moment)#2018-04-2722:43bozhidar:thumbsup:#2018-04-2806:25arrdemAny ideas why emacs is barking that this is an invalid function?
(defun cider-repl-handle-external-body (type buffer _body &optional show-prefix bol)
(if-let* ((args (second type))
(access-type (nrepl-dict-get args "access-type")))
(nrepl-send-request
(list "op" "slurp" (nrepl-dict-get args "URL"))
(cider-repl-handler buffer)
(cider-current-connection))))
#2018-04-2806:32arrdemnvm found it#2018-04-2809:31arrdemThere are still some strange interactions between the images layer and the pretty-printers (the pretty printers win for what seem to be nREPL middleware ordering reasons), and the images as inserted into the REPL aren't propertized read-only which means you can insert whitespace and mess with their positioning by accident.#2018-04-2814:44tbaldridgeWith a disco Hunchback, because with a 4P with 4MLs every battle is party time.#2018-04-2814:45tbaldridgeSorry, had to comment, because that game is sucking up all my free time these days 😃#2018-04-2809:31arrdemSubmitted a second cider-nrepl PR which cleans up some bugs I managed to merge 😕 sorry about that.#2018-04-2809:32dominicmg'night 🙂 this looks really cool#2018-04-2813:59bozhidarI’ve merged @arrdem’s work so far, so more people can play with it.#2018-04-2814:00bozhidar@gonewest818 looking at his build failures it be really nice if elint provided some summary about all problems. It’s very hard to find those in the build log.#2018-04-2816:30arrdem@bozhidar thanks! super stoked to finally have this in, sorry it's taken so long.#2018-04-2817:35gonewest818@bozhidar agreed, we need a summary which files were flagged and which check(s) did not pass. At the moment developers need to search the log output for “FAIL” to see which files were flagged, and then manually inspect the block of lines immediately preceding to see which checks did not pass. It’s doable but not especially nice.#2018-04-2817:36gonewest818For example https://travis-ci.org/clojure-emacs/cider/jobs/372418538#L1110-L1160#2018-04-2817:38gonewest818In this example elisp-lint found multiple problems in cider-repl.el. First, the bytecompiler raised some warnings about unused lexical arguments and undefined functions. Second, checkdoc had issues with the formatting of some of the docstrings.#2018-04-2817:39gonewest818It would be nice if elisp-lint summarized at the tail of the log output something like:#2018-04-2817:41gonewest818elisp-lint summary:
In cider-repl.el,
bytecompile errors found
checkdoc failed#2018-04-2817:46gonewest818https://github.com/gonewest818/elisp-lint/issues/20#2018-04-2912:22bozhidar:thumbsup:#2018-04-2912:22bozhidarExactly! I saw the problems and decided that probably it’d be easier for me to fix those, while still giving people the chance to play with an exciting new feature.#2018-04-2912:24bozhidar@arrdem Thanks for working on this! Keeping in mind we’ve been talking about this since the days when CIDER was nrepl.el, I think you implemented this quite fast. 😄#2018-04-2912:32bozhidarBtw, I just fixed the warnings.#2018-04-2912:34bozhidarApart from the rough edges mentioned by @arrdem so far I think here’s one more small addition needed - if you evaluation some image producing code in a source buffer we can show the image in a dedicated buffer. I think that’d be cool and should pretty easy now when the ground work has been done.#2018-04-2916:02arrdemYeah we'll see what gets done today but I'm going to try and head off stardiviner at the pass and at least document a CIDER setup where my demo repeatably works.#2018-04-2916:03arrdemdefinitely want to get a tech blog post out of this work.#2018-04-3001:58stardiviner@arrdem That's great. Thanks. Looking forward to play with it. And will integrate it into Emacs Org-mode ob-clojure (or ob-clojure-literate) in later days.#2018-04-3002:30theeternalpulseWhen I evala quil sketch and I exit it, I get random messages that stall my input, in the emacs popup window I get a stream of
error in process filter: nrepl--dispatch-response: [nREPL] No response handler with id nil found
error in process filter: [nREPL] No response handler with id nil found
#2018-04-3002:31theeternalpulsewithout quitting the nrepl it sporadically shows that message and stalls my whole emacs#2018-04-3002:50bozhidar@theeternalpulse That’s a long standing bug, which I never had time to debug. Certain responses arrive without a matching request id and we don’t know what to do with them basically, as the callbacks are associated with the id request.#2018-04-3002:50bozhidarI think you should search for quil on our github issues - I recall other people reporting a similar problem in the past.#2018-04-3004:43theeternalpulseI instrumented that function in the debugger and one anomaly I've noticed is this
nrepl-client-filter(#<process nrepl-connection> "d2:id2:167:session36:a6306720-98db-4ce8-938c-83331e9f9fe15:value39:#'sandbox.graphics.star-field/starfielde")
it's adding an e to some functions in this log. I've gotten this with other functions as well at the start of the stack, all with e added#2018-04-3004:47theeternalpulsehmm, I guess that's a false lead, something must be adding that and it's getting past the client filter#2018-04-3006:14dominicm@theeternalpulse the e is part of the protocol to signify the end of a dictionary#2018-04-3007:37manuelhi, latest CIDER from MELPA gives me this upon C-c M-J: error in process filter: cider-cljs-repl-form: Symbol’s function definition is void: nil
Do you want me to file an issue?#2018-04-3011:13andrea.crottiah yes I have the same problem#2018-04-3011:14andrea.crottiI updated Cider this morning and with this config
(eval . (add-to-list 'cider-cljs-repl-types
`("Figwheel+Integrant"
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"))
it fails to jack-in-clojurescript
even though evaluating these things manually works and gives me a working cljs repl
the only error I see is cider-cljs-repl-form: Symbol's function definition is void: nil#2018-04-3011:19bozhidar@manuel @andrea.crotti The name is of the REPL type is now a symbol, not a string. That’s causing this error for you.#2018-04-3011:21bozhidarI’ve changed this, as it’s confusing/uncommon to be referring to things by string names in Elisp.
You should have used cider-register-cljs-repl-type instead - it has validation of the its args and would have given you meaningful error.#2018-04-3011:24bozhidar(eval . (cider-register-cljs-repl-type
'figwheel+integrant
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"))#2018-04-3011:25bozhidar(and you can also add this to your Emacs config, of course - that’s make this REPL type available to all your projects)#2018-04-3011:34manuelthis is my .dir-locals:
((nil
(cider-refresh-before-fn . "mount.core/stop")
(cider-refresh-after-fn . "mount.core/start")
(cider-default-cljs-repl . "Figwheel"))
(emacs-lisp-mode
(flycheck-disabled-checkers . "emacs-lisp-checkdoc")))
I need to change cider-default-cljs-repl, then?#2018-04-3011:35bozhidarYeah, it’s now named 'figwheel.#2018-04-3011:35bozhidarThat’s why you get the nil - the code is searching for “Figwheel” in a list where there is not longer such an entry.#2018-04-3011:36bozhidar"Figwheel" -> 'figwheel#2018-04-3011:38bozhidarI was writing some documentation a day or two ago and then I decided I should probably change this before 0.17 is released, as relatively few similar configs use strings.#2018-04-3011:42manuel((nil
(cider-refresh-before-fn . "mount.core/stop")
(cider-refresh-after-fn . "mount.core/start")
(cider-default-cljs-repl . 'figwheel))
(emacs-lisp-mode
(flycheck-disabled-checkers . "emacs-lisp-checkdoc")))
Restarted Emacs just to be sure: error in process filter: cider-cljs-repl-form: Symbol’s function definition is void: nil#2018-04-3011:58bozhidarTry removing the '. I think it’s not needed in the context.#2018-04-3012:00manuelthat was it! Thank you @bozhidar, problem solved.#2018-04-3012:01bozhidarYou’re welcome!#2018-04-3012:02bozhidarI guess I should add some validation for the type, so people get a meaningful error if doesn’t exist.#2018-04-3012:13andrea.crottiok great thanks @bozhidar#2018-04-3012:13andrea.crottibut then
(cider-default-cljs-repl . 'figwheel+integrant) this should work?#2018-04-3012:14bozhidar(cider-default-cljs-repl . figwheel+integrant)#2018-04-3012:14andrea.crottistill count not manage to start it until I removed that and selected the figwheel+integrant#2018-04-3012:14andrea.crottiahh ok thanks#2018-04-3012:15andrea.crottiand just to clarify this does new config doesn't work on older versions right? (but still on 0.17-)?#2018-04-3012:15bozhidarYes, on 0.16 the config is completely different.#2018-04-3012:16bozhidar(but hopefully under 0.17 there are going to be no more changes to this for the foreseeable future)#2018-04-3012:16andrea.crottiok cool just to know how to warn my colleagues#2018-04-3012:35bozhidarI’ve updated the ClojureScript section of the manual to cover all of this http://cider.readthedocs.io/en/latest/clojurescript/#2018-04-3012:36bozhidarI’m really hoping that 0.17 is going to happen very soon - at this point there are no major changes I plan to do myself, just some small refinements here and there. I’m hoping that @gonewest818 will soon wrap the exciting feature he’s been working on, and then we’d be good to go.#2018-04-3012:45bozhidarBtw, I’d love it if more ClojureScript devs reviewed this part of the manual and helped us to improve it. 🙂#2018-04-3013:44andrea.crottisure I can check if I spot any problem#2018-04-3013:44andrea.crottido you prefer github issues or just on this channel if it's something small?#2018-04-3017:21bozhidar@andrea.crotti The manual’s in GH, so feel free to just fire PRs for problematic parts.#2018-05-0114:16reefersleepDoes anyone know how to prevent the repl from prefixing maps with the namespace part of keywords?#2018-05-0114:16reefersleepe.g.#2018-05-0114:16dpsuttonthere's a clojure option for that#2018-05-0114:16dpsuttonlet me look it up#2018-05-0114:16reefersleep#:person{:age 15, :name “john”}#2018-05-0114:17reefersleepthanks @dpsutton. I find it quite annoying 🙂#2018-05-0114:17reefersleepAnd couldn’t find anything on google#2018-05-0114:17dpsutton*print-namespace-maps*#2018-05-0114:17dpsuttoni had to go the the jira ticket by bronsa#2018-05-0114:18reefersleepcheers 👏 how do you toggle it?#2018-05-0114:18dpsuttoni think just (set x false)#2018-05-0114:18dpsuttonset!#2018-05-0114:18reefersleepmy savior 😄#2018-05-0114:23reefersleepwait, it doesn’t work! spoke too soon 🙂#2018-05-0114:23reefersleepset! doesn’t seem to have any effect#2018-05-0114:24dominicmI wonder if fipp behaves differently?#2018-05-0114:24reefersleepmy.ns>(set! *print-namespace-maps* false)
false
my.ns> *print-namespace-maps*
true
#2018-05-0114:26reefersleep(binding [*print-namespace-maps* false] does not work either#2018-05-0114:59dpsuttoni'd ask in #clojure#2018-05-0115:03dpsuttonso it doesn't work in lein repl. i'm guessing this is a thread based issue#2018-05-0115:03dpsuttonit does work with clj so they won't be too helpful i don't think#2018-05-0115:07dominicmI think it's an nrepl/session thing#2018-05-0115:14dpsuttonyeah. i think each eval is in its own thread in nrepl. and these bindings won't carry over#2018-05-0115:15dominicmkinda. The thread bindings get serialized into a "session" concept, they're forkable though. I'm guessing that a disposed session is being used for each eval in the repl.#2018-05-0115:18dpsuttonoh ok. i need to read that, especially if its gonna come under the clojure-emacs umbrella#2018-05-0118:33arrdemI think *print-namespace-maps* may not be correctly captured and persisted across eval requests… I had some difficulty turning this behavior off (I really dislike it too) but didn’t take the time to dig into why.#2018-05-0120:16dominicmIt uses the clojure function which gets all bindings.#2018-05-0202:18bozhidarSomeone should probably file a ticket for this, so we won’t forget to investigate what’s going on.#2018-05-0206:57dominicmI think I might change the tools.deps jack in integration if I get time, I want to make it easier to provide a custom main#2018-05-0208:32reefersleep@bozhidar https://github.com/clojure-emacs/cider/issues/2280#2018-05-0210:37reefersleep@dominicm @arrdem @dpsutton feel free to add your 2 cents to the issue 🙂#2018-05-0208:56andrea.crottiis thrown? in Clojure something really weird?#2018-05-0208:56andrea.crottiCider doesn't seem to know anything about it, doesn't complete it or suggest what arguments it takes#2018-05-0209:06dominicmI think thrown? is a special in clojure.test, but it's not defined normally#2018-05-0209:34andrea.crottimm yeah must be something like that#2018-05-0209:59thheller@andrea.crotti thrown? only works inside is as part of the clojure.test/assert-expr multimethod#2018-05-0210:37reefersleep@dominicm @arrdem @dpsutton feel free to add your 2 cents to the issue 🙂#2018-05-0213:48bstakesI’m using CIDER with a remote REPL and trying to navigate stack traces and am getting “No source location”. I have the files locally and they are shared to my remote host via NFS. Is there any way to accomplish this?#2018-05-0214:12bozhidarIs the source on your classpath?#2018-05-0214:13bozhidarActually do you run into this for Clojure or Java source files?#2018-05-0214:15dpsuttonhow would CIDER know a local directory correlates to a remote running repl?#2018-05-0214:18bstakes@bozhidar Clojure files, but the classpath is technically on the remote#2018-05-0214:19bstakes@dpsutton - that’s the question…is there a way to configure CIDER to know that the local files correspond to the remote REPL?#2018-05-0214:20bstakessomething similar to how PHP handles xdebug remote sessions#2018-05-0214:24dpsuttonI've never followed the code for cider connect. I'll look into that at lunch#2018-05-0214:27bstakesI’ll do the same this evening.#2018-05-0214:27bstakesthanks guys#2018-05-0214:38bozhidarWell, connections are always remote technically speaking - you always connect to some server. The problems usually come in the resolution logic (when you expect the metadata for the source locations - obviously when those are on a remote machine it’s not the same as when they are locally available).#2018-05-0214:39bozhidarYou can check cider-find-file to see what happens there. Haven’t worked on this code for a long time, so I don’t remember much about the implementation.#2018-05-0215:22andrea.crottiis there a way to set an environment variable without restarting my Repl somehow?#2018-05-0215:22andrea.crottiI have some env variables coming from environ.core/env#2018-05-0215:23andrea.crottibut they are only read at JVM boot time right?#2018-05-0217:01tanzoniteblackIs there a way with cider to jump to known implementations of a protocol?#2018-05-0217:12tanzoniteblackhttps://github.com/clojure-emacs/cider/issues/1969 ah, apparently not#2018-05-0305:39gastoveHow... does cider decide whether or not CLJS is supported?#2018-05-0305:40gastoveI have a CLJ/CLJS project which does use figwheel; I've updated to the cider cut of piggieback. And yet, when I try to jack in to a CLJS repl, I always get ClojureScript is not available.#2018-05-0305:41gastoveIs there.... a toggle I need to fiddle with?#2018-05-0712:13bozhidarI’ll switch back to 0.3.0, so the tests would pass and we can fix this later. Guess some of the refactorings in 0.3.1 broke the node repl.#2018-05-0712:14dominicmYeah, I presume so.#2018-05-0712:17bozhidarAnd were you able to run the tests locally? I really wonder why the hang for me…#2018-05-0712:18dominicmI was able to run them locally, yep#2018-05-0712:18dominicmDo you have node installed? 😄#2018-05-0712:19bozhidarhaha#2018-05-0712:20bozhidarI do, but now when I tried to run it I got a funny error#2018-05-0712:21bozhidardyld: Library not loaded: /usr/local/opt/icu4c/lib/libicudata.60.1.dylib
Referenced from: /usr/local/bin/node
Reason: image not found
#2018-05-0712:21bozhidarGuess some package upgrade broke my node and lead to my mysterious issues#2018-05-0712:28dominicmthat's why 🙂#2018-05-0713:12bozhidarYep, I can confirm this. 🙂 Reinstalling node fixed my test issues.#2018-05-0713:15bozhidar@nicola @r0man Would you mind testing the latest snapshot of cider-nrepl before I make it the new stable? 🙂#2018-05-0713:15niquola👍 will do#2018-05-0713:15bozhidarThanks!#2018-05-0713:15r0manyes, 1 sec#2018-05-0713:18niquolaworks like a charm! thank you#2018-05-0713:20dominicmWhat is 0.17 called? 🙂#2018-05-0713:22r0man@bozhidar Running all tests in a namespace seems to work fine now. But running a single tests case doesn't work for me.#2018-05-0713:22r0manI'm seeing this stacktrace in my nrepl-server buffer:#2018-05-0713:23dominicmI don't suppose cider sends non-namespaced vars when it's testing a single var?#2018-05-0713:24bozhidarI think it sends the ns and the var separately.#2018-05-0713:25bozhidar(defun cider-test-run-test ()
"Run the test at point.
The test ns/var exist as text properties on report items and on highlighted
failed/erred test definitions. When not found, a test definition at point
is searched."
(interactive)
(let ((ns (get-text-property (point) 'ns))
(var (get-text-property (point) 'var)))
(if (and ns var)
;; we're in a `cider-test-report-mode' buffer
;; or on a highlighted failed/erred test definition
(progn
(cider-test-update-last-test ns var)
(cider-test-execute ns (list var)))
;; we're in a `clojure-mode' buffer
(let ((ns (clojure-find-ns))
(def (clojure-find-def)))
(if (and ns (member (car def) cider-test-defining-forms))
(progn
(cider-test-update-last-test ns (cdr def))
(cider-test-execute ns (cdr def)))
(message "No test at point"))))))#2018-05-0713:25bozhidarYep, it’s a ns and a symbol (var).#2018-05-0713:27bozhidarA single element list to be precise.#2018-05-0713:28dominicmI can update cider-nrepl. Sorry, I've guessed how this op works to some degree. I can update the test op to union the namespace to the symbols automatically.#2018-05-0713:29dominicmdiff --git a/src/cider/nrepl/middleware/test.clj b/src/cider/nrepl/middleware/test.clj
index 46eeb72..ed57451 100644
--- a/src/cider/nrepl/middleware/test.clj
+++ b/src/cider/nrepl/middleware/test.clj
@@ -298,7 +298,7 @@
(merge msg {:var-query {:ns-query {:exactly [ns]}
:include-meta-key include
:exclude-meta-key exclude
- :exactly tests}})))
+ :exactly (map #(str ns "/" %) tests)}})))
(defn handle-test-all-op
[{:keys [load? include exclude] :as msg}]
This is the diff, it's really that simple.#2018-05-0713:36dominicmPR sent.#2018-05-0713:38dominicmThere's not much API surface to test & test-all, so I can't imagine there's anything else that could go wrong here (famous last words? 😁)#2018-05-0713:48bhauman@dominicm so was the issue with piggieback and node a false alarm?#2018-05-0713:55dominicm@bhauman no false alarm, it's real. We've rolled back for the tests.#2018-05-0714:15bhauman@dominicm which test suite do I need to run?#2018-05-0714:46dominicm@bhauman Running cider-nrepl's test suite with lein with-profile +test-cljs,+1.9 test#2018-05-0714:47bhaumanThanks!#2018-05-0718:17mattlyI’m attempting to connect via nrepl and I get this, has anyone seen it before?#2018-05-0718:28dpsuttonHave you upgraded emacs recently#2018-05-0718:33mattlyheh#2018-05-0718:33mattlyemacs-mac 26.1-rc1#2018-05-0718:33mattlyinstalled this morning#2018-05-0718:33mattlyI can’t run anything older for reasons not worth getting into#2018-05-0718:36bozhidarhmm#2018-05-0718:37bozhidarSeems something has changed in the queue.el lib we’re using in CIDER. Damn!#2018-05-0718:37bozhidarThe fix should be simple I guess, but our bad luck today is epic!#2018-05-0718:38mattlyok. LMK if there’s any info I can provide#2018-05-0718:38mattlyI’ve done a lot of emacs debugging already today#2018-05-0718:39dpsuttontry deleting your elc files or just reinstalling cider#2018-05-0718:40dpsuttoni'm on emacs 27 and it works fine. you probably just need to have emacs 26 compiled bytecode#2018-05-0718:42bozhidarBut do you know what’s your version of queue.el?#2018-05-0718:42dpsutton;; Version: 0.2#2018-05-0718:42dpsuttoni think it's changes in cl- style elisp#2018-05-0718:43bozhidarMaybe.#2018-05-0718:45bozhidarSeems version 0.2 is pretty old, so it’s more likely that something in Emacs broke it.#2018-05-0718:45bozhidarI’m on 25.3 and it works fine.#2018-05-0718:48dpsuttonyeah my thinking is they just changed what the compiled code looks like. such that a defstruct under 25.x is not what a defstruct under 26.x expects#2018-05-0718:48dpsuttonand i see this commit: Make cl-defstruct use records. CommitDate: Tue Apr 4 08:23:46 2017 +0200. 056548283884d61b1b9637c3e56855ce3a17274d#2018-05-0719:02bozhidarOuch. It’s probably true.#2018-05-0719:04bozhidarThat’s going to be one painful transition…#2018-05-0719:05dpsuttonI've run into it with recompiling emacs and I've solved it with just blowing away elc file#2018-05-0719:23dpsutton@mattly was recomping the dir or deleting the .elc files sufficient for you?#2018-05-0719:23mattlyI haven’t had time to try that yet#2018-05-0719:23mattlyI recomped this morning tho#2018-05-0719:24dpsuttonah ok#2018-05-0719:33bozhidarWell, we did it! Enjoy CIDER Andalucía! https://github.com/clojure-emacs/cider/releases/tag/v0.17.0#2018-05-0719:36dpsutton@bozhidar go drop that release in #announcements.#2018-05-0720:12bozhidarDone.#2018-05-0720:13bozhidarThanks to all of your for your contributions, feedback and for just being there! You’re the heart and soul of CIDER! ❤️#2018-05-0720:13bozhidarHopefully 0.17 won’t be very buggy and will be followed by smaller releases in the next few months.#2018-05-0721:17bhaumanI'm currently fixing the node repl problem with piggieback, had to prevent the initializing call to cljs.repl/repl to not tear down the node setup, and needed to bind out and err for initialization#2018-05-0721:37bhaumanWell it looks like piggieback is fixed, sorry to miss the release. @bozhidar @dominicm#2018-05-0721:37bhaumanand congrats on the release!#2018-05-0723:37b2berryCongrats on the release!#2018-05-0723:37b2berryI’ve spent most the working day trying to make heads or tails of this issue I’m experiencing, it’s nearly identical to this https://clojurians.slack.com/archives/C0617A8PQ/p1525088568000045 except that the resolution here didn’t work for me.#2018-05-0723:39b2berryWhen attempting to start cljs-repl via cider-jack-in-clojurescript I get the following error
error in process filter: cider-cljs-repl-form: Symbol's function definition is void: nil
error in process filter: Symbol's function definition is void: nil
Context: OSX, Spacemacs, Cider 0.17.0
.dir-locals.el
((nil
(cider-default-cljs-repl . figwheel+harmonium) ;; Was "Harmonium" tried also harmonium without figwheel+ and error persists
(cider-cljs-repl-types
("Harmonium" "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))"))))#2018-05-0723:40b2berryAny tips would be very appreciated#2018-05-0723:55artenatorstarted getting “namespaces are in a bad state” errors today when trying to refresh namespaces in cider. Anyone else run into this issue? I just updated to the 5-7-18 build from melpa#2018-05-0800:09dpsutton@b2berry take off the quote on figwheel#2018-05-0800:32b2berryWhereabouts? I just removed the quote in cider-cljs-repl-types but that made no difference#2018-05-0800:41dpsuttonRight before figwheel#2018-05-0800:41dpsutton@b2berry
((nil . ((cider-lein-global-options . "with-profile dev")
(cider-default-cljs-repl . figwheel))))
#2018-05-0800:41dpsuttonthat's from mine for work#2018-05-0800:42dpsuttonmake sure to save. and sometimes dir locals can be a little finicky#2018-05-0805:47bozhidarNo idea what this signature is. Have never seen such an error before.#2018-05-0805:47bozhidarWhat’s your Emacs version?#2018-05-0805:49bozhidar@b2berry I see in your second example you haven’t defined anywhere a type named figwheel+harmonium, that’s the fundamental problem.#2018-05-0805:50bozhidarYou should change “Harmonium” to figwheel-harmonium. Also - we’ve got a function called cider-register-cljs-repl-type which you can also use in your init.el or whatever.#2018-05-0805:52bozhidar@bhauman Thanks for looking into this!#2018-05-0805:59theeternalpulseemacs 25.2.2, I am also running the emacs command with a modified home to point to a separate directory structure for testing. Think that may be it. I just don't want to override my current emacs setup#2018-05-0807:18bozhidarI see.#2018-05-0807:19bozhidarAnyways, I’m happy that after I woke up I didn’t find a ton of issues reported here or on GitHub. Seems despite the final push and last minute issues the release shaped up nicely. 🙂#2018-05-0808:24benedek@dominicm seen your comment over the weekend. Does that mean you rejig how the vars are listed in cider /orchard?#2018-05-0808:24benedekSo i guess i eventually need to sync with master and follow up...#2018-05-0808:24benedekPlanned to work on the emacs /client side tbh next#2018-05-0808:25dominicm@benedek I think your work will potentially become a lot easier. I created a function in orchard for listing vars generically.#2018-05-0808:25benedekAh ok#2018-05-0808:25benedekWill have a look#2018-05-0808:25benedekDoes it do filteting with custom preds? ;)#2018-05-0808:26dominicm@benedek Nope, it's data driven, which I think is better. The idea is that it should be an interface you can send over nrepl. What predicates did you have?#2018-05-0808:28benedekIf it has a certain meta for example... i should probably check out your code before asking ;)#2018-05-0808:28benedekWhich ns or commit should i look at?#2018-05-0808:30dominicm@benedekyou can filter by having certain metadata keys, same as how tests can be filtered now 🙂#2018-05-0808:30dominicm@benedek orchard the orchard.query namespace#2018-05-0808:32benedekYou mean the vars fn right#2018-05-0808:32benedekI see what you mean#2018-05-0808:33benedekAn include fn and exclude fn would be nice perhaps#2018-05-0808:33benedekSo one can filter failed tests for example#2018-05-0808:33benedekOr really anything#2018-05-0808:36benedekYou already doing something like that with manipulate-vars#2018-05-0808:45benedekShould have started with thanks for this btw apologies and thx for this ;)#2018-05-0808:49dominicm@benedek it's hacked together from usages elsewhere, certainly scope for more tweaks. I'm keen to avoid functions being passed for filtering, as it restricts nrepl clients a little. The idea is that they would send this data structure directly, with some coercion in the middle.#2018-05-0808:50dominicmWhat kind of filtering are you thinking of?#2018-05-0808:50benedekDoes not manipulate-vars break this a bit already?#2018-05-0808:51benedekFiltering for failed tests which needs extra info (the value in the test result atom)#2018-05-0808:52benedekI guess nrepl clients would not be able to use this only internal clients#2018-05-0808:52dominicmYeah,thats a total hack for apropos to add special symbols.#2018-05-0808:53benedekI am just proposing an other hack then. But have not tried to code the failed tests bit yet#2018-05-0808:53benedekSo just guessing what would be nice here really#2018-05-0808:53benedekSo feel free to ignore for now#2018-05-0808:54benedekI will nag you again to discuss if i have something more concrete#2018-05-0808:54dominicmBut it could be used for this, my goal of the interface is really that apropos should be able to list failed tests.#2018-05-0808:55dominicmIt might be that the test wrapper moves into orchard, then this function can have a flag for filtering to those vars#2018-05-0809:16bozhidarYeah, the test wrapper should move to orchard as well. There’s still a lot of code that has to be moved there (and improved in the process I guess).#2018-05-0809:16bozhidarIt would also be nice if we agreed on some common conventions for the nREPL middleware APIs, so there are no editor quirks leaking there.#2018-05-0809:32orestisI just realised that CIDER will happily jack-in to a simple deps.edn project. So convenient! Thank you @bozhidar and team!#2018-05-0809:35bozhidarYou’re welcome! 🙂#2018-05-0809:49dominicmhttps://github.com/clojure-emacs/cider-nrepl/issues/529#issuecomment-387345915 are others encountering this?#2018-05-0809:51dominicmI'm wondering if it might be an old snapshot, but I have no basis for that.#2018-05-0809:54bozhidarSeems he’s on stable.#2018-05-0809:54bozhidarFrankly, I didn’t test this at all yesterday - I just hoped you got the fix right.#2018-05-0809:55bozhidarI’m way too busy at work currently, so I’ve got next to no time for testing/debugging myself.#2018-05-0810:10dominicmUnless the namespace isn't being sent, I don't know what could be wrong. I might have to try the dark side or something.#2018-05-0810:12bozhidarJoin us. 😉#2018-05-0810:14benedekjust upgraded#2018-05-0810:14benedekWorks for me#2018-05-0810:14dominicmFeeling annoyed with myself for getting this- plot thickens!#2018-05-0810:17benedekI loaded the ns before C-c C-t C-t#2018-05-0810:31dominicmIs it possible that the old version required the namespace before running the test?#2018-05-0810:32bozhidarDon’t think so.#2018-05-0811:02benedekExpez very likely uses cljr too#2018-05-0811:02benedekloads nses at start up unless configured differently#2018-05-0811:03benedekI have this disabled on my work (win) machine#2018-05-0811:05benedekYeah sorry so the default is not to load them unless you explicitly change the config to do so#2018-05-0812:25dominicmI Am without internet. My local snapshot works though. Excepting maybe auto-require#2018-05-0812:25dominicmWorks with Emacs that is#2018-05-0815:21jmckitrickHi all, I just updated my work machine to 0.17.0. I’m running a project with shadow-cljs. I seem to recall that when I ran cider connect on my personal machine (running stable) cider was able to figure out the host, port, and app I was running. Did I imagine that? Is that included in 0.17.0, or only stable ?#2018-05-0816:07bozhidar0.17.0 is the stable now 🙂#2018-05-0816:09bozhidarAs for the ports - this works just for lein repls, not sure if we can extend it to shadow as well. Basically we’re just running ps and parsing its output.#2018-05-0816:09dominicmThat's how it works?!#2018-05-0816:09bozhidarIf some process has the info we need we can extend this functionality, if it doesn’t - we’re out of luck. I recall boot does not have it.#2018-05-0816:09bozhidar@dominicm Yeah. It’s as lame as it gets. 😄#2018-05-0816:10bozhidarIdeally all nREPLs should register somewhere, but this requires changes to nREPL.#2018-05-0816:10dominicmI suppose that saves you from opening the relevant Project.clj file?#2018-05-0816:10bozhidarI’m still waiting on @cemerick to give us access to the repo.#2018-05-0816:11bozhidar@dominicm How would you know which is the relevant project? 🙂#2018-05-0816:12dominicm@bozhidar look at the opened file, and search upwards for .nrepl-port.#2018-05-0816:14dominicm(this is what fireplace does)#2018-05-0816:15bozhidarNormally when you’re doing cider-connect you’re not in a project.#2018-05-0816:15bozhidarYou’d be doing cider-jack-in within a project.#2018-05-0816:16bozhidarIf you do what you’d suggest you’d see just one running process, inspecting ps shows you all the servers running on localhost.#2018-05-0816:17dominicmThere's a list of running nrepl servers? I see. Interesting.#2018-05-0816:35jmckitrickthat makes sense.#2018-05-0816:35jmckitrickExcept my current project is shadow-cljs only.#2018-05-0816:36jmckitrickBut the same idea should work.#2018-05-0816:37b2berryI’m having no luck getting cljs-repl to startup, still. My .dir-locals is
(nil
(cider-default-cljs-repl . harmonium)
(cider-cljs-repl-types
('harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")))
which seems totally right. I’m running in spacemacs. I’m running 0.17.0 for cider. I’ve tried the nuclear option by blowing away all my maven repo’s, reinstalling /.emacs.d, trying a brand-new .spacemacs.#2018-05-0816:38b2berryIf I eval inside a running emacs instance (cider-register-cljs-repl-type 'harmonium "do (<see string above>...)") and then cider-jackin-clojurescript it allows me to choose this repl type and it’s good-to-go.#2018-05-0816:40b2berryCompletely strangely though everyone on my project team has no issues even though they’ve upgrade to 0.17.0 (and some haven’t) I’m sort of baffled at this point, certainly seems isolated to my environment but I don’t really know where else to go from here. Any thoughts?#2018-05-0816:44b2berryOh, helps if I post the error I’m getting: error in process filter: cider-cljs-repl-form: Symbol's function definition is void: nil#2018-05-0816:46bozhidar@b2berry Seems to me you’re missing a set of parens.#2018-05-0816:46b2berryThat was a yank error I think#2018-05-0816:46bozhidarThe repl-types is supposed to be a list of lists.#2018-05-0816:46b2berryhmmm ok#2018-05-0816:47b2berryI’ll adjust that now#2018-05-0816:47bozhidar(defvar cider-cljs-repl-types
'((nashorn "(cider.piggieback/cljs-repl (cljs.repl.nashorn/repl-env))"
cider-check-nashorn-requirements)
(figwheel "(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
cider-check-figwheel-requirements)
(node "(do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))"
cider-check-node-requirements)
(weasel "(do (require 'weasel.repl.websocket) (cider.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip \"127.0.0.1\" :port 9001)))"
cider-check-weasel-requirements)
(boot "(do (require 'adzerk.boot-cljs-repl) (adzerk.boot-cljs-repl/start-repl))"
cider-check-boot-requirements)
(shadow cider-shadow-cljs-init-form cider-check-shadow-cljs-requirements)
(custom cider-custom-cljs-repl-init-form nil)))
#2018-05-0816:47bozhidarThat’s the default list.#2018-05-0816:48b2berrySo in .dir-locals
((nil
((cider-default-cljs-repl . harmonium)
(cider-cljs-repl-types
('harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")))))
Is legit?#2018-05-0816:49bozhidarNo, it’s not.#2018-05-0816:49b2berryAh ok based on your example I’m still slightly off#2018-05-0816:49b2berryLike so?
((nil
(cider-default-cljs-repl . harmonium)
(cider-cljs-repl-types
(('harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")))))#2018-05-0816:49bozhidar'((harmonium…#2018-05-0816:49b2berryAh ok got it#2018-05-0816:50b2berryI think in the last twelve hours working on this I’ve seen probably 8 variations on how this is handled#2018-05-0816:50bozhidarYou should have just asked. 😉#2018-05-0816:51b2berry🙂 I’ve tried to learn from the previous similar questions first and try to think before begging for someone else to deal with my problems 😄#2018-05-0816:51bozhidarBut yeah - the syntax is .dir-locals.el is very confusing even for me. Often I have to google for this myself.#2018-05-0816:51bozhidarI’d just used to the semantics of (setq ....#2018-05-0816:52b2berryMy team is having success running on a completely different set of syntax that has stopped working for me, doesn’t make sense#2018-05-0816:53b2berry((nil
(cider-default-cljs-repl . harmonium)
(cider-cljs-repl-types
'((harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")))))
Just rendered
error in process filter: cider-cljs-repl-form: Symbol's function definition is void: nil
#2018-05-0816:54bozhidarProbably you need that . as well - like for the first form.#2018-05-0816:55b2berryafter the nil, yeah? I’ve attempted that in previous variations of this, I’ll try that here#2018-05-0816:55bozhidar`(cider-cljs-repl-types .
’((harmonium “(do (require ’figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \“login\” \“imageviewer\” \“harmonium\“)\n (figwheel-sidecar.repl-api/cljs-repl))“)`#2018-05-0816:56b2berryAh, ok I’ll try that#2018-05-0816:56b2berry(I’m jumping the gun here, I’ve been at this awhile 😄 )#2018-05-0816:56bozhidarI’m reasonably certainly it should be something like this.#2018-05-0816:56bozhidaror#2018-05-0816:56bozhidar(cider-cljs-repl-types .
((harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")#2018-05-0816:56bozhidarProbably this auto-quotes the list.#2018-05-0816:58b2berryerror in process filter: Wrong type argument: listp, quote [2 times]
#2018-05-0816:58b2berry^ for the first attempt, trying the second variation now#2018-05-0816:58b2berrystandby#2018-05-0816:59b2berry(without the leading ' that is )#2018-05-0816:59bozhidarYou can also use eval to just register a new type before setting it - e.g. like shown here https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs#2018-05-0817:00b2berryWinner!
((nil
(cider-default-cljs-repl . harmonium)
(cider-cljs-repl-types .
((harmonium "(do (require 'figwheel-sidecar.repl-api)\n (figwheel-sidecar.repl-api/start-figwheel! \"login\" \"imageviewer\" \"harmonium\")\n (figwheel-sidecar.repl-api/cljs-repl))")))))#2018-05-0817:00bozhidarhehe#2018-05-0817:01bozhidarThe beers are on you 😉#2018-05-0817:01b2berryI’ll buy all the beers!#2018-05-0817:01b2berryThanks a lot man, much appreciated!#2018-05-0817:02bozhidarYou’re welcome!#2018-05-0818:42arrdemCIDER together with aggressive-indent-mode seems to be insisting on vertical alignment of let forms and maps. While normally I’m a fan of this behavior, my team isn’t. I’m seeing that the relevant customs are defined to be off - am I missing something here?#2018-05-0818:48arrdemArgh. It looks like this is a bug in clojure-mode - it smells like there’s a shared codepath which assumes that automatic alignment is always enabled.#2018-05-0818:48arrdemDon’t have the time to tear all this apart right now.#2018-05-0818:49arrdemIt looks like clojure-align-region is the only place that clojure-align-forms-automatically is respected, so when you hit clojure-indent-function eg via aggressive-indent-mode it never does the form alignment check and just runs the same codepath.#2018-05-0819:36bozhidarFile a ticket about this. I wonder why no one hasn’t noticed it in 3 years or something. 🙂#2018-05-0819:45arrdemI’m probably one of very few people running aggressive-indent-mode I bet.#2018-05-0819:46eggsyntaxI reaaaally love aggressive-indent-mode, but I had to ditch it because it was completely killing my emacs perf. I should try it again one of these days in case the situation has improved.#2018-05-0819:46bozhidarIt doesn’t play well with big files in general, and it plays terribly with CIDER’s dynamic indentation.#2018-05-0819:47eggsyntaxSounds like possibly not improved, then 😉#2018-05-0819:47bozhidarI was using it in the past, but even for bigger Elisp files it was making everything unusable.#2018-05-0819:47eggsyntaxyah#2018-05-0819:48eggsyntax@arrdem you haven't had those sorts of problems, then?#2018-05-0820:34richiardiandreaI am using it currently but I have to say not with cider and not on big files#2018-05-0820:35richiardiandreaNow the cljfmt has been posted to Graal I am planning to use that#2018-05-0820:57arrdem@eggsyntax I definitely see CIDER/Emacs lag on large clj files. Enforces some small ns discipline 😉#2018-05-0821:10dpsuttonit's not a bug its a feature#2018-05-0821:27sashtonI’m not an emacs user, but I noticed that there is a CIDER-nREPL command format-code which uses cljfmt. Is that not commonly used?#2018-05-0821:40richiardiandrea@sashton aggressive-indent-mode does the reindantation at every key stroke, that's the beauty of it#2018-05-0821:48sashtoni’m curious why you mentioned trying graal-cljfmt, given there is a cider command for it. is there a disadvantage to the built-in command? with the jvm already running, I assume startup time isn’t an issue.#2018-05-0823:03richiardiandrea@sashton there is no command in cider directly, but I think somebody posted a hook trigger#2018-05-0823:03richiardiandreaon Twitter of something#2018-05-0823:06sashtonSorry, I meant there is a command for formatting with cljfmt which is packaged in cider-nrepl: cider-format-code#2018-05-0823:15richiardiandreaI don't think there is any if I remember correctly#2018-05-0823:15richiardiandreathis is the hook though: https://github.com/dzer6/cljfmt-graalvm#2018-05-0900:51sashtonI'll not talking about graal, just the default cider format command, which uses cljfmt code. I'm wondering if people use it.
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj#2018-05-0901:17richiardiandreayes I saw we were talking related but different things 😄#2018-05-0902:15theeternalpulseanyone else getting issues trying to install cider
Error (use-package): Failed to install cider: Failed to verify signature: "spinner-1.7.3.el.sig"
Error (use-package): Cannot load cider
#2018-05-0902:15theeternalpulseI am using use-package as such (use-package clojure-mode :ensure t)
(use-package cider :ensure t)
#2018-05-0902:26theeternalpulsethis is with emacs25#2018-05-0911:56bozhidarI saw others reporting this as well, but I don’t know how to handle it.#2018-05-0911:57bozhidarSomething seems to be wrong with this package in GNU Elpa (or with its signature).#2018-05-0916:57theeternalpulseis there a way to require cider but have it point to a local spinner.el file for the dependency?#2018-05-0911:57bozhidar(it’s a CIDER dep)#2018-05-0913:16thheller@bozhidar any idea what might be going on here? https://github.com/thheller/shadow-cljs/issues/273#issuecomment-387696388#2018-05-0913:22bozhidarNo idea. I can’t imagine how this can be connected somehow to CIDER, but I guess it is. It’s just that the error is quite generic and gives me no clue as to what’s the real problem.#2018-05-0913:24dpsuttonThat looks like the state handler#2018-05-0913:25dpsuttonI'm questioning the use of creating a sibling repl without the primary. I wonder if there are some important steps left out#2018-05-0913:27thhellerI'm totally clueless .. don't even know where to look. it doesn't make any sense to me 😛#2018-05-0913:28thhellerwarnings.clj does not use read-string at all anywhere. yet it is on the stack.#2018-05-0914:09bozhidar> I’m questioning the use of creating a sibling repl without the primary. I wonder if there are some important steps left out#2018-05-0914:09bozhidarWell, the sibling repl is just a regular repl which you convert to cljs. There’s nothing special about it. I’m actually planning to make it possible to jack-in just to a cljs REPL.#2018-05-0914:10dpsuttonits after a cider connect i guess. still feels a bit weird. but i thought that was out track state message but its a shadow-cljs message. I'm trying to track down where that chan is read in shadow#2018-05-0914:10bozhidarNot sure if many people need two repls at all.#2018-05-0914:11thhellerthe message appears in the log and happens in another thread not the REPL thread. thats the part I don't understand.#2018-05-0914:12thhellerin shadow-cljs there is a "worker" thread when you start a watch for the build. that worker does the recompile. in this case the recompile fails and when trying to get more info for the warning it fails with this weird error#2018-05-0915:50deep-symmetryHmm… after installing CIDER 0.17, trying to jack in fails with: `Error loading refactor-nrepl.middleware: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/misc__init.class or cider/nrepl/middleware/util/misc.clj on classpath., compiling:(refactor_nrepl/middleware.clj:1:1)
Exception in thread “main” java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/private/var/folders/fg/1tzg0xt88v5bp20059blypr00000gq/T/form-init7039836408815040552.clj:1:9942)`#2018-05-0916:08andnils@deep-symmetry same for me. Will try to look into it later tonight, but maybe you’ll find a solution before I do :-)#2018-05-0916:08deep-symmetryAlas, I need this to work, to do my work. 😕#2018-05-0916:09andnils:-(#2018-05-0916:20dpsuttonit's got a refactor nrepl message in there. try without that to see if you can get CIDER up and running without it?#2018-05-0916:30dominicmI think refactor needs to be on the snapshot in order to work with cider 0.17#2018-05-0916:31deep-symmetryCIDER injects the version of refactor-nrepl it needs, so if it is getting the wrong one, that’s a bug in CIDER itself.#2018-05-0916:32deep-symmetryFor now, I have checked out CIDER 0.16.0 from GitHub, and have tricked Emacs into installing the package from the git repo, and things seem to be working albeit without the snazzy new 0.17 features.#2018-05-0916:41bhaumanHmmm I don't see cider-register-cljs-repl-type#2018-05-0916:47dpsuttonweird. i see it. cider-register-cljs-repl-type in cider.el line 700#2018-05-0916:47dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L704#2018-05-0917:05bhaumanI tried to call it with M-x and it wasn't completing#2018-05-0917:06dpsuttoni don't believe its interactive. you need to write it out in your init#2018-05-0917:06bhaumanok sorry 🙂#2018-05-0917:06dpsuttonM-x only shows functions you can invoke easily by the modeline or with your curson in a buffer. more complex things are best left as code (non-interactive)#2018-05-0917:08bhauman@dpsutton do you know if cider/piggieback is getting included and inserted into the middleware when starting cider-jack-in-clojurescript when using Clojure CLI tools#2018-05-0917:09dpsuttonno i don't know how the merging up the edn files works. i think @dominicm knows the most about it but i can root around for a second#2018-05-0917:10bhauman@dpsutton no worries I think I see the problem on my end#2018-05-0917:12dpsuttonyou can see how its done for jacking in with clj at cider-jack-in-params and then emulate that. but i don't think there's one for cljs#2018-05-0917:12bhaumanhmmm actually it doesn't look like it's loaded#2018-05-0917:13dpsuttonno i doubt it#2018-05-0917:13bhaumanbut it is for leiningen#2018-05-0917:13dpsutton(defun cider-jack-in-params (project-type)
"Determine the commands params for `cider-jack-in' for the PROJECT-TYPE."
(pcase project-type
("lein" cider-lein-parameters)
("boot" cider-boot-parameters)
("clojure-cli" (format cider-clojure-cli-parameters
(concat
"["
(mapconcat
(apply-partially #'format "\"%s\"")
(cider-jack-in-normalized-nrepl-middlewares)
", ")
"]")))
("shadow-cljs" cider-shadow-cljs-parameters)
("gradle" cider-gradle-parameters)
(_ (user-error "Unsupported project type `%s'" project-type))))
#2018-05-0917:13dpsuttonclojure-cli command is built here#2018-05-0917:14dpsuttoni think you'll need to make a custom one at this point so that stuff is there at the beginning and then a custom cljs jack in type to then invoke it?#2018-05-0917:14dpsuttonand it looks like there's no utility function to do that so you'll need to do an add-to-list on that list#2018-05-0917:36bhaumanCool I got figwheel.main working in CIDER#2018-05-0917:37bhaumanwith cider-jack-in-cljs#2018-05-0917:37bhaumanI had to add the following line to my init.el#2018-05-0917:39bhaumanwhich I'm sure shouldn't be needed as jack-in-cljs for clojure-cli should ensure that piggiback is included#2018-05-0917:40bhaumanI tried to find where cider.el skipped a beat but I couldn't find the spot#2018-05-0917:40bhaumanI also added a figwheel.main repl type#2018-05-0918:33deep-symmetry@andnils if you do find a way to get 0.17.0 working, I’d love to hear it.#2018-05-0919:56benedek@deep-symmetry clj-refactor decides what to inject for itself it only uses cider machinery for the injection#2018-05-0919:56benedekSo do try to uograde your cljr package to latest snapshot if you are not on that#2018-05-0920:21andnils@benedek @deep-symmetry that worked for me. I only use packages from “melpa-stable”. So, I uninstalled the stable version of clj-refactor, added the ‘ordinary’ melpa package url, and installed clj-refactor v20180420. Now cider works!#2018-05-0920:22benedekGlad to hear that ;)#2018-05-0920:23andnilsBig thanks for the tips. I was digging around to find the problem, but I wasn’t even close to clj-refactor…#2018-05-0920:26andnilsConclusion: cider v0.17.0 is not compatible with clj-refactor 2.3.1#2018-05-0920:31deep-symmetryYes, I also use melpa-stable and would prefer to stay that way. It sounds like the error was putting cider 0.17 on melpa-stable before its dependencies were?#2018-05-0920:31benedekCljr is not a dependency of cider#2018-05-0920:32benedekIt is a separate package#2018-05-0920:32benedekWlc @andnils#2018-05-0920:33benedekA cljr release is long overdue but low prio as the latest snapshot works fine with newest cider#2018-05-0920:33deep-symmetryBut that breaks people relying on Melpa. #2018-05-0920:34benedekNothing stops you using both melpa and melpa-stable btw#2018-05-0920:35deep-symmetryNot wanting unstable releases is what stops me. #2018-05-0920:35benedekUse-package is specially a good way to manage packages incl stable /melpa#2018-05-0920:35andnilsIndeed. “pin” is your friend#2018-05-0920:36benedekFor cljr there is no stable release in that sense#2018-05-0920:36benedekAtm#2018-05-0920:36deep-symmetryBut this just reinforcing how painful packages are in emacs. I don’t want to have to learn all these details but I guess I’m going to have to. #2018-05-0920:37andnilsAtm the snapshot is the stable one. And the stable is unstable. 🙂#2018-05-0920:37benedek@andnils ;) the stable is old...#2018-05-0920:38benedekUse-package worths your time really but i feel your pain#2018-05-0920:38andnilsThe nice thing with emacs is, when things breaks you can often poke around in the elisp source and solve it yourself#2018-05-0920:39andnils…and, even if you don’t, you always learn a lot.#2018-05-0921:19deep-symmetryAgreed, and I’ve done that and even contributed emacs packages in the past. But when I’m putting in multiple weeks of overtime working hard in a different language and environment isn’t when I want to do that! Anyway, thanks for identifying the problem, I now know what I need to do if I want to move back onto 0.17. #2018-05-0921:19andnils👍#2018-05-1005:49bozhidarWell, I’d really love it for us to fix this. In the mean time I’ve added a section in “Troubleshooting” about refactor-nrepl, which probably no one read. 🙂#2018-05-1005:50bozhidarThe problem is that refactor-nrepl does this injection, not CIDER. I think the simple solution would be for refactor-nrepl to check the CIDER version before injection itself and just skipping this injection for incompatible versions.#2018-05-1005:51bozhidarAnyways, my involved in the refactor-nrepl project is almost 0, which is another reason for this state of affairs. I would have synched the releases, but I don’t have time for more projects.#2018-05-1005:55bozhidar@bhauman We don’t have dep injection for cljs, as it’s a bit more involved. Currently the code is written in a way that you get asked about the REPL to start fairly late in the init process and because of this you don’t really know what to inject (after a clj REPL has already started). Another nice way to solve this would be to add some hotloading functionality to CIDER, so you’d be able to add the cljs deps after you’ve started a clj REPL.#2018-05-1005:55bozhidar@benedek Is this functionality in refactor-nrepl complex? Would it be feasible to move it?#2018-05-1006:03benedekwell it is not that bad as it leans on a dependency, alembic to do the heavy lifting. but alembic is unmaintained not compatible with java9 +#2018-05-1006:03dominicmThere's a function in tools deps alpha that does it now#2018-05-1006:03dominicmI would guess it works with 9#2018-05-1006:04benedekAnd you also need to retriebe libs you want to load via http i guess#2018-05-1006:04benedekSeen that @dominicm#2018-05-1006:04benedekMy plan is to rewrite it the feature#2018-05-1006:04benedekCould go to cider but yeah it is pretty complex#2018-05-1006:05benedekSorry for the typos. On my phone#2018-05-1006:12bozhidarGot it.#2018-05-1006:12bozhidar@dominicm I also saw this feature and I was wondering whether we can just take this and stuck into some middleware.#2018-05-1006:13bozhidarI find it odd that adding libs at runtime is still not a solved problem in Clojure after all those years.#2018-05-1006:15dominicmI thought it was? Chas' library offered this functionality for maven#2018-05-1006:16benedekYou mean alembic, right?#2018-05-1006:16dominicmhttps://github.com/cemerick/pomegranate/blob/master/README.md has the Loading too#2018-05-1006:17dominicmJust call the add class path function#2018-05-1006:19bozhidarBut this stopped working Java 9+.#2018-05-1006:19bozhidar(the classloader changes)#2018-05-1006:19bozhidarI think this is what @benedek referred to.#2018-05-1007:06dominicmI don't understand the problem yet. TDA just uses the closest Clojure dynamic class loader. Why don't people running cider have one of those?#2018-05-1007:09arrdemClojure's addUrl is private and I think always has been.#2018-05-1007:10bozhidarAll the code I’ve seen for dynamic loading libraries used an URLClassLoader.#2018-05-1007:10arrdemPreviously reflection was used to hack it public, which stops working in 9/10.#2018-05-1007:11arrdemBoot and some other things have their own bootstrap runtimes precisely to inject their own dynamic class loader as high as they can.#2018-05-1007:11arrdemAt least that's my understanding from some poking at this issue and build tooling#2018-05-1007:12bozhidarhttps://github.com/cemerick/pomegranate/commit/8d964e35cfc1ba0d8c46e30da8c424fb8a541f85#2018-05-1007:14bozhidarI haven’t played with that much, I just know what we were doing got fucked up recently. 🙂#2018-05-1007:41dominicmThe one in Clojure seems public https://github.com/clojure/tools.deps.alpha/compare/add-lib doesn't seem too complex#2018-05-1007:45bozhidarBut I seemed to recall it (currently) doesn’t work with nREPL properly (or something like this).#2018-05-1007:46bozhidarProbably because of a different classloader hierarchy.#2018-05-1007:53dominicmI suspect we will need to look there to find a solution then.#2018-05-1008:05benedekyup, this issue starts with researching this a bit i suppose. and checking out in detail what the core team is coming up with re. @dominicm and clj tooling support for this#2018-05-1008:20bozhidarTrue. So, did I get this right - @dominicm is our volunteer to research this? 😉#2018-05-1008:21dominicmPretty much 🙂#2018-05-1008:28dominicmThat's fine by me though.#2018-05-1008:28benedekhahaha, that would be super nice. i intend to do the same if I by same luck/miracle get some time for it#2018-05-1008:28benedekso @dominicm would be very grateful here if you have/time energy#2018-05-1008:29dominicmYou've given me a puzzle now, there's no way I'm not going to figure it out#2018-05-1008:31benedekthis is how far i got with it: https://github.com/clojure-emacs/refactor-nrepl/issues/206#2018-05-1008:31benedeksee specially https://github.com/clojure-emacs/refactor-nrepl/issues/206#issuecomment-359267034#2018-05-1009:59bozhidar@dominicm Good man! 🚀#2018-05-1010:26dominicmif it is an nrepl problem, then t.d.a.r/add-lib wouldn't work with nrepl#2018-05-1010:26dominicmtdar sounds like ta-da#2018-05-1011:20bozhidar😄#2018-05-1011:20bozhidarI don’t what problems is it or if there’s even a real problem - just remember seeing some Twitter thread after Alex Miller announced this feature.#2018-05-1013:07benedekhttp://insideclojure.org/2018/05/04/add-lib/#2018-05-1013:07benedekthis is what we are talking about, right?#2018-05-1013:08benedekwonder if this works under java9+ at all…#2018-05-1013:15benedekand https://github.com/clojure/tools.deps.alpha/tree/add-lib#2018-05-1013:18benedektools.deps.alpha is tested on openjdk 9 so i guess it should work#2018-05-1013:18benedekbut it is all down to the classloader hierarchy really…#2018-05-1014:14bhauman@bozhidar it seems like it would be safe to add piggiback to the deps and place it in the middleware if a cider-jack-in-cljs is called. Simply because its a no-op until you execute the piggie/cljs-repl call#2018-05-1014:14bhaumanIt's only extra dependency is clojurescript ... and that is required anyway#2018-05-1014:15bhaumanisn't there only one repl (shadow) that doesn't need it?#2018-05-1014:15bozhidarYeah, that’s easy - I was mostly referring to what to do with the actual deps like figwheel. Ideally we’d have to change the current logic now to first ask for the actual cljs REPL to run, inject all the deps, start and convert the clj REPL.#2018-05-1014:16bhaumanoh I'm not talking about requiring figwheel#2018-05-1014:16bhaumanbut I what you are saying#2018-05-1014:17bozhidar> isn’t there only one repl (shadow) that doesn’t need it?
Yeah, it doesn’t use it, but probably it won’t be a problem to have it around regardless.#2018-05-1014:19bhaumanI think getting piggieback in there early would be a big boon, and would get rid of the complexity here: https://cider.readthedocs.io/en/latest/clojurescript/#2018-05-1014:21bhaumanAlso, I'd love to know how to decorate cljs errors so that you can get line, column and stack info. I can make an issue on piggieback?#2018-05-1014:22bozhidar> I think getting piggieback in there early would be a big boon, and would get rid of the complexity here: https://cider.readthedocs.io/en/latest/clojurescript/#2018-05-1014:22bozhidarI agree. It’s not a complete solution, but it’s a good (and simple first step).#2018-05-1014:22bozhidar> Also, I’d love to know how to decorate cljs errors so that you can get line, column and stack info. I can make an issue on piggieback?#2018-05-1014:23bozhidarSure. Basically you just have to get them in the same format as the Clojure errors in terms of line structure.#2018-05-1014:23bhaumanYou mean format the error message text.#2018-05-1014:24bozhidarYeah, exactly.#2018-05-1014:24bozhidarHow do they look right now?#2018-05-1014:25bhaumanoh they are all over the place, as there are many different kinds and it depends on the context#2018-05-1014:25bhaumanI have a way to turn them into data#2018-05-1014:25bozhidar(defun cider-extract-error-info (regexp message)
"Extract error information with REGEXP against MESSAGE."
(let ((file (nth 1 regexp))
(line (nth 2 regexp))
(col (nth 3 regexp))
(type (nth 4 regexp))
(pat (car regexp)))
(when (string-match pat message)
;; special processing for type (1.2) style
(setq type (if (consp type)
(or (and (car type) (match-end (car type)) 1)
(and (cdr type) (match-end (cdr type)) 0)
2)))
(list
(when file
(let ((val (match-string-no-properties file message)))
(unless (string= val "NO_SOURCE_PATH") val)))
(when line (string-to-number (match-string-no-properties line message)))
(when col
(let ((val (match-string-no-properties col message)))
(when val (string-to-number val))))
(aref [cider-warning-highlight-face
cider-warning-highlight-face
cider-error-highlight-face]
(or type 2))
message))))#2018-05-1014:26bhaumanwell thats helpful#2018-05-1014:26bozhidarThat’s the code in CIDER that processes errors/warnings and maps them to the source buffers.#2018-05-1014:27bozhidarAnd that’s the regexp:
(defvar cider-compilation-regexp
'("\\(?:.*\\(warning, \\)\\|.*?\\(, compiling\\):(\\)\\(.*?\\):\\([[:digit:]]+\\)\\(?::\\([[:digit:]]+\\)\\)?\\(\\(?: - \\(.*\\)\\)\\|)\\)" 3 4 5 (1))
"Specifications for matching errors and warnings in Clojure stacktraces.
See `compilation-error-regexp-alist' for help on their format.")#2018-05-1014:28bozhidar(which we can obviously change if we have to)#2018-05-1014:28bhaumanwould it be a bad idea to have a data protocol?#2018-05-1014:29bhaumanwhere we send this info directly, and then fall back to parsing the string?#2018-05-1014:29bhaumanI'm sure that's a bigger change#2018-05-1014:30bozhidarA data protocol would certainly be preferable - when I was starting out I was limited by the fact that no one wanted to make changes neither on Clojure or nREPLs side. 🙂 (and we didn’t use middleware back then)#2018-05-1014:30bhaumanI totally get you there#2018-05-1014:32bhaumanthere is also Throwable->map which is interesting#2018-05-1014:34dpsuttonis there any word on getting nrepl under the clojure-emacs team?#2018-05-1014:47degI've just created a new project (Luminus template +cider etc.). I updated the cider dep to 0.17.0 and jacked in from a ClojureScript file. I updated all my Emacs packages.
I'm getting "WARNING: CIDER's version (0.17.0-snapshot) does not match cider-nrepl's version (0.17.0). Things will break!"
I can't see who is loading the snapshot version.#2018-05-1014:50degHmm, in [Messages] I see "Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.17.0-SNAPSHOT\"\] -- repl :headless :host ::..."#2018-05-1014:56dpsuttonYou could try lein deps to see if that explains anything. Traditional culprits are profile.clj#2018-05-1015:06dominicm@benedek Clojure adds a dynamic class loader when it starts.#2018-05-1015:48bozhidar@deg How did you do the update?#2018-05-1015:49bozhidar@dpsutton No, I guess @cemerick is busy and he hasn’t seen the ticket.#2018-05-1015:50deg@dpsutton lein deps :tree shows only 0.17..0. And nothing interesting in my ~/.lein/profies#2018-05-1015:50dpsuttonthat's weird that it shows that. do you know why?#2018-05-1015:50dpsuttonthis should be injected solely by CIDER. ie, your project shouldn't have any knowledge of it#2018-05-1015:51degCame from the Luminus template#2018-05-1015:51degActually, the template had 0.15.1 and I updated it when warned by lein ancient#2018-05-1015:52dpsuttondelete it from the tmeplate#2018-05-1015:52dpsuttonlet cider manage it#2018-05-1015:52degWhat brings in Cider?#2018-05-1015:53dpsuttoni thought you said it was in the template#2018-05-1015:53degYes. I think we are talking past each other. ....#2018-05-1015:54degLuminus template created project.clj
project.clj now contains
:dependencies [... [cider/cider-nrepl "0.17.0"] ...
#2018-05-1015:54degAll mentions of Cider in project are:
./src/clj/diffusion/core.clj:6: [cider.nrepl :refer [cider-nrepl-handler]]
./src/clj/diffusion/core.clj:31: :handler cider-nrepl-handler }))
./project.clj:7: [cider/cider-nrepl "0.17.0"]
./project.clj:52: [cemerick.piggieback/wrap-cljs-repl cider.nrepl/cider-middleware]}
#2018-05-1015:55degAh... should line 52 go away? Was it needed in 0.15.1?#2018-05-1015:56dpsuttonno. it hasn't been needed since 9 or so i believe. just strip out all mentions of cider-nrepl. CIDER has been configured to inject its own dependencies so that you don't have to worry about keeping the behind the deps and the emacs version in sync#2018-05-1015:57degHmm, I'm surprised that Luminus gets this wrong.
So, you are saying that I should kill both lines in core.clj, right?
And in project.clj, I assume I need to keep line 7, but should kill 52?#2018-05-1015:58deg(fixed major typo there ... read edited version)#2018-05-1016:08bozhidarI don’t think that’s a problem - I’m more curious why you’ve got CIDER 0.17-snapshot on the Emacs side.#2018-05-1016:08degAh, I see. You really meant to remove all 4 lines. What magic you wizards weave! 🙂#2018-05-1016:09bozhidarThat’s why I asked how exactly did you do the upgrade. Maybe you didn’t restart Emacs afterwards?#2018-05-1016:09degI did an update i M-X List Packages... one sec, I'll check details.#2018-05-1016:09degAnd, definitely did a restart. My UPS battery died last week and we had a power blip so, umm, yeah, I did a restart. 😞#2018-05-1016:10degThis is the Cider listed in List Packages: cider 20180509.109 installed Clojure Interactive Development Environment that Rocks#2018-05-1016:11deg(my text reads funny. Meant to say that the battery died last week, I have't replaced it yet; and had a power blip today right after updating Emacs)#2018-05-1016:12degHmmm... My Cider is 0.18.0snapshot in the header comment. I wonder if you updated to 0.18 and put in the word snapshot, but left "17" someplace?#2018-05-1016:31bozhidarI don’t think so.#2018-05-1016:34bozhidarJust checked this.#2018-05-1016:35bozhidarBut at any rate - if you’re using MELPA the chance is that you’d be either 0.17-snapshot or 0.18-snapshot. It’s unlikely you’ll be on 0.17 stable.#2018-05-1016:38bozhidarAh, I didn’t read the message carefully - yeah, you had installed 0.17-snapshot and from luminos you had the wrong middleware overriding the one CIDER injects itself. Mystery solved. 🙂#2018-05-1017:24degI still don't see where I had installed 0.17-snapshot. As far as I can see, I had 0.17 from my edit of Luminus, and 0.18-snapshot from MELPA.#2018-05-1017:28dpsuttonOh I misunderstood the confusion sorry. Have you restarted emacs since upgrading? And you could grep the elpa directory for the version string. Also check mx cider-version#2018-05-1018:01deep-symmetryOk, I am trying to switch to use-package so I can have most things come from melpa-stable and get clj-refactor from melpa. I think I have that mostly set up, but for some weird reason I do not see any versions of clj-refactor from melpa. I only see the ancient 2.3.1 from melpa-stable!#2018-05-1018:04justinbarclay@deep-symmetry What does your package-archives look like? Use package pulls from there, so unless you have ("melpa" . "") in there, it won’t know about it.#2018-05-1018:05deep-symmetrySorry, my fault… I did have melpa in there and was seeing other snapshots, but I had accidentally pinned clj-refactor to melpa-stable in overzealous use of my keyboard macro to change to using use-package.#2018-05-1018:08arrdem@bozhidar Chas just transfered the repo!#2018-05-1018:08arrdemwelcome https://github.com/clojure-emacs/nREPL#2018-05-1018:09deep-symmetrySigh. But now I have CIDER 0.17.0 and refactor-nrepl 20180420.223 installed, and am still seeing this crash trying to jack in:
error in process sentinel: Could not start nREPL server: Could not find artifact refactor-nrepl:refactor-nrepl:jar:2.4.0-SNAPSHOT in central-mirror ()
Could not find artifact refactor-nrepl:refactor-nrepl:jar:2.4.0-SNAPSHOT in clojars-mirror ()
Could not find artifact refactor-nrepl:refactor-nrepl:jar:2.4.0-SNAPSHOT in releases ()
Could not find artifact refactor-nrepl:refactor-nrepl:jar:2.4.0-SNAPSHOT in snapshots ()
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
#2018-05-1018:10deep-symmetryAh, that looks local.#2018-05-1018:14deep-symmetryTemporarily turning off our clojars mirror allowed me to download the snapshot, I will have to talk to the person who set that up to find a more permanent solution.#2018-05-1018:18jsa-aerialI am trying to get cider to work with clj 1.9, but I keep hitting this error: Error loading cider.nrepl.middleware.test: java.lang.RuntimeException: Invalid token: ::clojure.test/once-fixtures#2018-05-1018:21jsa-aerialI have looked at various issues reporting this or things very close to it and have tried many combinations of cider/n-repl and tools.nrepl. It has defeated me at every step. If I go back to 1.8 things just work - no matter what combination of those I use. I know this has something to do with a change in 1.9 that now enforces an intent on :: keywords, but at this point I would have thought cider/n-repl 17 and tools.nrepl 2.13 would have the changes to fix this. Does anyone have any suggestions?#2018-05-1018:26dpsuttonthat was due to a change in keywords. in 1.8 ::fully-qualified-namespace/var was legal. in 1.9 it no longer is. now its ::alias/var. This was updated in cider-nrepl a long time ago. can you tell me what version of cider you are on?#2018-05-1018:29dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/commit/b2d04f95c1d59bf8dc0df08f1b7273e914597763#2018-05-1018:30dpsuttonwow. comments in that thread talk about a 0.15.1 release which will publish the fix. how old is your cider?#2018-05-1018:30dpsutton(assuming its the same issue @jsa-aerial)#2018-05-1018:36jsa-aerialAs I mentioned - I know this has to do with a change in :: keyword processing and that I have tried all combinations of cider/n-rrepl from 0.13 up through and including 0.17.0 with both tools.nrepl 0.2.12 and 0.2.13#2018-05-1018:37dpsuttoncan you delete the artifact in ~/.m2/repository/cider and make sure you're on a recent cider?#2018-05-1018:38jsa-aerialYou mean delete the entire directory recursively?#2018-05-1018:38dpsuttoni want to make sure you pull a new cider-nrepl artifact. the hope is that its one with that fix. i would just remove ~/.m2/repository/cider#2018-05-1018:40jsa-aerialOK, something does seem weird - when I look in there I do see 0.15.1 and 0.16.0, but not things like 0.13 and 0.17 - despite having put those in the project.clj and saw what appeared to be dowload messages first time used.#2018-05-1018:42dpsuttoncider injects its own dependencies. just change your emacs cider version and you should get the correct (and matching) cider-nrepl#2018-05-1018:42dpsutton(cider-add-to-alist 'cider-jack-in-lein-plugins
"cider/cider-nrepl" (upcase cider-version))
#2018-05-1018:43jsa-aerialI'm not even running emacs cider at this point - just tying to get lein repl to run#2018-05-1018:43dpsuttonoh. well then grab the latest cider-nrepl and try that then#2018-05-1018:43dpsuttonbut if you're not using CIDER why do you have a dep on cider-nrepl?#2018-05-1018:44jsa-aerialI have - I used both 15.1 and 0.17 - neither worked. But as I say, oddly 17 wasn't even in the repo (?!?)#2018-05-1018:44dpsuttoni'm not sure that you have tried 0.17 then#2018-05-1018:44jsa-aerialit was in the project.clj when lein repl was invoked ...#2018-05-1018:45jsa-aerialI've cleaned up the repo area - let me see if things are any better now#2018-05-1018:47jsa-aerialOK, maybe this has something to do with where I'm putting these in the project.clj. I have them in [:profiles :dev], and maybe the ~/.lein/profiles.clj stuff is overriding that?#2018-05-1018:49dpsuttonyeah lein profile merging is complicated i've heard. why do you want to put cider-nrepl into any of those?#2018-05-1018:50dpsuttondo you use vim fireplace or something?#2018-05-1018:51jsa-aerialOK, putting those at the 'top level' fixes the original problem but now introduces Error loading refactor-nrepl.middleware: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/misc__init.class#2018-05-1018:52jsa-aerialGenerally I would only put the dependencies in ~/.lein/profiles.clj, but in this particular case I was trying to see if things would actually work before committing to moving to 1.9#2018-05-1018:53dpsuttonwhy do you want to put an explicit dependency on cider-nrepl? I still don't follow your use case#2018-05-1018:53jsa-aerialI never use jack in - I always start separate servers and connect. I have found that to be far more useful and productive#2018-05-1018:54dpsuttonah ok. i follow you.#2018-05-1018:55jsa-aerialI'm guessing I now have some odd mismatch with refactor-nrepl. I suppose I could get rid of that altogether - I find I don't really use if much#2018-05-1019:01jsa-aerialYeah, refactor-nrepl is just broken - if I remove it from plugins things now work - and I was using the most recent version 2.3.1. I've had a lot of problems with it in the past as well. There are some nice things in it but it just doesn't seem to play well with the rest of the stack#2018-05-1019:27jsa-aerial^^^ If you use 2.4.0-SNAPSHOT of refactor-nrepl it works - there are multiple issues on this and suggestion to use the snapshot with latest cider-nrepl...#2018-05-1020:45bozhidarYeah, as I mentioned a few times - the development of refactor-nrepl is mostly independent from CIDER and the releases are sometimes out of sync.#2018-05-1020:46bozhidarNot much I can do about this.#2018-05-1020:46bozhidar@arrdem partywombat#2018-05-1020:48bozhidarNow it’s time to figure out how to handle the first release. Likely I’ll follow the original plan and just release nREPL 0.3 with a new coordinate and the old namespace and afterwards we have to decide how to handle the ns transition.#2018-05-1020:49bozhidarChanging the namespaces in our projects is easy, but that’s we might have to create new tasks for boot and lein until the dep gets changed upstream.#2018-05-1100:33hlolliI've been screwing my emacs config all day so I can't tell if it's me or cider, I'm on the most recent melpa unstable 0.18.0-snapshot. And the error stacktrace doesn't have the underline link to the source files in the trace. And when I click on the line I get
Debugger entered--Lisp error: (error "No input at point")
signal(error ("No input at point"))
error("No input at point")
cider-repl--send-input(t)
cider-repl-return(nil)
funcall-interactively(cider-repl-return nil)
call-interactively(cider-repl-return nil nil)
command-execute(cider-repl-return)
maybe a config issue on my side (I have cider-nrepl 0.18.0-snapshot)?#2018-05-1101:17theeternalpulseI solved that issue, seemed that I can only install Cider from http://stable.melpa.org#2018-05-1101:29dpsuttonHave you tried installing it manually?#2018-05-1101:32dpsutton@theeternalpulse by installing spinner manually and seeing what the issue is?#2018-05-1101:33theeternalpulseyeah, from http://melpa.org I couldn't install spinner manually#2018-05-1101:38dpsuttonright. can you clone it and see if you can eval it?#2018-05-1101:38dpsuttonthe last commit is over 3 years old#2018-05-1101:38dpsutton2 years but still 🙂#2018-05-1106:47bozhidar> And the error stacktrace doesn’t have the underline link to the source files in the trace. And when I click on the line I get#2018-05-1106:47bozhidar@hlolli Can you show us some screenshot/mini video of what you’re doing exactly?#2018-05-1106:53bozhidarFirst practical question about nREPL - how do we name the deployment artefact for version 0.3. It can’t retain its old name. I was thinking of cider/nrepl for consistency with the other projects, but that would result in namespace conflicts down the road with cider/cider-nrepl unless we change the name of cider-nrepl to something like orchard-nrepl (which I’m perfectly fine with). I’ve been thinking lately that it’s probably time to decouple cider-nrepl from the release cycles of CIDER itself.#2018-05-1106:56arrdem+1 for orchard-nrepl#2018-05-1106:57arrdemjust rename the whole artifact and re-namespace everything.#2018-05-1106:57bozhidarYeah, yeah - that’s what I’ve been thinking about.#2018-05-1106:58bozhidarThat would also underline the editor-agnostic nature of cider-nrepl I guess.#2018-05-1106:58arrdemI'd like to see cider-nrepl be less coupled to cider anyway, see my recent comments about the pretty print middleware.#2018-05-1106:58arrdemyep!#2018-05-1106:58bozhidarFor nREPL 0.3 the namespaces will be the same, only the artefact id will be different, to simplify the rollout.#2018-05-1106:59arrdemSure, just as long as there's an announced migration plan.#2018-05-1107:00arrdemidle thought - it'd be really cool if cider could natively tee execution output and results to a log file.#2018-05-1107:00bozhidarThat was the original migration plan, that Chas himself announced.#2018-05-1107:00bozhidarOn the client side?#2018-05-1107:00bozhidarI’ve always been wondering if we don’t need an execution log on the server side.#2018-05-1107:00arrdemI've totally used cider for days-long evaluations and then had to write out a huge repl buffer at the end of it.#2018-05-1107:01arrdemServers could probably persist a log of commands too, I'm interested in more durably capturing out, err and the eval result.#2018-05-1107:01arrdembut I'm definitely using cider for some weird stuff atm.#2018-05-1107:02arrdemanyway. ideas for after the work deadline :white_frowning_face:#2018-05-1107:04bozhidarWell, we can certainly discuss this in more detail later.#2018-05-1107:05bozhidarFor now it seems that the first step would be replacing maven with lein and cutting 0.3. Haven’t used maven in so many years, and I don’t really want to change this.#2018-05-1107:05bozhidarThere’s also the fact that nREPL is targeting Clojure 1.2 now. 🙂#2018-05-1107:06bozhidarPlus I noticed another Java 9 incompatibility:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by clojure.tools.nrepl.middleware.interruptible_eval$set_line_BANG_ to field
WARNING: Please consider reporting this to the maintainers of clojure.tools.nrepl.middleware.interruptible_eval$set_line_BANG_
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
#2018-05-1107:21dominicm@bozhidar if you don't change the namespaces, it's not going to work for most, due to class path collisions. I would strongly recommend against doing that.#2018-05-1108:02bozhidarBut this was Chas’s original plan - to keep the namespace the same for the first version.#2018-05-1108:02bozhidarI’m fine with changing it right away, though. That’s unavoidable basically.#2018-05-1108:19dominicmI fear that adding [cider/nrepl "0.3.0"] to a project wouldn't do anything, due to the already-present copy of the same files from leiningen.#2018-05-1108:19dominicmclasspaths suck eh 🙂#2018-05-1108:20dominicmThis is really the maven relocation problem, and I don't think it can be solved without org.clojure/tools.nrepl "delegating" to us.#2018-05-1108:23bozhidarYeah, that’s a valid point.#2018-05-1108:26bozhidarOK, let’s go with the new namespace then.#2018-05-1114:44richiardiandreaShouldn't orchard be completely nRepl agnostic so that it can run on socket as well? Maybe I misunderstood the plan 😃#2018-05-1114:45richiardiandreaOr are there gonna be two: orchard and orchard-nrepl?#2018-05-1115:33bozhidarThey are going to be two orchard and orchard-nrepl.#2018-05-1115:35bozhidarThe only tricky thing right now is how to make something like orchard work with the old and the new nrepl namespace. I really don’t want to have conditional checks for everything.#2018-05-1115:36bozhidarLikely I’ll cut a small CIDER release that just has the orchard-nrepl change, and the next CIDER release is likely going to stop using lein repl and boot repl and will instead have a couple of basic tasks that spin an nREPL server using the new nREPL.#2018-05-1116:42dominicmThat won't work for boot users, as there's a special repl task for starting with clojurescript loaded#2018-05-1115:37bozhidarFun times ahead! If someone wants to help out with these transformations - there’s plenty of work to go around. 😉#2018-05-1116:24richiardiandrea@bozhidar as you know my goal is to port stuff to cljs and self-host, the cljs-tooling PR is WIP but almost there, then will try to see if I can integrate (and how) into lumo, then socket cider/`orchard` porting, dunno...I guess I will test the waters when I get there#2018-05-1116:25richiardiandreaalso don't want to commit to much because I am becoming busy again at work and summer is coming 😉#2018-05-1116:46bozhidarI guess this applies to all of us, but it’s important we’re all trying to make things better.#2018-05-1120:42bozhidarOK, I’m wrapping the work on Clojure tooling for now. If someone wants to help out with some easy tasks I’d appreciate this:
* tackle the eastwood warnings
* add some “modern” main to nREPL so we can start it and pass it middleware (as opposed to doing this from cider-nrepl as we currently do)
* create a lein and boot tasks that start the new nREPL and can be passed a list of extra middleware#2018-05-1204:14arrdemDoes CIDER have a code style guide for minutia like the ns form?#2018-05-1204:14arrdemhttps://github.com/clojure-emacs/nREPL/pull/23 looks mostly good, but the ns styling is somewhat unusual.#2018-05-1204:15arrdemthen again I don’t always agree with what cljr-clean-ns generates so#2018-05-1204:15arrdem(who owns that? Can we get that pulled in somehow? cider eat world)#2018-05-1204:16arrdemOh. Hey. It’s already on clojure-emacs I missed that.#2018-05-1204:55bozhidarIt’s more or less a fork of the abandoned slamhound that’s party of refactor-nrepl. That’s the type of functionality I think we should have straight in orchard, btw.#2018-05-1204:57arrdemYeah I largely agree with that, would also kinda like orchard to eat cljfmt and for it to be a lot more opinionated.#2018-05-1204:58arrdembeen thinking about how to use the clojure.spec specs for core to drive a formatter on and off for a while now#2018-05-1204:58arrdemEg. CIDER’s format specification language is honestly inadequate, as is cljfmt’s, you need something like spec which gives you full parse capabilities.#2018-05-1204:58arrdemprojects for after the work deadline#2018-05-1205:51bozhidar> Eg. CIDER’s format specification language is honestly inadequate, as is cljfmt’s, you need something like spec which gives you full parse capabilities.
Why so? I think cljfmt’s main problem is that it doesn’t do proper parsing, so there’s some potential for false positives. Overall I agree there’s always room for improvement. CIDER format spec and cljfmt improved vastly on the voidness that preceded them. 😄#2018-05-1205:51bozhidarIt’s a pity we never really ported the format spec to cljfmt. I prefer this way more to some global config file.#2018-05-1206:02arrdemOh absolutely 😉 just thinking we now have a full, agreed upon pattern language to hand and leveraging it would lead to some better understanding - eg the ability to specify how you want let binding forms indented no matter what macro they occur in because it’s just the same spec.#2018-05-1207:39dominicmSo, regarding the dynapath upgrade… did we try a require to https://github.com/tobias/dynapath/blob/master/src/dynapath/defaults.clj ?#2018-05-1207:39dominicmI don't have java 9 on my system, and I'm a little scared to update 😛#2018-05-1215:30willahhhHi everybody,
Is it possible to have completion on external required (nested) map ?
(ns myns.core
(:require [myns.setting :as setting]))
(:■ (setting/setting-map))
(:■ (:default-params (setting/setting-map)))#2018-05-1310:35stardivinerWhen I cider-jack-in without project, I load core.async with (require '[clojure.core.async :as a]) . But got error:
1. Unhandled java.io.FileNotFoundException
Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath.
When I jack-in with project. core.async is loaded. What's the difference, and why?#2018-05-1311:05jumar@stardiviner I guess you don't have core.async available as a dependency on classpath#2018-05-1311:06stardivinerYou can I need to include core.async into clj -Ddeps explicitly?#2018-05-1311:06stardivinerIsn't the core.async in Clojure by default.#2018-05-1311:08jumarno, it isn't#2018-05-1311:09jumarit's a separate library#2018-05-1311:33stardivinerAho, I see. Thanks#2018-05-1316:46bozhidarAt the beginning I think the intention was to develop it separately for a while and then include it, but I guess that’s never happening at this point.#2018-05-1318:32hlolliis it possible to surpress printing eldoc of keywords?#2018-05-1319:04bozhidarI don’t recall if I made this configurable or not, but it’s trivial to do so.#2018-05-1319:05bozhidarYou can file a ticket, so I will remember to take a look.#2018-05-1319:53hlolliwill do, thx#2018-05-1319:55hlollithere's already one here https://github.com/clojure-emacs/cider/issues/1968 and a temporary solutin in the comment#2018-05-1319:28Karol WójcikHi i tried to connect to nashorn repl in cljs file here is the file content
(ns clojurescript-playground.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
and the project.clj is
(defproject clojurescript-playground "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.238"]]
:repositories [["" ""]
["sonatype" {:url ""}]]
:profiles {:dev {:dependencies [[cider/piggieback "0.3.2"]]}}
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]})
The error
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling /tmp/form-init5963414928397737092.clj at (1:29)
1. Caused by java.lang.ClassNotFoundException
cljs.repl.nashorn
Anyone experienced similiar issue? It is possible that my clojurescript version has no support for nashorn?#2018-05-1406:11bozhidarSeems unlikely. Did you try to manually require it?#2018-05-1406:15bozhidar@dominicm No, frankly I haven’t tried anything about this. But I was brave and upgraded to Java 10 to test the classpath stuff. Somewhat funny Java 9 is already dead. 🙂#2018-05-1406:18bozhidarBtw, isn’t this just what you end up using by default? (just looking at the code and its history)#2018-05-1406:22dominicm@bozhidar I don't see a require to the default namespace, where is it? Main usage is through the util namespace.#2018-05-1406:34bozhidar@kwcharllie379 I found the problem. There’s no require in the command CIDER uses for nashorn. If you changed this to "(do (require 'cljs.repl.nashorn) (cider.piggieback/cljs-repl (cljs.repl.nashorn/repl-env)))" it should work. I’ll update the default.#2018-05-1406:36Karol Wójcik@bozhidar seems that node repl is broken by default as well#2018-05-1406:37Karol WójcikWhen node repl started then it immiedietly dies because of socket close#2018-05-1406:37bozhidarit’s broken on piggieback 0.3.2 for a different reason, try 0.3.3#2018-05-1406:37Karol WójcikOk I will give it a try#2018-05-1406:37bozhidar@dominicm I guess you missed this line https://github.com/tobias/dynapath/blob/230f78f7b3023702926a978dc04aa81ec99fc93d/src/dynapath/util.clj#L4#2018-05-1407:11dominicm@bozhidar I did, yep! Thanks.#2018-05-1408:15benedek@bozhidarre. migrating clean-ns over to cider: if this happens i would like the feature broken up (again) into subfeatures — so to say — so clients or users can run the whole shebang in one go OR just parts of it. like sort requires/imports only or remove unused only etc#2018-05-1408:37bozhidar@benedek Yeah, I agree.#2018-05-1408:38bozhidarI’d start with the simplest functionality and take it from there. E.g. whatever used to be slamhound doesn’t have any external deps, right? It’d be easy to move this over.#2018-05-1408:39bozhidarI’m not sure how removed unused is implemented currently, but I assume it’s not rocket science either.#2018-05-1408:51bozhidarI’m not very familiar with the code, so you’ll have to enlighten us as to what’s most feasible.#2018-05-1415:17Karol Wójcik@bozhidar nashorn works well but the node repl still have some errors#2018-05-1415:18Karol WójcikWhen i try to evalute something in the repl I got
To quit, type: :cljs/quit
nil
cljs.user> '()
error:
java.io.IOException: Stream closed
at java.base/java.io.BufferedWriter.ensureOpen(BufferedWriter.java:107)
at java.base/java.io.BufferedWriter.write(BufferedWriter.java:224)
at java.base/java.io.Writer.write(Writer.java:162)
at cljs.repl.node$write.invokeStatic(node.clj:47)
at cljs.repl.node$write.invoke(node.clj:46)
at cljs.repl.node$node_eval.invokeStatic(node.clj:66)
at cljs.repl.node$node_eval.invoke(node.clj:61)
at cljs.repl.node.NodeEnv._evaluate(node.clj:235)
at cljs.repl$evaluate_form.invokeStatic(repl.cljc:553)
at cljs.repl$evaluate_form.invoke(repl.cljc:484)
at cider.piggieback$eval_cljs.invokeStatic(piggieback.clj:133)
at cider.piggieback$eval_cljs.invoke(piggieback.clj:132)
at cider.piggieback$do_eval.invokeStatic(piggieback.clj:159)
at cider.piggieback$do_eval.invoke(piggieback.clj:140)
at cider.piggieback$evaluate.invokeStatic(piggieback.clj:182)
at cider.piggieback$evaluate.invoke(piggieback.clj:180)
at clojure.lang.Var.invoke(Var.java:381)
at cider.piggieback$wrap_cljs_repl$fn__1403$fn__1405$fn__1406.invoke(piggieback.clj:211)
at cider.piggieback$enqueue$fn__1383.invoke(piggieback.clj:115)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__860.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
#2018-05-1415:19Karol WójcikI will try to investigate what is wrong#2018-05-1415:24dominicm@kwcharllie379 what piggieback version are you using?#2018-05-1415:25Karol Wójcik0.3.3#2018-05-1415:25Karol WójcikWith the newst clojurescript version#2018-05-1415:25dominicmThat looks exactly like the error I had on 0.3.2#2018-05-1415:25dominicmor .1, not sure.#2018-05-1415:25Karol WójcikMaybe I will try to clean my deps wait.#2018-05-1415:26dominicmOh wait, I'm lying I think#2018-05-1415:26dominicmnode is known broken with 0.3.2+#2018-05-1415:26Karol Wójcikaaaaaaa ok#2018-05-1415:26dominicmI didn't open a gh issue though#2018-05-1415:26dominicmI just pinged bhau man#2018-05-1415:27Karol WójcikDid you try to solve the problem?#2018-05-1415:34bozhidar@dominicm @bhauman fixed the problem you reported in 0.3.3#2018-05-1415:34bozhidarI didn’t really try the fix then, perhaps he didn’t fully address the problem.#2018-05-1415:34bozhidarAnyways, file a ticket.#2018-05-1415:35dominicmNo idea#2018-05-1415:35bozhidarThat’s the relevant commit, btw https://github.com/clojure-emacs/piggieback/commit/cc48fe207d1fe2d90ce6ce6d87a1a2476b00cadb#2018-05-1416:08bhauman@bozhidar @dominicm this is fixed in 0.3.3#2018-05-1416:10bozhidarNot according to @kwcharllie379 🙂#2018-05-1416:12Karol WójcikI will file a ticket. But I am trying to fix it know 😄#2018-05-1416:12bhaumanI'm thinking you have stale deps#2018-05-1416:12bhaumanbecause this is under test coverage#2018-05-1416:13Karol WójcikOk so I will try to remove whole m2 and then check whether it works correctly#2018-05-1416:14bhaumanalso your target directory and hope that you aren't bringing in AOTed code somehow#2018-05-1416:24Karol WójcikI flushed the target and m2 then still the problem occurs#2018-05-1416:25bhaumanThen I would conclude that you are pulling in the earlier version?#2018-05-1416:25Karol WójcikI will try to match my project.clj to the one which exists in piggieback#2018-05-1918:04bozhidarI’m pretty familiar with using nREPL as an API, but not super familiar with the internal, unless it was something frustrating to me as an end user.#2018-05-1918:04bozhidarI’m also a bit puzzled about why the Connection class in implemented in pure Java, maybe it was simpler at the time.#2018-05-1918:05arrdemMay also make embedding an nREPL endpoint in a Java app easier from an FFI perspective.#2018-05-1918:05arrdemNo need to muck about with Clojure AOT.#2018-05-1918:06dominicmI don't see any major features that warrant spending time pulling out support for old versions.#2018-05-1918:07arrdemIt'd be kinda nice to drop some of the old #^{} notation and some stuff, but yeah I agree it's kinda an aesthetic only upgrade AFAIK.#2018-05-1918:07bozhidarWell, that’s certainly not a big deal, but then again - I don’t want to spend time ensuring compatibility with something no one uses.#2018-05-1918:08arrdemI'd support adding a cider/version_check pseudo-ns of some sort that everything requires / forces so that we have some way to check Clojure and Java's version and tell users about (in)compatability.#2018-05-1918:08bozhidarAnd I’ve got this dream of nREPL that could be started with a self-hosted cljs, which certainly would require “a few” changes, but that’s not high up the todo list.#2018-05-1918:09dominicmWhat's this incompatibility you speak of? Growth!#2018-05-1918:10arrdem>.>#2018-05-1918:13arrdemwell in order to get an IANA port assignment we need protocol-level versioning support which may or may not be a breaking change.#2018-05-1918:13arrdemalso probably means we need different port assignments for a "bare" socket REPL vs a BEncode repl because they aren't really wire-compatable or negotiable - they're different formats.#2018-05-1918:14dominicmfun#2018-05-1918:14arrdemre-namespacing things if we do that is gonna be another breaking change#2018-05-1918:14arrdemdropping support for ancient clojure / java versions would be a breaking change if we decided to do it#2018-05-1918:15arrdemand philosophically I don't support burdening yourself with indefinite backwards compatibility as a design goal, especially when we're as ah lightly resourced as we are#2018-05-1918:16arrdemPlan for change /management/ because you will want change 😉#2018-05-1918:16bozhidarWell, it’s done to some extend as I already deleted some compatibility code for Java 5, but I doubt someone is going to notice it. 😄 We’ve also restyled all the ns-es to Clojure 5 syntax or something like this (I don’t quite remember when ns got its current syntax).#2018-05-1918:17bozhidar> re-namespacing things if we do that is gonna be another breaking change#2018-05-1918:17bozhidarProbably the only meaningful change of the two.#2018-05-1918:17arrdemthe existing non-nREPL nREPL clients all seem like abandonware? can't really tell.#2018-05-1918:18bozhidarI wonder when exactly to do it, as this will require a ton of PRs to other projects.#2018-05-1918:18bozhidarThe only client that matters as Java code is reply, everything else is dead.#2018-05-1918:18arrdemI'm an owner on Chas' python-nrepl client which is incomplete anyway#2018-05-1918:18arrdemcan probably get full ownership of that codebase and move it to the nrepl org if I want it.#2018-05-1918:19bozhidarClients that don’t use the API directly won’t notice the change.#2018-05-1918:19bozhidarMaybe we should move it to the new org at least for historical reasons.#2018-05-1918:19arrdemyeah but if/when we do a protocol version handshake something#2018-05-1918:19arrdemwhich is probably the only thing I care to work on besides supporting better custom result handlers#2018-05-1918:20arrdemso many yaks so little time#2018-05-1918:20bozhidarYeah, that’d be great to have, but we’ll have to have a fallback for current clients - e.g. whatever the “version” was before we introduced this.#2018-05-1918:21bozhidarYou don’t say…#2018-05-1918:21arrdemheh#2018-05-1918:23dominicm@arrdem https://github.com/clojure-vim/nrepl-python-client/ would prefer we use my tree of nrepl-python-client, it supports crazy things like negative numbers.#2018-05-1918:23dominicmand empty lists#2018-05-1918:24arrdem@dominicm yeah I definitely want to get them merged / have only one#2018-05-1918:24arrdemwe should also update the deployed copy on PyPi#2018-05-1918:26arrdemI'd suggest that I get Chas' (which shows up on google) moved into the nREPL org, merge your code as a big-bang PR and go from there.#2018-05-1918:28dominicmsgtm.#2018-05-1918:28dominicmI think I broke the api at some point by switching to binary sockets, but I'm not entirely certain. It works.#2018-05-1918:29arrdem🤷 I think you're the primary user anyway and there was never a good documented API so shouldn't be a problem.#2018-05-1918:30arrdem'cause Grenchman has its own entire nREPL+BEncode client#2018-05-1918:37vemv^ I realise it might be a Pedestal-specific question, but also stdout handling may be a faq#2018-05-1918:45vemvAs a quick bandaid I just removed <appender-ref ref="STDOUT" /> from logback.xml. Although it'd be nice to print logger stdout at lein repl, while not doing so at the CIDER repl#2018-05-1918:37dpsuttonshould all new changes happen on a 4.x release and then once its stabilized go to a 5.x?#2018-05-1919:35bozhidar@vemv There’s a setting about this in CIDER - cider-redirect-server-output-to-repl.#2018-05-1919:38vemvCool! Will be playing with it#2018-05-1919:37bozhidarBtw, that’s one of the biggest improvements on my personal list for nREPL - the situation with output that ends up in the server’s output instead of the clients is quite annoying. We should certainly fix this, so such workarounds are not needed.#2018-05-1919:37bozhidarThere are also some cases when clients receive out messages without a request id attached to them and that breaks stuff.#2018-05-1919:39bozhidar@dpsutton I’ll likely change the namespace in the next release and mark this as nREPL 1.0 (or 0.4) - I still wonder about this. nREPL has been around for a very long time, so I guess it’s time to release 1.0.#2018-05-1919:40dpsuttonI was just thinking prevent any clients from using the new code unless the opt into it by specifying the new major version#2018-05-1919:47dpsuttonAnd need to keep @cfleming in the loop for any changes. Can't risk interrupting his product with changes to nrepl#2018-05-1919:54bozhidar@dpsutton I really doubt most clients would be impacted by the internal changes at all - there will be 0 backward incompatible changes to the protocol for now, you’ll only notice the changes if you’re doing something with the nREPL API (and the changes are one change - the new namespace).#2018-05-1919:54dpsutton👍#2018-05-1919:55bozhidarBut yeah - if Colin is using the Clojure API of nREPL he’ll have to update a bit of code on Cursive, that’s true.#2018-05-1919:56bozhidarFor me the most painful part is getting this upstream in reply, boot and lein. Everything else should be relatively easy. Luckily it’s a one time deal and we’ll never have to make changes like this again.#2018-05-1919:57dpsuttonThere was also just a little hiccup when switching namespaces previously so just want him to be aware and test with us#2018-05-1919:57dpsuttonWith piggieback#2018-05-1919:57bozhidarAnd, of course, someone will actually have to update their deps to notice something - nREPL is now essentially a different project than the contrib one, there can’t be accidental updates.#2018-05-1919:58dpsuttonAh yeah good point#2018-05-1919:59bozhidarYeah, the middleware breakages are mostly unavoidable, but I’m not that worried about them controlling directly almost all the nREPL middleware in existence. 🙂#2018-05-1920:01bozhidarIf it gets problematic to push for changes upstream I’ll just start booting cider with custom tasks using the new nREPL and update all of my middleware projects to rely on it. Whoever wants to stick to clojure.tools/nrepl can do so, but they won’t have much middleware they’d be able to use with it. 🙂#2018-05-2015:23bhaumankeep in mind that @darwin has done a massive amount of nREPL middleware work with his https://github.com/binaryage/dirac#2018-05-2015:24bhaumanIt would really be great if we didn't make breaking changes for only aesthetic reasons#2018-05-2015:25theeternalpulsewhen I do cider-connect-clojurescript it asks me to associate with a project, it doesn't seem to do this with cider-connect (clojurescript). Does it infer something different with clojure projects vs clojurescript ones?#2018-05-2016:04soulflyerJust started seeing this error when I do cider-jack-in:
WARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (1.0.0). Things will break!
I'm using the latest version of cider, and as the repl starts I see it is using cider/cider-nrepl "0.18.0-SNAPSHOT" not 1.0.0. This project was working fine a few hours ago. Doing a package update of cider (I was a day behind) didn't change anything. Any ideas?#2018-05-2016:23bozhidar@soulflyer Hmm, that’s an unexpected bug - the result of me trying to remove some version duplication using https://github.com/trptcolin/versioneer#2018-05-2016:24bozhidarThis was supposed to extract the version of cider-nrepl from the artifact’s metadata.#2018-05-2016:24bozhidarYou can ignore the warning. I’ll revert the change if I can’t figure out what went wrong.#2018-05-2016:25bozhidar> It would really be great if we didn’t make breaking changes for only aesthetic reasons (edited)#2018-05-2016:27soulflyerSo it should still work ok? My project is no longer working, looks like none of my re-frame :events are getting registered. Maybe I broke something unrelated...#2018-05-2016:27bozhidar@bhauman Sure. Generally I just want to avoid having to test on a huge build matrix and have to do weird compatibility tricks. I’m fine with maintaining Clojure 1.7 if someone starts complaining about this, but I really don’t think we need to bother with JDKs that have reached their EOL 5 years ago.#2018-05-2016:28bozhidar@soulflyer I can’t imagine how this can be the problem. It’s a one-liner type of change.#2018-05-2016:29bozhidarIt’s a pity that it’s so hard to be able to leverage the project’s version declaration internally. 😄#2018-05-2016:29soulflyerOk thanks, will keep digging and ignore the nrepl error#2018-05-2016:37bozhidar@soulflyer I’ve reverted this change, btw. A new build will be up soon.#2018-05-2016:50soulflyerah-ha. all good now. clj-refactor had moved the subs :require out of my core.cljs. Absolutely nothing to do with cider-nrepl at all....#2018-05-2017:14bozhidarGood to know! I’m happy you managed to sort this out quickly!#2018-05-2020:35bozhidar@bhauman CIDER now injects piggieback automatically. Tomorrow I’ll clean up the code and make it more generic.#2018-05-2109:25theeternalpulseIs there a way to make cider pick up my project that isn't a boot/lein project? I am using shadow-cljs and every time I connect to nREPL#2018-05-2111:07andrea.crottigetting
wrong-type-argument stringp package-desc
this morning when requiring cider this morning#2018-05-2111:08andrea.crottimore precisely
Debugger entered--Lisp error: (wrong-type-argument stringp package-desc)
signal(wrong-type-argument (stringp package-desc))
epl-package-from-lisp-file("/Users/acrotti/.emacs.d/elpa/clj-refactor-20180420.223/clj-refactor.el")
epl-package-from-file("/Users/acrotti/.emacs.d/elpa/clj-refactor-20180420.223/clj-refactor.el")
(epl-package-version (epl-package-from-file source))
(let* ((source (pkg-info-library-source library)) (version (epl-package-version (epl-package-from-file source)))) (pkg-info--show-version-and-return version show))
pkg-info-library-version(clj-refactor)
(or orig-version (pkg-info-library-version library))
(let* ((package (or package (if (stringp library) (intern library) library))) (orig-version (condition-case nil (pkg-info-library-original-version library) (error nil))) (lib-version (or orig-version (pkg-info-library-version library))) (pkg-version (condition-case nil (pkg-info-package-version package) (error nil))) (version (if (and pkg-version (not (version-list-= lib-version pkg-version))) (format "%s (package: %s)" (pkg-info-format-version lib-version) (pkg-info-format-version pkg-version)) (pkg-info-format-version lib-version)))) (pkg-info--show-version-and-return version show))
pkg-info-version-info(clj-refactor)
cljr--version(t)
cljr--inject-jack-in-dependencies()
(lambda nil (cljr--inject-jack-in-dependencies))()
eval-after-load-helper("/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
run-hook-with-args(eval-after-load-helper "/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
do-after-load-evaluation("/Users/acrotti/.emacs.d/elpa/cider-20180520.2317/cider.elc")
require(cider)
eval((require 'cider) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
#2018-05-2111:09bozhidar@andrea.crotti That’s not from CIDER, it’s from clj-refactor.el.#2018-05-2111:09bozhidarSeems something’s wrong with the package metadata, I’ve seen others report this as well.#2018-05-2111:10bozhidarIf you remove the package the error will go away.#2018-05-2111:11bozhidar@theeternalpulse CIDER has native support for shadow projects. On jack-in you should get some prompt asking you whether to use lein or shadow.#2018-05-2111:11theeternalpulseah, maybe i haven't updated cider in a while#2018-05-2111:13bozhidar@theeternalpulse This was added in 0.17.#2018-05-2111:15theeternalpulsehmm, what about cider-connect-clojurescript, that's what I'm using#2018-05-2111:15theeternalpulsesince the nrepl server is already created by shadowcljs#2018-05-2111:15theeternalpulsethat one tells me to choose the project directory#2018-05-2111:18bozhidar> hmm, what about cider-connect-clojurescript, that’s what I’m using#2018-05-2111:19bozhidarIf you want to associate a project with a connection there’s a command named cider-assoc-project-with-connection.#2018-05-2111:20benedekThis could be an old elc file lurking in your .emacs.d @andrea.crotti#2018-05-2111:20benedekTry to delete and reinstall the package#2018-05-2111:24andrea.crottiI think I deleted the whole elpa directory alraedy#2018-05-2111:24andrea.crottibut I'll do it again#2018-05-2111:26bozhidarNo need to do this for the entire elpa. Just this one package would be enough.#2018-05-2111:26bozhidarYou can remove it from package-list-packages (for instance)#2018-05-2111:27bozhidar@benedek Can you remind me why this was done?#2018-05-2111:27bozhidarhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L380#2018-05-2111:28benedekWhat do you mean @bozhidar?#2018-05-2111:28bozhidarI’m planning to just move the default deps to their defvars and simplify this code. To me it makes no sense.#2018-05-2111:29benedekAh ok. I think we agreed with @malabarba to do this#2018-05-2111:29bozhidarI definitely don’t think the deps are risky local variables (if you know what you’re doing).#2018-05-2111:29benedekPerhaps there are traces of that conversation with him on the PR#2018-05-2111:33andrea.crottiwell I'm actually trying to move to emacs 26 as well in the meanwhile#2018-05-2111:34andrea.crottibut I think now it all works fine#2018-05-2111:36benedekGood to hear @andrea.crotti#2018-05-2111:36andrea.crottibut actually the bigger problem is that the cider linking to the Clojurescript repl is now not working#2018-05-2111:37andrea.crottiI think since I upgraded this morning#2018-05-2111:37benedek@bozhidar yeah look at pr 1552#2018-05-2111:38andrea.crottieven though the cljs repl itself works perfectly fine and I used jack-in-clojurescript to create it#2018-05-2111:40benedekSuppose reason is @bozhidar that we actually inserting stuff which potentially modifies your REPLs behaviour or could do other funky stuff#2018-05-2112:15bozhidar> Suppose reason is @bozhidar that we actually inserting stuff which potentially modifies your REPLs behaviour or could do other funky stuff#2018-05-2112:15bozhidarI’ll take a look at the PR, but if that’s the reasoning I’m going forward with my changes. 🙂#2018-05-2112:16bozhidar> but actually the bigger problem is that the cider linking to the Clojurescript repl is now not working#2018-05-2112:16bozhidar@andrea.crotti Can you elaborate on this?#2018-05-2112:21andrea.crottiSince this morning if I try to evaluate some code directly in a clojurescript buffer it complains there is no repl @bozhidar#2018-05-2112:22andrea.crottiEven if the repl is there and working#2018-05-2112:23bozhidarInteresting. I don’t have time to test this, but I’ll try to take a look later today. I wonder if it’s not something related to the injection of piggieback I added in the morning.#2018-05-2112:24bozhidar@benedek I don’t see comments regarding this in https://github.com/clojure-emacs/cider/pull/1552/files#2018-05-2112:24bozhidarIt actually looks as I’d expect it to.#2018-05-2112:27benedekCant link the comment on my phone unfortunattely :/#2018-05-2112:28benedekcomments on lines 185-188#2018-05-2112:53andrea.crotti@bozhidar in this project we have already piggieback and in project.clj
35: [com.cemerick/piggieback "0.2.2"]
86: :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}
#2018-05-2112:53andrea.crottiif that helps#2018-05-2112:57andrea.crottithe figwheel auto reloading also works so it's really just evaluating in the buffer#2018-05-2115:10dpsuttonhmm. cranking up cljs project with latest CIDER changes and getting#2018-05-2115:10dpsuttonjava.lang.IllegalStateException: Can't change/establish root binding of: *cljs-compiler-env* with set
at clojure.lang.Var.set(Var.java:223)
at cemerick.piggieback$run_cljs_repl$fn__15669.doInvoke(piggieback.clj:184)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at cljs.repl$repl_STAR_$read_eval_print__15052.invoke(repl.cljc:881)
#2018-05-2115:11dpsuttonand looks suspicious because it has cemerick piggieback in it. not sure why this used to work though#2018-05-2115:13dpsuttonException Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
A) not providing piggieback as a dependency and/or
B) not adding piggieback middleware into your nrepl middleware chain.
example profile.clj code:
-----
:profiles {:dev {:dependencies [[com.cemerick/piggieback <current-version>]
[org.clojure/tools.nrepl <current-version>]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
-----
Please see the documentation for piggieback here
Note: Cider will inject this config into your project.clj.
This can cause confusion when your are not using Cider. figwheel-sidecar.repl/eval38415/fn--38416 (repl.clj:167)
also the error looks like it still talks about the cemerick version not the cider/piggieback version#2018-05-2115:33dpsuttonupdating to latest fighweel 0.5.16 and now it doesn't throw on startup but it doesn't connect to the repl#2018-05-2115:36dpsuttonFigwheel: Starting nREPL server on port: 7888
WARNING: unable to load "cemerick.piggieback/wrap-cljs-repl" middleware
#2018-05-2115:37manuelwith latest CIDER and piggieback is working for me#2018-05-2115:37manuelsee here for a working project.clj: https://github.com/manuel-uberti/boodle/blob/master/project.clj#2018-05-2115:37dpsuttonthanks. i'll keep rooting around 🙂#2018-05-2115:37manuelI updated piggieback to 0.3.5 today#2018-05-2115:59dpsuttonok. so fighwheel is aware of the two piggiebacks except for one spot with setting the middleware for the repl and it will inject an expectation of cemerick's version unless you specify :nrepl-middleware#2018-05-2115:59dpsuttonso taking care of that and i still cannot get a repl to connect#2018-05-2116:05bozhidar@andrea.crotti Yeah, that’s the problem - having the old piggieback there as well.#2018-05-2116:06bozhidarAnd, of course, another problem would be trying to use the new piggieback with something that doesn’t support it (e.g. an old version of figwheel).#2018-05-2116:07dpsuttonas far as i can tell current versions are [cider/piggieback "0.3.5"] and lein-figwheel "0.5.16"#2018-05-2116:13bozhidarWell, that should certainly work.#2018-05-2116:13bozhidar@dpsutton CIDER should be setting for you both the dep and the middleware config.#2018-05-2116:15dpsuttoni can't get it to connect even running lein figwheel. not sure where to look#2018-05-2116:16dpsuttonfigwheel needs to update to not require you to set :nrepl-middleware
(defn start-nrepl-server
[figwheel-options autobuild-options]
(when (:nrepl-port figwheel-options)
(let [middleware (or
(:nrepl-middleware figwheel-options)
["cemerick.piggieback/wrap-cljs-repl"])
resolve-mw (fn [name]
(let [s (symbol name)
ns (symbol (namespace s))]
(if (and
(utils/require? ns)
(resolve s))
(let [var (resolve s)
val (deref var)]
(if (vector? val)
(map resolve val)
(list var)))
(println (format "WARNING: unable to load \"%s\" middleware" name)))))
middleware (mapcat resolve-mw middleware)]
(nrepl-serv/start-server
:port (:nrepl-port figwheel-options)
:bind (:nrepl-host figwheel-options)
:handler (apply nrepl-serv/default-handler middleware)))))
#2018-05-2116:16bozhidarDoes the lein invocation look OK to you?#2018-05-2116:16dpsuttonit looks fine. it just doesn't "see" the browser to connect#2018-05-2116:17bozhidar> (or
(:nrepl-middleware figwheel-options)
[“cemerick.piggieback/wrap-cljs-repl”])#2018-05-2116:17bozhidarWhat is this?#2018-05-2116:18dpsuttonThat's from how figwheel starts up an nrepl server#2018-05-2116:20bozhidar@dpsutton Sorry, I didn’t pay enough attention. Yeah, I guess @bhauman should update this.#2018-05-2116:21bozhidarBtw, is everything working fine for you if you just use say nashorn?#2018-05-2116:23bhauman@bozhidar @dpsutton just to be clear, you just need me to get rid of that line?#2018-05-2116:24bhaumannot update it to read "cider.piggieback/wrap-cljs-repl"#2018-05-2116:24dpsuttonhttps://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/components/nrepl_server.clj#L12#2018-05-2116:24dpsuttonso there's lots of places that you check for cider/ or cemerick/ ... I'm wondering if we could remember which is found and then require found/wrap-cljs-repl at that point#2018-05-2116:25dpsuttonbut it's a lot of bookkeeping for a simple thing#2018-05-2116:25dpsuttonnot a big deal. you do a good job of making lots of places aware of the two piggiebacks and that's just one place that assumes one#2018-05-2116:26bhaumanI'm surprised that folks are still using the nrepl_server in figwheel#2018-05-2116:26bozhidar@bhauman Maybe you should add some deprecation notice for it? 🙂#2018-05-2116:26bhaumanbut I'm going to fix it#2018-05-2116:27bhaumanFigwheel main is the future and it doesn't have this anymore#2018-05-2116:27bozhidarWhat’s figwheel-main? I thought it was just some way to run figwheel with tools-cli.#2018-05-2116:28bhaumanfigwheel-main is a complete rewrite of figwheel#2018-05-2116:28dpsuttoni guess we are using it.
:figwheel
{:nrepl-port 7888
:server-port 3000
:load-all-builds false
:repl true
:ring-handler breeze.jib.server.ring-handler/static-ring-handler
:nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]
}
#2018-05-2116:28dpsuttonand it just spins and doesn't connect to the browser#2018-05-2116:28bhauman@dpsutton I'll fix it this morning#2018-05-2116:29dpsuttondo you know how i could start diagnosing why the repl just sits at Prompt will show when Figwheel connects to your application and doesn't see the browser? that seems to be where i am now#2018-05-2116:29bhauman@dpsutton but that's only needed for the cider-connect workflow,#2018-05-2116:29dpsuttonand thanks so much for your help so far 👍#2018-05-2116:30bhaumanif folks aren't using that, you can comment out that line :nrepl-port and keep working for now#2018-05-2116:30dpsuttonah. well i was getting the error message that cemerick/wrap-cljs-repl wasn't found so somehow we are using that codepath#2018-05-2116:30bozhidar> figwheel-main is a complete rewrite of figwheel
Oh! I guess I should read a bit about it. The name didn’t imply anything so significant.#2018-05-2116:31bhaumanhttps://github.com/bhauman/lein-figwheel/tree/master/figwheel-main#2018-05-2116:33bhauman@dpsutton did you see my previous message about commenting out :nrepl-port for now?#2018-05-2116:33dpsuttoni'm cranking it up now with that suggestion#2018-05-2116:34dpsuttonno dice 😞#2018-05-2116:36bhauman@dpsutton where's the error? as that makes little sense to me#2018-05-2116:38bhaumanthat code path only occurs if :nrep-port is available#2018-05-2116:39dpsuttonthe behavior is that i jack in clojurescript, get
Successfully compiled build :raw to "target/raw/jib_out/js/jib.js" in 4.907 seconds.
Launching ClojureScript REPL for build: raw
and then my repl gets stuck at this:
> Prompt will show when Figwheel connects to your application#2018-05-2116:39dpsuttoneverything seems to work, i just don't have a repl. the site builds and loads#2018-05-2116:39bhaumanso that is not caused by the :nrepl-port line#2018-05-2116:40dpsuttonno it doesn't appear to be#2018-05-2116:40dpsuttoni only found that because of an assumption about cemerick's piggieback#2018-05-2116:40dpsuttoni think its unrelated for now. was just a surprising bit#2018-05-2116:41dpsuttonso the app is building just no hot-reloading now#2018-05-2116:41bhaumanyeah if its not found everything still works#2018-05-2116:41bhaumanwhat changed in your configuration?#2018-05-2116:42dpsuttoni upgraded CIDER.#2018-05-2116:42dpsuttonbut i then responded by upgrading lein-fighweel from 5.14 to 5.16#2018-05-2116:43dpsuttonand changing the nrepl-middleware to point to cider.piggieback and switching
- [com.cemerick/piggieback "0.2.2"] ; needed by figwheel nrepl
+ [cider/piggieback "0.3.5"] ; needed by figwheel nrepl
#2018-05-2116:43dpsuttonso kind of a lot, but when i hadn't changed anything i got the warning that you can't call set! on Can't change/establish root binding of: *cljs-compiler-env* with set#2018-05-2116:44bhaumanOK are you explicitly inserting the middleware?#2018-05-2116:44dpsuttonyes i am#2018-05-2116:44dpsuttonerr, if you mean the figwheel middleware yes#2018-05-2116:45bhaumanno the cider middleware#2018-05-2116:45dpsutton:nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]#2018-05-2116:45dpsuttonno i let the jack in process handle taht#2018-05-2116:45bhaumanoh is that happening now?#2018-05-2116:46dpsuttondo you mean cider-nrepl? that has been auto injected for a while. recently now it autoinjects cider.piggieback as well#2018-05-2116:46bozhidar@bhauman You asked for it. 😉#2018-05-2116:46dpsuttonbut i have an explicit dependency on cider/piggieback (as of this morning) since i work with some cursive users who won't get the auto#2018-05-2116:47bhauman@dpsutton first try to insert the piggieback middleware explicitly#2018-05-2116:47dpsutton [cider/piggieback "0.3.5"] ; needed by figwheel nrepl is in my dependencies. it used to be the explicit cemerick 0.2.2 which worked on friday#2018-05-2116:48dpsuttonwith figwheel 0.5.14 and CIDER as of a week ago#2018-05-2116:48dpsuttonlots of juggling pieces 🙂#2018-05-2116:48bhaumangive this a try :nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]#2018-05-2116:48dpsuttonalready there#2018-05-2116:49bhauman@dpsutton no not that#2018-05-2116:49dpsuttoni have to do that otherwise it will default to cemerick (which was the tangential bug i mentioned earlier)#2018-05-2116:49bhaumancider-jack-in-clojurescript doesn't use these keys#2018-05-2116:49bhauman:nrepl-port or :nrepl-middleware#2018-05-2116:49bhaumanin :figwheel#2018-05-2116:50dpsuttonok. so make a top level :nrepl-middleware entry?#2018-05-2116:50bhaumanjust like in the cider docks#2018-05-2116:50bhauman:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}#2018-05-2116:51bhaumanyou should really remove the :nrepl-port and :nrepl-middleware keys unless someone is using the cider-connect workflow#2018-05-2116:52dpsuttoni'm not sure what a cursive workflow is. but most everyone else is on that. which runs lein figwheel raw and then conencts to that#2018-05-2116:52bhaumanoh they may use a direct connection#2018-05-2116:54bhauman@dpsutton any luck?#2018-05-2116:54bhaumanOK I'm going to upgrade cider and see what happens, should have done that first off#2018-05-2116:54dpsuttontrying now. accidentally left it as a string and it does not like that 🙂#2018-05-2116:55dpsuttonam getting this though:
> [WARNING] No nREPL middleware descriptor in metadata of cider.piggieback/wrap-cljs-repl, see clojure.tools.middleware/set-descriptor!#2018-05-2116:55bhaumanthat's fine#2018-05-2116:55bhaumanno wait that shouldn't happen#2018-05-2116:56bhaumanpiggieback isn't required?#2018-05-2116:56bozhidarHmmm, I think I get what’s going on. The jack-in logic is quite convoluted for different tools - for lein the middleware is probably injected by the cider lein plugin or whatever.#2018-05-2116:56dpsuttonno luck#2018-05-2116:56bozhidarI’m busy right now, so I can’t check, but oh - I hate those differences between the tools so much…#2018-05-2116:56dpsuttoni wish lein was blessed and we all just used that#2018-05-2116:57bhauman@bozhidar which repo's did you make changes to so I can check this out?#2018-05-2116:57dpsuttonand it had an extension for boot tasks for deployments and such#2018-05-2116:57bozhidarWe’ve got some lein plugins at play there, something different for boot and clojure-cli, nothing for gradle.#2018-05-2116:57bozhidar@bhauman CIDER’s#2018-05-2116:58bozhidarhttps://github.com/clojure-emacs/cider#2018-05-2116:59bhauman@dpsutton it really looks like piggieback isn't getting required#2018-05-2117:00bozhidarYeah, it seems the damn lein code is not using the middlewares config option at all. 😄#2018-05-2117:00bozhidarI didn’t write this originally myself, so I keep getting surprised by how inconsistent everything there is.#2018-05-2117:01bozhidarOn lein the magic current happens like this https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider_nrepl/plugin.clj#2018-05-2117:02bozhidarCIDER injects this plugin and it injects the proper lein config.#2018-05-2117:04bhauman@bozhidar I think it would be safer for now to revert the change#2018-05-2117:04bozhidarI guess I can check if there’s a clojurescript dependency and put something else here or make this generate the whole thing.#2018-05-2117:04bhaumanso that folks aren't broken#2018-05-2117:06bozhidarYeah, yeah. I’ll do this later.#2018-05-2117:10dpsuttoni can't get lein figwheel raw to work with the setup with cider.piggieback and figwheel 0.5.16. i moved my version of cider back to before any changes to the cljs jack in (to the eldoc fix) and back to cemerick/piggieback and figwheel 0.5.14 i'm back in business#2018-05-2117:10dpsuttoni can help people test after work but i'm already a morning down at the moment#2018-05-2117:10bhaumancdier/piggieback and figwheel 0.5.16 should work#2018-05-2117:23dpsutton@@ -50,12 +50,12 @@
]]
;; Take ring-core's newer ring-codec dep
- [stasis "2.3.0" :exclusions [ring/ring-codec]]
+ [stasis "2.3.0" :exclusions [ring/ring-codec com.cemerick/piggieback]]
[hiccup "1.0.5"]
;; Jib dev server dependencies
;; These are not needed in production.
- [com.cemerick/piggieback "0.2.2"] ; needed by figwheel nrepl
+ [cider/piggieback "0.3.5"] ; needed by figwheel nrepl
[com.cognitect/transit-clj "0.8.300"] ; used by cljs analysis cache if present
[clojure-watch "0.1.13"]
[http-kit "2.2.0"]
@@ -64,7 +64,7 @@
:plugins [[org.clojure/clojure "1.9.0"]
[lein-cljsbuild "1.1.6" :exclusions [org.clojure/clojure]]
- [lein-figwheel "0.5.14" :exclusions [org.clojure/core.cache]]
+ [lein-figwheel "0.5.16" :exclusions [org.clojure/core.cache]]
[circle/s3-wagon-private "1.2.2" :exclusions [commons-codec]]
[slothcfg "1.0.1"]
[lein-pdo "0.1.1"]]
@@ -173,7 +173,7 @@
{:jvm-opts
^:replace ["-Xmx750m" "-XX:+UseG1GC" "-XX:+UseStringDeduplication"]
- :dependencies [[figwheel-sidecar "0.5.14"
+ :dependencies [[figwheel-sidecar "0.5.16"
:exclusions [org.clojure/clojure cljsjs/react]]
;; nrepl dep is to make sidecar happy and override a default
;; 0.2.12 dep from lein's base profile
@@ -187,7 +187,7 @@
:load-all-builds false
:repl false
:ring-handler breeze.jib.server.ring-handler/static-ring-handler
- :nrepl-middleware ["cemerick.piggieback/wrap-cljs-repl"]}
+ :nrepl-middleware ["cider.piggieback/wrap-cljs-repl"]}
with the "before" changes I can jack in clojurescript and i can run lein figwheel raw. with the after changes neither is true as they both hang at Prompt will show when Figwheel connects to your application#2018-05-2118:10bhaumanI'm pretty sure you need this at the top level :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}#2018-05-2118:17bhauman@bozhidar I just did cljs-jack-in-clojurescript with the latest and the injection worked without a hitch#2018-05-2118:22bhaumanyeah it seems to work just fine#2018-05-2118:29dpsuttonwell then we've got some weird stuff going on. i've done that and still not connecting to the application. i'll have to dig later tonight#2018-05-2118:59bozhidar@bhauman Good to know. At any rate - I’ll try to spend some time in cleaning up all the injection related code.#2018-05-2206:30rahulr92(Reposting in #nrepl and #cider as per recommendation from #beginners channel)
I am getting the following error while trying to load a buffer to my (remote) REPL:
Exception in thread "nREPL-worker-0" java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.load_file$wrap_load_file$fn$reify__668
Complete stack trace: https://pastebin.com/fafec0AV
My profiles.clj:
{:repl {:plugins [[cider/cider-nrepl "0.17.0-SNAPSHOT"]
[refactor-nrepl "2.4.0-SNAPSHOT"]]
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]
}
}
Effectively none of my required namespaces are getting loaded.
Any help/pointers would be helpful. TIA.#2018-05-2206:37bozhidar@rahulr92 Seems like some dependency issue. Why did you create a separate profile for the repl, btw?#2018-05-2206:38bozhidarHow exactly are you booting your server?#2018-05-2206:53rahulr92@bozhidar I created the :repl profile to mitigate warnings of cider complaining about cider-nrepl versions as per http://cider.readthedocs.io/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version
I am booting my server as follows:
lein repl :headless :host <hostname>
Then I am connecting to that instance from my local emacs (Spacemacs) using cider-connect.#2018-05-2206:55bozhidar@rahulr92 What exactly is the version mismatch warning you’re getting otherwise?#2018-05-2207:03rahulr92@bozhidar This is the error if I remove the repl profile:
WARNING: CIDER's version (0.17.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT (package: 20180316.1000) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.#2018-05-2207:14bozhidarOf course. I’m asking dumb questions early in the morning.#2018-05-2207:15bozhidarI’m puzzled by this error you’ve gotten. Have never seen it before and your setup seems correct.#2018-05-2207:18bozhidarYou can check lein deps :tree. Maybe something’s wrong with the deps resolution.#2018-05-2210:42rahulr92I get the error without the repl profile too. On running lein deps :tree :
lein deps :tree
[clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]
#2018-05-2212:00bozhidarThat’s fine. Those come from lein itself.#2018-05-2213:21bozhidarhttps://github.com/nrepl/drawbridge is now depending on the new nREPL 0.4 and I’ve patched reply as well https://github.com/trptcolin/reply/pull/182#2018-05-2213:21bozhidarThis migration is so much work…#2018-05-2213:21bozhidarThat’s the last time I sign up for something like this. 😄#2018-05-2213:22dominicmdon't break stuff then... 😉#2018-05-2213:23bozhidarAnyways, now the last bit is providing a boot and lein tasks in cider-nrepl to use the new nREPL. @richiardiandrea @dominicm Interested in helping with those?#2018-05-2213:23bozhidar@dominicm 😉#2018-05-2213:28dominicmI'm surprisingly busy in the short-term I'm afraid.#2018-05-2213:34bozhidarUnderstood.#2018-05-2215:03richiardiandrea@bozhidar what should the boot task do? Sorry I was a bit out of the loop#2018-05-2215:06bozhidar@richiardiandrea Basically it needs to start the new nREPL (0.4+) instead of the one bundled with Boot. I think you’re also on Boot’s team, so you might be able to help with the nREPL update there.#2018-05-2317:05richiardiandreaquestion, is this task for boot core or it should go somewhere else?#2018-05-2317:05richiardiandrea☝️ @bozhidar#2018-05-2317:11bozhidar@richiardiandrea Both.#2018-05-2317:12richiardiandreawhich one first and where 😄#2018-05-2317:12bozhidarIt should go to boot-core, but as not everyone will be on the latest boot, it might be good to have this as some task in cider-nrepl as well.#2018-05-2317:13bozhidarI also wonder how we can make things painless for people stuck with some legacy middleware using boot-core. Ideally there should be some param to choose whether you want to start the new nREPL server or the legacy one.#2018-05-2317:14bozhidarFor a cider-nrepl task - you just have to be able to start the new one and inject whatever deps/middleware is needed.#2018-05-2317:14bozhidarboot cider-repl ...#2018-05-2317:23richiardiandreaso usually I have a task called cider#2018-05-2317:24richiardiandrea(deftask cider "CIDER profile"
[]
(require 'boot.repl)
(swap! @(resolve 'boot.repl/*default-dependencies*)
concat '[[org.clojure/tools.nrepl "0.2.13"]
[cider/cider-nrepl "0.16.0"]
[refactor-nrepl "2.4.0-SNAPSHOT"]])
(swap! @(resolve 'boot.repl/*default-middleware*)
concat '[cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor])
identity)
#2018-05-2317:24richiardiandreaI can expand on this#2018-05-2317:26richiardiandreaof course passing parameters in#2018-05-2317:28richiardiandreaso actually...I am checking https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/tasks.clj#2018-05-2317:29richiardiandreaso the only thing we need is a small wrapper to the new namespace#2018-05-2317:29richiardiandreabecause then we can do boot add-middleware ..... new-nrepl#2018-05-2318:11richiardiandreait is definitely deeper than just a task, because we use boot-cljs-repl with boot#2018-05-2318:11richiardiandreaso I will have to continue another time 😉#2018-05-2215:07bozhidarSee https://github.com/boot-clj/boot/issues/695#2018-05-2215:07bozhidarI was thinking that upstream they can add an extra task to spin the new nREPL instead of the legacy one (the package names and the classes are different, so there can be no conflicts between them).#2018-05-2215:09dominicm@richiardiandrea boot-cljs-repl needs updating too#2018-05-2215:10richiardiandreaOk I will try my best#2018-05-2215:11bozhidar@richiardiandrea Much appreciated!#2018-05-2217:52benedekDo we need to update that in refactor-nrepl too?#2018-06-0508:53hkjelsSo, I was running my project yesterday with jack-in-clojurescript just fine, but today it complains about missing dependency [com.cemerick/piggieback "0.2.2" :scope "test"]. I’ve been using [cider/piggieback "0.3.5"] for the last couple of weeks, so the project has not changed. Only difference I know of, is that I deleted my elpa-directory and re-installed all packages. Do any of you have any clues to what issue I’m experiencing?#2018-06-0510:43jumar@U0B1SDL67 what kind of error are you getting? Does lein repl runs ok? Have you upgraded java recently?#2018-06-0510:49hkjelsIt’s a boot project and runs without issues on the command-line#2018-06-0510:52jumarwhich version of Cider do you have.#2018-06-0512:24hkjelsCIDER 0.18.0snapshot#2018-06-0514:00bozhidarAnd where exactly do you get the error about the missing dep?#2018-06-0607:39hkjels`You are missing necessary dependencies for boot-cljs-repl.
Please add the following dependencies to your project:
[com.cemerick/piggieback “0.2.2” :scope “test”]`#2018-06-0519:28richiardiandreaI have a discrepancy between what I see with clojure -Stree and cider-classpath-libs#2018-06-0519:28richiardiandreabasically clojure/clojurescript is missing#2018-06-0519:28richiardiandreain (cider-classpath-libs)#2018-06-0519:30richiardiandreaand therefore I receive an error: ClojureScript is not available. ...#2018-06-0519:31richiardiandreausing the exact clojure command to get -Stree at the shell#2018-06-0519:31richiardiandreaoh#2018-06-0519:31richiardiandreaok I found a problem#2018-06-0600:25bhaumandoes nREPL middleware have a concept of finally or teardown?#2018-06-0600:27bhaumanhmmm I guess the :close message#2018-06-0600:29bhaumanyeah that's not guaranteed#2018-06-0600:36richiardiandreaI am not sure they support that yeah...never heard of it#2018-06-0607:00manuelhi, with latest CIDER from MELPA I get this every time I try to do cider-load-buffer:
Caused by clojure.lang.ExceptionInfo
No such namespace: cheshire.core, could not locate cheshire/core.cljs,
cheshire/core.cljc, or JavaScript source providing "cheshire.core"
cheshire is in my project.clj and I can run my project (and the tests) without any issues. Do you want me to report it on GitHub?#2018-06-0607:31andre.stylianos@manuel seems like Cheshire is a clj only lib and you're trying to use it from Clojurescript?#2018-06-0607:31manuelnope, I am doing it from a clj file#2018-06-0607:33andre.stylianosOdd. But it's trying to load it in a cljs environment from what I can see. It's looking for a cljs/cljc source file#2018-06-0607:35manuelwell, I did cider-jack-in-clojurescript because it is clj/cljs project, but still I did cider-load-buffer from a clj file#2018-06-0609:47bozhidar> does nREPL middleware have a concept of finally or teardown?#2018-06-0609:47bozhidar@bhauman What do you need this for?#2018-06-0609:50bozhidar@manuel Maybe something’s wrong with the connection mapping? Can’t tell you more without being able to play with some reproducible example.#2018-06-0609:51bozhidarI don’t think anything important has changed recently, though - except auto-injection of cljs deps. You can try disabling it to see if that won’t fix your problem, although I can’t imagine how it could cause what you’re describing.#2018-06-0609:51manuelthanks. It'd be hard to give an example, the code is under non-disclosure agreement.#2018-06-0612:51dpsuttonI'm not sure I've seen an easy way to inhibit invection of cljs deps#2018-06-0615:06bozhidarYou just set them to nil. 🙂 It doesn’t get much easier than this.#2018-06-0615:07manuel@bozhidar FWIW I switched to another project and everything's working fine.#2018-06-0615:07manuelmust be something messy in the other one's config#2018-06-0615:14bozhidarGood to know!#2018-06-0615:16dpsutton@manuel does the other one still rely on cemerick/piggieback?#2018-06-0615:16manuelyep just noticed it and updating its project.clj#2018-06-0615:17manuelthanks 🙂#2018-06-0615:17dpsuttoni think there's still some incompatability with figwheel piggieback and cemerick. i'm still trying to track it down#2018-06-0615:41richiardiandreaYesterday Bruce fixed a problem FYI in Piggieback: it was not threading in some compiler options#2018-06-0615:49bhauman@bozhidar the figwheel repl launches a node process, and it would be nice if there was a finally block in nrepl that sends a tear-down message through the middleware stack, because if folks don't :cljs/quit from the cljs repl it seems to hang. This may be an none issue, as it may just be Reply's handling of shutdown, still investigating. But ... the nature of the system doesn't really allow for clean up.#2018-06-0616:44bhaumanhmmm it does look like its just a problem in reply#2018-06-0616:58bhaumanyeah its only a problem when I do control-D out of reply it leaves a node process running on my machine#2018-06-0616:59bhaumanbut its fine when I quit out of cider#2018-06-0617:14richiardiandrea@bhauman is the new piggieback in a SNAPSHOT? Cannot use gitlibs because of https://github.com/clojure-emacs/cider/issues/2308#2018-06-0617:18richiardiandrea(I mean I can clone it of course 😉 just asking)#2018-06-0617:18bhaumanyeah#2018-06-0617:18bhaumanits not released#2018-06-0617:19bhaumansupposedly I have permission to do that, I just haven't figured it out yet#2018-06-0617:19richiardiandrealein deploy clojars#2018-06-0617:19bhaumanI also fixed this in figwheel.main proper to work with the current piggieback#2018-06-0617:19richiardiandrea(maybe)#2018-06-0617:19richiardiandreaok I am trying thanks!#2018-06-0617:20bhauman@richiardiandrea but I haven't release the figwheel.main yet#2018-06-0617:20bhaumaneither#2018-06-0617:20richiardiandreacloning both#2018-06-0617:42richiardiandrea@bhauman ☝️#2018-06-0617:42bhaumanyeehaw!!#2018-06-0617:42richiardiandreaawesome#2018-06-0617:43richiardiandreafigwheel-main can now become a proper repl type 😄#2018-06-0617:43bhaumanI'd really like this to be more configurable, need to be able to supply args to figwheel.main start#2018-06-0617:44bhaumanalso I think figwheel main start should probably take the command line args#2018-06-0617:44bhaumanor there should be another fn that does that#2018-06-0617:45richiardiandreacider usually has configurable command line strings so probably we can take the same approach#2018-06-0617:45richiardiandreathe problem is how to make the REPL forms configurable enough#2018-06-0617:46richiardiandreasay you want to launch different builds .... this is a more general cider improvement though#2018-06-0617:46bhaumanexactly#2018-06-0617:46bhaumanthats what I was refering to#2018-06-0617:49richiardiandreaat some point I wanted to have something like a "plugin" in inf-clojure where you declare your maven deps and a function that will be called for configuration (that sends forms to the repl)...didn't have time to expand it and dropped it 😄#2018-06-0617:54richiardiandreathis is probably an unnecessary complication, as we could just add functions specific to figwheel, for instance, that produce the form to send...with defcustoms ad-hoc for its options#2018-06-0617:55bhaumanmuch easier#2018-06-0617:55richiardiandreaand that's how a cider-figwheel.el was born 😄#2018-06-0617:55bhauman🙂#2018-06-0618:21richiardiandrea@bhauman @bozhidar quickly hacked https://github.com/clojure-emacs/cider/pull/2313#2018-06-0618:34bhaumanisn't is easy to make that interactive to ask which build id you want?#2018-06-0618:58richiardiandreayes I just opened it for discussing more about it 😄#2018-06-0701:08bozhidar@bhauman What exactly is the problem you have with deployments? On Clojars you’ve got access to https://clojars.org/groups/cider#2018-06-0701:09bozhidarTechnically you can deploy updates to everything under cider/. 🙂#2018-06-0701:17bozhidar@richiardiandrea Regarding making things flexible - the form for booting a cljs repl can be a string or a function generating a string. If you need to generate something dynamically, prompting the user for input and so on - that’s the way to go.#2018-06-0702:06richiardiandreaYep I saw that, it is nice, please comment on the PR for the best approach...Bruce was asking about interactive build ids for instance. I did not want to answer that before you give your opinion simple_smile#2018-06-0704:02bozhidarThat’s what we do for shadow, so I’d probably do the same with figwheel for consistency.#2018-06-0704:43richiardiandreaOh cool I can check and enable that for both, didn't know that#2018-06-0704:03bozhidarBtw, I cut 0.3.6 while waiting at my gate.#2018-06-0704:44richiardiandreaAwesome#2018-06-0704:44richiardiandreaWill bump cider tomorrow#2018-06-0713:53rhansenI'm sorry if this is written down somewhere, I couldn't find it in the documentation. Is there anyway of specifying which alias to use when calling cider-jack-in in a deps.edn project?#2018-06-0713:54rhansenlike cider-jack-in -A:test#2018-06-0717:57bozhidarWell, it doesn’t work quite like this.#2018-06-0717:58bozhidarThere are a few cider-clojure-cli-* defcustoms which control what gets invoked on cider-jack-in. I guess you should just modify one of those.#2018-06-0718:00richiardiandrea@rhansen I use this in my .dir-locals.el:
((nil . (cider-preferred-build-tool . "clojure-cli")
(cider-clojure-cli-global-options . "-A:cljs-jvm:dev:unit-test")))
#2018-06-0718:42hlollispeaking of alias, is there any neat way to have two leiningen profiles from a project, I'm still thiking if a minimal cider-jack-in-with-lein-profile function would be worth adding. I could make one myself. Otherwise I guess it's only the global variable (set-variable 'cider-lein-parameters "with-profile +my-profile repl") that would need to be changed before starting a new profile.#2018-06-0718:48hlolliwell, it's not such a big deal, I'm makeing a boilerplate for a cljc project. I leave the headache to the user to choose clj vs cljs profile.#2018-06-0719:55aganyone having problems with code reloading in CIDER 0.18.0snapshot (package: 20180606.1608) ?#2018-06-0720:01richiardiandreaCode reloading is usually a repl/underlying tool concern I guess, what error do you get#2018-06-0722:01richiardiandreaso how to I execute a (require 'my-ns.core :reload) in cider?#2018-06-0722:02richiardiandreawhich function achieves that?#2018-06-0722:02dpsuttoncider-refresh-after-fn#2018-06-0722:02richiardiandrea(I am not using tools.namespace)#2018-06-0722:02dpsuttonoh wait. thought you meant after refreshing. sorry#2018-06-0722:02richiardiandreayeah just a require + :reload#2018-06-0722:05dpsuttoni'm not sure i follow. there's nothing that does a require that i know of#2018-06-0722:05dpsuttonthere's cider-refresh of course to reload#2018-06-0722:05richiardiandreaoh#2018-06-0722:05richiardiandreain inf-clojure I added https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L386#2018-06-0722:06dpsuttoncheck the comma menu. should be refresh/restart in there#2018-06-0722:06richiardiandreaso I though cider had the same...#2018-06-0722:06richiardiandreayep but that's tools.namespace...I guess, but will explore#2018-06-0723:01richiardiandreaothe q. is there a way to create a cljs buffer only with no clj buffer?#2018-06-0723:06dpsuttonnot that i've ever heard of. cljs is always a sibling#2018-06-0723:06dpsuttonunless you manually invoke the startup shenanigans#2018-06-0723:07richiardiandreathanks a lot, I was afraid of that 😄#2018-06-0723:07richiardiandreaI have functions for sending the shenanigans to REPL, I will use those#2018-06-0723:35ag> is there a way to create a cljs buffer only with no clj buffer?
Technically when you do (cljs-repl) in becomes cljs only buffer, right?#2018-06-0723:38agI guess you're trying to get a way to do cider-jack-in-cljs with only one cljs buffer?#2018-06-0723:48richiardiandreaYep exactly @ag#2018-06-0800:06agYou can just kill clj repl, but why would you do that? Having 2 repls is convenient#2018-06-0800:20richiardiandreaBecause at the moment I am working on the server side only - node - in cljs#2018-06-0813:10bozhidar@richiardiandrea There’s nothing like this in CIDER, just the tools.namespace reload. Obviously it won’t be hard to add it, though.#2018-06-0813:10bozhidarI never needed anything else. 🙂#2018-06-0814:20genmeblogafter upgrading to emacs 26.1 I've started to get following errors when trying to connect to nrepl (or doing cider-jack-in).
error in process filter: queue-enqueue: Wrong type argument: queue, [cl-struct-queue nil nil]
error in process filter: Wrong type argument: queue, [cl-struct-queue nil nil]
Packages were recompiled after upgrade, cider version: cider-20180607.2155#2018-06-0814:21genmeblog$ lein repl
nREPL server started on port 58957 on host 127.0.0.1 -
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b18
#2018-06-0814:21genmeblogand from emacs (cider-jack-in)
Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- repl :headless :host ::...
nREPL server started on 57781
[nREPL] Establishing direct connection to localhost:57781 ...
[nREPL] Direct connection to localhost:57781 established
error in process filter: queue-enqueue: Wrong type argument: queue, [cl-struct-queue nil nil]
error in process filter: Wrong type argument: queue, [cl-struct-queue nil nil]
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
#2018-06-0814:25hlolli@tsulej ah that. It's really annoying with these cl errors, that so many emacs developers use these cl- functions but don't realize that it's already required elsewhere in their emacs environment. I bet if you add (require 'cl) at the beginning of your init.el, it will fix.#2018-06-0814:27hlollior maybe not, sorry, the error doesn't look like cl-struct-queue is wrong...#2018-06-0814:27hlolliyou can try#2018-06-0814:28genmeblogjust tried, doesn't work 😞#2018-06-0814:29hlollihow about (defalias queue-enqueue 'cl-struct-queue) ?#2018-06-0814:29hlolliin the scratch buffer you can of course do M-. on the symbol queue-enqueue and see if it's there#2018-06-0814:30genmeblogchecking, meanwhile debugger output
Debugger entered--Lisp error: (wrong-type-argument queue [cl-struct-queue nil nil])
signal(wrong-type-argument (queue [cl-struct-queue nil nil]))
queue-enqueue([cl-struct-queue nil nil] "d2:id1:111:new-session36:a4c59ff8-14e5-4341-8fdd-6f8313c718867:session36:5906ee68-0733-4842-85f4-075c6f1136b46:statusl4:doneee")
nrepl-client-filter(#<process nrepl-connection<1>> "d2:id1:111:new-session36:a4c59ff8-14e5-4341-8fdd-6f8313c718867:session36:5906ee68-0733-4842-85f4-075c6f1136b46:statusl4:doneee")
accept-process-output(nil 0.01)
nrepl-send-sync-request(("op" "clone" "id" "1") #<buffer *cider-repl localhost*<2>> nil nil)
nrepl-sync-request:clone(#<buffer *cider-repl localhost*<2>>)
nrepl--init-client-sessions(#<process nrepl-connection<1>>)
nrepl-start-client-process("localhost" 58957)
cider-connect("localhost" 58957)
funcall-interactively(cider-connect "localhost" 58957)
#<subr call-interactively>(cider-connect nil nil)
apply(#<subr call-interactively> cider-connect (nil nil))
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> cider-connect nil nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (cider-connect nil nil))
call-interactively(cider-connect nil nil)
command-execute(cider-connect)
#2018-06-0814:31hlolliit's most likely this here https://github.com/clojure-emacs/cider/blob/dd836340ba9571b24d9bbccae2336c3f0c22116b/nrepl-client.el#L433-L436#2018-06-0814:33hlollisince string-q is nil in your error, you may want to resolve the symbol queue-create
(setq string-q (queue-create)))
probably also cl- function that needs to be aliased...#2018-06-0814:34genmeblogqueue-enqueue is there (from queue-0.2/queue.el package)#2018-06-0814:43genmebloglooks like process-get returns nil here https://github.com/clojure-emacs/cider/blob/master/nrepl-client.el#L471#2018-06-0814:50hlolliway deeper than I imagined first. No idea what's happening, why would the process filter even be evaluated if there's no data. I also have newest cider and emacs 26. No take that back, I'm on 25.3... I pass the ball.#2018-06-0814:59bozhidarI’ll test things on 26.1 when I can.#2018-06-0815:00bozhidarGenerally it’s a good idea to delete all compiled packages between Emacs updates.#2018-06-0815:00bozhidarCan’t imagine what else can it be.#2018-06-0815:03genmeblogI forced compilation of all packages. But probably deleting is better option here. I'll let you know in a minute.#2018-06-0815:10genmeblogthat was it... recompilation wasn't enough. Thank you for your time. No need to test @bozhidar#2018-06-0815:33bozhidarI feel like I have divine Emacs powers. 😄#2018-06-0816:28richiardiandreaCider gurus, I am trying to implement the :reload feature and it kind of freezes the UI with cider-interactive-eval the first time. I wonder if cider contains already some sort of async eval mechanism of some sort#2018-06-0816:28richiardiandrea(in the meantime, exploring the code base)#2018-06-0816:33dpsuttoni believe it is by default "async". check nrepl-send-request versus nrepl-send-sync-request#2018-06-0816:33richiardiandreawell, it seems all the commands call cider-interactive-eval so will use that for now#2018-06-0816:35dpsuttoni traced it for a second and it seemed like cider-interactive-eval uses the async version#2018-06-0816:35dpsuttonhowever emacs is single threaded so if you're doing stuff emacs is only doing that#2018-06-0816:39richiardiandrea(not for long because 26.1 introduced threads!)#2018-06-0816:40jmckitrickHas anyone here gotten shadow-cljs to auto-connect to the correct repl once things are up and running? I find I have to run (shadow.cljs.devtools.api/repl :app) manually in the clojure repl.#2018-06-0816:48hlollishouldn't be difficult to add something like
(cider-interactive-eval
(format "(shadow.cljs.devtools.api/nrepl-select %s)" build-id))
into the pipeline, I guess it's not there, I also have to choose the repl. But I also start a shadow-cljs server, it's probably tricky for cider to know if the nrepl is connecting to a watch or server.#2018-06-0816:48richiardiandreathere should be a command for launching the shadow things, maybe something is missing#2018-06-0816:49hlollicider actually auto detects if there's shadow-cljs.edn in cider-jack-in, it's very nice!#2018-06-0816:50richiardiandreahere: https://github.com/clojure-emacs/cider/blob/4c593d099825a8e9f6319903fcbe5bcbc15662cf/cider.el#L680#2018-06-0816:51hlolliso it's still that strange bug lurking around, with cider + shadow, sometimes things have to be said twice, or press enter sometimes to get the cljs connection running#2018-06-0817:47dealyhi, I'm just getting acquainted w/cider, is there a way to make it pretty print my maps by default?#2018-06-0819:33richiardiandreasay I am bootstrapping a CLJS manually#2018-06-0819:33richiardiandreado I need to set the connection type to cljs for the buffer manually as well?#2018-06-0819:34dpsuttonyes i believe so#2018-06-0819:34dpsuttonthat property is used in finding a repl of suitable type for evaluation#2018-06-0819:34dpsutton(setq cider-repl-typ "cljs") or something like that#2018-06-0819:39richiardiandrea@dpsutton thank you! check that#2018-06-0819:40dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L851#2018-06-0819:40richiardiandreacool thank you!#2018-06-0819:41richiardiandreashadow REPL is a bit flaky, trying it now for the first time#2018-06-0819:42richiardiandreabetter to start a server at the terminal and connect to it#2018-06-0819:49richiardiandrea@dpsutton actually...if you do cider-connect-clojurescript the cider-repl-type var seems to be set for you#2018-06-0819:49richiardiandreaeven if it is a clj repl not yet "upgraded"#2018-06-0819:50richiardiandreano ok, once you upgrade you lose it#2018-06-0819:51richiardiandreacrap, I am lost in tooling land 😄#2018-06-0819:51dpsuttoni think there are some bugs out there that are resetting the repl back to clj. i think a state message comes back after the upgrade and says clj so it resets the repl back to clj#2018-06-0819:52dpsuttonso be careful of what is intended behavior and what is a bug in state management#2018-06-0819:52richiardiandreayeah it seems like it#2018-06-0819:52richiardiandreabecause:
ELISP> cider-repl-type
"cljs"
<-- sent evaluation ->
ELISP> cider-repl-type
"clj"
#2018-06-0819:53richiardiandreamaybe the repl type should not be changed at all after the fact?#2018-06-0819:53richiardiandreabut I don't know maybe it is like this for a reason#2018-06-0819:54richiardiandreaELISP> (setq cider-repl-type "cljs")
"cljs"
ELISP> cider-repl-type
"cljs"
<-- sent cljs evaluation ->
ELISP> cider-repl-type
"clj"
ELISP>
#2018-06-0820:01richiardiandreait seems to me the behavior was there to manage when you do :repl/quit#2018-06-0820:01richiardiandreaand demote#2018-06-0820:02richiardiandreabecause it seems on :repl/quit a changed-namespaces is sent back#2018-06-0820:10richiardiandrea@dpsutton open a PR in order to discuss the behavior https://github.com/clojure-emacs/cider/pull/2316#2018-06-0820:50dpsuttonseems more like an issue at the moment#2018-06-0822:10richiardiandreait would be great if the patch can be tested for a little bit in order to see what the consequences are#2018-06-0822:12dpsuttonOh gotcha. Didn't notice there was a patch involved#2018-06-0822:12richiardiandreaa simple one 😄#2018-06-0822:37richiardiandreacompletions in shadow does not work am I right?#2018-06-0822:37richiardiandreaor do I need the cider-nrepl middleware with it?#2018-06-0904:16bozhidarYou need the middleware, as internally it uses the cljs-tooling where completing logic is.#2018-06-0904:17bozhidar@dpsutton @richiardiandrea The idea is that you might do something that changes the REPL type and it’d be nice for this to be detected and switch the type automatically. The detection is the track-state middleware and it just checks for the presence of some piggieback vars. Probably we can make it more robust.#2018-06-0904:18bozhidarGenerally we wanted to not need a different cider-connect function and be able to detect code that converts REPLs between clj and cljs.#2018-06-0904:19bozhidarI’m assuming that fixing the middleware is not going to be complex, but I haven’t paid this much attention as I’m stretched super thin and I use cljs only to test CIDER.#2018-06-0904:21dpsuttonI was talking about this today. We need a real world complex cljs app as a reference for testing CIDER#2018-06-0904:36richiardiandreaSo @bozhidar are you then saying that the track state middleware is most likely broken? Because according to the scenario I posted it always returns clj#2018-06-0904:39richiardiandreaI basically observed a :changed-namespace message coming on repl "upgrade". And it was always containing clj#2018-06-0904:40richiardiandreaIt might be coming from here: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#2018-06-0906:31xtreak29When I do cider-jack-in it gives Wrong type argument: stringp, package-desc. I am on emacs 26.1 on Mac OS. It gives the same error for even cider-version#2018-06-0906:33xtreak29Please ignore the above upgrading works for now 🙂#2018-06-0907:06bozhidar> I was talking about this today. We need a real world complex cljs app as a reference for testing CIDER#2018-06-0907:06bozhidarI don’t think we need it to be complex, but we certainly need a proper testing app in general. 🙂#2018-06-0907:06bozhidar> So @bozhidar are you then saying that the track state middleware is most likely broken? Because according to the scenario I posted it always returns clj#2018-06-0907:07bozhidarYes, it’s likely broken. Shortly after we started work on this @malabarba and me both got sidetracked and this was left in a somewhat immature state.#2018-06-0911:49magraWhen I want to interrupt cider in the repl I can use c-c c-b.
How can I stop an evaluation I executed using c-x c-e in a clj buffer?#2018-06-0911:59bozhidarSame way.#2018-06-0912:16magraI tried to stop a slurp to a url where something seems to be wrong. Should this be stoppable that way?#2018-06-0916:54bozhidarIt should be. If it’s not - you found some bug.#2018-06-0919:34magraOn my machine (Thread/sleep 10000) can be interrupted. (slurp "http://joyofclojure.com/hello") can not.#2018-06-0919:54magracider-version 0.18.0snapshot 20180607.2155#2018-06-0923:12richiardiandrealazy dev q. how to enable logging of nrepl messages again? 😄#2018-06-0923:18dpsuttonnrepl-toggle-message-logging#2018-06-0923:18dpsutton@richiardiandrea ^#2018-06-0923:19richiardiandreaawesome thanks a lot, I was reading 😄#2018-06-0923:20dpsuttonno worries!#2018-06-1011:03bozhidar@magra Please, file a ticket for this, so we won’t forget about it.#2018-06-1011:19magra@bozhidar Is this the same as, or related to, issue #2317 you added yesterday? https://github.com/clojure-emacs/cider/issues/2317#2018-06-1011:22magraok. It isn't it is just related to the workaround.#2018-06-1011:23bozhidarThe problem with 2317 is that when you start reading in you can’t mark the end of the input.#2018-06-1011:52magraYes, it seems that I have rediscovered this one: https://github.com/clojure-emacs/cider/issues/1438#2018-06-1013:25bozhidarAh, I remembered this one. Didn’t really have time to debug it properly, but that’s likely some issue on the nREPL side.#2018-06-1016:58theeternalpulseI'm connecting to the clojurescript repl run by shadow-cljs but cider can't resolve any requires or look up docs. is there an extra step needed for clojurescript projects to work ootb#2018-06-1017:44richiardiandrea@theeternalpulse I kind of noticed the same while working with shadow#2018-06-1017:44richiardiandreait happens with manual bootstrap so it might be some middleware issue#2018-06-1018:24richiardiandrea@bozhidar the README of nrepl says that the namespaces have been renamed to nrepl.* but that does not seem to be what is in src?#2018-06-1018:25richiardiandreais it a README issue, I can fix it...just wanted to be sure#2018-06-1023:02theeternalpulseMy issue actually was that I was as using shadow-cljs and I didn't include cider-nrepl. I assumed it would pick up my lein or boot profile.#2018-06-1023:11richiardiandreaIn cider with jack-in you should not need that, if you start it from the terminal then yes you need to hook that up#2018-06-1105:59bozhidar@theeternalpulse Yeah, it has to be on your classpath and shadow will leverage it properly.#2018-06-1106:00bozhidar@richiardiandrea I just checked in src and everything there seems correct to me. If you’re referring to the extra clojure dir, that’s because nREPL still has a bit of Java code under src/java. I’ll likely drop the Java code at some point.#2018-06-1106:06richiardiandreaOh ok got it, I was updating Shadow's namespaces today and I thought the error was due to that. Rather haste conclusion actually. Will report back.#2018-06-1107:51robert-stuttafordHow do I alter the host list shown by cider-connect? for some reason it won’t include ‘localhost’ until i’ve actually opened a connection to localhost once while Emacs is open. i’ve grepped all over the place to try find a history file, to no avail. it seems to be inferring a bunch of hosts from my ~/.ssh/config too#2018-06-1114:24theeternalpulseI think it looks down the path, and for lein looks at greps the process for the port and host#2018-06-1114:25theeternalpulseI had a pr to include additional paths, but I don't think it covered all the bases.#2018-06-1120:20mattlyso I'm having an issue where when I do cider-load-buffer everything seems to work fine – it'll even print stuff to the repl buffer and whatnot#2018-06-1120:20mattlybut for any given form when I try to eval it I get Namespace not found#2018-06-1120:21mattlyin the Messages buffer; nothing shows up anywhere else#2018-06-1120:23mattlyany ideas?#2018-06-1120:27dpsuttonwhat do you mean eval? do you mean typing a form in at the repl and evalling, or using the commands to eval last sexp in a code buffer?#2018-06-1120:31mattlysorry, the latter; evaling from a buffer#2018-06-1120:31dpsuttoncljc/ cljs/ clj?#2018-06-1120:32dpsuttonand how many projects do you have open? just the one?#2018-06-1120:33mattlyclj ; I've never gotten cljs working with cider#2018-06-1120:33mattlydespite trying#2018-06-1120:33dpsuttonoh bummer. sorry about that#2018-06-1120:33mattlyI have a few projects open, though this is the only one connected#2018-06-1120:34mattlyit's ok, I can't get cljs working anywhere else either#2018-06-1120:34dpsuttoncan you try m-x nrepl-toggle-message-logging? It will show you the messages going back and forth#2018-06-1120:34dpsuttoncan look at those to see if there are any clues#2018-06-1120:34dpsuttonit will make a Messages buffer for you#2018-06-1120:34mattlysure, thanks#2018-06-1120:42mattlyok I think I figured it out#2018-06-1120:42dpsuttonwhat's the issue?#2018-06-1120:43mattlyso for my dev profile in lein, I've got a source dir env/dev/src:` :source-paths ["env/dev/src"]`#2018-06-1120:43mattlythe file at env/dev/src/sketch.clj has (ns sketch but cider was thinking it was supposed to be (ns dev.src.sketch#2018-06-1120:43mattlychanging it to that and reloading the buffer made it happy#2018-06-1120:44mattlyreally I should just be doing this type of exploratory work in org+babel#2018-06-1120:44mattlybut I haven't gotten that working quite right either#2018-06-1120:44dpsuttonthat seems weird. I don't think CIDER expects stuff like that. I thought that's classpath stuff#2018-06-1120:45dpsuttonbut i'm not sure. I get real hazy on those details#2018-06-1120:45mattlyyeah I'm not really sure on that either#2018-06-1120:45mattlyI understand just enough of this stuff to cargo cult bits and pieces#2018-06-1120:45dpsuttonwelcome to the club#2018-06-1120:46mattlystory of my career 😄#2018-06-1122:44richiardiandreadoes anybody knows why the following keys are not defined in my repl?
(with-eval-after-load "cider-repl-mode"
(define-key cider-repl-mode-map (kbd "C-c r f") 'ar-emacs-cljs-figwheel-main-repl)
(define-key cider-repl-mode-map (kbd "C-c r n") 'ar-emacs-cljs-node-repl)
(define-key cider-repl-mode-map (kbd "C-c r p") 'ar-emacs-cljs-piggieback-node-repl)
(define-key cider-repl-mode-map (kbd "C-c r b") 'ar-emacs-cljs-boot-repl)
(define-key cider-repl-mode-map (kbd "C-c r s") 'ar-emacs-cljs-shadow-select-repl))
#2018-06-1122:45richiardiandreaah#2018-06-1122:46richiardiandreaI need cider-repl there, which is the "namespace" of the file#2018-06-1204:05dpsuttonjust made a PR to make CIDER feel a bit more like the way cursive inserts and evals forms in the repl. Probably most useful for comment blocks. But put the cider-insert-X-into-repl commands into their own map so they are easier to invoke. Previously it required a prefix arg to cause the repl to evaluate it by default so there's a new defcustom to make it eval by default. It also used to move the cursor to the repl which isn't always what I would want so there's a defcustom to not do that. comments and thoughts welcome! https://github.com/clojure-emacs/cider/pull/2319#2018-06-1204:14dpsutton@tbaldridge i think you might be interested in this because it seems to be the way you like to work. I was watching your JIT videos and I've seen your others in the past. Make it easy to send forms to the repl and show the form and the result#2018-06-1206:39bozhidar@dpsutton Nicely done! If you want to tackle something similar - you can take a look at https://github.com/clojure-emacs/cider/pull/2311 and put the format code/edn stuff into their own keymap as well.#2018-06-1207:34manuel@dpsutton lovely, thanks for the PR. Already using it. 🙂#2018-06-1208:33p4v4nHi All,
Is there a way to load new dependencies into an existing cider-nrepl without using cider-restart?#2018-06-1208:38bozhidar@p4v4n clj-refactor adds such functionality.#2018-06-1208:39bozhidarEventually we plan to have this in CIDER itself, but we don’t have any concrete timetable on this.#2018-06-1208:40bozhidarUsing something like pomegranate should make this easy (hopefully).#2018-06-1208:47p4v4nThanks @bozhidar
cljr-add-project-dependency is exactly what i needed.#2018-06-1221:22jsa-aerialCuriosity question: At some point between cider(-nrepl) 0.12 and 0.17 it looks like print-length was defaulted to 100. When did that happen?#2018-06-1301:30dpsuttonIf anyone is interested there's a PR (https://github.com/clojure-emacs/cider/pull/2323) open to make eval-ing the top level defun do the correct thing inside of comment forms and eval the top level inside of the comment form rather than just dumbly returning nil from the comment itself. comment and thoughts welcome#2018-06-1303:28stardiviner@dpsutton no, I want to see the docment of .write.#2018-06-1303:30dpsuttoni'm not sure i follow then#2018-06-1322:01zalkyHey all: does anyone know if it's possible to suppress the printing of errors directly in the cider repl, but still have them show in an exception pop-up buffer? The errors being printed directly into the cider repl are playing havok with the parenthesis parsing and indentation modules.#2018-06-1401:08theeternalpulseHow do I force downloading the correct version of cider in emacs/spacemacs#2018-06-1401:13theeternalpulseI'mgetting an issue with 0.18 and the nrepl#2018-06-1401:14theeternalpulseI can connect but it pretty much stops after it starts, so I can't eval or use the repl#2018-06-1401:17theeternalpulseshould it be 0.17?#2018-06-1401:28theeternalpulseof cider that is#2018-06-1401:28dpsuttonare you talking about cider or cider-nrepl? CIDER version is up to you: melpa stable is 0.17.0 and the melpa version is 0.18.0-SNAPSHOT#2018-06-1401:28dpsuttondo you get any feedback when it "pretty much stops"#2018-06-1401:30theeternalpulseso I go to eval, and emacs highlights green, then red and says that I have to be connected to a clojurescript repl#2018-06-1401:31theeternalpulsethe odd thing is that the repl operates, but tells me that there is a mismatch#2018-06-1401:32theeternalpulseWARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (0.17.0). Things will break!
More information.
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
#2018-06-1401:32theeternalpulsethe no project is an ongoing issue with trying to get it to connect with shadow-cljs#2018-06-1401:32theeternalpulsenot sure if that's related to why I can't eval#2018-06-1401:33dpsuttonare you using piggieback in your dependencies?#2018-06-1401:34dpsuttonor wait, you said shadow, so you aren't#2018-06-1401:34theeternalpulsehmm, let me try something#2018-06-1401:34dpsuttonor does it? I don't remember#2018-06-1401:34theeternalpulsereading through the nrepl docs, I think i'm missing SNAPSHOT#2018-06-1401:34dpsuttonyeah cider 0.18.0 does not exist#2018-06-1401:35theeternalpulseof cider-nrepl#2018-06-1401:35dpsuttononly it's snapshot for development purposes#2018-06-1401:35dpsuttonyeah i see that from your output. do you explicitly say which cider-nrepl version to use?#2018-06-1401:36theeternalpulseI changed it WARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (0.17.0-snapshot). Things will break!
#2018-06-1401:36dpsuttonchanged what?#2018-06-1401:36theeternalpulsethe reference to cider-nrepl to use snapshot#2018-06-1401:36dpsuttoncider should inject its own nrepl dependency. if possible you should remove it#2018-06-1401:37dpsuttonthat way you don't have to worry about them going in lockstep#2018-06-1401:37dpsuttonalso, CIDER now injects cider/piggieback and i bet that might be mucking with some stuff as well#2018-06-1401:37theeternalpulsenow it's complaining about nil#2018-06-1401:37theeternalpulseWARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.
#2018-06-1401:38theeternalpulseI think I did something, I don't remember this happening when I first fiddled with shadow-cljs#2018-06-1401:38dpsuttoni don't know much about shadow unfortunately#2018-06-1401:38theeternalpulseI think updating cider was the first thing I did before this started happening#2018-06-1401:39dpsuttonmaybe downgrade to 0.16.0 and see what happens? then report a bug?#2018-06-1401:40theeternalpulsefrom melpa or melpa-stable#2018-06-1401:41dpsuttonmelpa#2018-06-1401:42dpsuttonstable#2018-06-1401:42dpsuttonmelpa-stable are the releases, melpa are the dev versions. although the non-snapshots might be on melpa as well. but melpa-stable are the intended releases#2018-06-1401:43dpsuttonit's kind of a pity that the base name "melpa" are the dev versions and you have to go out of your way to get the stable releases on "melpa-stable"#2018-06-1401:43theeternalpulselet me try 0.17 stable#2018-06-1401:43dpsuttoni think it should be melpa and melpa-dev but that ship has sailed#2018-06-1401:54theeternalpulse0.17 is seen by emacs as obsolete, it won't let me revert#2018-06-1401:55dpsuttonemacs or spacemacs?#2018-06-1401:55theeternalpulsespacemacs, sorry#2018-06-1401:56dpsutton0.17 is the current stable. that's a spacemacs problem then#2018-06-1402:01theeternalpulseahhh, so I just removed cider layer, restarted to have them cleared out, restarted and added cider layer, now it works perfectly#2018-06-1402:01theeternalpulsefinds the port by itself and project association#2018-06-1402:01dpsuttonand the repl is evaling just fine?#2018-06-1402:01theeternalpulseyup#2018-06-1402:01dpsuttonthe ole turn it off turn it on?#2018-06-1402:02theeternalpulseThat really needs to be at the top of my debugging#2018-06-1402:02dpsuttonelisp can be fickle. i named a variable comment-start in my own let binding and it would kill my emacs font locking and error out#2018-06-1402:02theeternalpulsethe obvious difference was that I'm using spacemacs, and it has it's own config I have no control of#2018-06-1402:03dpsuttonbecause that's a global var that's not supposed to be an integer apparently. go figure#2018-06-1402:03dpsutton¯\(ツ)/¯#2018-06-1402:05theeternalpulsewild. I'm trying to tackle elisp myself and I hit walls very often#2018-06-1402:05theeternalpulsethe whole ecosystem is a massive state machine, have to know where the buttons and levers are buried under buttons and levers#2018-06-1405:55bozhidar@jsa-aerial I think this was done in 0.17. It’s configurable.#2018-06-1416:32vemvI am facing a single logical project, but divided into clj and cljs codebases, each with its own project.clj
I'm more used to a single project.clj.
Is the former scenario something CIDER can handle well? i.e. multiple connections, each with its own middleware running I presume
Otherwise should I fire up two Emacs instances instead? Recommendations welcome#2018-06-1416:34dpsuttonso projectile uses the git root as the project so they will appear as one to that (which is probably good). but i believe in dispatching to repls CIDER looks for a base project.clj which means they will appropriately appear as two, wihch you probably want here#2018-06-1416:35vemvand does CIDER work fine with two disparate projects? e.g. I don't want autocompletions from one project being offered for the other one#2018-06-1416:35dpsuttonyes just fine#2018-06-1416:36dpsuttonalthough if you are on 0.18.0-snapshot there's about to be a major overhaul of connections so you'll be kind of a canary on that front.#2018-06-1416:36dpsuttonif there are any problems 0.17.0 from melpa-stable should be just fine#2018-06-1416:38vemvbtw, how to install a fixed version? Last time I researched that didn't seem possible
My code is like this
(dolist (package '(cider company queue fiplr clojure-mode clj-refactor
dash simpleclip helm-ag git-timemachine paren-face))
(unless (package-installed-p package)
(package-refresh-contents)
(package-install package)))
#2018-06-1416:37dpsuttonif you run into problems with things from one project being eval-ed in the other let me know. i've got a patch that makes that better that gets rid of the "last repl used" heuristic which i find is often not what i want#2018-06-1416:38dpsuttongetting on a flight i 'll let someone else answer#2018-06-1417:12richiardiandreawhat can be the reason of a bunch of
[WARNING] No nREPL middleware descriptor in metadata of #'cider.piggieback/wrap-cljs-repl, see clojure.tools.middleware/set-descriptor!
...
?#2018-06-1417:15richiardiandreaoh it seems the namespaces for nrepl have not been changed in https://github.com/nrepl/piggieback#2018-06-1417:16richiardiandreais there a reason why not or just folks did not get to it yet? should I do it?#2018-06-1417:33bozhidar@richiardiandrea I haven’t had time to add a lein task to spin nREPL for CIDER. Without this there’s no way to start a new nREPL server, as lein doesn’t support it yet. Same issue with boot.#2018-06-1417:34bozhidarWhen this is done I’ll update all the middleware to target the new nREPL.#2018-06-1417:36richiardiandrea@bozhidar I was wondering because I changed the namespaces in shadow but I started to have all the warnings, it seems the until cider/piggieback changes this https://github.com/nrepl/piggieback/blob/master/src/cider/piggieback.clj#L5#2018-06-1417:36richiardiandreait cannot work with nrepl 0.4.1#2018-06-1417:37richiardiandreaah yeah ok#2018-06-1417:37richiardiandreasorry I re-read your message#2018-06-1417:39bozhidarYeah, once the boot and lein tasks are added to cider-nrepl we’ll just update our defcustoms and all the middlewares.#2018-06-1417:40bozhidarIf you can just wrap your work on the boot task and do the very same task for lein that’d be appreciated!#2018-06-1417:43richiardiandreaabout the boot task, do you think that's all we need? I feel we would break a lot of stuff if we do not replicate the original boot task (the server one, which has a lot of options)#2018-06-1417:48bozhidarWhy?#2018-06-1417:49bozhidarNot sure how many people use those, I know I never did use any fancy options.#2018-06-1417:49richiardiandreauhm ok#2018-06-1417:50bozhidarIf the tasks take more params that’d certainly be better, but I don’t view this is something that’s must have right now.#2018-06-1417:59bozhidarIf you decide to do something very flexible I won’t stop you, but right now I’ll just take anything that actually gets us to a running REPL. 🙂#2018-06-1418:17richiardiandreaok so if that's the case i will make sure it works than remove the WIP from that PR#2018-06-1418:53cjsauerHow would I go about adding an alias to the cider-jack-in command if using tools.deps? Does it happen to auto-add :dev or :repl or anything I can hook into?#2018-06-1418:54richiardiandrea@cjsauer this is what I have in my dir-locals.el#2018-06-1418:54richiardiandrea...
(cider-preferred-build-tool . "clojure-cli")
(cider-clojure-cli-global-options . "-A:cljs-jvm:dev:unit-test")
#2018-06-1418:59cjsauer@richiardiandrea hm...can't seem to get that working. Is the file .dir-locals.el, with the leading dot? I admittedly haven't used local variables in emacs before 😅#2018-06-1419:00richiardiandreayeah it is with a dot and you need revert-buffer to load them#2018-06-1419:03cjsauer@richiardiandrea with this as .dir-locals.el I keep getting Wrong type argument: listp...
(cider-preferred-build-tool . "clojure-cli")
(cider-clojure-cli-global-options . "-A:dev")
:thinking_face:#2018-06-1419:03cjsauerDo I need to wrap these forms in a list?#2018-06-1419:08cjsauerI found I can just write a shell script with this in it:
clj -A:dev:test -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'
#2018-06-1419:08cjsauerAlmost does the right thing, but refactor-nrepl isn't getting loaded...#2018-06-1419:08cjsauerGuessing I need to add it to the middleware stack...#2018-06-1419:10cjsauerAha:
clj -A:dev:test -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware" "refactor-nrepl.middleware/wrap-refactor"])'
#2018-06-1419:10cjsauerThis works, now I can just cider-connect to that#2018-06-1419:13richiardiandrea@cjsauer sorry yeah you can do that but also use .dir-locals.el, the format is not exactly the one I sent you because I have extracted only the salient parts 😉#2018-06-1419:14richiardiandreabut cider inject its own deps so you can avoid lauching terminal scripts by using the above defcustoms#2018-06-1419:14cjsauer@richiardiandrea ah ok. I'm not familiar at all with .el files, I come from the land of Vim haha#2018-06-1419:15cjsauerWould the syntax be:
(defcustom
(cider-preferred-build-tool . "clojure-cli"))
Something like this?#2018-06-1419:33richiardiandrea@cjsauer sorry a bit busy now but you can google emacs .dir-locals.el or if you use projectile you can delete the file and use C-c p E#2018-06-1419:36cjsauerThanks for the help @richiardiandrea, appreciate it 🍻#2018-06-1420:43Garrett HopperIs there a way to use the cljs browser repl via cljs.main?#2018-06-1420:44Garrett HopperDo I need to manually setup a cider-nrepl repl then start the browser cljs repl?#2018-06-1421:14richiardiandrea@ghopper my PR should be in. figwheel-main is the type#2018-06-1421:19Garrett HopperCool, thanks#2018-06-1510:37bbssI recently updated my prelude packages, and now I have an issue where I can still start a shadow-cljs repl and have it autobuild. But inline evaluation tells me it needs a cljs repl and I probably need to jack-in. I've tried to cider-assoc-buffer-with-connection manually. But that doesn't change it.#2018-06-1521:39bozhidar@bbss See the conversation here - https://github.com/clojure-emacs/cider/pull/2316#2018-06-1521:39bozhidarI haven’t investigated what’s wrong with shadow-cljs exactly, but I also don’t recall any changes on our end recently that might have caused this.#2018-06-1521:43richiardiandrea@bbss yes, I am setting the repl type manually on my side now...I personally too, haven't had time to investigate more#2018-06-1521:43bbssOkay thanks! using cider-repl-set-type seems to have done the trick, I'll read up a bit more if I run into it again. I only recently started using shadow-cljs (it's great). It was working earlier, maybe I messed up an emacs setting.#2018-06-1521:44bozhidarMore likely something is messed up with the repl type detection with shadow, but I haven’t had time to debug it, and it seems no one else had time for this as well.#2018-06-1521:44richiardiandreawell, not manually but with something like:
(defun ar-emacs-cljs-shadow-select-repl ()
"Return the init form a running shadow-cljs REPL."
(interactive)
(save-some-buffers)
(let ((build-ids (read-from-minibuffer "Shadow-cljs build: ")))
(ar-emacs-clj--send-to-repl
(concat "(do (require 'shadow.cljs.devtools.api) "
(format "(shadow.cljs.devtools.api/nrepl-select %s)" build-ids)
")")))
(ar-emacs-clj--set-cljs-repl-type))
#2018-06-1521:44richiardiandrea(defun ar-emacs-clj--set-cljs-repl-type ()
"Set the cider REPL type to cljs."
(when (or (bound-and-true-p cider-mode)
(equal major-mode 'cider-repl-mode))
(with-current-buffer (cider-current-repl-buffer)
(cider-repl-set-type "cljs")
(cider-repl-return))))
#2018-06-1521:45bbssto make matters more complicated it's a chrome-extensions which runs in a slightly different browser context. It's (in early) support by shadow-cljs though and worked before. I might just have messed up my emacs..#2018-06-1521:45bozhidarI haven’t merged the proposed workaround mostly because I’ve decided not to merge any PRs while we merge the big connection overhaul as I don’t want @vspinu to have to deal with conflicts there.#2018-06-1521:45bbss@richiardiandrea cheers, appreciated!#2018-06-1521:45richiardiandreamake sense @bozhidar, better to get that in 😉#2018-06-1521:46richiardiandreaemacs is flexible enough that I can maintain a couple of lines of elisp for now 😉#2018-06-1521:46richiardiandrea(double wink)#2018-06-1521:47bbssI should probably take some time to learn some elisp#2018-06-1521:48richiardiandreait's as fun as writing Clojure 😄#2018-06-1521:48bbsshahah, unbelievable!#2018-06-1521:48richiardiandreaI can say, better, at times#2018-06-1521:49bbssah really? I guess emacs gets better as you understand it better, so I can imagine.#2018-06-1521:49richiardiandreain terms of tooling it is super smooth imho#2018-06-1521:49richiardiandreadebugging + REPL#2018-06-1521:49richiardiandrea(well, cider has the same)#2018-06-1607:22bozhidar@richiardiandrea Mostly because our main inspiration for cider’s debugger was edebug 😄#2018-06-1607:23bozhidarI used to hate Elisp in the beginning, but it really grows on you (+ the language evolved so much since I started using Emacs around 22.1).#2018-06-1611:05benedek@bozhidar your refactor-nrepl commit breaks compatibility with 0.17 cider i think#2018-06-1611:05benedekI think it is better to keep snapshot compatible with 0.17 until i have time to cut a release#2018-06-1611:06bozhidarWhy? Orchard is a self-contained dep which is rewritten, so nothing will break.#2018-06-1611:06bozhidarBut on the bright side - now this works with 0.18.#2018-06-1611:06benedekah ok#2018-06-1611:07benedekDid not realise but i guess you are right#2018-06-1611:07benedekThanks then :)#2018-06-1611:07bozhidarThis wasn’t renamed internally in cider-nrepl, it’s just not there anymore. 🙂#2018-06-1614:20blueberryC-x o (other-window) seems to work differently in recent cider. Is there a way to return to previous behavior? I have 3 monitors, with one workspace each. Each monitor has an emacsclient opened. Previously, if I invoked C-x o, it cycled through open buffers/windows in that particular workspace/monitor's emacslicent. Now, C-x o would display a number in all windows, and I have to type a number of the window I want to switch to. The desired behavior is, as previously, to move the focus to the next window in the same emacsclient, and leave emacsclients in other workspaces/monitors alone. Any hints?#2018-06-1614:54dpsuttonhave you upgraded to emacs 26 recently? I believe by default C-x o runs the command other-window which is not CIDER related but an emacs built-in.#2018-06-1614:55dpsuttonif you're not using spacemacs, hit C-h c (ask which command is invoked by key combo) C-x o to see what command is run by C-x o#2018-06-1614:55dpsuttoni'm sure spacemacs has similar functionality i'm just not sure where it is#2018-06-1615:26blueberry@dpsutton emacs is 25.3 on arch. I'haven't updated anything but cider in the last few months. I've been away from home for one month, and before the cider update that I did one month ago (before I left) everything worked as expected. Now, you gave me a good hint. It seems that C-x o is bound to ace-window instead of other-window, but I don't know why, since, as I said, I didn't change anything else but updated cider...#2018-06-1615:32dpsuttonweird. but ace-window is not a dependency of cider that i know of#2018-06-1616:15blueberry@dpsutton after unsuccessfully trying to eradicate ace-window from my emacs, I found out that it's a dependency of @bozhidar’s prelude, so I'll have to find a way to disable just this particular remapping of C-x o, as I really prefer the old behavior.#2018-06-1616:16dpsuttoni see. i think it's normally bound to M-p must have changed recently#2018-06-1616:16bozhidarYou don’t need to remove it. You just need to change the keybinding.#2018-06-1616:16dpsuttonthe man speaketh#2018-06-1616:17bozhidarIt’s not bound to anything by default. I just bind it to C-x o as I think it’s better than the default in every use case.#2018-06-1616:17bozhidarMany modes bind M-p, so that’s a poor keybinding IMO.#2018-06-1616:22blueberry@bozhidar In my multi-monitor case the new behavior is just annoying. Previously, I easily cycled between buffers with C-x o, and if I needed to switch windows, I used my winow manager for that (xmonad). Now, I have to look for the right number to type each time I do C-x o, even though in 95% of the cases I just want to move to the next buffer. Anyway, what is the right place to disable/change this setting and get back to C-x o invoking other-window?#2018-06-1616:23blueberryBTW, I usually switch to other Prelude defaults, as they turn out to be better than how things work by default, but this particular functionality is really annoying, at least in my setup...#2018-06-1616:26dpsuttonit looks like its in core/prelude-global-keybindings.el#2018-06-1616:27dpsuttonhttps://github.com/bbatsov/prelude/blob/master/core/prelude-global-keybindings.el#L115#2018-06-1616:30blueberryThanks. I also found that, but I do not know whether I should edit there (and introduce a difference to the stock prelude) or I can override somehow in my custom.el? (global-set-key "C-x o" 'other-window) didn't work...#2018-06-1616:36dpsuttonuse personal.el but yeah should be fine#2018-06-1616:36dpsuttoni think custom is for things changed with the defcustom editor#2018-06-1616:36blueberry@dpsutton I do not have personal.el. In prelude, custom settings are in .../personal/custom.el#2018-06-1616:37blueberryAnd how exactly should I disable the setting?#2018-06-1616:37blueberryprelude does that remapping-fu...#2018-06-1616:37blueberryIs there a way to undone it, or I should let it do its business, and then re-re-map it somehow to other-window?#2018-06-1616:37dpsutton>
In some cases you may not want to have a key-chord that is defined by prelude,
in which case you can disable the binding in your personal.el file by setting
its command to nil. For example, to disable the jj key-chord add the
following line:#2018-06-1616:38dpsuttonfrom the readme. i believe you should create a personal.el file and use your modifications in there. i believe custom.el is used and assumed to be overwritable#2018-06-1616:38dpsutton;; config changes made through the customize UI will be store here
(setq custom-file (expand-file-name "custom.el" prelude-personal-dir))
#2018-06-1616:38dpsuttonthat will probably nuke your stuff if you ever use the customize ui#2018-06-1616:41dpsutton;; load the personal settings (this includes `custom-file')
(when (file-exists-p prelude-personal-dir)
(message "Loading personal configuration files in %s..." prelude-personal-dir)
(mapc 'load (directory-files prelude-personal-dir 't "^[^#\.].*el$")))
#2018-06-1616:41dpsuttonyou can name it whatever you want and however many you want. just custom.el is assumed for particular use#2018-06-1616:41blueberry@bozhidar Now I am lost 🙂 Can you give us a hint about this C-x o "back to defaults" thing?#2018-06-1616:43dpsuttonhttps://github.com/bbatsov/prelude#disabling-key-chords#2018-06-1616:43blueberry@dpsutton Is there a difference to the jj example that, in this case, it's not about the chord, but the C-x something, and that I do not want to disable it, just to disable the particular remaping to ace-window?#2018-06-1616:44dpsuttonthen just manually (global-set-key (kbd "C-c C-w") 'copy-defun-for-web) or whatver you need#2018-06-1616:44blueberry@dpsutton Thank you for trying to lead me here. I've already tried global-set-key and it didn't work#2018-06-1616:45blueberryit still invokes ace-window#2018-06-1616:45dpsuttonhmm. that's strange#2018-06-1616:45blueberryI've also read and re-read that disabling-key-chords, but I do not understand how it applies here#2018-06-1616:45blueberrysince I do not want to disable the bindings#2018-06-1616:46dpsuttonyou could try what he's doing in the first place: (global-set-key [remap other-window] 'ace-window) and instead do (global-set-key [remap ace-window] 'other-window)#2018-06-1616:46blueberryI've also make sure that I restarted emacs each time 🙂#2018-06-1616:47blueberryNope. Doesn't work for me...#2018-06-1616:47blueberryI've tried evaling it with C-x C-e, and also added it to custom.el, and restarted emacs#2018-06-1616:48bozhidarHmm, if you’ve placed this in the right place it’s impossible for this not to work.#2018-06-1616:48bozhidarYou should not edit custom.el manually, btw.#2018-06-1616:48blueberry? I thought this is the place for user's personal things. Thanks for pointing this out to me!#2018-06-1616:49blueberryWhere can I read where exactly should I put my custom things?#2018-06-1616:49dpsuttonany other file i nthat dir except for custom.el#2018-06-1616:49blueberryI assumed it is in ./emacs.d/personal/custom.el#2018-06-1616:49bozhidarExactly.#2018-06-1616:49blueberryAhaaaa#2018-06-1616:49dpsutton#2018-06-1616:49bozhidarPeople usually name this personal.el or something like this.#2018-06-1616:50blueberryOK. Will change that. But, anyway, mu custom settings worked even though they were in custom.el, and this one gets ignored.#2018-06-1616:50blueberryThanks for pointing this one to me 🙂#2018-06-1616:51dpsuttonyes they will work there. but if you use the customize ui it will most probably overwrite them all or put the file in corrupted state#2018-06-1616:53bozhidarBut yeah - generally changing this there should have worked as well, if you’ve wrote the right thing.#2018-06-1616:53blueberryInteresting: I moved my part of custom.el to personal.el, and now everything from personal.el gets ignored...#2018-06-1616:54blueberryI use stock prelude on 25.3...#2018-06-1616:54blueberryAnd generally didn't mess with anything outside custom.el#2018-06-1616:55bozhidarCheck the messages buffer and what gets loaded there. I have to run now, so I can’t offer more assistance right now.#2018-06-1616:55bozhidarGenerally all files in this folder should be treated the same way and there should be some message saying they were loaded.#2018-06-1616:56blueberryPrelude is powering up... Be patient, Master dragan!
Loading personal configuration files in /home/dragan/.emacs.d/personal/preload...
Loading /home/dragan/.emacs.d/personal/preload/init.el (source)...done
Loading Prelude’s core...
Loading /home/dragan/.emacs.d/savefile/recentf...done
Loading Prelude’s modules...
Loading /home/dragan/.emacs.d/prelude-modules.el (source)...
Key Chord mode on
Loading /home/dragan/.emacs.d/prelude-modules.el (source)...done
Loading personal configuration files in /home/dragan/.emacs.d/personal...
Loading /home/dragan/.emacs.d/personal/custom.el (source)...
Problems while trying to load export back-end ‘ascii’
Problems while trying to load export back-end ‘html’
Problems while trying to load export back-end ‘icalendar’
Problems while trying to load export back-end ‘latex’
Starting new Ispell process aspell with default dictionary...
For information about GNU Emacs and the GNU system, type C-h C-a.
next-line: End of buffer [3 times]
previous-line: Beginning of buffer [2 times]
Quit
mwheel-scroll: Beginning of buffer
Mark set
mwheel-scroll: Beginning of buffer#2018-06-1616:56blueberryIt seems that personal.el just gets ignored#2018-06-1616:56bozhidarI don’t see personal.el there.#2018-06-1616:56bozhidarThat’s super odd. Is it in the right folder?#2018-06-1616:56blueberryMe neither 🙂#2018-06-1616:56bozhidarBtw, you can also just set aw-scope to frame.#2018-06-1616:57blueberryBut it definitely exist#2018-06-1616:57bozhidar(setq aw-scope ’frame)#2018-06-1616:57bozhidarSeems to me this is going to solve your problem.#2018-06-1616:58bozhidarhttps://github.com/abo-abo/ace-window#aw-scope#2018-06-1616:58blueberry@bozhidar Interestingly, that too does not change anything#2018-06-1616:58blueberrySince as soon as I have more than 2 windows, I get the ace-window's numbers#2018-06-1616:59bozhidarWell, that’s the point - you’re supposed to be able to quickly navigate more than 1 window, which you can’t do by default.#2018-06-1616:59blueberrymy personal.el is in ~/.emacs.d/personal/personal.el#2018-06-1616:59bozhidarBut I thought your problem was with multiple frames.#2018-06-1617:00bozhidarOr maybe you call a window something else.#2018-06-1617:00blueberry@bozhidar I get the idea. Just in practice it's much easier to me to hit C-x o C-x o than to hit C-x o and then look at the changed display to see which number correspond to each frame#2018-06-1617:01blueberryYep, the main part of the problem. Thanks for resolving that#2018-06-1617:01blueberryBut now I have two problems 🙂#2018-06-1617:01blueberryWhy the hell my personal.el is being ignored#2018-06-1617:02blueberryAnd how to disable ace-window's hijacking and a prelude setting in general 🙂#2018-06-1617:02blueberryIn a "proper" way#2018-06-1617:02dpsuttontry commenting out the line in prelude just to see if that works. and make sure the world is steady underneath out feet#2018-06-1617:03blueberryA "window" was a thingy inside one emacs rectangle that display one buffer. The main emacs windows is called frame if I remember well?#2018-06-1617:03dpsuttondo you have prelude symlinked into ~/.emacs.d or is it actually there?#2018-06-1617:03dpsuttonis it possible you are editing a different copy of your init?#2018-06-1617:04blueberry@dpsutton it's actually there#2018-06-1617:04blueberryI don't believe so, because other custom settings don't get ignored#2018-06-1617:05blueberryI had some customizations in custom.el. They were applied. When I moved them to personal.el in the same folder, now they get ignored...#2018-06-1617:05blueberryof course, I'm restarting /bin/emacs each time to make sure it gets applied#2018-06-1617:07blueberryOne thing that might be different: In my personal folder, there is custom.el, and custom.elc, but there is no personal.clc#2018-06-1617:07blueberryShould I invoke some compilation step when I edit personal.el?#2018-06-1617:07blueberrypersonal.elc...#2018-06-1617:07blueberrynot clc#2018-06-1617:07dpsuttonShouldn't need to#2018-06-1617:08blueberryDo you use Prelude, too?#2018-06-1617:08dpsuttonYes I do#2018-06-1617:09blueberryCan you tell me exactly how you set up your personal settings and where?#2018-06-1617:10dpsutton~/.emacs.d/personal/personal.el#2018-06-1617:10dpsuttonneither is byte compiled#2018-06-1617:11blueberryit's the same file name on my system...#2018-06-1617:11dpsuttondelete the elc files. and move the old custom.el into ~/custom.el.copy or something#2018-06-1617:13dpsuttonalso, are you sure you are restarting emacs? you're not running an emacs server and just killing your client connection?#2018-06-1617:14blueberryYep, I'm invoking /bin/emacs just to make sure that it's the plain old restarted emacs.#2018-06-1617:16blueberrymanaged to fix the personal.el issue!#2018-06-1617:17blueberrythe problem was that after moving some parts of custom.el to personal.el custom.el needed some more re-fixing to not throw errors that stopped emacs to further continue loading personal files. Now onto the ace-window issue 🙂#2018-06-1617:17blueberryThank you a lot for helping me with this (and teaching me the proper way of personal configurations :)#2018-06-1617:19blueberryHmmm... Althugh that other settings get applied now, none of the suggested things for the ace-window problem get applied...#2018-06-1617:19dpsuttonwhat was blowing up in custom.el?#2018-06-1617:19blueberrySome org2jekyll things. But that's fixed now.#2018-06-1617:20dpsuttonah. also, check in *Messages* if there are any warnings or something during startup#2018-06-1617:21blueberryThe problem is back at what I had when I had my settings in custom.el: Everything else works fine, but I can't remap ace-window back.#2018-06-1617:21blueberry`elisp#2018-06-1617:21blueberryPrelude is powering up... Be patient, Master dragan!
Loading personal configuration files in /home/dragan/.emacs.d/personal/preload...
Loading /home/dragan/.emacs.d/personal/preload/init.el (source)...done
Loading Prelude’s core...
Loading /home/dragan/.emacs.d/savefile/recentf...done
Loading Prelude’s modules...
Loading /home/dragan/.emacs.d/prelude-modules.el (source)...
Key Chord mode on
Loading /home/dragan/.emacs.d/prelude-modules.el (source)...done
Loading personal configuration files in /home/dragan/.emacs.d/personal...
Loading /home/dragan/.emacs.d/personal/custom.el (source)...done
Loading /home/dragan/.emacs.d/personal/personal.el (source)...done
Prelude is ready to do thy bidding, Master dragan!
Starting new Ispell process aspell with default dictionary...
For information about GNU Emacs and the GNU system, type C-h C-a.
Prelude tip: Press <C-c G> to search in GitHub.#2018-06-1617:21blueberrySeems fine to me#2018-06-1617:28blueberry@bozhidar @dpsutton I have to solve this by commenting the ;;(global-set-key [remap other-window] 'ace-window) line in prelude-global-keybindings.el. Thank you both for helping me with this! I'll open an issue in prelude regarding inability to do this the "proper" way, in my personal settings. I hope this will help others that have the same problem, and will lead to the proper solution eventually...#2018-06-1618:34blueberryThis worked: (global-set-key [remap other-window] 'other-window)#2018-06-1711:43theeternalpulseHow do I get spacemacs to install that version. It's by default using the 0.18-SNAPSHOT version#2018-06-1712:53dpsuttonhttps://github.com/jwiegley/use-package#package-installation . looks like you use :pin melpa-stable in the cider layer config#2018-06-1716:14theeternalpulseI found instructions in the java layer documentation
(push '("melpa-stable" . "") configuration-layer-elpa-archives)
(push '(cider ."melpa-stable") package-pinned-packages)
#2018-06-1713:07orestisNot sure if this is the right channel — any pointers to nREPL clients I can use for reference? I want to play around adding Clojure support to Sublime Text.#2018-06-1713:10orestisOf course, a second after posting this, Google gives me this: https://github.com/cemerick/nrepl-python-client — 5 years old, but there are a couple of forks out there.#2018-06-1716:23bendlasI'm trying to get the debugger working for clojurescript. see https://github.com/clojure-emacs/cider/issues/1416
Can somebody explain, what I need to do, to be able to transform messages in the debug-middleware on a piggieback-cljs connection?#2018-06-1717:12bendlasok, found it: expects-piggieback#2018-06-1717:34bozhidar@bendlas I saw your question too late. Glad you sorted this out by yourself!#2018-06-1717:35bozhidar@orestis I know both @dominicm and @arrdem have some forks which we’ve been meaning to promote to the “official” nREPL client for Python.#2018-06-1718:25orestis@bozhidar I’m using @dominicm’s fork for now — thanks!#2018-06-1718:26orestisAre nREPL sessions implicit? Even if I don’t create one, I get the “session done” message back.#2018-06-1718:28bozhidarYou always create a session by connecting to the server.#2018-06-1718:28bozhidarAnd each message will ultimately will result in some done message signaling that a request has been fully processed.#2018-06-1718:50orestisHm, I am not creating a session id on my own, it could be that that python nrepl client does it for me. Each eval sends me back a different session id.#2018-06-1719:18arrdemYeah @bozhidar I'd definitely get behind promoting @dominicm's client although I think there's still more to do.#2018-06-1719:34orestisI’ll be looking at using that client in Sublime (as a way to get a colleague to at least try Clojure :) ) so hopefully I’ll kick the tires a little bit!#2018-06-1720:13bozhidarThe big connection management refactoring was just merged in 🙂#2018-06-1809:18hlolliI have auto-update module with my use-package macro. Auto adventureous, compiling cider-repl.el (cider-repl-handle-shortcut) freezes my emacs 25.1. But it's no problem to fix it and revert.#2018-06-1809:20hlolliactually just x-kill and restart, then it skipped cider, so no stress at all. forget my comment.#2018-06-1802:37arrdemoooooooo time to update 👌👌👌#2018-06-1802:38arrdemhourly builds on desktop or are you even trying#2018-06-1806:38manuelthanks for the hard work guys, upgrading now eager to try out the new session manager. 🙂#2018-06-1808:03bozhidarHappy to hear this!#2018-06-1808:39manuelI am working on a new CLJS-only project. In my project.clj I hit C-c M-J and select Figwheel among the options. If I hit C-c C-z from a CLJS file I can see the REPL as expected. But if I open dired and navigate to a CLJS file, hitting C-c C-z from the REPL brings me back to dired instead of the CLJS file I was visiting. Do you want me to open an issue on GitHub?#2018-06-1808:59manuelalso, there is no indication in the REPL buffer that this is a CLJS REPL. I mean, the buffer name shows clj even though I can interact with Figwheel from it.#2018-06-1810:40manuelmoreover, in the modeline the indicator always shows cider[not connected] even after C-c M-J.#2018-06-1811:00bozhidar@manuel Please, file all of these as tickets and we’ll address them shortly.#2018-06-1811:00manuelsure#2018-06-1811:32borkdudeI keep getting these kinds of traces in emacs when editing clojurescript code, after upgrading Emacs + prelude:#2018-06-1811:33borkdudeI’m on CIDER 0.17#2018-06-1811:35borkdudeI previously wasn’t using a cljs REPL but it seems now it expects one#2018-06-1811:47borkdudeFixed. I had (setq debug-on-error t) which caused it.#2018-06-1813:04dpsutton@borkdude you can file a ticket about this if you want. there are ways to suppress errors from the debugger i think if they are really just kinda logical ones#2018-06-1816:34richiardiandreareporting about the new changes, OOTB C-c M-J does the right thing for me, creating only one REPL asking for which CLJS one to start right after#2018-06-1816:35richiardiandreaI would say, AWESOME !#2018-06-1816:37richiardiandrealittle behavior change is that cider-default-cljs-repl is not taken into consideration#2018-06-1816:47richiardiandreaopened an issue#2018-06-1818:18bhauman@richiardiandrea @bozhidar haven't tried the new changes but wondering about futher parameterization when starting a CLJS REPL, I.E. so that folks can further specify a build#2018-06-1818:54bozhidar@bhauman That’s really easy to do even now - we can just prompt users for the build. The thing that’s tricker is to be able to offer them some completion about the available builds - we should know where can we extract them from.#2018-06-1818:58bhauman@bozhidar its fairly difficult to prompt for builds in project.clj#2018-06-1818:58bhaumanwell it works for the simple case#2018-06-1818:58bhaumanbut for merged builds etc its no dice#2018-06-1818:59bhaumanfor figwheel.main it's easy as pie#2018-06-1819:00bhaumanI don't know if you pull data from the project.clj already but the best way is to define a deproject macro and then load the project.clj file#2018-06-1819:21bozhidarWe don’t process it (yet), but we can do it if necessary.#2018-06-1819:21bozhidar> for figwheel.main it’s easy as pie#2018-06-1819:21bozhidarPlease, do tell! 🙂#2018-06-1819:21bhaumanall the builds are in the project root directory and they end with .cljs.edn#2018-06-1819:22bhaumanso the "dev" build is dev.cljs.edn#2018-06-1820:31bozhidarYeah, that’s quite convenient indeed.#2018-06-1820:54richiardiandreamy idea when I had the cider-figwheel.el main namespace was to add a parser eventually there#2018-06-1820:54richiardiandreacannot commit time at the moment but we'll see#2018-06-1823:24mhcatSince updating, I've started seeing flickering in clojure and cider buffers - it seems to be el-doc related; that is, it goes away when I deactivate el-doc in that buffer, and then seems to stay good for a while before starting again. I'm not blaming this on cider so far, because I've changed a bunch of other stuff including compositor, window manager, etc, over the weekend, and I build a new emacs every week from master. But I'd be interested if @bozhidar you can think of a mechanism for cider causing this, or if anyone else sees it.#2018-06-1823:27mhcatwelp, it isn't el-doc specifically at least, it just started up without el-doc switched on 🤷#2018-06-1905:40bozhidarWhat’s your OS & Emacs version? I haven’t seen anything like this myself.#2018-06-1913:17mhcatOS is arch linux (rolling, current) and emacs built on Saturday from git master branch#2018-06-1913:18mhcatI'm going to try stable emacs#2018-06-1902:13theeternalpulseIs the "no response handler with id nil" something that only occurs with quil?#2018-06-1902:14theeternalpulseI haven't seen it elsewhere but working with quil is almost unusable because of it#2018-06-1905:22bozhidar@theeternalpulse Pretty much yes. If you search in the issue tracker you’lll see some workarounds.#2018-06-1920:34theeternalpulseI'm moving on to Clojure2d for now, is this something that you think has to be fixed in quil?#2018-06-1905:23bozhidarFor some reason some reason with it there are some nREPL responses generated without a matching request id and this confuses CIDER. I never had time to investigate this, though I have some ideas how to potentially handle this.#2018-06-1906:47manueljust to confirm: latest version from MELPA now correctly catches cider-default-cljs-repl from .dir-locals.el on C-c M-J.#2018-06-1907:02bozhidarYeah, the code’s on the ugly side now, but it sure works.#2018-06-2005:45bozhidarCIDER finally can do M-x cider https://github.com/clojure-emacs/cider/commit/eea7e6e1402d4640f1515177a48ca0fefea18ca4 … Great success! 😄#2018-06-2005:59wusticalityHey folks, quick question about cider’s cider-font-lock-dynamically option. It seems that the only way to enable the extended faces for functions et al is to evaluate the file in emacs first? I’m curious if anyone has any other approaches (like evaluating the file in a hook when you open it).#2018-06-2005:59wusticalityThanks in advance!#2018-06-2006:07bozhidarYeah, you have to eval the file first because this generates some extra data for the clojure-mode’s font-locking. That’s why it’s called dynamic. 🙂#2018-06-2006:08bozhidarYou can eval files on opening them, but you should be wary of the side effects.#2018-06-2006:20wusticalityyeah, that’s a recipe for unpleasantness most likely 🙂#2018-06-2006:20wusticalityok thanks mate#2018-06-2006:23bozhidarNow that we have 7 (!!!) interactive commands to do jack-in/connect, I felt it’d be nice to group those together somehow so people won’t have to remember all of them (and their keybindings). I’m still pondering whether leave this as a simple list of commands you can just from or to make it a bit more user friendly (show explanations what a command doesn instead of its name).#2018-06-2006:24bozhidar(I had started typing this with my message about M-x cider, but I forgot to press ENTER and I switched to another device :D)#2018-06-2008:24wusticalityi sure wish that elisp had clojure-style reader comments (aka, #_(defn foo ...)#2018-06-2011:56bozhidarYou can always suggest on the Emacs Dev mailing list. I think implementing this won’t be hard, provided the core devs are interested in working on it.#2018-06-2017:16richiardiandreaneed some emacs help to debug a problem: basically when I am in a cljs REPL and type (, emacs seems to hang#2018-06-2017:17richiardiandreaI have to C-g...then typing resumes normally#2018-06-2017:17richiardiandreahow can I know which functions are invoked for a buffer?#2018-06-2017:23justinbarclayI don’t know of a nice way to do that, have you tried using the profiler (https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html) to narrow down the list of functions? Unfortunately they aren’t buffer specific but they could show you what functions are being invoked after you start the profiler and which ones are chewing through RAM/CPU cycles.#2018-06-2017:24richiardiandreaI tried to use that, but it seems that because I am doing C-g...I cannot really get a report#2018-06-2017:27richiardiandreaif the first character in a CLJS buffer is a parenthesis, then it hangs#2018-06-2017:32dpsuttonyou want to use the profiler#2018-06-2017:38richiardiandreayeah I am trying that see above...it seems not to work#2018-06-2017:42richiardiandreamoving this to #emacs because it seems not related to cider#2018-06-2017:43mgthey’re probably gonna mention the profiler again in there :rolling_on_the_floor_laughing:#2018-06-2112:22bbssI'm on CIDER 0.18.0snapshot (package: 20180611.2335) and my cljs repl doesn't get set properly. I can manually call cider-repl-set-type and that will make my next cider eval work, but after that gets set back to clj so I need to do that before each eval I want to do.#2018-06-2112:25bozhidar@bbss Sounds similar to https://github.com/clojure-emacs/cider/issues/2305#2018-06-2112:26bbssYep, am using shadow-cljs#2018-06-2112:26bozhidarI’ll look at this when I can, but everyone is welcome to beat me to it. I’ll also likely add some override for the auto-detection the REPL type.#2018-06-2112:26bozhidarSeems our middleware check for the repl type doesn’t work properly for shadow, but so far I haven’t had time to debug this.#2018-06-2112:27bozhidarHere’s another discussion of the problem and a workaround for it https://github.com/clojure-emacs/cider/pull/2316#2018-06-2112:29bbssI've seen that one before and even got two emacs functions from richiardiandrea , but couldn't get them to work, only one of the functions evalled#2018-06-2112:44bozhidarThis can be fixed properly only in the middleware, as I wrote somewhere in the PR comments. Anyways, I’ll try to add some form of the proposed workaround later today.#2018-06-2112:51bbssOh please don't feel rushed by me.#2018-06-2112:51bbssI can manage with the live-reload in the cljs world, in clj it would be pretty annoying to not have inline eval.#2018-06-2117:35bozhidar@bbss https://github.com/clojure-emacs/cider/commit/5bc9326373afccf1005568cdb5d9b4fff0214e32#2018-06-2117:35bozhidarNext time the beers are on you! 😉#2018-06-2117:39bbssFor sure! 🍻#2018-06-2118:09bbss@bozhidar I've updated to CIDER 0.18.0snapshot (package: 20180621.1033) but now when I select shadow-cljs in the jack in process I get:
error in process sentinel: Could not start nREPL server: npx: installed 225 in 4.837s
command not found: server
#2018-06-2118:10bbssI'm not sure it's related to the most recent cider commit, I don't see anything that does something with a server.#2018-06-2118:10bbssI used package-refresh-contents, list-packages and shift-u x to update, so maybe some other packages got updated as well?#2018-06-2119:03bozhidarNo, that’s unrelated.#2018-06-2119:04bozhidarWhat exactly is the command CIDER is running for you? Isn’t it npx shadow-cljs server?#2018-06-2119:13bbssRunning through the shadow-cljs installation instructions again, seems I didn't need those last time#2018-06-2119:22bbss@bozhidar https://shadow-cljs.github.io/docs/UsersGuide.html#_launch_the_clojurescript_repl says to use cider-create-sibling-cljs-repl but I don't seem to have that according to my helm#2018-06-2119:24bbsshowever all good when I use cider-connect-cljs to connect to the nrepl#2018-06-2119:24bbss:thumbsup:#2018-06-2119:25bbssBefore it was more easy, I'd just run cider-jack-in-cljs and it would ask me the host port and build and set-up a clojure and clojurescript repl.#2018-06-2119:25bbssAnyway thanks a bunch! it works 🙂#2018-06-2119:54bozhidarThe manual is a bit outdated right now. Unfortunately the PR which introduced the connection management changes didn’t update any documentation.#2018-06-2119:58bozhidarThe command is now cider-connect-sibling-cljs. There’s also cider-jack-in-clj&cljs.#2018-06-2119:59bozhidarcider-jack-in-cljs now creates only a ClojureScript REPL, as many people mentioned in the past they wanted a command that didn’t create an extra Clojure REPL.#2018-06-2119:59bozhidarAh, that’s the shadow-cljs manual. Well, it can’t be updated before 0.18 is released.#2018-06-2120:06bbssYeah, makes sense. I'm happy it works, and I also sometimes didn't need the extra clj repl, when I am using a remote repl instead of running a server locally.#2018-06-2122:38richiardiandrea@bozhidar this last commit breaks for me https://github.com/clojure-emacs/cider/commit/28bdc1f2897d351f8a1761e4cf121a1dd353a667#2018-06-2122:39richiardiandreait says cider-interaction.el file termination or something 😉#2018-06-2200:40richiardiandreamaybe not that we have expound we could improve the print out of exception info?
1. Unhandled clojure.lang.ExceptionInfo
"could not start [#'ep-cloud.config/options] due to Error: Spec assertion failed\n-- Spec failed
--------------------\n\n {:aws {:definition-bucket nil, :s3-region ...},\n ^^^\n :azure
...}\n\nshould satisfy\n\n string?\n\n-- Spec failed --------------------\n\n {:aws
{:definition-bucket ..., :s3-region nil},\n ^^^\n :azure ...}\n\nshould satisfy\n\n string?\n\n--
Spec failed --------------------\n\n {:aws ..., :azure {:definition-blob nil}}\n ^^^\n\nshould
satisfy\n\n string?\n\n-------------------------\nDetected 3 errors\n"
#2018-06-2205:11manuelre-installing from MELPA gives me:
Error (use-package): Failed to install cider: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install cider-mode: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install nrepl-client: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install cider-repl: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install cider-interaction: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install cider-stacktrace: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Failed to install cider-util: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
Error (use-package): Cannot load cider-util
Error (use-package): Failed to install clj-refactor: cider-interaction.el:0:0: error: scan-error: (Unbalanced parentheses 63119 87569)
#2018-06-2205:11manuelsame as @richiardiandrea I guess#2018-06-2205:24dpsuttonthis has been fixed already. not sure when it will appear on melpa but should be soon (TM)#2018-06-2205:25dpsuttonhttps://github.com/clojure-emacs/cider/pull/2343#2018-06-2205:51bozhidarSorry about the breakage, guys! I copy/pasted this and I was too tired to test it. Hopefully the new build will be out soon. If you’re in a hurry there’s always this option#2018-06-2205:52bozhidarhttp://emacsredux.com/blog/2015/05/10/building-melpa-packages-locally/#2018-06-2206:09manuelno problem, here. I can safely wait. Thanks for the prompt fix!#2018-06-2206:29bozhidarYou’re welcome!#2018-06-2208:25kah0onaHi people, I’ve updated cider to 0.18 snapshot, and when i do cider-jack-in-clojurescript i only get one cljs repl, before it also started a clj repl. Is this a bug or a feature/#2018-06-2208:26kah0onaor should I now do first cider-jack-in, and then cider-jack-in-clojurescript#2018-06-2208:26manuelI think it's a feature now#2018-06-2208:27manuelI use both commands for projects which involve clj and cljs#2018-06-2208:28kah0onaah okay#2018-06-2208:28kah0onaonly disadvantage is now that i need two extra keystrokes, but that’s ok 🙂#2018-06-2208:29manuelon the other hand, for cljs-only projects you get one REPL only now 😉#2018-06-2208:30kah0onayeah I see the trade-off#2018-06-2208:42bozhidar@kah0ona The old command still exists - it just has a different name now (`cider-jack-in-clj&cljs`).#2018-06-2208:42bozhidarThere’s no real trade-off, we just made the commands more granular.#2018-06-2208:56manueloh I missed the different name#2018-06-2209:09kah0onasoo, since i’m fairly new to emacs (i actually use spacemacs), I always do a jack-in with `, “' key combination#2018-06-2209:10kah0ona,"#2018-06-2209:10kah0onaand when I press only , I see a list of available commands#2018-06-2209:10kah0onais that spacemacs or emacs specific?#2018-06-2209:10kah0onaanyway; the cider-jack-in-clj&cljs is not enlisted there, whilst cider-jack-in and cider-jack-in-clojurescript are#2018-06-2209:11kah0onaon the bottom pop-up of the editor#2018-06-2209:11kah0onanot familiar with all the emacs terminology to know what ‘thing’ does that, lol#2018-06-2209:12manuelI don't use spacemacs, but if you do C-c M-x or M-x cider you should see the list of commands available. Among them, cider-jack-in-clj&cljs.#2018-06-2209:13kah0onayeah it’s there#2018-06-2209:13kah0onaso if you do only C-c#2018-06-2209:14kah0onado you see a popup in the bottom enlisting what hotkeys are available?#2018-06-2209:14kah0onaif so; is that an emacs specific thing, or some package that does that? (since spacemacs comes with ‘batteries included’, a lot of features i don’t know where it comes from, if it’s a package or something standard or whatever :-))#2018-06-2209:17manuelI have a popup, yes, I am using which-key (https://github.com/justbur/emacs-which-key).#2018-06-2209:18kah0onaaah which-key#2018-06-2209:18kah0onaokay#2018-06-2209:19kah0onaso if you press , then in a .clj file, does something happen? (if not i presume it’s a spacemacs thing showing a which-key dialog)#2018-06-2209:19manuelno, must be something on your side. 🙂#2018-06-2209:19kah0onaaha okay thank#2018-06-2209:20kah0onawell there the cider-jack-in-clj&cljs is not (yet) listed, so i’ll look further to figure out which open source project should be contacted to reflect this command 🙂#2018-06-2209:30bozhidar@kah0ona Listed where? Docs/menus? Unfortunately they are not yet updated after the changes, hopefully this will happen over the weekend.#2018-06-2209:31bozhidarM-x cider-jack-in-clj&cljs should fine, though.#2018-06-2209:32bozhidarI think it’s not in which-key because it doesn’t have any keybinding associated with it.#2018-06-2209:32kah0onaM-RET#2018-06-2209:32bozhidarBtw, there’s now also M-x cider which is a wrapper around all jack-in commands. I’d advice most people to simply use it. C-c M-x.#2018-06-2209:32kah0onawhat does that for you?#2018-06-2209:33kah0onafor me it gives the same which menu as I talked about before, but againn, not sure if it’s spacemacs specific…#2018-06-2209:33bozhidarThat’s certainly not a standard Emacs keybinding.#2018-06-2209:34bozhidarAnd I’ve never used Spacemacs, so I can’t tell you more on the subject.#2018-06-2209:34kah0onahttps://www.youtube.com/watch?time_continue=364&v=Uuwg-069NYE
at 8:55#2018-06-2209:34kah0onaskip to 8:55#2018-06-2209:34bozhidarExcept maybe use C-h k to see what this is bound to.#2018-06-2209:34kah0onato see what i mean#2018-06-2209:34kah0onaah ok if it’s spacemacs specific, then n/m of course#2018-06-2209:35kah0onajust wondered if it was 🙂#2018-06-2209:36kah0onabut anyway; someone made that (or it is auto-generated), and it doesn’t list cider-jack-in-clj&cljs yet, so i’ll ask in #spacemacs or something 🙂#2018-06-2209:36bozhidarWhich like which-key to me.#2018-06-2209:36kah0onayeah idd#2018-06-2209:36bozhidarI normally use it with a timer, maybe they just bound it to some key.#2018-06-2209:36kah0onaah yeah#2018-06-2210:43andre.stylianos@kah0ona that's spacemacs specific, it's configured in the clojure layer#2018-06-2210:44andre.stylianosThis needs updating:
https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Blang/clojure/packages.el#L108#2018-06-2210:58kah0onaAh thanks!#2018-06-2210:59kah0onaI have a bit of trouble with the new Cider version. Sometimes if I evaluate something in a .clj file, it sends it to the cljs repl somehow#2018-06-2210:59kah0onaand then it of course crashes since it doesn’t compile#2018-06-2210:59kah0onaanyone experiencing the same?#2018-06-2211:01kah0onait seems like both repls are of type [clj] as well, used to be 1 [clj] and one [cljs]…#2018-06-2211:01kah0onanot sure if that is related#2018-06-2211:56bozhidar@kah0ona What’s the cljs repl you’re using?#2018-06-2211:57kah0onafigwheel#2018-06-2211:58bozhidarhmm#2018-06-2211:58bozhidarSeems similar in nature to https://github.com/clojure-emacs/cider/issues/2332#2018-06-2211:59bozhidaralthough the auto-detection should be working fine for figwheel (don’t have time to test it now, though)#2018-06-2211:59bozhidarYou can use the work-around I’ve mentioned in the end - it’s possible to stop the auto-detection of the REPL type and just manually set it.#2018-06-2413:16danielszWith the latest snapshot, I'm seeing errors such as void-variable cider-ancillary-buffers apparently coming from cider-connection. The definition has moved with the latest commit (to cider-common.el). Could it be that there's a reference to the old location dangling? Anybody else can see that error?#2018-06-2413:47dottedmag@bozhidar Are your recent commits related to require: Symbol’s value as variable is void: cider-ancillary-buffers-like issue?#2018-06-2414:23bozhidarSeems MELPA just built from a bad commit. I fixed this only minutes after I broke it.#2018-06-2414:23bozhidarThe current master should be fine - I see it’s compilation errors/warnings free.#2018-06-2414:24bozhidar@danielsz @dottedmag ^^#2018-06-2414:24danielszAwesome. thanks a lot.#2018-06-2414:46dottedmag@bozhidar I'm getting an error with a current master, had to revert to 5a75a3e234f1aefb6696260d5a67ec5014b2c8e5#2018-06-2414:46dottedmagJust a sec, let me dig out the error message#2018-06-2414:49dottedmag@bozhidar ^ current master#2018-06-2414:52dottedmagHappens after startup, on M-x cider-version#2018-06-2414:52dottedmagSo something breaks due to autoloads.#2018-06-2418:18pabloreSo I have cider/cider-nrepl "0.18.0-SNAPSHOT on my .lein/profiles.clj, but when doing cider-connect-cljs on emacs I’m getting: 'cider-connect-clojurescript' requires the nREPL op "classpath". Please, install (or update) cider-nrepl 0.18.0-SNAPSHOT and restart CIDER
#2018-06-2418:23richiardiandrea@pablore that command does not inject any deps so you need to have it already on your classpath - deps.edn or project.clj#2018-06-2418:23richiardiandreaThe jack in command does it for you#2018-06-2418:23pabloreI am actually using shadow-cljs#2018-06-2418:24pabloreso no project.clj#2018-06-2418:24richiardiandreaYeah so cider should have shadow repl, but you need to jack-in-cljs#2018-06-2418:25richiardiandreaOn mobile now cannot recall the exact command#2018-06-2418:26pablorecider-jack-in-cljs gives error in process sentinel: Could not start nREPL server: npx: installed 225 in 13.772s
command not found: server
#2018-06-2418:27richiardiandreaUhm, how is shadow installed, it seems cider assumes local install#2018-06-2418:29richiardiandreaGotta go now sorry, will check in later #2018-06-2419:59bozhidar@dottedmag Just fixed it again. This time should be for real.#2018-06-2420:00bozhidarI’m still puzzled what was causing the problem, but I’m certain it no longer exists on master.#2018-06-2420:01bozhidar@pablore Yeah, we try to start shadow with npx shadow-cljs server.#2018-06-2420:01bozhidarDoes this work for you outside Emacs?#2018-06-2420:04pabloreyep, that works#2018-06-2420:09dpsuttonis it possible that the path is not on emac's path? check exec-path#2018-06-2420:29pabloreadded my path to npx to exec-path but still nothing#2018-06-2420:35dpsuttonso it looks like it passes server as the arg#2018-06-2420:35dpsutton(defcustom cider-shadow-cljs-parameters
"server"
"Params passed to shadow-cljs to start an nREPL server via `cider-jack-in'."
:type 'string
:group 'cider
:safe #'stringp
:package-version '(cider . "0.17.0"))
#2018-06-2420:35dpsuttoncan you run npx shadow-cljs server outside of emacs?#2018-06-2420:36pabloreyes i can#2018-06-2420:38pabloreand I tried running it outiside of emacs and then using cider-connect-cljs but got this error: https://clojurians.slack.com/archives/C0617A8PQ/p1529864339000076#2018-06-2420:38dpsuttonwhat about something like (shell-command cmd "cd [location] && npx shadow-cljs server")#2018-06-2420:38dpsuttonmaybe see some error in *Messages*#2018-06-2420:46dpsuttonoutput is in ‘Shell Command Output’#2018-06-2420:48bozhidar> 'cider-connect-clojurescript' requires the nREPL op "classpath". Please, install (or update) cider-nrepl 0.18.0-SNAPSHOT and restart CIDER
#2018-06-2420:49pablorethat command apparently crashed my emacs :S#2018-06-2420:50bozhidarI’m pretty puzzled by this. I guess you haven’t setup the middleware in your project, but even without it you should be able to connect. I don’t think cider-connect-cljs requires cider-classpath during it’s init. Unless that’s coming from the cljs deps checking.#2018-06-2420:50dpsuttonsorry about that 🙂#2018-06-2420:50bozhidarWorks for me. (tm) 😄#2018-06-2420:50dpsuttonconnecting with cljs now checks for piggieback and clojurescript on the classpath. which will fail if they don't have cider-nrepl on the classpath which can handle the classpath op#2018-06-2420:51dpsuttonor does regular nrepl handle the classpath operation?#2018-06-2420:52dpsuttonyeah cider-nrepl is what provides to understand what the classpath operation is. so can no longer connect to cljs repls with CIDER it would seem (without cider-nrepl)#2018-06-2420:52dpsutton(defun cider-library-present-p (lib)
"Check whether LIB is present on the classpath.
The library is a string of the format \"group-id/artifact-id\"."
(let* ((lib (split-string lib "/"))
(group-id (car lib))
(artifact-id (cadr lib)))
(seq-find (lambda (lib)
(let ((g (car lib))
(a (cadr lib)))
(and (equal group-id g) (equal artifact-id a))))
(cider-classpath-libs))))
#2018-06-2420:54dpsuttonhmm, i'm not seeing that on cider-connect-cljs though#2018-06-2420:54pablorewtf now cider-jack-in-clojurescript is outputting:
cider-jack-in-command: Invalid byte opcode: op=183, ptr=2Invalid face reference: t
Invalid face reference: t [125 times]
#2018-06-2420:55pablore(the only change i made was updating the cider package to the latest#2018-06-2420:55dpsuttoncan you wipe it out of the elpa dir and reinstall?#2018-06-2516:30pabloreNow I'am at work in a completely different machine and am getting the same error#2018-06-2420:56dpsuttondid you upgrade to emacs 26 recently by any chance?#2018-06-2420:56pabloreAnyway, see ya later, I’m off to the movies. Thanks for the help!#2018-06-2420:56pablore@dpsutton I will try doing a full reinstall later. And not, still on emacs 25#2018-06-2420:56dpsuttonenjoy the movies. ok. was just a little suspicious of invalid bytecode#2018-06-2421:09dottedmag@bozhidar Thanks, now it works (re: cider-ancillary-buffers )#2018-06-2505:14bozhidarYou’re welcome!#2018-06-2507:39manuelmorning. Just an FYI: latest cider from MELPA works as expected now.#2018-06-2507:39manueland once again, thanks everybody for the prompt fixes 🙂#2018-06-2507:54bozhidarYou’re welcome!#2018-06-2507:54bozhidar🙂#2018-06-2516:26bjaWith the recent connection api work, is there a quick alternative to cider-current-repl-buffer?#2018-06-2516:31dpsuttoncider-switch-to-repl-buffer ? @bja#2018-06-2516:31bjaI think it's actually cider-current-repl#2018-06-2516:32bjaperusing the diff and testing it, this seems to be it#2018-06-2516:33bjathis broke my spacemacs since a ton of the custom spacemacs stuff runs through spacemacs//cider-eval-in-repl-no-focus which was using cider-current-repl-buffer#2018-06-2516:33bjait looks like swapping (cider-current-repl-buffer) with (cider-current-repl) gets things back online#2018-06-2516:39bozhidar@vspinu forgot to add obsoletion warnings in the initial PR. We’ll likely add them back before 0.18 is made final.#2018-06-2516:40richiardiandrea@bja I was using cider-current-repl too#2018-06-2516:41bjaI'm prepping a PR for spacemacs. It seems I'm the lucky fool to both track develop and update his packages first#2018-06-2516:43richiardiandreathanks for doing that I would add 😉 I am an Emacs Live user and I quit sending back patches because the repo and maintainer is not really responsive given the pace things evolve#2018-06-2516:44richiardiandreaI know it's bad#2018-06-2516:44richiardiandreaI maintain my own fork#2018-06-2516:44andre.stylianoshey @bja I did that a few hours ago#2018-06-2516:44andre.stylianoshttps://github.com/syl20bnr/spacemacs/pull/10954#2018-06-2516:44bjaoh#2018-06-2516:45bjaso I'm the second person, sweet#2018-06-2516:45andre.stylianos😛#2018-06-2516:45bjathanks#2018-06-2516:45andre.stylianosI had been a few days suffering from this, but today I actually had time in the morning to investigate and do the PR#2018-06-2516:45bjaI try to only update my spacemacs once every week or so#2018-06-2516:45bjaI like to track develop since I like bugfixes#2018-06-2516:46bjabut updating every day was too much time spent on stuff like this#2018-06-2516:46andre.stylianosI update at random times, guess I was just lucky 😂#2018-06-2516:47bja@richiardiandrea I came to emacs (Spacemacs really) so I could stop maintaining my own vim distro#2018-06-2516:48bjaI was at the point I had a ~/.vim.d and realized I was recreating the emacs portion of cider atop a weird mix of tmux/vim-sexp/tslime/vim-fireplace#2018-06-2516:50richiardiandreaah ah nice#2018-06-2518:09pabloreSo digging around my problem, it appears cider is doing npx server command instead of npx shadow-cljs server#2018-06-2518:10pablorewhen doing cider-jack-in-clojurescript#2018-06-2518:12pablorenpx: installed 225 in 19.408s
command not found: server
which is the same result as doing npx server on the command line#2018-06-2519:11dpsuttonanyone know offhand how to link a buffer to a cljs repl? I'm a little confused why its not linked. Its the same project. same directory, it just doesn't "see" the repl#2018-06-2519:11dpsuttonkinda feels weird to run cider connect cljs to a repl that cider and emacs created#2018-06-2519:19dpsuttonoh. it's just based on last visited repl.#2018-06-2519:19dpsutton😞#2018-06-2519:28Timo Freibergi'm currently looking at https://github.com/clojure-emacs/cider/issues/2317 (`(slurp in)` can't be interrupted)
maybe someone can give me some early feedback 🙂#2018-06-2520:05Timo Freibergi've been looking at cider-need-input in cider-client.el and it looks like the problem is that there's no way to send EOF via read-from-minibuffer.
C-c C-c is not bound in minibuffers for me, I hope that's usual and not caused by spacemacs... therefore I close the minibuffer with C-g, which closes the minibuffer via signal.
so i could change cider-need-input to catch the signal and send an EOF-equivalent to nrepl.
nrepl seems to interpret an empty message as EOF according to this test: https://github.com/clojure/tools.nrepl/blob/master/src/test/clojure/clojure/tools/nrepl_test.clj#L403
any other suggestions? seems quite hacky#2018-06-2622:52Philip HaleBeginner emacs question - what does C-c C-M-l stand for? I think macOS might be getting in the way of one of those keys if it's Ctrl + c then Ctrl + Option + l...
(aka cider-load-all-files)#2018-06-2623:06justinbarclayYeah it stands for Ctrl + c then Ctrl + Option + l, are you doing this in the command line version of emacs or in the GUI version?#2018-06-2623:06Philip Halegui#2018-06-2623:07Philip HaleThanks for the confirmation 🙂 I'll see if there's a shortcut already assigned to that...#2018-06-2623:08justinbarclayIf you’re new to emacs, you can do C-h k and then the key combination to see what command is bound to it#2018-06-2623:11Philip HaleThanks -- getting pretty far leaning on spacemacs, <space><space> to helm through all the commands 👍#2018-06-2716:31hagmonkanyone know how to enable the "new" parinfer smart mode? do I need a special package or is it bundled into cider?#2018-06-2716:46justinbarclayPretty sure the Emacs implementation of parinfer doesn’t have smart mode, I know the maintainer of the package was working on it a few months back, but he’s been radio silent for awhile.#2018-06-2717:09mattlyYou might want to ask about it in #parinfer#2018-06-2719:40hagmonkIt's never clear to me what parts of this Cider pulls in itself, which is what prompted me to ask here. I was using Spacemacs, but nowadays Doom Emacs, both of which I think explicitly include clojure-mode and cider at the very least#2018-06-2719:41dpsutton> ;; Version: 0.18.0-snapshot
> ;; Package-Requires: ((emacs "25") (clojure-mode "5.7.0") (pkg-info "0.4") (queue "0.1.1") (spinner "1.7") (seq "2.16"))#2018-06-2719:41dpsuttonlists it right at the top of cider-el#2018-06-2719:42dpsuttonthese are the dependencies#2018-06-2719:42hagmonkhuh, does use-package parse the comment to figure that out? I had no idea#2018-06-2719:43dpsuttoni believe those are meaningful but i'm not sure whether its emacs or package system or somewhere else#2018-06-2719:43dpsuttonah i remember something in emacs breaking on parsing those at one point. so emacs cares#2018-06-2719:43dpsuttonbut that might be because package.el is part of emacs now#2018-06-2719:44hagmonkI guess file scope overrides are a thing, and they are formatted similarly …#2018-06-2719:44dpsuttoni don't follow#2018-06-2719:45hagmonkhttps://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables#2018-06-2719:46hagmonkI was just reminded that "yes, there are other places in emacs where comments are interpreted and influence the runtime"#2018-06-2719:46hagmonkWhich feels pretty gross, but hey#2018-06-2719:47dpsuttonhave you seen the C code?#2018-06-2719:47dpsuttononly time i've seen comments be meaningful#2018-06-2719:48dpsuttonDEFUN ("set-buffer", Fset_buffer, Sset_buffer, 1, 1, 0,
doc: /* Make buffer BUFFER-OR-NAME current for editing operations.
BUFFER-OR-NAME may be a buffer or the name of an existing buffer.
See also `with-current-buffer' when you want to make a buffer current
temporarily. This function does not display the buffer, so its effect
ends when the current command terminates. Use `switch-to-buffer' or
`pop-to-buffer' to switch buffers permanently.
The return value is the buffer made current. */)
#2018-06-2719:48dpsuttonthat's a literal comment in C code that makes the journey through compilation#2018-06-2719:49hagmonkI didn't know C macros could wrap comments like that. What foul magick …#2018-06-2719:49justinbarclayYeah thats always been my thought when looking into emacs internals “This feels gross, but hey…”#2018-06-2719:50dpsuttonhaha#2018-06-2719:50hagmonkand that reminds me I need to check in and see how the remacs project is coming along#2018-06-2719:51hagmonkrecent commits! last time I tried to use it, I didn't get very far, but that was more than 6 months ago#2018-06-2719:52hagmonkFYI: https://github.com/Wilfred/remacs#2018-06-2720:20Garrett HopperIs there a .dir-locals.el-friendly way to make clojure-cli projects use an alias from deps.edn for clj and cljs repls? Ideally the cljs would be a separate alias.#2018-06-2720:21dehliIs there any way to run clojurescript tests within cider?#2018-06-2720:21dehliI saw https://cider.readthedocs.io/en/latest/clojurescript/ say that it's not supported, but I was wondering if there were any workarounds#2018-06-2720:37Garrett HopperAlright, cider-clojure-cli-global-options seems to do the trick.#2018-06-2722:14dehliSo running tests isn't as big of a deal right now for me 🙂 I could just run them outside of cider.. but i'm having issues getting pprint working in cljs. Anyone know if that's supported? Edit: Seems like right after I ask I figure it out... just had to require cljs.pprint#2018-06-2722:30bozhidar@dehli You can just run the tests in the REPL, as you’d normally do without CIDER.#2018-06-2722:31bozhidarWhat’s not supported is running those tests via cider-test commands, as the underlying functionality hasn’t been ported to ClojureScript yet.#2018-06-2722:31bozhidar> huh, does use-package parse the comment to figure that out? I had no idea#2018-06-2722:32bozhidarpackage.el parses this, not use-package. use-package is just a convenient macro to work with package.el packages.#2018-06-2722:36dehliOhhh, that's awesome news! 🙂 For some reason doing cider-jack-in-cljs doesn't seem to load the files in my test directory. I'll see if there's a configuration I'm missing#2018-06-2722:42bozhidarcider-jack-in-cljs doesn’t load anything. 🙂 You have to evaluate each namespace yourself your use one of the commands for loading all files in a project.#2018-06-2722:43bozhidarWe don’t load projects on jack-in automatically, as they might have some nasty side-effects, associated with evaluating the source code.#2018-06-2722:44dehliAhh, thanks for the explanation! When I run cider-load-buffer from a file in src it can import all the requires. For some reason when I do the same from a file in test it says that it could not locate the namespace of a file I have under the test directory.#2018-06-2722:45bozhidarHmm, that’s odd. It shouldn’t be CIDER-related.#2018-06-2722:45dehliWell it's not really that it's from src or test, it's that the file I'm requiring lives in test#2018-06-2722:46dehliThanks! It must be something wrong with my classpath#2018-06-2722:46bozhidarYeah, probably. Likely some issue from the way the project is setup?#2018-06-2722:47dehliYa, I'm using deps.edn and I don't specify test in there anywhere. I'll keep digging. Thanks for your help and all the work you do with cider!#2018-06-2809:04mgrbytedoing the same (deps.edn) - probably need to add "test" to :paths there#2018-06-2812:57dehliThanks! That's what I ended up doing 🙂#2018-06-2722:48bozhidarYou’re welcome!#2018-06-2809:55mccraigmccraigis it possible to (deliberately) drop a cider connection without also killing the associated buffer ? i quite often want to keep my session history, but connect to a different vm... cider-quit and cider-connections-close-connection both kill the buffer#2018-06-2812:20bozhidar@mccraigmccraig I think it was possible at some point, but not anymore. Before we had two different buffers - connection buffer and repl buffer and we could attach a connection to any REPL buffer. Now the REPL and the connection are the same. Maybe we can think of something, though. File some ticket on the issue tracker and we can discuss this further there.#2018-06-2812:29mccraigmccraig@bozhidar done - https://github.com/clojure-emacs/cider/issues/2353#2018-06-2812:37bozhidar:thumbsup:#2018-06-2815:32dpsuttonis there some kind of hook to turn off cider-mode introduced recently? I've found I've had to enable cider-mode in quite a few clj/cljs buffers#2018-06-2815:54richiardiandrea@dpsutton I thought I was crazy but now that you mention it, I have had the same!#2018-06-2815:54dpsuttonyeah it keeps asking me for a tags file. and then i cider-mode and then life is good again. super strange#2018-06-2816:20richiardiandreaUhm haven't seen the tag file thing but cider mode was turned off in some buffers, i have eval in .dir-locals.el and this might mean cider-mode in a switch now..not enable only..maybe?#2018-06-2816:27jjttjjHow do I define an indent spec so that the second line is always just indented one space regarless of what's on the first line? I feel like I've tried everything in the indent_spec docs but can't seem to get this to work
(h/div :class "container"
(h/h1 "title")
#2018-06-2816:28jjttjj(define-clojure-indent
(div '(:defn)))
(define-clojure-indent
(div 0))
The former does 2 spaces instead of one and the latter aligns with the first arg class#2018-06-2816:34dpsutton@richiardiandrea when you ask to navigate to symbol and cider mode isn't on that's what you'll get. an option to select a tags file#2018-06-2816:44richiardiandreaah yes I saw that as well#2018-06-2817:36gfredericksI have a clojure function for reformatting a file
how can I make a cider keybinding to apply this to a file, presumably by evaling some code in the repl?#2018-06-2817:58bozhidar@gfredericks You just have to put your function in the cider-mode-map.#2018-06-2817:58bozhidar(define-key cider-mode-map ...)#2018-06-2817:59gfredericksan elisp function though, right?#2018-06-2817:59bozhidarYep.#2018-06-2817:59gfredericksI have a clojure function, so I need to know what elisp to write to tie them together#2018-06-2817:59bozhidarYou can just call your function with something like cider-interactive-eval.#2018-06-2817:59gfredericksit could either work by supplying the whole contents of the buffer to the clojure function and replacing the buffer with the return value, or by supplying a filename and then running revert#2018-06-2818:00gfredericksany guess which of those is easier?#2018-06-2818:00bozhidarBtw, what does your function do exactly? You do know that cider has integration with cljfmt, right?#2018-06-2818:00bozhidar@dpsutton There are no changes I can think of.#2018-06-2818:00gfredericksit does cljfmt + how-to-ns + normalized end-of-file-newlines#2018-06-2818:00bozhidarIf something got broken this was accidental.#2018-06-2818:07gfrederickswhat function can I use to lookup values in a (dict ...)? I tried get-hash but that didn't work#2018-06-2818:07gfredericksgoogle isn't sure#2018-06-2818:09bozhidarnrepl-dict-get#2018-06-2818:09bozhidarYou can see the dict api in nrepl-dict.el.#2018-06-2818:09gfredericksah cool, thanks#2018-06-2818:10bozhidar> it could either work by supplying the whole contents of the buffer to the clojure function and replacing the buffer with the return value, or by supplying a filename and then running revert#2018-06-2818:11bozhidarYou can also extend the code formatting functionality that exists today and just leverage whatever else exists for the code formatting already.#2018-06-2818:11bozhidarThe part about the newline in the end can be done by Emacs itself. No need for a clojure function to do this IMO. Every editor can ensure a trailing newline.#2018-07-1022:00dpsuttonyou don't pin to a version as much as you pin to melpa-stable#2018-07-1022:03cjsauer@hagmonk nice, that's a decent workaround for now#2018-07-1022:03cjsauer@dpsutton hm interesting...so maybe the clojure layer of spacemacs should pin its use-package calls to melpa stable?#2018-07-1022:04dpsuttonthat sounds reasonable. melpa is the dev version versus melpa stable is the stable releases. seems more likely that the vast majority of users would want the stable#2018-07-1022:08cjsauerwhew...hopefully can get it worked out soon; thanks for the help. Would be lovely to one day have an editor situated directly inside of the clojure ecosystem...I haven't yet bitten the bullet on really learning elisp and its surroundings#2018-07-1022:09cjsauerSometimes feel like I'm targeting 3 platforms: JVM, JavaScript, and Emacs haha#2018-07-1022:15dpsuttonspend 5 minutes to learn the debugger, how to jump to definition and a good grep style package and you'll be elisping in no time#2018-07-1022:15dpsuttonthe elisp is way easier than figuring out gnarly problems in the cider-nrepl. the feedback loop is tough to debug the tools#2018-07-1022:16hagmonk"jump to definition" is one of the things that consistently doesn't work for me :) It's always like rolling a dice in emacs .... in elisp or clojure#2018-07-1022:16dpsuttonoh. it works for me just fine in both. I would be very annoyed if it didn't#2018-07-1022:17dpsuttonif you can file a ticket with some repro i can try to track it down#2018-07-1022:17hagmonkCursive's is far more reliable for me - it doesn't require a REPL to be started, and it can jump into jars (which I'm always doing), and decompile the jars or download their source if required#2018-07-1022:18hagmonkI just tried to test a repro case (org.httpkit.client/get was the last one that failed) but my hacky state with cider-nrepl means that nothing is working properly :/#2018-07-1022:18dpsuttoncider jumps into jars for me. i can't get into java source though#2018-07-1022:18dpsuttonwell when things settle down let me know and i'll look at it with you#2018-07-1022:19hagmonkthat would be awesome!#2018-07-1022:22hagmonkI have been meaning to check out the Cider support in some of the VSCode plugins. Unfortunately it doesn't appear that any of them have deps.edn support yet, and I've migrated almost everything over that way#2018-07-1022:39cjsauer@hagmonk quick tweak to your workaround: had to change :handlers to :middlware, and then I also added a bit more middleware for what appears to be a new debugger dependency (bpiel/sayid):
-e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:middleware ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"] :port 0 :bind "::"})'
#2018-07-1023:20hagmonk@dpsutton cider--jump-to-loc-from-info: Symbol’s value as variable is void: find-tag-marker-ring - that seems to be the current error whenever I try to jump#2018-07-1023:26dpsuttonGonna get dinner started and I'll look into it tonight @hagmonk #2018-07-1101:15dpsutton@hagmonk what kind of emacs are you running? it looks like that's been deprecated but you should still have the info
(make-obsolete-variable
'find-tag-marker-ring
"use `xref-push-marker-stack' or `xref-pop-marker-stack' instead."
"25.1")
> etags.el#2018-07-1101:17hagmonkDoom emacs v2.0.9, emacs v26.1#2018-07-1101:17hagmonkcider-find-var is what I'm invoking#2018-07-1101:18dpsuttonwhat does C-h V find-tag-marker-ring say?#2018-07-1101:18hagmonkeww, it doesn't exist#2018-07-1101:19dpsuttonweird#2018-07-1101:19dpsuttonmy emacs has etags.el built in#2018-07-1101:19hagmonkhuh so etags.el is potentially missing entirely#2018-07-1101:20dpsuttonoh is doom the executable or the init package?#2018-07-1101:20hagmonkit's a spacemacs like distro, so it's all hung off the init#2018-07-1101:21dpsuttondo you brew install the executable? where do you get that from?#2018-07-1101:21dpsuttonthere's aquamacs, brew, gnu, etc#2018-07-1101:22hagmonkI think this is a http://emacsformacosx.com build#2018-07-1101:22hagmonkso etags.el should have come with that?#2018-07-1101:23dpsuttoni'm still looking for that actually. in the source#2018-07-1101:23hagmonk./Contents/Resources/lisp/progmodes/etags.el.gz#2018-07-1101:24dpsuttonthat sounds like it should be visible then. hmm#2018-07-1101:24hagmonkhow it's normally loaded?#2018-07-1101:25dpsuttonno idea ha#2018-07-1101:25hagmonkemacs.d for doom just has this to say:
modules/config/default/+bindings.el
124: :i "C-]" #'company-etags
modules/feature/evil/+everywhere.el
62: etags-select
modules/feature/lookup/config.el
98:;; By default, `etags--xref-backend' is the default xref backend. No need. We'll
104: (let ((xref-backend-functions '(etags--xref-backend t)))
#2018-07-1101:25dpsuttondo you see find-tag-marker-ring in that file?#2018-07-1101:26hagmonkhmm no actually#2018-07-1101:27dpsuttonso its just not in that file at all?#2018-07-1101:27dpsuttonwell then#2018-07-1101:27dpsuttoni don't understand who controls these files. maybe it is clobbered by doom? this is in emacs/lisp/progmodes/etags.el.#2018-07-1101:29dpsuttonone thing to try: in cider-jump-to replace (ring-insert find-tag-marker-ring (point-marker)) with the suggested change: (ring-insert xref-push-marker-stack' (point-marker))#2018-07-1101:29dpsuttonmaybe there's a reason it's been deprecated#2018-07-1101:37hagmonkI'm trying to make the repl start again ... where's that -SNAPSHOT fix?? lol#2018-07-1101:39hagmonkerror in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath., compiling:(cider/nrepl/middleware/pprint.clj:1:1)
#2018-07-1101:39hagmonkeyeroll#2018-07-1101:39dpsuttonOh what a pain#2018-07-1101:41dpsuttonDid you lein install it recently when testing your patience?#2018-07-1101:41dpsuttonPatch#2018-07-1101:42dpsuttonThere's some Mr Anderson shenanigans in there#2018-07-1101:42hagmonkno I'm all clojure-cli / deps.edn#2018-07-1101:42hagmonkrebooting emacs, let's see ...#2018-07-1101:43dpsuttonAre you trying this in cljs or a clojure project#2018-07-1101:43hagmonkclojure#2018-07-1101:48dpsuttonCider nrepl does some source rewriting to prevent cider depend from interfering with project dependencies. Are you using git coordinates for that?#2018-07-1101:48hagmonkhmm said xref-push-marker-stack can't be found either#2018-07-1101:49dpsuttonHmm#2018-07-1101:49dpsuttonI thought that was emacs built in 25#2018-07-1101:51dpsuttonI'm starting to suspect your install#2018-07-1101:53hagmonkyeah it wouldn't hurt for me to throw down a new emacs#2018-07-1101:55hagmonkdownloading a nightly build, because that's how I roll (and how I get into these situations)#2018-07-1101:57dpsuttonbuild from source!#2018-07-1101:57dpsuttonit's really easy#2018-07-1101:58hagmonkI used to build from source, I had a brew command that worked pretty well ...#2018-07-1101:58dpsuttoni actually switched to linux from my beloved mac because i started building from source. and xcode said I could have gcc buti had to ask apple nicely to install them 😞#2018-07-1101:58dpsuttonoh nice#2018-07-1101:59hagmonkwell I'm on 27.0.50 now, lol#2018-07-1102:00hagmonkyou should check out Alacritty, that's the only other thing I habitually build from source#2018-07-1102:00dpsuttonsame here. and its smooth sailing#2018-07-1102:00hagmonkhttps://github.com/jwilm/alacritty#2018-07-1102:00dpsuttoni'm on it now#2018-07-1102:00hagmonkI've never used it on Linux, actually#2018-07-1102:00hagmonksweet!#2018-07-1102:00dpsuttonah one of the new rust programs#2018-07-1102:02dpsuttonno scrollback. is this your standard terminal?#2018-07-1102:02hagmonkyeah the idea is that you tmux your way through everything :)#2018-07-1102:02dpsuttonoh and wayland funkiness. i'm on fedora 27 so that would bite me#2018-07-1102:02hagmonkit was a nice forcing function, I had to become proficient in tmux as a result#2018-07-1102:03dpsuttonyou are in and out of many machines? I'm largely if not exclusively on my own all the time#2018-07-1102:03dpsuttonotherwise i would. i also need to learn tramp from emacs#2018-07-1102:04hagmonkwhen you say in and out - you mean do I move between different physical machines?#2018-07-1102:04dpsuttonno remoting to many#2018-07-1102:05dpsuttonwhich i understood to be the principal benefit of tmux#2018-07-1102:06hagmonkoh I'd say the principal benefit is that it's basically a window manager for your terminal#2018-07-1102:06hagmonkthere's also a modal selection you can drop in to, so you can scroll back in the buffer, search for text, highlight it, yank it … it's quite emacs-ish#2018-07-1102:15dpsuttonare you able to start up a repl and if so, jump to definition?#2018-07-1102:16hagmonkI had to flush doom emacs completely out first, trying again now#2018-07-1102:23hagmonkalright, after all that#2018-07-1102:23hagmonkfind-tag-marker-ring symbol is still void, lol#2018-07-1102:24dpsuttonwell at least you got those fresh emacs bits#2018-07-1102:24dpsuttonwell i'll be https://github.com/clojure-emacs/cider/issues/1669#2018-07-1102:25dpsuttoncan you eval (require 'etags) and try again?#2018-07-1102:25hagmonkthat seems to have done the trick!#2018-07-1102:26dpsuttonha. you should reopen that issue. it seems that require is no longer in the code#2018-07-1102:26dpsuttonit will be a super simple fix. i guess somewhere in my init that gets required so i've never seen it#2018-07-1102:26dpsuttonhow long have you been without find-var? that would be unbearable for me#2018-07-1102:29hagmonkI think something else in my stack was probably autoloading it, it has been on and off …#2018-07-1102:29hagmonkis there a protocol for re-opening issues, or should I just file a new issue?#2018-07-1102:30dpsuttoni put a comment on that issue and tagged bbatsov. i bet he sees this chat history at some point as well#2018-07-1102:30hagmonkcool - thanks for working through that problem with me, much appreciated!#2018-07-1102:30dpsuttonof course#2018-07-1102:31dpsuttonthanks for the tip about tmux and allacrity#2018-07-1105:12vinaiThis morning I've started getting
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.IllegalArgumentException: No matching ctor found for class java.net.InetSocketAddress when starting up the repl with cider-jack-in-cljs
Yesterday evening things where working. Any idea what might have happened?#2018-07-1105:56euccastro@vinai: it's explained above. I worked around it by setting cider-clojure-cli-parameters to -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init {:middleware %s :port 0 :bind "::"})'#2018-07-1105:57euccastrothat's assuming you're in a tools.deps project#2018-07-1105:58euccastrosee other variants in today's slack history if this exact incantation doesn't work for you#2018-07-1106:00vinaiThank you @euccastro #2018-07-1106:07vinaiWhat command is C-u C-m M-j mapped to for you?#2018-07-1106:09euccastroI don't have it mapped to anything since I'm in spacemacs, but I think it's cider-jack-in with an universal argument (to override arguments to clojure)#2018-07-1106:09euccastroso it's basically the same trick as I say, but for a single cider-jack-in invocation#2018-07-1106:10euccastroin spacemacs I would say SPC u , '#2018-07-1106:12vinaiOkay, thanks#2018-07-1106:18vinai@euccastro That workaround worked great, thank you#2018-07-1106:27euccastronp, glad to know that!#2018-07-1106:28euccastro@hagmonk and @cjsauer did all the work 🙂#2018-07-1107:02bozhidar@hagmonk Fixed. Likely I deleted the require accidentally during some refactoring. I’ve been restructuring the code a lot recently.#2018-07-1107:04bozhidar@euccastro That’s now patched upstream. An unfortunate side-effect of the auto-deployments having failed recently.#2018-07-1107:11euccastrothanks @bozhidar!#2018-07-1108:15hkjelsMy build also worked yesterday and failing now. I’m receiving a different error though
error in process filter: progn: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
#2018-07-1108:16hkjelsI’ve bumped cider/piggieback and nrepl. Same result#2018-07-1108:33hkjelshmm.. Things have broken outside of emacs as well and in multiple projects. Geeee!#2018-07-1108:34hkjelsThis doesn’t make any sense.. I’m rebooting#2018-07-1108:50hkjelsapparently it’s not able to merge the alias map of my deps file, but I’m not able to spot any issues#2018-07-1109:02andrea.crottione of my colleagues had a strange problem with jack-in-clojurescript that was firing up only one REPL instead of two#2018-07-1109:03andrea.crottishe was using 0.18 snapshot, I made her switch to 0.17 stable to see if it was related to that and now it works fine#2018-07-1109:03andrea.crottihowever to other people with 0.18 and the same config it seems to work 😕#2018-07-1109:03andrea.crottiwe are using a custom repl type like
(eval . (cider-register-cljs-repl-type
'figwheel+integrant
"(do (require 'figwheel-sidecar.repl-api)
(require 'integrant.repl)
(integrant.repl/go)
(figwheel-sidecar.repl-api/cljs-repl))"))
which I think might be related#2018-07-1109:05bozhidar> one of my colleagues had a strange problem with jack-in-clojurescript that was firing up only one REPL instead of two#2018-07-1109:05bozhidar@andrea.crotti It’s not a problem, it’s the new standard behaviour of CIDER 0.18. 🙂#2018-07-1109:06bozhidarjack-in-clojurescript now starts just a ClojureScript REPL (as many people as for this).#2018-07-1109:06bozhidarThere’s a separate command to start both REPLs.#2018-07-1109:06bozhidarBtw, we wrote a ton of documentation of all those changes, people should started reading the changelog and the manual. 🙂#2018-07-1109:08bozhidarhttp://docs.cider.mx/en/latest/managing_connections/#2018-07-1109:14andrea.crottiah ok yes I started looking at the docs, but then my other colleagues told me it worked for them, so I got confused#2018-07-1109:14andrea.crottinot sure how it works for them then 😄#2018-07-1109:15andrea.crottifrom the docs then there is no key binding by default for the new command to fire up both repls?#2018-07-1109:45manuelC-c M-x lets you pick the command you want#2018-07-1109:51andrea.crottiyes ok well I can just rebind it#2018-07-1109:51andrea.crottiI always need or both or just CLJ anyway#2018-07-1109:51andrea.crottijust curious, why would anyone only want the CLJS anyway?#2018-07-1109:52andrea.crottiunless you somehow have a cljs only project?#2018-07-1109:53manuelIn my case, I happen to work on CLJS-only projects sometimes, I don't need the extra CLJ REPL#2018-07-1110:10bozhidar> from the docs then there is no key binding by default for the new command to fire up both repls?#2018-07-1110:10bozhidarNot yet.#2018-07-1110:11bozhidarWe’ll likely put all those commands in a common keymap.#2018-07-1110:15bozhidar(we’re just figuring out the details - e.g. something like C-c C-x j/J/c/C/s)#2018-07-1110:16bozhidarSee https://github.com/clojure-emacs/cider/pull/2369 for the ongoing conversation.#2018-07-1111:39minikomiI'm using boot, along with boot-cljs-repl, so I typically use cider-connect to get a clojure repl for my project, and then in the rare cases where I want a cljs repl, use (start-repl) in there.
So, I don't typically have a "cljs repl" and a "clj repl" -- they're one and the same.
I used to be able to switch to the clj repl fine from cljs files, but now I get the message user-error: No cljs REPL in current session (project-name)#2018-07-1111:40minikomiswitching from a clj file works fine..#2018-07-1111:41minikomiI assume this is something to do with the connection changes in 0.18.0 .. is there a hook i can do something with to associate the clj repl with cljs files?#2018-07-1111:43minikomioh, i just started up a cljs repl with start-repl, and was able to switch from a cljs file//. interesting.#2018-07-1111:44minikomiI think i get it...#2018-07-1112:31bozhidar> So, I don’t typically have a “cljs repl” and a “clj repl” -- they’re one and the same.#2018-07-1112:31bozhidarThey can never be the same. 🙂#2018-07-1112:31bozhidarIt’s either a Clojure or a ClojureScript REPL.#2018-07-1112:37bozhidar@eraad You can try the command like invocation in a terminal and try connecting with cider-connect. Everything seems OK to me in your log, but likely something goes wrong with the server init if CIDER can’t connect to it.#2018-07-1112:43eraad@bozhidar Thanks, will look into it#2018-07-1114:00eggsyntax@bozhidar this seems to be breaking quite a lot of people's workflow. I don't know enough about it to do this myself, but I suggest writing up a brief guide for folks who are coming to the channel and saying, "help, my CIDER just broke!" so that we can all have something standard to point them to (and take some of the repetition off your shoulders). Something short that just says, "here's what changed, here's what you need to change in your workflow."#2018-07-1114:01manuel@eggsyntax is this helpful? http://docs.cider.mx/en/latest/managing_connections/#2018-07-1114:01eggsyntaxThat's definitely the best thing we've got so far that I've seen 🙂#2018-07-1114:02eggsyntax(caveat: I just found out about it 15 min ago, so I'm still in the process of reading through it)#2018-07-1114:26bozhidar@eggsyntax I understand this change is probably somewhat surprising, but I think it’s for the better overall. Generally we plan to downplay the various jack-in-commands down the road and steer most people to the M-x cider - when you see the list of all possible entry points all the confusion disappears IMO.#2018-07-1114:27bozhidarBut yeah, we always knew that reworking the connection management was going to be painful. The release is not ready yet, the final docs will be even better.#2018-07-1114:28eggsyntaxAgreed. And to some extent folks who are choosing to use the snapshot are accepting some breakage (although a lot of folks, including beginners, end up on bleeding-edge by accident because spacemacs defaults to it).
Just wondering if there's some good way to save you some time answering the same questions over & over, and to get the word out to the community that if they're gonna update to 0.18.0-SNAPSHOT they must read the new docs.#2018-07-1114:30eggsyntaxMaybe that alone is enough: "Your workflow broke? You probably updated to the new snapshot; either pin cider to melpa-stable, or go read http://docs.cider.mx/en/latest/managing_connections/ ." I'll default to telling people that for now.#2018-07-1114:55bozhidarI think that I can just added a few breaking markers to the changelog and hope people will actually read it. 🙂#2018-07-1114:56bozhidarOr add the breaking changes to the REPL startup messages.#2018-07-1114:56bozhidarBut yeah - a ton of my time goes into support and that’s extremely tiring.#2018-07-1114:57bozhidarI often miss the days when I had completely ignored this channel for a year and half.. And I’m strongly considering doing it again. 🙂#2018-07-1115:03eggsyntax"add the breaking changes to the REPL startup messages" -- I think that might really help (although I find if I'm not paying attention, my eye skips right over startup messages once I've seen them enough times).
"strongly considering doing it again" -- mental health / sustainable development comes first! Your input here is awesome, but the rest of us will muddle by 😉#2018-07-1115:05andre.stylianos> my eye skips right over startup messages once I've seen them enough times
I'm pretty sure that's what will happen#2018-07-1115:06bozhidarhttps://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md#2018-07-1115:20eggsyntaxThanks!#2018-07-1115:06bozhidar(I’ve added a few notes about the bigger breaking changes here)#2018-07-1115:07dpsuttonI wish there was an easy way for the startup message to display 4 random defcustoms and their docstrings#2018-07-1115:07dpsuttonbe a good way to learn about the knobs of CIDER#2018-07-1115:11dominicm> Allow evaling top level forms in a comment form rather than the entire comment form with cider-eval-toplevel-inside-comment-form.
Can someone explain the rationale of this to me? Do I want to port this to other editors?#2018-07-1115:18dpsutton(comment
(def db (get-dev-database))
(def users (query db :users))
(let [user (first users)]
(make-admin user)))
Imagine something like this in the repl. When you execute cider-eval-defun you will get nil because that's what any comment form evals to. This option checks to see if you're inside a comment form and if so readjusts what "top level" means.#2018-07-1115:18dpsuttonand you want toplevel to mean the first level inside of the comment form where your cursor is. ie, you want (def db (get-dev-database)) not (comment ...)#2018-07-1115:19andre.stylianosYup, otherwise you have to keep finding the right spot to move the cursor to so you can call cider-eval-last-sexp or something like that#2018-07-1115:19dpsuttonexactly. you can take pains to put point right after the sexp or you can just eval as normal with this defcustom#2018-07-1115:20andre.stylianosProbably does not affect vim-fireplace users as much since you have a more general selection of what you're evaluating with text objects#2018-07-1115:20andre.stylianosbut it might still be a nice touch#2018-07-1115:20dpsuttonvim surround is the bomb#2018-07-1115:21eggsyntaxAvailable in emacs via evil-surround IIRC#2018-07-1115:20dominicmI see. So it doesn't "eval top level sexps inside a comment form" it "eval-top-level-form by selecting from a comment first"#2018-07-1115:20dominicmYeah, vim-sexp gives me way more control, so I don't need this. Great 😄#2018-07-1115:21eggsyntaxAvailable in emacs via evil-surround IIRC#2018-07-1115:21dpsutton#2018-07-1115:21dpsuttonI'm not sure i follow.#2018-07-1115:29dominicm@dpsutton I was reading as taking:
(defn foo [])
and turning it into
(comment
(defn foo []))
which made no sense to me.#2018-07-1115:29dominicmIt's redefining what "top-level-form" means, as opposed to evaluating the top level inside a comment#2018-07-1115:29dpsuttonhaha yeah. it takes the latter and realizes that you most probably want to think of it as the former#2018-07-1115:31dpsutton@bozhidar pointed out a problem in that this probably needs to live in clojure-mode so it can affect beginning-of-defun rather than at certain calls#2018-07-1115:44dominicmIf you like vim-surround from the perspective of true text obj + operator, you'll love vim-sandwich. I recently made the switch, it's very good.#2018-07-1115:45dominicmDefining custom surrounds which take params is ❤️.#2018-07-1117:14hagmonk@bozhidar I'm worried there might have been a bug in #537#2018-07-1117:17hagmonkI only put two and two together after waking up this morning - init is taking middleware, not handlers#2018-07-1118:08eraadHi! May this be causing a timeout when trying to connect to a clojure-cli repl?
I get this on the repl:
ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1}
java.lang.IllegalArgumentException: Key must be integer
at clojure.lang.APersistentVector.invoke(APersistentVector.java:294)
at clojure.tools.nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at clojure.tools.nrepl.server$handle_STAR_.invoke(server.clj:16)
at clojure.tools.nrepl.server$handle$fn__1005.invoke(server.clj:28)
at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)#2018-07-1203:08euccastro@eraad yes, this is the cause; see a workaround in #cider#2018-07-1117:27bozhidar@hagmonk Likely you’re right. I’m having a very busy day and didn’t look carefully at the patch, but I was surprised by the handler part. I just assumed you tested this and knowing it only affects clojure-cli users decided to merge it without fretting too much over it.#2018-07-1117:29hagmonkI tested starting the REPL, which worked, but the bug shows up as soon as you try to send a command to the REPL :( Totally my fault, I apologize. I can submit another PR with a test case that covers this more thoroughly#2018-07-1117:48bozhidar@hagmonk Yeah, that’d be great.#2018-07-1118:19myguidingstarif I have clj and cljs repls, the code in (cider-interactive-eval "(some-clj-code)") get evaluated in both of them. How to eval in just clj?#2018-07-1118:38eggsyntaxI've just switched back to 0.17.0, since I was having trouble with 0.18.0 after updating, but now I'm getting
Symbol’s function definition is void: cider-current-repl
Ring any immediate bells for anyone? Googling that only brings up two results, neither of which seems to fit.#2018-07-1118:46dpsuttoni believe that's what cider-current-connection has become in 0.18#2018-07-1118:48dpsuttonit shouldn't be present if you've gone back to 0.17 unless you have custom code or maybe an updated helper package#2018-07-1118:49eggsyntaxYeah, that latter is what I just started wondering. I'm gonna turn the debugger on & try to see where it's coming from. Thanks!#2018-07-1118:52dpsutton👍#2018-07-1118:58eggsyntaxHmm, call chain is
spacemacs/cider-send-ns-form-to-repl -> spacemacs//cider-eval-in-repl-no-focus -> save-current-buffer -> (set-buffer (cider-current-repl))#2018-07-1119:00eggsyntaxcider-eval-in-repl-no-focus is from the clojure layer, not cider. So maybe the clojure layer has to be pinned as well :thinking_face:#2018-07-1119:03dpsuttonno idea. but that layer could use the new insert in repl commands#2018-07-1119:04eggsyntaxJust to be sure I'm clear, you're saying that clojure might use commands that require cider 0.18.0-SNAPSHOT, right?#2018-07-1119:05dpsuttoni have no insight into what the clojure layer of spacemacs does. I was just saying cider-eval-in-repl-no-focus is not a cider command and they could use some new functionality without making a custom version#2018-07-1119:14eggsyntaxNah, pinning clojure doesn't fix it. Investigation continues.#2018-07-1119:16eggsyntaxTurns out to be a spacemacs thing, details in #spacemacs in case anyone else encounters it.#2018-07-1215:26eggsyntaxMinor follow-up -- author of the original Spacemacs patch has submitted a new PR to SM so that the new cider-current-repl will only be use if CIDER > 17, so this should hopefully be fixed soon for SM folks.#2018-07-1119:36hagmonk@bozhidar @richiardiandrea I have a new PR that fixes the cider-nrepl regression I introduced: https://github.com/clojure-emacs/cider-nrepl/pull/539#2018-07-1120:43bozhidar> Symbol’s function definition is void: cider-current-repl#2018-07-1120:43bozhidar@eggsyntax This used to be named cider-current-repl-buffer is 0.17.#2018-07-1120:45eggsyntaxGot it. Turns out to be a Spacemacs thing; it uses cider-current-repl regardless of cider version.#2018-07-1120:46eggsyntaxThanks!#2018-07-1120:51bozhidar@hagmonk I’ll take a look tomorrow, as I’m too tired today already. Seems @richiardiandrea already gave some feedback with respect to the boot plugin.#2018-07-1120:51dpsuttonThey added an alias for cider current connection o think. Should be easy to patch up spacemacs#2018-07-1120:52bozhidarThe alias was always there. It’s not something new.#2018-07-1120:53hagmonk@bozhidar thanks! looks like @richiardiandrea’s comment might have been from yesterday. There some strange test failures in unrelated areas - I can try re-running to see if they are intermittent.#2018-07-1123:08richiardiandreaYeah my comment was not regarding the new add-on to the patch, unfortunately cannot check this now..after the 16th I will be able to...#2018-07-1120:54dpsutton[Fix #2342] Alias and obsolete variables after #2324 on CommitDate: Sat Jun 30 19:24:48 2018 +0200. cider-current-connection went away and then came back i believe#2018-07-1120:56eggsyntax& then the name change to cider-current-repl is at https://github.com/syl20bnr/spacemacs/pull/10954/commits/3651c57253ebe1a68ca15cfde3a1ade1054a6840
Which is fine in general, but incompatible with CIDER 0.17.0.#2018-07-1120:57dpsuttonright. so i believe the alias cider-current-connection was added back so that older tooling and newer tooling had the same vocabulary#2018-07-1123:26eraadHi! Please, can anyone provide clues on how to load deps from an deps.edn alias when doing clojure-jack-in? By default, they don´t seem to get loaded#2018-07-1123:43euccastro@eraad: you can supply arbitrary command line arguments to clojure by changing cider-clojure-cli-parameters or, for a one-time thing, by prefixing your clojure-jack-in with an universal argument (`C-u` in emacs or SPC u in spacemacs)#2018-07-1211:39eraadJust to let you know, got it working using cider-clojure-cli-global-options#2018-07-1216:16euccastronice, thanks for the pointer!#2018-07-1123:49eraadThanks @euccastro #2018-07-1123:52euccastronp. I guess it would be most convenient to be able to set that in a per project basis, but I don't know how to do that#2018-07-1215:26eggsyntaxMinor follow-up -- author of the original Spacemacs patch has submitted a new PR to SM so that the new cider-current-repl will only be use if CIDER > 17, so this should hopefully be fixed soon for SM folks.#2018-07-1202:43euccastrogetting this now right after cider-jack-in (no custom cider-clojure-cli-parameters):
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} com.billpiel/sayid {:mvn/version "0.0.16"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
[nREPL] server started on 35964
[nREPL] Establishing direct connection to localhost:35964 ...
[nREPL] Direct connection to localhost:35964 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
#2018-07-1202:45euccastroif I try and switch to the REPL buffer, it shows up as an empty buffer with name *cider-uninitialized-repl*#2018-07-1203:07euccastroif anyone else is experiencing this, a workaround is to set cider-clojure-cli-parameters to "-e '(require (quote cider-nrepl.main)) (cider-nrepl.main/start-nrepl {:middleware %s})'"#2018-07-1205:26bozhidar> right. so i believe the alias cider-current-connection was added back so that older tooling and newer tooling had the same vocabulary#2018-07-1205:27bozhidar@dpsutton Ah, yeah. Now I remembered what happened - Vitalie meant to add aliases since the beginning but he forgot or something like this.#2018-07-1212:35dpsuttonexactly. and it looks like spacemacs reacted at the very moment those things changed.#2018-07-1205:38bozhidar@hagmonk Just woke up and left some review.#2018-07-1205:38bozhidarOverall things are looking good and my comments are mostly minor.#2018-07-1205:40hagmonk@bozhidar I am still not asleep, so I will take a look now :)#2018-07-1205:59bozhidar@hagmonk Thanks!#2018-07-1206:22hagmonk@bozhidar after pushing changes, looks like all but one test passed (CLJS test timed out)#2018-07-1206:23bozhidarYeah, those fail randomly from time to time.#2018-07-1206:23bozhidarCan’t be related to your changes.#2018-07-1206:23bozhidarI’ve pushed a new snapshot, hopefully now the problem is solved for everyone.#2018-07-1206:24hagmonkme too! sorry for extending it a day#2018-07-1206:45dominicmthus solving the problem once and for all#2018-07-1208:09bozhidarnREPL now has an official manual http://nrepl.readthedocs.io/en/latest/ It’s still pretty much a work in progress (mostly a restructuring of the old README) and your help improving it would be appreciated! (http://nrepl.readthedocs.io/en/latest/about/contributing/#working-on-the-manual)#2018-07-1209:07andrea.crottiI'm having a very strange issue where the Cider CLJ repl doesn't load the user.clj file#2018-07-1209:07andrea.crottithe weird thing is that it was working fine yesterday and I don't think I changed anything#2018-07-1209:49andrea.crottilein dev however works so leiningen actually loads that correctly#2018-07-1210:02andrea.crottitried now with both 0.17 and 0.18-snapshot and it's the same, not even sure it's a problem with Cider to be fair but anyone had issues loading user.clj files?#2018-07-1210:19andrea.crottiok checking out the project again with the asme exactly config and no untracked files works, so whatever it is is not related with Cider#2018-07-1210:19andrea.crottiI even did a couple of lein clean but there must be still something there that made it fail#2018-07-1211:16bozhidarOK, a problem that solves itself (at least for me) - my favourite kind. 🙂#2018-07-1212:43andrea.crottiyeah when they solve themselves without apparent reason is not great, but well 😄#2018-07-1215:27andre.stylianosYep, sorry. My fault.
I changed that in spacemacs but didn't account for people who had cider pinned to the stable version, since spacemacs defaults to the snapshot version.
I opened a PR with the fix using cider-current-connection instead of cider-current-repl#2018-07-1215:28andre.stylianosit's already merged by the way 😳#2018-07-1215:37mikerodI think I’ve seen this here befoer, but cannot remember, when doing something like cider-jack-in can you go back and see the command that was ran (shows up briefly in minibuffer), and also can you see any output/error it resulted in?#2018-07-1215:38eggsyntaxProbably in messages#2018-07-1216:37mikerod@U077BEWNQ oh, thanks there is some stuff there!#2018-07-1216:37mikerodI should have guessed#2018-07-1215:38eggsyntaxer, *messages*#2018-07-1215:40eggsyntaxYeah, just confirmed. There's also *cider-error* IIRC, for errors thrown by the REPL after it's started up. Also the nrepl-server buffer occasionally has useful info.#2018-07-1215:50Karol WójcikDoes anyone has a problem with macroexpanding with Node repl, the newest clojurescript and the newest cider?
(ns serverless-cljs-lambdas.core
(:require [cljs-lambda.macros :refer [defgateway]]))
(defgateway echo [event ctx]
{:status 200
:headers {:content-type (-> event :headers :content-type)}
:body (event :body)})
Expanding on defgateway simply returns itself.#2018-07-1217:15mikerod(related to question that was answered earlier for me here)
So when looking at *Messages* buffer to see the cmd that is used for cider-jack-in I see something like this:
Starting nREPL server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.16.0\"\] -- repl :headless :host ::...
At the end, the repl :headless :host ::... part, what are the ... ? Is this Emacs truncated this somehow ( I don’t see any way to tweak this), or is Cider truncating (can’t find that in cider source either0, or does the cmd actually end in ...?#2018-07-1219:33baptiste-from-parishello friends, am I the only one to have this behavior with cider 0.17
(for [x (range 4)]
(println x))
=> 1
=> 2
=> 3 IN CLJ
=> 123 IN CLJS
#2018-07-1219:33baptiste-from-parisit makes me crazy when I want to (dir 'namespace)#2018-07-1219:53dpsuttonI am observing
(for [x (range 4)]
(println x))
0
1
2
3
(nil nil nil nil)
in both clj and cljs repls#2018-07-1219:57dpsuttoni'm on 0.18-snapshot that is very up to date but not on the latest commit i'm sure#2018-07-1219:59eggsyntaxI'm on 0.17, and I'm seeing the same behavior that @baptiste-from-paris reported.#2018-07-1219:59baptiste-from-parisseems to be a cljs stuff#2018-07-1219:59baptiste-from-parisnot an cider#2018-07-1220:00eggsyntaxFunny, I don't remember that behavior from when I was on 17 before for a long time (I just switched back to 17 yesterday until 18 stabilizes).#2018-07-1220:02euccastro@mikerod I think the ... are just for dramatic effect: https://github.com/clojure-emacs/cider/blob/master/nrepl-client.el#L1043#2018-07-1220:02euccastrothey aren't part of the command, and they don't mean the command is being truncated. just ignore them?#2018-07-1220:13mikerodAh ok. Thanks for showing me where it is! #2018-07-1305:21bozhidarYeah, in the beginning the command was much shorter and the ... were there to indicate it’s going to take a while for nREPL to start.#2018-07-1305:22dpsuttonah. that's why i thought it was truncated as well#2018-07-1305:22bozhidarAll of the code/configuration about the jack-in commands is in cider.el currently, although this probably won’t be the case for long.#2018-07-1305:24bozhidarThe message used to be first simply Starting nREPL..., then it became Starting nREPL via lein..., then Starting nREPL via lein repl... and so it became really long after we started auto-injecting the deps as we had to craft an awfully long command.#2018-07-1305:44manuelI always looked at . . . as a "waiting" indicator.#2018-07-1309:11arrdemhttp://{www,docs,}.http://nrepl.org should all point to the readthedocs page now @bozhidar#2018-07-1311:59bozhidar@arrdem http://nrepl.org currently redirects to your blog 🙂#2018-07-1312:00bozhidarAlso seems to be some redirect to rtd, instead of a CNAME.#2018-07-1312:08kambiingHi sirs, I am having a hard time with the recent version.#2018-07-1312:08kambiingI was using the 0.14.0 for quite sometime. A year i think.#2018-07-1312:08kambiingI notice a difference that really get on my nerve.#2018-07-1312:08kambiingGiven,#2018-07-1312:09kambiing(range 1 102)
(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...)#2018-07-1312:09kambiingNotice the ... at the end#2018-07-1312:09kambiingThis goes terribly with spit, as anything that i spit will be truncated and have a ... at the end#2018-07-1312:39bozhidar@kambiing I guess you didn’t read the changelog. 😉#2018-07-1312:40bozhidarAt some point we started setting the *print-length* to avoid the problems people faced when they dumped a huge data structure in the REPL.#2018-07-1312:40bozhidar@gonewest818 is working on a more robust solution for this, hopefully we’ll introduce this soon.#2018-07-1312:40bozhidarIn the mean time you just just disable the *print-length* (which is 100 by default).#2018-07-1312:41kambiing@bozhidar yeah i didn't 😧 i found this just now https://github.com/clojure-emacs/cider/issues/2152#2018-07-1312:41bozhidarI’m still puzzled why someone decided that this should affect spit, though. Seems really odd.#2018-07-1312:42bozhidarhttp://docs.cider.mx/en/latest/using_the_repl/#limiting-printed-output-in-the-repl#2018-07-1312:48kambiingi did a workaround by rewriting the spit yesterday to write line by line 🤤. anyway thanks for the reply sir.#2018-07-1321:36eggsyntaxI like to do:
(defn pretty-spit
"Same args as spit"
[f content & options]
(assert f "You're trying to spit to an unnamed file!")
( f)
(binding [*print-namespace-maps* false
*print-length* 100000]
(apply spit f
(with-out-str (ppr/pprint content))
options)))#2018-07-1321:38eggsyntaxMakes for nice readable files.#2018-07-1313:21bozhidarYou’re welcome!#2018-07-1314:06dpsuttonthis bit of code will return random docstrings of defcustoms. This would be a nice addition to the startup message i think
(let* ((customs (seq-filter (lambda (entry)
(not (eq (nth 1 entry) 'custom-group)))
(get 'cider 'custom-group)))
(max (length customs))
(elt (random max))
(thing (car (nth elt customs))) )
(list thing (get thing 'variable-documentation)))
#2018-07-1314:18bozhidar@dpsutton We can probably integrated something like this with cider-tips.#2018-07-1316:18jjttjjI was messing around with cider dependencies in emacs/lein profiles.clj and now for some reason the C-c M-n switch to namespace command isn't working at all, and doesn't show up in the describe-mode docs. Everything else seems to be working. Does this sound like a familiar issue to anyone#2018-07-1402:24soulflyerJust started seeing this too, no idea why. I get a message saying No cljs REPLs found. Have you linked a session? when I try to run switch to namespace.#2018-07-1404:03soulflyerJust noticed that the emacs buffer name shows as *cider-repl nnn(clj)* although it is a cljs repl. Pretty sure this is new, I clearly remember locating the correct buffer in the past by looking for the (cljs) ~Maybe cider is also looking for the cljs repl by buffer name.~ renaming the buffer doesn't fix this.#2018-07-1316:33arrdem@bozhidar I couldn't use cnames because it lead to ssl cert issues. if you can configure readthedocs to use a "real" ssl cert for http://docs.nrepl.org then the cname will work. otherwise I suggest we stick with the current redirect.#2018-07-1316:34arrdemwill try to debug the failure to redirect tho, may just be a caching thing in your browser unfortunately. I was issuing 302 moved permanently for a while and that was a mistake.#2018-07-1316:43bozhidar> @bozhidar I couldn’t use cnames because it lead to ssl cert issues. if you can configure readthedocs to use a “real” ssl cert for http://docs.nrepl.org then the cname will work. otherwise I suggest we stick with the current redirect.#2018-07-1316:44bozhidarThat’s not supported there - you’re http-only when using this feature, but I think it’s perfectly fine for site of this type.#2018-07-1316:45bozhidarIt’s more flexible to just deploy the mkdocs site directly to GH pages, but you lose the automated builds, which are quite handy.#2018-07-1316:45bozhidarProbably something like this can be setup as a CI job, but dealing with the credentials is always a bit of a hassle.#2018-07-1402:24soulflyerJust started seeing this too, no idea why. I get a message saying No cljs REPLs found. Have you linked a session? when I try to run switch to namespace.#2018-07-1404:03soulflyerJust noticed that the emacs buffer name shows as *cider-repl nnn(clj)* although it is a cljs repl. Pretty sure this is new, I clearly remember locating the correct buffer in the past by looking for the (cljs) ~Maybe cider is also looking for the cljs repl by buffer name.~ renaming the buffer doesn't fix this.#2018-07-1405:48bozhidar@soulflyer Likely some REPL-type auto-detection problem.#2018-07-1405:48bozhidarSupposedly we had recently fixed those.#2018-07-1405:54soulflyer@bozhidar anything I can do to help fix it? I'm currently using in-ns and require from the repl so it's not a show stopper.#2018-07-1405:58bozhidar@soulflyer See this ticket and the related commits/docs https://github.com/clojure-emacs/cider/issues/2332#2018-07-1405:58bozhidarWhat’s the cljs REPL you’re using?#2018-07-1405:58bozhidarHow are you starting it?#2018-07-1406:00soulflyerI'm doing a cider-jack-in-clojurescript and selecting figwheel from the options offered#2018-07-1406:05soulflyerand (cider-set-repl-type "cljs") fixes it#2018-07-1406:20soulflyerah ha. Switching from cemerick/piggieback to cider/piggieback seems to have done the trick. 🙂#2018-07-1408:01bozhidarYeah, that’s the future.#2018-07-1408:02bozhidarHappy to hear you sorted this out! (although @dpsutton’s recent fix should have solved your problem). At any rate - cider/piggieback is much nicer and faster.#2018-07-1408:10dominicmso very fast#2018-07-1608:44bozhidarDoes anyone know how to keep a lein process running after it spawned some server?#2018-07-1608:46bozhidarI’m trying to create a simple lein plugin to just run the new nREPL server, but I hit a surprising roadblock - the server starts and then lein just exits and kills it.#2018-07-1608:46bozhidar(defn nrepl
"Start a headless nREPL server within your project's context."
[project & args]
(println args)
(eval/eval-in-project
project
`(start-nrepl ~(convert-args args))))
#2018-07-1608:47bozhidar(this just uses the start-nrepl wrapper from cider-nrepl and passes it a hash with the params it normally expects.#2018-07-1608:49bozhidarI took a look at https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj and I don’t quite understand everything it does to spin the headless server. I really don’t want to copy all of this, as it seems more complex than it needs to be.#2018-07-1608:54dominicmI would expect it's to do with thread daemonization...#2018-07-1608:58bozhidar@dominicm Are you referring to this?#2018-07-1608:58bozhidar(defn server [project cfg headless?]
(nrepl.ack/reset-ack-port!)
(when-not (nrepl-dependency? project)
(main/info "Warning: no nREPL dependency detected.")
(main/info "Be sure to include org.clojure/tools.nrepl in :dependencies"
"of your profile."))
(let [prep-blocker @eval/prep-blocker
ack-port (:port @ack-server)]
(-> (bound-fn []
(binding [eval/*pump-in* false]
(let [[evals requires]
(server-forms project cfg ack-port headless?)]
(eval/eval-in-project project
`(do ~(ignore-sigint-form) ~evals)
requires))))
(Thread.) (.start))
(when project @prep-blocker)
(when headless? @(promise))
(if-let [repl-port (nrepl.ack/wait-for-ack
(get-in project [:repl-options :timeout] 60000))]
(do (main/info "nREPL server started on port"
repl-port "on host" (:host cfg)
(str "- nrepl://" (:host cfg) ":" repl-port))
repl-port)
(main/abort "REPL server launch timed out."))))#2018-07-1608:59dominicmI just meant general JVM thread daemonization.#2018-07-1608:59dominicmLooks like they're working around the problem by blocking via @(promise)#2018-07-1609:03bozhidarYeah, I was just wondering if there’s isn’t some higher-level logic in Lein to deal with daemons.#2018-07-1609:14bozhidarAnyways, blocking the functions that starts the process works like charm. Should have thought of this earlier. I’ll share in a bit the new “fancy” plugin. 😄#2018-07-1609:16dominicmIt's a common pattern: https://github.com/juxt/edge/blob/fc0c371aaa2f88ae0f8eb2c72316282bf167c9af/app/src/edge/main.clj#L15#2018-07-1616:29dominicmAnyone around with an emacs nrepl connected who can confirm the behaviour in the case of two requires? https://github.com/clojure-vim/clj-refactor.nvim/issues/30
Only if it's really convenient and you aren't put off by vim users using the information. #2018-07-1617:23justinbarclayI can confirm this behaviour. Given multiple require statements only the first one remains and any subsequent require is dropped/goes missing.#2018-07-1705:18dominicmInteresting, thanks!#2018-07-1620:17bozhidarI’ve started hacking on the migration to nREPL 0.4 today - I’d love to see some people play with https://github.com/clojure-emacs/cider-nrepl/pull/540#2018-07-1620:43jlfischerQuick question: I'm starting my nREPL sessions manually (using the instructions here: https://github.com/clojure-emacs/cider-nrepl#via-embedding-nrepl-in-your-app), and connecting via cider-connect-clj, but any attempts to execute code in the repl (e.g. (println "Hi"), load files, evaluate anything, either hang or after some chunk of time give me an nREPL sync error. Any suggestions where to look to get it working?#2018-07-1620:44jlfischerCider reports this after connecting:
;; Connected to nREPL server -
;; CIDER 0.18.0snapshot (package: 20180714.811), nREPL 0.2.13
;; Clojure 1.9.0, Java 1.8.0_144
#2018-07-1620:51jlfischerFWIW, I don't end up with an *nrepl-messages* buffer, so I don't have a good view into what's going on.#2018-07-1620:54jlfischerScratch that, enabled nrepl logging according to http://docs.cider.mx/en/latest/troubleshooting/#missing-nrepl-messages-buffer and I've got the buffer. But still, it's just hanging trying to eval something simple:
(-->
id "9"
op "eval"
session "ebe59b11-8cb8-484f-b75f-7444556b4a6b"
time-stamp "2018-07-16 13:52:46.713737000"
code "(println \"Hi\")"
column 7
content-type "true"
file "*cider-repl localhost(clj)*"
line 43
ns "user"
)
#2018-07-1705:14bozhidarThat’s odd. And nothing comes after this message?#2018-07-1804:01tianshucan I jump to the file when browsing the namespaces? I think this will be much easier than jump file by projectile-find-file.#2018-07-1806:37jumar@U0NBGRGD6 maybe you want to use cider-find-ns instead.#2018-07-1806:41jumarYou can also press s when in the browser to jump to the source code of a particular function or a namespace#2018-07-1806:42jumarsee https://cider.readthedocs.io/en/latest/miscellaneous_features/#namespace-browser#2018-07-1807:01tianshuyes, this is what I'm looking for.#2018-07-1804:37richiardiandrea@bozhidar @hagmonk what is the status of the boot and nRepl? I am back and tomorrow my time I can check and try to come up with the second function for it if I understand correctly #2018-07-1804:45bozhidar@richiardiandrea I think we fixed it.#2018-07-1804:46bozhidarNow all the focus is here https://github.com/clojure-emacs/cider-nrepl/pull/540#2018-07-1804:46richiardiandreaYeah I think so too I was wondering if there is any additional step on either side#2018-07-1804:46richiardiandreaOh cool#2018-07-1804:46bozhidarGetting cider-nrepl to work with nREPL 0.4, so we can finally make the switch and focus on more creative endeavours.#2018-07-1804:47bozhidarWell, unfortunately it’s not going very well. I expected it’d be a trivial rename tasks, but some middlewares (like info and track-state) are currently not working properly, so I’d love some help in debugging the root of the damn problems.#2018-07-1804:49richiardiandreaUhm ok maybe I can help there then#2018-07-1805:00bozhidar@richiardiandrea That would be much appreciated!#2018-07-1805:04hagmonkI would dive in to help, now that I know roughly how things are laid out, but I have a monster work deliverable due in the next 24 hrs. I’ll check in tomorrow to see if there’s anything I can do.#2018-07-1805:06hagmonkI will add that for asshole grade hangs and/or socket problems, I often lean on jstack or FlameGraphs. Especially the latter, I’ve debugged many perf issues and hangs that way#2018-07-1805:06hagmonkThis guy makes it easy: https://github.com/clojure-goes-fast/clj-async-profiler#2018-07-1805:15bozhidar@hagmonk Thanks! I’ll likely wait a couple of days before diving into this again with a fresh mind. What puzzles me the most is how can something break if everything is identical and only the namespace has changed. I see that most middlewares are working just fine, there are just some isolated problems and even though there’s error reporting for each middleware op nothing triggers. I’ve left plenty of notes in the PR, so people won’t have to waste time on the things that I’ve discovered so far.#2018-07-1805:19hagmonkLOL, I know that miserable feeling so well, I feel for you! I think the last time I went on such a wild goose chase was because of a Java API returning a primitive bool false which is actually truthy in Clojure because it’s not a java.lang.Boolean. Printing out the value and shouting it’s fucking false, why are you branching like it’s true??? Good times#2018-07-1805:36bozhidarYeah, I’m reasonably sure something like this is going to be at the root of the current problem. 🙂#2018-07-1805:53bozhidarOn a related note - can someone help me understand why this simple plugin https://github.com/nrepl/lein-nrepl is raising this error when I try to use it outside its source folder
Exception in thread "main" java.lang.ClassNotFoundException: leiningen.nrepl, compiling:(/private/var/folders/f0/cm24s0qd0s5cch5jvj6ctnb00000gn/T/form-init15686757270206144100.clj:1:126)
Seems that the plugin can’t find its only namespace which looks quite bizarre to me.#2018-07-1806:05hagmonk@bozhidar you could try using fs_events (on Mac, can’t remember command on Linux) to discover the path it’s trying to reach … or see what’s in that temporary .clj file to check for clues there. Reminds me of the weird errors you get if you try to (compile ‘foobar) and the foobar namespace exists, but the target folder (“classes” by default) does not - you just get an error about not finding a file #2018-07-1806:05hagmonkIndeed since this error is thrown when compiling, I wonder if that is related … just a guess …#2018-07-1806:10bozhidar@hagmonk Hmm, I don’t see an fs_events command. I guess I’ll google around for it.#2018-07-1806:10bozhidarIt’s a pity that temp file gets deleted after the compilation failure, so I can’t easily peek into it.#2018-07-1806:25hagmonk@bozhidar oh I’m sorry, you want sudo fs_usage -w #2018-07-1806:27hagmonkIf you do man -k dtrace there are some other occasionally handy tools. For instance, execsnoop and newproc let you trace transient processes. Often handy in cases where tools are spawning other tools, or you suspect they might be #2018-07-1808:03tangrammerHi ciders!
I’m wondering why I’m getting this error command-execute: Wrong type argument: commandp, cider-find-var when i try cider-find-var with M-.
debugging a bit the code I had to explicitly add (require 'cider-find) to cider-browse-ns.el to get it running again ….
does it make sense?
I’m using …
https://github.com/clojure-emacs/cider/commit/82d379c2c5be5bf061931ed29bf95b3cf5440c14
with GNU Emacs 25.3.1 (x86_64-apple-darwin16.4.0, NS appkit-1504.81 Version 10.12.3 (Build 16D32)) of 2018-05-24#2018-07-1808:30dominicmI think I've figured out how to get dynamic dependency loading working with nrepl again 🙂#2018-07-1808:36jumar@U09LZR36F that's great! Any details?#2018-07-1808:36dominicmI just need to set a context class loader in the right spot 🙂 and I know where that is, just testing. The patch is horribly short, like 10 loc max.#2018-07-1808:37dominicmI'm saying it works based on tools.deps.alpha, alembic may need to change a little, I'm not sure on how it works exactly.#2018-07-1808:37jumarI'm looking forward to having this in master 🙂.#2018-07-1808:40dominicmnetwork-repl
Clojure 1.9.0
user=> (use 'clojure.tools.deps.alpha.repl)
nil
user=> (add-lib 'org.clojure/core.memoize {:mvn/version "0.7.1"})
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.pom from
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.pom from
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.pom from
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.jar from
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.jar from
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.jar from
true
user=> (require 'clojure.core.memoize)
nil
Promising result!#2018-07-1808:54bozhidarGreat news!#2018-07-1808:56bozhidarI think that alembic is pretty much dead at this point (I know refactor-nrepl plans to replace it with pomegranate), and there’s also a promising PR there https://github.com/cemerick/pomegranate/pull/102#2018-07-1808:59dominicmI don't think that PR would be necessary if my changes are merged. But it could be useful on it's own.#2018-07-1809:16dominicmhttps://github.com/nrepl/nREPL/pull/35 builds are passing, looks good 🙂 I can try pomegranate I guess 🙂#2018-07-1808:40dominicmnetwork-repl
Clojure 1.9.0
user=> (use 'clojure.tools.deps.alpha.repl)
nil
user=> (add-lib 'org.clojure/core.memoize {:mvn/version "0.7.1"})
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.pom from
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.pom from
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.pom from
Downloading: org/clojure/core.memoize/0.7.1/core.memoize-0.7.1.jar from
Downloading: org/clojure/core.cache/0.7.1/core.cache-0.7.1.jar from
Downloading: org/clojure/clojure/1.6.0/clojure-1.6.0.jar from
true
user=> (require 'clojure.core.memoize)
nil
Promising result!#2018-07-1808:59bozhidar@tangrammer How did you install CIDER? cider-find-var is an autoloaded command, so probably in your case something’s wrong with your autoloads. package.el generates those automatically, but perhaps you installed CIDER differently.#2018-07-1809:02tangrammerHi Bozhidar!
here you are 🙂
(add-to-list 'load-path "~/git/tangrammer/sesman") ;; boths locally cloned
(add-to-list 'load-path "~/git/tangrammer/cider")
(require 'cider)
#2018-07-1809:04tangrammerups looking now at https://cider.readthedocs.io/en/latest/hacking_on_cider/#obtaining-the-source-code
maybe i need to add (require 'cider-autoloads)#2018-07-1809:04tangrammer:thinking_face:#2018-07-1809:05tangrammersorry about the noise! I thought i have read this doc part 😬#2018-07-1809:18bozhidarNo problem! Finally someone who managed to solve their problem by reading the manual! 🙂#2018-07-1809:29tangrammernow I’m feeling proud of it#2018-07-1809:29tangrammerhahaha#2018-07-1817:18dominicm@bozhidar how should I be building your PR? I'm getting orchard.misc related issues trying to run your build#2018-07-1817:18dominicmCaused by: java.io.FileNotFoundException: Could not locate orchard/misc__init.class or orchard/misc.clj on classpath.
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.core$require.doInvoke(core.clj:5947)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at cider.nrepl.middleware.pprint$eval1518$loading__6434__auto____1519.invoke(pprint.clj:1)
at cider.nrepl.middleware.pprint$eval1518.invokeStatic(pprint.clj:1)
at cider.nrepl.middleware.pprint$eval1518.invoke(pprint.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7062)
at clojure.lang.Compiler.eval(Compiler.java:7051)
at clojure.lang.Compiler.load(Compiler.java:7514)
#2018-07-1817:19bozhidarCan’t imagine why. I just run lein install in that brach and that’s all. I don’t even apply MrAnderson when doing my tests.#2018-07-1817:20dominicmlein install? But doesn't that bypass Mr. Anderson?#2018-07-1817:20dominicmI thought ./build.sh install or make install was necessary.#2018-07-1817:20bozhidarYes, it does, but that shouldn’t be an issue.#2018-07-1817:20bozhidar(unless you have some conflicting libs in project you’ll be just fine)#2018-07-1817:21dominicmIt seems that Mr. Anderson isn't working correctly for that branch though.#2018-07-1817:21bozhidar~/p/cider-nrepl ❯❯❯ ./build.sh install nrepl-0.4
project prefix: cider.inlined-deps
retrieve dependencies and munge clojure source files
retrieving profile artifact.
retrieving tools.trace artifact.
retrieving puget artifact.
prefixing imports in clojure files in 'target/srcdeps/puget' ...
prefixing imports in clojure files in 'target/srcdeps/puget/color' ...
retrieving arrangement artifact.
prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/puget/v1v0v2' ...
retrieving compliment artifact.
prefixing imports in clojure files in 'target/srcdeps/compliment' ...
prefixing imports in clojure files in 'target/srcdeps/compliment/sources' ...
retrieving cljs-tooling artifact.
prefixing imports in clojure files in 'target/srcdeps/cljs_tooling' ...
prefixing imports in clojure files in 'target/srcdeps/cljs_tooling/util' ...
retrieving cljfmt artifact.
prefixing imports in clojure files in 'target/srcdeps/cljfmt/indents' ...
retrieving rewrite-clj artifact.
prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/cljfmt/v0v5v7' ...
retrieving rewrite-cljs artifact.
prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/cljfmt/v0v5v7' ...
retrieving orchard artifact.
prefixing imports in clojure files in 'target/srcdeps/orchard' ...
retrieving dynapath artifact.
prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/orchard/v0v3v0' ...
retrieving fipp artifact.
prefixing imports in clojure files in 'target/srcdeps/fipp' ...
retrieving core.rrb-vector artifact.
prefixing imports in clojure files in 'target/srcdeps/cider.inlined-deps/fipp/v0v6v12' ...
retrieving tools.namespace artifact.
prefixing imports in clojure files in 'target/srcdeps/clojure/tools/namespace' ...
retrieving java.classpath artifact.
retrieving tools.reader artifact.
prefixing imports in clojure files in 'target/srcdeps/cljs/tools/reader' ...
prefixing imports in clojure files in 'target/srcdeps/cljs/tools/reader/impl' ...
prefixing imports in clojure files in 'target/srcdeps/clojure/tools/reader' ...
prefixing imports in clojure files in 'target/srcdeps/clojure/tools/reader/impl' ...
Created /Users/bozhidar/projects/cider-nrepl/target/cider-nrepl-0.19.0-SNAPSHOT.jar
Wrote /Users/bozhidar/projects/cider-nrepl/pom.xml
Installed jar and pom into local repo.#2018-07-1817:22bozhidarWorks fine for me. Nothing really changed, so I can’t imagine what can be affecting it (compared to master).#2018-07-1817:22dominicmThe build works, but when I try to run it, it blows up#2018-07-1817:24bozhidarTried the build - works for me.#2018-07-1817:24bozhidarI’ll just push it to clojars now, so you can get it from there if you want.#2018-07-1817:25bozhidarDone.#2018-07-1817:27dominicmSeems to work, now I'm double suspicious 😛#2018-07-1817:28bozhidar😉#2018-07-1817:28bozhidarAs you should be…#2018-07-1817:39dominicmHaving looked a little, I think lein-nrepl#1 has the right idea, you need to add a dep to the project#2018-07-1817:39dominicmthe plugin example in the lein docs is even about adding a swank dependency to the project!#2018-07-1821:45bozhidarYeah, I noticed this. There’s also this approach https://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L59#2018-07-1918:36richiardiandreaSo I have noticed cider-repl-set-ns binding has changed to C-c M-n n, is it by mistake or on purpose?#2018-07-2007:39bozhidar@richiardiandrea It’s mentioned as a breaking change in the changelog, so I think we meant to do it. 😉#2018-07-2007:40bozhidarThe idea was to put all the related ns keybindings under the same keymap, so people can find them easier. For a few releases we’ve been trying to reduce the epic amount of top-level keybindings and organize them better.#2018-07-2007:42bozhidarPeople will also notice that now all the commands to start CIDER are under C-c C-x and after a few releases we’ll remove the legendary C-c M-j and C-c M-c.#2018-07-2014:43Garrett HopperIs there a variable to set for the custom cljs repl command in .dir-locals.el?#2018-07-2014:44Garrett Hopper@bozhidar You're removing C-c M-j? 😧#2018-07-2014:46dpsuttoncider-default-cljs-repl i think @ghopper#2018-07-2014:46dpsuttonbut that code has changed quite a bit since i've last been in it and i didn't trace it very carefully#2018-07-2014:46dpsutton(defcustom cider-default-cljs-repl nil
"The default ClojureScript REPL to start.
This affects commands like `cider-jack-in-cljs'. Generally it's
intended to be set via .dir-locals.el for individual projects, as its
relatively unlikely you'd like to use the same type of REPL in each project
you're working on."
:type '(choice (const :tag "Nashorn" nashorn)
(const :tag "Figwheel" figwheel)
(const :tag "Node" node)
(const :tag "Weasel" weasel)
(const :tag "Boot" boot)
(const :tag "Shadow" shadow)
(const :tag "Custom" custom))
:group 'cider
:safe #'symbolp
:package-version '(cider . "0.17.0"))
#2018-07-2014:47Garrett HopperI can set it to custom, but I can't actually set the form that gets used. Unless I'm missing something?#2018-07-2014:47Garrett HopperPerhaps it can be more than just a symbol?#2018-07-2014:48dpsuttonyou can add the custom init function to cider-cljs-repl-types#2018-07-2014:48Garrett HopperAh, ok. Is there a good way to do that in .dir-locals.el? (To append and not override)#2018-07-2014:49dpsuttonwith the key that you set as the cider-default-cljs-repl above. I don't believe it has to be "Custom" it could be project name and then you make sure there's an init function in that list#2018-07-2014:49dpsuttonyou can eval things in dir-locals but i get a little lost in the syntax. alternatively you could just replace the entire list and not append it, just make it the sole list entry#2018-07-2014:50Garrett HopperDoes this look right?
((nil . ((cider-default-cljs-repl . example)
(cider-cljs-repl-types . ((example "(start-example-cljs-repl)"))))))
#2018-07-2014:51Garrett HopperI get confused by the ($a . $b) and (($a $b)) syntax stuff.#2018-07-2014:51dpsuttonit looks like it needs a function at the end that gets invoked to make sure everything is good to go. you can reuse one of the existing ones or just put a thunk that doesn't throw an error#2018-07-2014:51dpsuttoncider-check-node-requirements is an example#2018-07-2014:52dpsuttonand you're syntax looks right to me#2018-07-2014:53dpsuttonhere's mine but i think cider has drifted so this is out of date
((nil . ((cider-lein-global-options . "with-profile dev")
(cider-default-cljs-repl . figwheel))))
#2018-07-2014:54Garrett HopperHmm, it's prompting me for the ClojureScript REPL type now. 😕#2018-07-2014:55Garrett HopperThe prompt lists all available types not just my custom added one which is weird, because if I inspect the cider-cljs-repl-types var, it only has mine in it.#2018-07-2014:56Garrett HopperI guess it uses the global value instead of the buffer-local value.#2018-07-2014:57dpsuttontry m-x hack-local-variables i think i've seen times where it has been "slow" to see new dir locals and then starts working#2018-07-2014:57Garrett HopperWell, the dir local is working, because I see it when inspecting the variable; it just isn't set globally.#2018-07-2015:05mgrbytedo people use flycheck + squiggly-clojure w/cider? just upgraded to cider 0.18-snapshot and it breaks my setup due to this issue i believe https://github.com/clojure-emacs/squiggly-clojure/issues/54#2018-07-2015:05mgrbyteif not, what do you use?#2018-07-2015:17eggsyntaxI do use flycheck. I've moved back to cider 0.17 for now, though, because 0.18 is still snapshot & has been undergoing rapid change as bbatsov et al do a bunch of fixes & improvements.
cider-default-connection became something else, I forget what though.#2018-07-2015:18mgrbyte@eggsyntax how did you rollback? I assume you're not using package.el ?#2018-07-2015:19dpsuttonthere's a way to pin to melpa-stable which will give you 0.17#2018-07-2015:19Garrett HopperHmm, so I have cider-default-cljs-repl set via .dir-locals.el, and I can verify that it's set to what I'm expecting, but inside cider--update-cljs-type, cider-default-cljs-repl is nil. Any ideas?#2018-07-2015:19eggsyntax@mgrbyte I'm using spacemacs, I can give you the incantation for that if you are as well.#2018-07-2015:19mgrbyteah yeah, I used to have that, but found it got really annoying to ping-pong between updating my lein profiles when wanting to upgrade#2018-07-2015:20mgrbyte@eggsyntax nah, it's cool. Using stock GNU emacs 26, have done the pinning thing before so I guess I'll just re-instate it for now#2018-07-2015:27mgrbyte@eggsyntax thanks v. much btw :thumbsup:#2018-07-2015:28eggsyntaxAnytime 🙂#2018-07-2015:34mgrbyte@eggsyntax happen to know what version stanza I need for cider-nrepl? I have currently have the following :repl profile:
:repl {:dependencies
[[acyclic/squiggly-clojure "0.1.9-SNAPSHOT"
:exclusions [org.clojure/tools.reader]]
[compliment "0.3.5"]]
:plugins [[cider/cider-nrepl "0.17.0"]
[refactor-nrepl "2.3.1"
:exclusions [org.clojure/tools.nrepl]]]}
#2018-07-2015:35mgrbyteGetting the y'old version mismatch malarky#2018-07-2015:35eggsyntaxstanza? I'm not familiar with that, I'm afraid.
Hmm, let me check what's in my .spacemacs for config.#2018-07-2015:36eggsyntaxVery early in my init (early enough that it runs before packages are loaded) I've got
(add-to-list 'configuration-layer-elpa-archives '("melpa-stable" . ""))
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
#2018-07-2015:36eggsyntaxI think that's it for pinning etc#2018-07-2015:37mgrbytestanza: as in "piece of code" in ~/.lein/profiles.clj in my case#2018-07-2015:37eggsyntaxI'm not specifying a CIDER version since melpa-stable will give me whatever the last non-snapshot is (currently 17)#2018-07-2015:37eggsyntaxOh, gotcha.#2018-07-2015:37eggsyntaxAh, lemme check that#2018-07-2015:38eggsyntaxI've got [cider/cider-nrepl "0.17.0"] as well.#2018-07-2015:39eggsyntaxI imagine you might need to delete your ~/.m2 repo, or at least the cider-nrepl subdir.#2018-07-2015:39eggsyntax(& a restart of course)#2018-07-2015:39mgrbytehmm :thinking_face: I'll try byte-recompiling everything again. ty.#2018-07-2016:53bozhidar> @bozhidar You’re removing C-c M-j? 😧 (edited)
@ghopper Yes, but not soon. First we’ll remove all mentions of it from all the docs and we’ll remove it in a few releases. It’s going to be C-c C-x (C-)j going forward and all the related commands are there.#2018-07-2016:54bozhidarAs for custom ClojureScript REPLs everything one needs to know is documented here.#2018-07-2016:54bozhidarhttp://cider.readthedocs.io/en/latest/clojurescript/#starting-a-clojurescript-repl#2018-07-2016:56Garrett HopperI've already switched over to C-c C-x C-j C-[jJ] 🙂 I kinda like it.
Thanks; I think I've got my .dir-locals.el setup properly now.
((nil . ((cider-clojure-cli-global-options . "-A:cljs:emacs")
(eval . (with-eval-after-load "cider"
(cider-register-cljs-repl-type
'example-repl "(start-example-repl)"
'cider-verify-piggieback-is-present))))))
There does seem to be some issue with cider-default-cljs-repl not working as expected in there though, but I ended up not needing it, because I've got two different cljs repls, so being able to choose is good.#2018-07-2017:21bozhidarWhat kind of issues?#2018-07-2019:15Garrett Hopper@bozhidar cider-default-cljs-repl is nil inside of cider--update-cljs-type when it's set via .dir-locals.el, so I end up getting the select type popup.#2018-07-2019:16Garrett HopperIs there a way to rename the sesman sessions to override the example#2 names they're given by default?#2018-07-2019:53theeternalpulsetrying to jack in to a shadow-cljs project and this is what occurs
error in process filter: lispy-cider-load-file: Symbol’s function definition is void: cider-map-repls
error in process filter: Symbol’s function definition is void: cider-map-repls
#2018-07-2020:01dpsuttonare you on version 0.17 and using lispy?#2018-07-2020:49theeternalpulseah, I'm using evil-lispy#2018-07-2020:50theeternalpulsebut yes 0.17#2018-07-2020:54dpsuttonsounds like evil lispy updated for 0.18 then#2018-07-2020:55dpsuttoncan you pin evil lispy to melpa stable?#2018-07-2021:02theeternalpulseah, will do that#2018-07-2021:13theeternalpulseError (use-package): Failed to install evil-lispy: Package ‘evil-lispy-’ is unavailable
Error (use-package): Cannot load evil-lispy
#2018-07-2021:14theeternalpulseafter pinning, this happens when I try to install#2018-07-2021:17theeternalpulsethere doesn't seem to be a stable one#2018-07-2021:18theeternalpulsefor evil-lispy at least#2018-07-2021:19theeternalpulseah, so I pinned lispy and it seemed to work#2018-07-2021:20theeternalpulsethat or me removing evil-lispy and having it re-installed#2018-07-2021:20theeternalpulseugh, melpa is a mess lol#2018-07-2107:12Ho0manHi,
I encountering a problem with cider-eval-last-sexp-and-replace.
I am using :
cider 0.18.0snapshot
GNU Emacs 26.1
Spacemacs Release 0.200.13.x
and when I cider-eval-last-sexp-and-replace the sexp is executed twice (the sexp has some side effects which are amqp operations using langohr concerning with connecting to a local rabbitmq docker instance).
Is it a bug with cider (If it is, then I assume it must have been issued by now but could not find anything on its github) or it may be due to some configuration problem ?
Thanks#2018-07-2107:15bozhidar@ghopper Likely a regression from some recent changes. Please, file a ticket for this.#2018-07-2114:21Garrett HopperWill do :thumbsup: Thanks#2018-07-2107:17bozhidar@ho0man First time I hear of such problem. You can check exactly what’s being evaluated in the *nrepl-messages ...* buffer (provided you’ve enabled it). Feel free to file a ticket for this.#2018-07-2107:19Ho0manThanks, will do.#2018-07-2107:20Ho0manThe problem does not appear when I use other modes of eval, though.#2018-07-2107:21bozhidarIf I recall eval-and-replace does the same eval as everything else. Don’t have time to check this now, though.#2018-07-2118:59genmeblogjust tried lein nrepl and connected from latest Cider which complains:
WARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT (package: 20180708.57) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
The other problem is when I stop nrepl from terminal (cygwin) with ctrl-c, nrepl exits to terminal but java process is left. This is not happen with lein repl#2018-07-2119:01genmebloganother issue I have, when connecting with cider-connect-clj there is no default localhost. localhost was available in the past#2018-07-2119:08genmebloganother issue: when I create new clj file (beeing connected to nrepl 0.2.12) sometimes I get namespace not found message. c-c c-k works fine, but c-x e not. I have to close file and load again to get things working. I can't find conditions to reproduce this, but I get this bug quite often.#2018-07-2119:10genmeblogand last one: how to force cider to reuse repl buffer when I reconnect? Currently cider-connect-clj creates new one, previously I was getting a question if I wanted reuse or not.#2018-07-2119:11genmeblogenough 🙂#2018-07-2123:25vxeis cider.nrepl.middleware.util.java.parser still a thing, or are statements like this now meaningless: (require '[cider.nrepl.middleware.util.java.parser :as parser]) ?#2018-07-2207:19bozhidar@vxe This was extracted to orchard a while ago. orchard is a dependency of cider-nrepl.#2018-07-2207:20bozhidar@tsulej I’ve mentioned somewhere in the README that you should ignore the version mismatch and add a dependency to cider-nrepl 0.19-SNAPSHOT somewhere (e.g. in your :dev profile).#2018-07-2207:20bozhidar> The other problem is when I stop nrepl from terminal (cygwin) with ctrl-c, nrepl exits to terminal but java process is left. This is not happen with lein repl (edited)#2018-07-2207:21bozhidarI didn’t really fret on this much - I implemented lein nrepl as simple as possible. The lein repl is pretty complex by comparison, so maybe it does something special to address this on Windows.#2018-07-2207:22bozhidarGenerally I hope that at some point someone will just merge the patch for nREPL 0.4 upstream in leiningen and the additional plugin will not be necessary. Unfortunately things are happening pretty slow upstream.#2018-07-2207:23bozhidar> another issue: when I create new clj file (beeing connected to nrepl 0.2.12) sometimes I get namespace not found message. c-c c-k works fine, but c-x e not. I have to close file and load again to get things working. I can’t find conditions to reproduce this, but I get this bug quite often.#2018-07-2207:24bozhidarI can’t imagine how something like this can happen. I’ve never encountered such a problem. If you find a way to reproduce it, please report it upstream.#2018-07-2207:24bozhidar> and last one: how to force cider to reuse repl buffer when I reconnect? Currently cider-connect-clj creates new one, previously I was getting a question if I wanted reuse or not.#2018-07-2207:25bozhidarThis was removed in 0.18 and it’s no longer possible. I recall Vitalie felt it made the code much more complex than it needed to be. Feel free to file a ticket to discuss what we can do to address this.#2018-07-2215:40genmeblogthx a lot, when I reproduce namespace not found bug I'll file a ticket#2018-07-2219:17richiardiandreaI read once a very nice guide on the cider middlewares...expecially regarding piggieback and JS eval. I would like to read it again because I am thinking of adding completion for JS requires/objects. Does somebody remember or has one I can look at?#2018-07-2223:28euccastro@bozhidar
> As for custom ClojureScript REPLs everything one needs to know is documented here.
The doc you link has a "Using the Figwheel REPL (Leiningen-only)" section, but apparently nothing on figwheel-main. Yet when I try and launch / connect to a cljs REPL in 0.18.0-snapshot, figwheel-main is one of the REPL types offered. Is that supported?#2018-07-2223:30euccastrowhen I try and actually use it, I get prompted for a build name (`dev` in my case) and then I get this exception: "Unable to resolve symbol: dev in this context"#2018-07-2223:32euccastroha, it seems it expects a keyword (i.e., :dev works)#2018-07-2306:43bozhidar@richiardiandrea Maybe it was this https://lambdaisland.com/guides/clojure-repls/clojurescript-repls#org3393425 ?#2018-07-2306:44bozhidar> The doc you link has a “Using the Figwheel REPL (Leiningen-only)” section, but apparently nothing on figwheel-main. Yet when I try and launch / connect to a cljs REPL in 0.18.0-snapshot, figwheel-main is one of the REPL types offered. Is that supported?
The docs were written before figwheel-main was a thing. I guess we should update them.#2018-07-2306:44bozhidar> ha, it seems it expects a keyword (i.e., :dev works)#2018-07-2306:45bozhidarWe should make this more flexible - probably accepting both dev and :dev would make it easier for users.#2018-07-2309:25bozhidarBtw, I’ve added a section on figwheel-main to the manual.#2018-07-2309:26manuelthanks @bozhidar, I'll give figwheel-main a try asap.#2018-07-2315:26euccastro@bozhidar re: http://cider.readthedocs.io/en/latest/clojurescript/#using-figwheel-main, in my case step 2 (opening a browser) wasn't necessary; it was opened automatically. one missing step is providing your build name (and the caveat that it has to be a symbol, i.e., preceded by a colon, would be nice to add until that's fixed)#2018-07-2315:27euccastroI guess people will figure it out anyway, but well 🙂#2018-07-2315:28bozhidarI’ve added a hint for this together with the doc updates. (e.g. :dev)#2018-07-2315:29mhcathey @bozhidar I noticed that C-c C-p (new projectile binding) conflicts with cider - is that down to something else in my ridiculously large configuration, or is it to be fixed, or...?#2018-07-2315:29bozhidar@j0ni It was just fixed on master - https://github.com/clojure-emacs/cider/commit/6d6aa42ecf5bad9110cc0a781e7786b87812b624#2018-07-2315:30mhcatah splendid, thanks!#2018-07-2315:30bozhidarUnfortunately CIDER’s keymap grew epic with time.#2018-07-2315:30mhcatindeed 🙂 but it merely tracks CIDER's epicness#2018-07-2315:30bozhidarhaha 😄#2018-07-2315:31bozhidarAt any rate - I’ll have to spend some quality time with the keymaps to clean them up and make them more consistent. That was a small step in that direction.#2018-07-2315:34mhcatgah, 2 hours for a melpa build - how far has my impatience evolved since waiting 2 weeks for that slackware walnut creek cd to show up in 1995 🤷#2018-07-2315:35mhcatbtw @bozhidar thank you for your work on cider, particularly the recent connection management bits ❤️#2018-07-2315:37bozhidarYou’re welcome!#2018-07-2315:38bozhidarThe last few months were a really wild ride, but we’re close to a big breakthrough. 🙂#2018-07-2412:53plexusI've been getting this thing lately where when I try to evaluate a form all I get is a complaint in the minibuffer saying "Namespace Not Found"#2018-07-2412:54bozhidarAny repro steps for this?#2018-07-2412:54plexusIt seems in this case it started when I created a new namespace, it's there, it's saved, it's on the filesystem in the right place. I can eval the ns form, but anything else it won't do.#2018-07-2412:55bozhidarload-file doesn’t work?#2018-07-2412:55plexuswhere would I do that? (load-file "full-path.clj") from the REPL?#2018-07-2412:58plexustried this with two namespaces, for one doing load-file cleared the problem, for the other it doesn't. they both contain nothing but an empty (ns) form#2018-07-2413:05plexushow do I enable the thing where I can see all nREPL messages going back and forth?#2018-07-2413:06dpsuttonnrepl-toggle-message-logging#2018-07-2413:06dpsuttonthat message is in the response. so for sure check what's going over the wire#2018-07-2413:08plexusok this is interesting#2018-07-2413:08plexus(-->
id "35"
op "eval"
session "8e6e275a-6335-4ead-9e78-827b408adbd4"
time-stamp "2018-07-24 15:07:34.188062715"
code "(+ 1 1)
"
column 1
file "/home/arne/Nextjournal/nextjournal/journal/server/env/dev/server/figwheel/api.clj"
line 2
ns "server.env.dev.server.figwheel.api"
)
(<--
id "35"
session "8e6e275a-6335-4ead-9e78-827b408adbd4"
time-stamp "2018-07-24 15:07:34.207152917"
status ("namespace-not-found" "done" "error")
)
#2018-07-2413:08plexusvs#2018-07-2413:08plexus(ns server.figwheel.api)
#2018-07-2413:09plexuswhen that file was first created it automatically got an ns form that read (ns server.env.dev.server.figwheel.api) (I guess clj-refactor does that)#2018-07-2413:10plexussomehow CIDER thinks it still has that namespace, even though the ns form has been updated, and even though I restarted nREPL (!)#2018-07-2413:10dpsuttondid you kill the buffer?#2018-07-2413:11dpsuttonthere's a buffer local version to hold that value apparently#2018-07-2413:14bozhidar@dpsutton I don’t think we have a buffer-local for for the source buffers.#2018-07-2413:14bozhidarThere’s a bit of logic to watch the ns for modifications even.#2018-07-2413:15plexusreloading the buffer does clear it up#2018-07-2413:15dpsutton(setq-local cider-buffer-ns ns) . I'm not sure how it gets set in code buffers but there is some state out there#2018-07-2413:15bozhidarInteresting. Guess really some buffer-local ns var must have been set, but those were never intended to be used with source files.#2018-07-2413:16dpsuttonyeah i've never seen that before#2018-07-2413:16dpsutton@plexus do you override the start ns from user to something else?#2018-07-2413:19plexusyes, we do, we have a server.repl namespace#2018-07-2413:19dpsuttonand is this that namespace or is it unrelated?#2018-07-2413:19plexusno, that's unrelated#2018-07-2413:21dpsuttonwell i'm at a loss then. if you can give some steps to repro from a new project i can look into it but if its not worth your time i understand that as well#2018-07-2413:21plexusI'll see if it comes up again, ran into this three times in two days on three separate projects so not unlikely#2018-07-2413:25pabloreHi, just updated Cider this morning an am getting this error#2018-07-2413:29bozhidar@pablore You’re getting it from clj-refactor.el and refactor-nrepl (which was recently updated).#2018-07-2413:29bozhidarGuess you’ll have to disable it.#2018-07-2413:30pabloreHow do I do disable it? I’m using spacemacs#2018-07-2413:30bozhidarRead CIDER’s FAQ/Troubleshooting.#2018-07-2413:30bozhidarThere was something about this there.#2018-07-2413:35pablorethanks!#2018-07-2414:19jumar@pablore I got the same error when using Java 1.10. I downgraded to java 1.8 and can still use clj-refactor.#2018-07-2418:10pabloreIs there anyway I can set my JAVA_HOME from inside emacs?#2018-07-2419:46jumar@pablore you could use setenv but I'd suggest to configure proper java system wide. I use jEnv (http://www.jenv.be/) for that.#2018-07-2414:49aptHey, does anyone know how to programatically evaluate something with cider and show the result in a window in Emacs? This is what I have done: http://ix.io/1igi . I think it actually works, except that I don't know how to get the output in a window in a decent way (I could insert the result into a buffer, load clojure mode and indent it, but I'm sure there's a better way). Also, what's a good resource for learning Cider internals?#2018-07-2414:53dpsutton@andre.peric there's the manual at https://cider.readthedocs.io/en/latest/ and i have some internal walkthroughs at http://hackingcider.com/#2018-07-2414:55aptThanks, hackingcider seems to be exactly what I want#2018-07-2414:56dpsuttonawesome! when you learn things make an overview of what was useful and submit a PR!#2018-07-2415:47martinklepschhas anyone tried hacking on clojure.spec with Cider? I can’t get it to work for some very weird reasons:
#object[clojure.spec.alpha$and_spec_impl$reify__2173 0xf14b48f
"clojure.spec.alpha$and_spec_impl$reify__2173@f14b48f"] is not a
fn, expected predicate fn
I did create a deps.edn file with the appropriate :paths#2018-07-2415:49martinklepschWhen loading clojure.spec.alpha it seems the c/and in line 81 is pointing to spec’s and for some reason …#2018-07-2415:56bozhidarI haven’t used spec much, but generally CIDER shouldn’t affect spec usage at all.#2018-07-2416:00martinklepschIt’s not really about spec usage but rather about hacking on Spec itself — as in running cider in this repo: https://github.com/clojure/spec.alpha/#2018-07-2416:07bozhidarIt should be a project like any other. Not sure what can special to it.#2018-07-2416:08martinklepschI’m also not sure what could be different which is why I came here to ask if anyone else tried it 😄#2018-07-2416:23dominicmdoesn't cider depend on spec in some way?#2018-07-2416:46bozhidarNo, it doesn’t.#2018-07-2417:05dominicmIt does, for the spec Explorer? #2018-07-2417:05dominicmhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/spec.clj in Orchard now #2018-07-2417:07dominicmI don't think that's a dependency which is inlined though. #2018-07-2417:57bozhidarIt’s not a project dependency at all - we check if spec is present, otherwise we just stub it.#2018-07-2417:58bozhidar(ns orchard.spec
(:require [clojure.walk :as walk]
[clojure.pprint :as pp]
[clojure.string :as str]))
(defmacro spec [fname & args]
`(when-let [f# (or (resolve (symbol "clojure.spec.alpha" ~fname))
(resolve (symbol "clojure.spec" ~fname)))]
(f# ~@args)))
(defmacro spec-gen [fname & args]
`(when-let [f# (or (resolve (symbol "clojure.spec.gen.alpha" ~fname))
(resolve (symbol "clojure.spec.gen" ~fname)))]
(f# ~@args)))#2018-07-2417:59bozhidarSo, there’s basically nothing to inline - if spec’s there it will be resolved, otherwise it won’t be.#2018-07-2417:59bozhidarNot sure how this can cause the problems @martinklepsch mentioned.#2018-07-2420:05jumar@martinklepsch I tried it with leiningen and the same error.
It seems that the key setting is -Dclojure.spec.skip-macros=true: https://github.com/clojure/spec.alpha/blob/master/pom.xml#L73
With it I can at least eval the alpha namespace.#2018-07-2420:05jumarHere's my project.clj:
(defproject clojure-spec-alpha "0.2.169-SNAPSHOT"
:description "Clojure spec"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.10.0-alpha4"]
[org.clojure/test.check "0.10.0-alpha2"]]
:source-paths ["src/main/clojure"]
:java-source-paths ["src/java"]
:target-path "target/%s"
:jvm-opts ["-Dclojure.spec.skip-macros=true"])
#2018-07-2420:32martinklepschInteresting — thanks for the pointer!#2018-07-2514:41tbaldridgeIs this the proper place to ask questions about clj-refactor?#2018-07-2514:48dpsutton@tbaldridge its the best place most likely#2018-07-2515:49bozhidarYeah, I’d say it’s the best place. 🙂#2018-07-2516:13dpsuttoni've just hit that wrong namespace bug. Seems to be in clojure-cache-ns#2018-07-2516:13dpsuttonnot sure if that has seen a change recently#2018-07-2516:15dpsuttonnot sure what's up but (setq clojure-cache-ns nil) has resolved it for me. If you're interested @plexus#2018-07-2516:25bozhidarI figured as much. I just assumed people changed their namespaces using command in clojure-mode, which updates the cache as well. 😉#2018-07-2516:27bozhidarThe problem was that not caching the ns was making some ns operations pretty slow for some people and there’s no way to know when to expire it.#2018-07-2516:28bozhidarhttps://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1822#2018-07-2516:29bozhidarhttps://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1735#2018-07-2516:33achesnaisHey everyone 🙂
It looks like clj-refactor is unavailable through Melpa at the moment – getting a 404 when running package-install or hitting the url directly: https://melpa.org/packages/clj-refactor-20180708.57.tar#2018-07-2516:34achesnaisIs anyone experiencing this as well?#2018-07-2516:35bozhidarSeems like some issue on the MELPA side.#2018-07-2516:35bozhidarProbably the build is erring or something.#2018-07-2516:49dpsuttonAh. That makes sense. But I always copy and paste a ns form to start out lol#2018-07-2516:55bozhidarI guess in that case it’s a matter of when clojure-find-ns will kick in first to trigger the caching. 🙂#2018-07-2516:56bozhidarBut you make a great point - we should add a basic command to clojure-mode to simple insert a skeleton ns which people can edit.#2018-07-2519:02bozhidarhttps://github.com/clojure-emacs/clojure-mode/issues/478#2018-07-2519:04bozhidarI guess one simple trick would be to expire the cache on file-save, but that’s going to impact negatively the performance you save often while typing.#2018-07-2519:04bozhidarOr this can be expired in cider’s eval commands…#2018-07-2519:04bozhidarCache invalidation is always hard. 😄#2018-07-2600:20arrdemWhat happened to cider-test-test-ns? I see cider-test-run-test which seems to make frankly stupid assumptions about the relative naming of the current namespace and the presumed test namespace.#2018-07-2600:27arrdemOh my namespace ends in -tests not -test so CIDER doesn’t think it’s a test ns for C-c C-t C-n#2018-07-2600:27arrdem:face_with_rolling_eyes:#2018-07-2605:48bozhidar@arrdem I think this part of the code has been the same since day 1, but the the expected ns name is configurable.#2018-07-2606:49bozhidar@dpsutton @plexus See https://github.com/clojure-emacs/cider/commit/122a40fd6ed9bb14387eac62aeed65cfd32b5a0b. That’s the best solution I could come up with. I disabled the caching by default in clojure-mode, but use cached ns values in the problematic dynamic indent code. Seemed like a reasonable middle ground.#2018-07-2607:49bozhidarI’m really sorry for the problems this caused. I just didn’t account for the fact that nREPL doesn’t echo back the missing ns. I’ve patched this in nREPL 0.4.3 as well and I’ll issue a release in a bit.#2018-07-2608:30plexus@bozhidar thanks a lot! 💯#2018-07-2608:37bozhidarhttps://github.com/nrepl/nREPL/releases/tag/0.4.3#2018-07-2612:12bherrmannHumm... does cider work with "clojure -r / deps.edn" ?#2018-07-2612:12dominicm@bherrmann yep#2018-07-2612:14bherrmannOh yea... I should have googled some... https://cider.readthedocs.io/en/latest/up_and_running/#connect-to-a-running-nrepl-server#2018-07-2612:14bozhidar@bherrmann cider-jack-in also works with tools.deps.#2018-07-2612:15bozhidarhttps://cider.readthedocs.io/en/latest/up_and_running/#launch-an-nrepl-server-and-client-from-emacs#2018-07-2613:00plexus@bozhidar the nrepl-0.4 stuff, is there an easy way to try that? or is it too soon to try?#2018-07-2613:58bozhidar@plexus Yeah, it’s pretty easy. I’ve created a simple plugin for lein and for clj and boot there’s some support to boot the 0.4 server in cider-nrepl-0.19.0-SNAPSHOT.#2018-07-2613:58bozhidarhttps://github.com/nrepl/lein-nrepl#2018-07-2613:59bozhidarI’ve meant to add this to the nREPL docs, but I haven’t had time for this yet. Hopefully by the end of the week.#2018-07-2614:00bozhidarRight now the only bigger problems is that I haven’t updated piggieback to work with nREPL 0.4, but that’s trivial. Afterwards a few other projects will require trivial modifications as well.#2018-07-2614:00dpsuttoni wonder you could ping the maintainers of lein on that issue to gauge their interest in testing out the new nrepl and moving lein over to it#2018-07-2614:00bozhidarI’ve actually updated the code in lein for 0.4 and they’ve had a PR opened for quite a while now.#2018-07-2614:00bozhidarSame with boot.#2018-07-2614:01bozhidarhttps://github.com/technomancy/leiningen/pull/2444 and https://github.com/boot-clj/boot/pull/703#2018-07-2614:01bozhidarSomeone just has to merge them. 🙂#2018-07-2614:03bozhidarThis nREPL transition is one of the most frustrating undertakings I’ve ever had, but it’s also very rewarding.#2018-07-2614:03bozhidarThe past few weeks we’ve fixed more problems with nREPL than in the past 2-3 years.#2018-07-2614:04bozhidarWe just have to push through the painful part and it will be smooth sailing from there.#2018-07-2614:06dpsuttoncider#2018-07-2616:18mhcathey @bozhidar - question about your lein-nrepl plugin - is it only possible to start a server on the command-line and connect from cider, or can I configure cider to use the plugin?#2018-07-2616:27bozhidar@j0ni You can configure CIDER to use it, but the generation of the dependency jack-in params will be different for it, so if you want to use the plugin it’d be best to disable auto-injection of params and simply put the plugin and some dependency to cider-nrepl in your lein profiles.#2018-07-2616:28bozhidarI meant to put a section about this in the README, but I forgot about it.#2018-07-2616:28mhcatah cool - so disable injection, and ensure all the injected deps are in my ~/.lein/profiles.clj should do it#2018-07-2616:30mhcathmm, should both cider-nrepl and refactor-nrepl be plugins and not dependencies?#2018-07-2616:31mhcatI figured them for dependencies, but I see the injections use the :plugins key#2018-07-2617:12mhcathmm, I can't find a way to fire it up, either manually or via cider-jack-in with lein params set to the command line you suggest in the readme, without getting the dreaded warning: WARNING: CIDER's version (0.18.0-snapshot) does not match cider-nrepl's version (0.19.0-snapshot). Things will break!
More information.
maybe I'm missing some configuration option 😞#2018-07-2618:11bozhidar@j0ni You can ignore the warning. 0.18 and 0.19 are exactly the same.#2018-07-2618:11mhcatokeydoke#2018-07-2618:11bozhidarI just had to issue this as a different version because we haven’t released 0.18 officially yet. The only thing different is that one is built for nREPL 0.2 and the other for nREPL 0.4.#2018-07-2618:12bozhidarrefactor-nrepl doesn’t have a version for 0.4 yet, although doing this is trivial - it’s a just a matter of changing a few namespaces.#2018-07-2618:12bozhidar> hmm, should both cider-nrepl and refactor-nrepl be plugins and not dependencies?#2018-07-2618:13bozhidarThe plugins are simply manipulating the project.clj to add the required stuff to lein :repl profile automatically. As lein nrepl doesn’t use this profile, you should configure cider-nrepl simply as a dev dependency with it.#2018-07-2619:30Drew Verleehello! is there a way to search all functions in a project? that is, can i get a list of them all via cider?#2018-07-2619:42dominicmApropos with .* as your query#2018-07-2619:43dominicmI believe that helm-cider does fuzzy matching on apropos for you#2018-07-2620:05richiardiandreaHelm-cider or helm-ag is what I use#2018-07-2705:33manuelFYI: do not upgrade to latest sesman, because it is broken https://github.com/vspinu/sesman/issues/6#2018-07-2705:34manuel@drewverlee I use counsel-projectile-rg#2018-07-2707:16bozhidar@j0ni A bit too late, but still https://github.com/nrepl/lein-nrepl#using-with-cider 🙂#2018-07-2711:30manuellatest sesman from MELPA fixed the problem mentioned above#2018-07-2717:58rymndhngdoes cider-nrepl's ^:source-dep always override the version of artifacts in the classpath?
I want to try using a different version of tools.namespace, and I'm seeing some weird behaviour where the clojure compiler says I have a missing var :thinking_face:#2018-07-2718:08rymndhngnevermind I think i know what's wrong -- my classpath was calculcated incorrectly because my non-canonicial fork has a different name (so both jars were loaded, an older one and a newer one)#2018-07-2718:28Drew Verleeso i added fighweel {:nrepl-port 7888} to my project.clj then ran lein fighweel then cider connect localhost 7888. i evaled something simple (+ 1 1) and it was successful. however when i evaled my namespaces requires i got java.lang.illegalaccesserror: read-string does not exist which hints to me that i didnt set something up correctly.#2018-07-2802:36arrdemIn new CIDER how do I “link” a directory tree to a session?#2018-07-2802:37arrdemIt seems to be playing poorly with my checkouts for the most part.#2018-07-2803:17dpsuttonhttps://github.com/clojure-emacs/cider/issues/2351#2018-07-2803:17dpsuttonsome background @arrdem#2018-07-2803:26arrdemLooking thanks @dpsutton#2018-07-2803:27dpsuttoni run 2 to 3 repls at work. i've just gotten into the habit of making a frame for each. I wrote a package to help resize windows which helps because "current session" is dictated entirely by last repl buffer you were in#2018-07-2803:29arrdemNice! I’m used to the old CIDER functionally global instance behavior and just trying to get acclimated.#2018-07-2812:14bozhidar@arrdem http://www.cider.mx/en/latest/managing_connections/#context-links#2018-07-2819:33martinklepschI’m getting Namespace not found. messages but don’t understand why — things I’ve checked
- namespace can be loaded (require 'namespace)
- filename corresponds to namespace name
- functions from that namespace can be called in repl after loading it with C-c C-k#2018-07-2819:34martinklepschI didn’t update, anything but did restart the nrepl session/server/process#2018-07-2819:35martinklepschI’m also not seeing anything else besides that message in *Messages*#2018-07-2819:37martinklepschGuess I’ll just upgrade all my packages and hope for the best lol ¯\(ツ)/¯#2018-07-2819:46dpsuttonis this a new file by any chance?#2018-07-2819:48martinklepschI just created it a few minutes ago, not sure if that qualifies as new @dpsutton 😄#2018-07-2819:48martinklepschI updated all packages and restarted emacs — and it’s working again 😄#2018-07-2819:48dpsuttontry (setq clojure-cache-ns nil)#2018-07-2819:48dpsuttonthere's a namespace cache that has some edge cases right now#2018-07-2819:49dpsuttonbut i think the update to clojure mode accomplishes that as well#2018-07-2819:50martinklepschthat sounds like it could have been it — I found a bunch of issues in github related to namespace not found — maybe it’s a good idea to open an issue to make this easier to find? (maybe even immidiately close it)#2018-07-2819:51dpsuttonthere's one open on clojure-mode right now#2018-07-2819:51dpsuttonhttps://github.com/clojure-emacs/clojure-mode/issues/480#2018-07-2819:52dpsuttonah, you might be right#2018-07-2819:52dpsuttonthis is more internal discussion and not a "observed problem" -> "solution". I think the solution is to kill the buffer which kills the buffer-local cached value#2018-07-2821:27genmeblogI sometimes get namespace not found and figured out my case finally. Under cygwin I have symlinked dropbox folder from the other drive. When I create from emacs, path is like ~/dropbox-clj/..../project/src/bbbb.clj. Namespace name is (ns cygdrive.d.Dropbox....project.bbbb). And now, when I change ns to (ns project.bbbb) I'm getting Namespace not found. c-c c-k works perfectly but c-x c-e on a sexp give an error. Reloading a file solves a problem.#2018-07-2821:36genmeblogworth to mention that I run nrepl outside emacs and connect with cider-connect-clj#2018-07-2821:38genmeblogI know that java sees paths as they are on Windows, Emacs sees paths as they are on Cygwin. I remeber that there are functions in cider (or clojure mode) already which take care about translating one into another. Probably case with symlinked folder is too much and it's extreme corner case here.#2018-07-2822:05genmeblogok, looks like path to replicate namespace not found is simple: open emacs, open project file, cider-jack-in, create new file, change proposed namespace, and that's all. c-c c-k works, c-x c-e doesn't (on any sexp other than ns)#2018-07-2822:13dpsuttonThat's what I was talking about before#2018-07-2822:13dpsuttontry (setq clojure-cache-ns nil)#2018-07-2822:16genmeblogyep, works#2018-07-2901:09Drew Verleere asking my question. as im worried it got buried 🙂
im trying to setup my development workflow where im able to eval parts of my project into the repl from emacs via cider.
the project im working on starts a repl via figwheel. in looking at the figwheel docs i assume i should add an option to my project .clj for nrepl and then connect to it on that port. basically i added fighweel {:nrepl-port 7888} to my project.clj then ran lein fighweel then cider connect clojurescript localhost 7888. i evaled something simple (+ 1 1) and it was successful. however when i evaled my namespaces requires e.g (ns blah (:require .... i got java.lang.illegalaccesserror: read-string does not exist which hints to me that i didnt set something up correctly.
im also confused about an error about java read-string as i connected via clojurescript#2018-07-2903:20dpsuttonare you sure port 7888 is the correct port?
https://github.com/plexus/chestnut/issues/8#2018-07-2903:21dpsuttonthis is showing some similar issue and that there are two ports in play#2018-07-2903:27dpsuttonalso, since you are running lein figwheel can you try requireing your namespace from there and seeing if works without any CIDER mechanisms in play?#2018-07-2909:20bozhidar> this is more internal discussion and not a “observed problem” -> “solution”. I think the solution is to kill the buffer which kills the buffer-local cached value#2018-07-2909:23bozhidar@dpsutton Thanks for looking into this. I’m not on the fence about solving this:
• I can completely remove the caching
• perhaps it’s best to split clojure-find-ns into two commands - one that looks up the form itself and one that simply returns the ns of the current buffer
• alternatively this caching can be moved only to the indentation code in cider
And in general - probably those side-effect relying bits of the code should be changed.#2018-07-2920:50Drew Verleeim trying to trouble shoot the issue i mention above, in doing so im following along with some videos by lambda island, long story short they suggest that you change your cider default cljs repl when using figwheel and piggieback.
unfortunately, unlike in the video, i dont get figwheel as an option when i run customize variable > cider-defaul-cljs repl. i tried typing in "Figwheel-repl" (dont recall the exact spelling). and that didnt work. any suggestions on how im supposed to set this var to use figwheel?#2018-07-2920:51Drew Verleepicture for reference#2018-07-2920:52Drew Verleemaybe this...https://github.com/clojure-emacs/cider/issues/2381 is relevent#2018-07-2920:53Drew Verleei guess ill set it via .dir-locals.el#2018-07-2922:47Drew Verleei should probably get off cider 1.18.0-snapshot right? and on to something more stable.#2018-07-2923:06dpsuttonyou could try. but your issue doesn't sound related to any new changes#2018-07-3007:16bozhidarI think there’s no listing of the options anymore because now they are dynamic and they used to be fixed in the past. I’m not sure if defcustom has support for handling a dynamic list of options.#2018-07-3007:18bozhidarBut it’s the issue you mentioned is certainly odd - like something to do with missing hack-variables or something (needed for dir-locals to work with non-file buffers).#2018-07-3007:19bozhidarI’d like to solicit a bit of feedback on updating piggieback for nREPL 0.4 from everyone. Please, take a look here https://github.com/nrepl/piggieback/pull/92 and let me know how this looks to you. Some help with the mysterious error will also be appreciated!#2018-07-3008:10martinklepschI have a git repo with a deps.edn in a sub directory but no project files at the top level — is there any way I can run cider from that sub directory?#2018-07-3008:11bozhidarCIDER considers deps.edn to be a project root anyways.#2018-07-3008:11bozhidarActually clojure-mode does this, but the end result is the same. 🙂#2018-07-3008:12martinklepschahhh — I got confused because it asked me which command to use which made me think it couldn’t figure it out but it’s really just because the project has project.clj and deps.edn#2018-07-3008:13martinklepschThanks @bozhidar 🙂#2018-07-3008:15bozhidarYeah, exactly. When there are several potential project targets we leave it to the users to decide what exactly to be used.#2018-07-3008:15bozhidarYou’re welcome!#2018-07-3008:28martinklepschGood stuff. That new cider command is really nice 👍 #2018-07-3008:30martinklepschI used to use “Eval & pretty print” quite often but noticed that this has been removed (I think?). I found the inspector thing - which is cool but requires me to know how to use it :D
Is there any chance pretty printing will come back?#2018-07-3008:50bozhidar@martinklepsch It was never removed. 🙂#2018-07-3008:51bozhidarJust the keybindings changed recently, as there were many pprint-related commands and we moved them in a dedicated keymap, so people can find them easier.#2018-07-3008:51bozhidar(I just assume you’re refererring to C-c C-p which is not around anymore).#2018-07-3008:52bozhidar* **(Breaking)** Move `cider-pprint-eval-last-sexp`, previously on `C-c C-p`, to `C-c C-v (C-)f (C-)e` in the `cider-eval-commands-map`.
* **(Breaking)** Move `cider-pprint-eval-defun-at-point`, previously on `C-c C-f`, to `C-c C-v (C-)f (C-)d` in the `cider-eval-commands-map`.
#2018-07-3008:58bozhidarBtw, I’m happy to report that I sorted out the piggieback situation and now 0.3.7 is out with support for nREPL 0.4. It will still work with the legacy tools.nrepl, so piggieback users won’t experience any issues if they are still using it.#2018-07-3009:16manuelso now, aside from using piggieback 0.3.7, is there anything special that needs to be set up to have nREPL 0.4 in CIDER?#2018-07-3012:55bozhidarWe just need to cut a stable 0.18 release and afterwards I’ll update the mainline middleware.#2018-07-3012:55bozhidarI’m playing with the idea to update the middleware straight in 0.18, but I’m not sure if I’ll have time and energy for this. 🙂#2018-07-3012:58bozhidarGenerally now it’s very easy to get 0.4 going with clj or the lein nrepl, but lein repl requires you to be running lein from master. (and you have to use cider-nrepl-0.19-SNAPSHOT which I’ve build especially for early adopters).#2018-07-3012:59bozhidarIf someone goes over all the cider-nrepl code and applies conditional requires like here https://github.com/nrepl/piggieback/commit/2f38ab2a7cf84061fc1a744c9a8e91660b3c3ac9#diff-748325368821931b8d3cdb2efc2a7586R19 we can have the support for 0.4 even now.#2018-07-3012:59bozhidarPretty trivial, but that’s at least 1-2 hours boring manual work. 🙂#2018-07-3013:00bozhidarProbably doing things in this manner would be preferable to dropping support for tools.nrepl directly, though (which is what I did in the 0.19 branch).#2018-07-3018:10agigaoHi there, how can I evaluate just part of the function or one specific expression in comment? for example:
(comment
(def server (-main "--port" "8080")) ;; just this one
(web/stop server))
#2018-07-3018:20dpsutton@chokheli there are several ways.
1. put cursor at the end of the expression and press C-x C-e
2. there is an insert into the repl type of evaluation. There's a useful way to make things insert into the repl and eval automatically there which I like.
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-after-insert-p nil)
The first of these makes forms put into the repl with the insert commands eval automatically rather than requiring you to hit enter. The second prevents the point from moving into the repl buffer.
3. You can redefine what top level defun means.
(setq cider-eval-toplevel-inside-comment-form t)
will make eval-ing top level defun aware of comment forms like this and make it do the right thing. If your point is inside the form, evaling (or inserting) into the repl using a top level defun command will work on what you mean and not the whole comment form which returns nil#2018-07-3018:21dpsuttonThe insert commands are nestled inside of a keymap at C-c C-j. There you'll find e for last expression, d for top-level-defun, r for region and one other one#2018-07-3018:23dpsuttonhttps://github.com/clojure-emacs/cider/commit/35cf253ff35596dbf48925291ec76eac3b234fdc#2018-07-3018:23dpsuttonif you want to see some more discussion and the code#2018-07-3018:23agigaoThank you Dan!#2018-07-3018:23dpsuttonabsolutely#2018-07-3018:23agigaoCheers#2018-07-3018:24dpsuttonIf you use cider-eval-toplevel-inside-comment-form there is a bug with autocompletion inside of comment forms at the moment. If you retoggle it off the bug goes away. There is a disagreement of what begginning-of-form means. I need to fix it#2018-07-3018:28theeternalpulseIf you want to hear the dulcet tones of the one and only @bozhidar
https://soundcloud.com/defn-771544745/36-a-long-glass-of-cider-with-bozhidar-batsov-aka-bbatsov#2018-07-3022:24Drew Verleei'm trying to get a nrepl connection via figwheel. im not sure what versions of what i should use at this point. for example, it seems like bozidar has done some awesome work and updated the whole setup, im not sure if changes need to be made to lein-figwheel to support this or not.
more directly, with more current setup i get this error:
SEVERE: Unhandled REPL handler exception processing message {:op classpath, :session 066f0db1-77c8-42b8-bcc0-67610738112b, :id 9}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.transport.FnTransport
its possible i should open a more formal github issue, but its not clear with who and about what.#2018-07-3102:23richiardiandrea@drewverlee I would open a cider issue and continue from there, cannot think of an immediate reason for that off the top of my head#2018-07-3104:44bozhidar@drewverlee Just looking at the error - it seems you on the nREPL 0.4, but figwheel-sidecar doesn’t know about it. Updating this should be trivial, but someone (e.g. @bhauman should do it).#2018-07-3104:45bozhidarP.S. There’s also figwheel-main these days, which I believe will replace lein-figwheel completely soon, so it should be updated as well.#2018-07-3105:38bozhidarIt also seems I made an epic typo in piggieback 0.3.7 - in the namespace check I used clojure.tool.nrepl instead of the correct clojure.tools.nrepl. I’ll issue 0.3.8 in a moment.#2018-07-3107:13manuel@bozhidar fantastic podcast on defn#2018-07-3107:43bozhidar@manuel Thanks! :man-bowing:#2018-07-3109:27donavanHi all, just a little stuck on a config question. Is it easily possible to get coloured output in a Cider repl? Currently if I pprint a complex map it’s all in a yellow face (except some ns stuff). But if I manually enter a map at the repl it’s returned value is coloured correctly. Much thanks!#2018-07-3109:42bozhidarPretty-printed output is treated as any other other output, therefore the lack of any special syntax-highlighting.#2018-07-3109:43bozhidarBtw, how exactly are you doing the pretty printing?#2018-07-3110:11donavanvia (clojure.pprint/pprint something)#2018-07-3111:57bhauman@bozhidar @drewverlee I don't think this is figwheel-sidecar, We'd have to see the rest of the stacktrace but it looks like this is piggieback#2018-07-3112:44bozhidar@bhauman Yeah, yeah - this was the result of the typo I mentioned. I had written (find-ns 'clojure.tool.nrepl) intead of (find-ns 'clojure.tools.nrepl).#2018-07-3112:45bozhidar0.3.8 should work again with tools.nrepl.#2018-07-3112:59bozhidarBtw, I just cut nREPL 0.4.4 and it has some sweet support for clj baked in - you can now launch nREPL with whatever custom handler you need without resorting to 3rd party tools (details here - http://nrepl.readthedocs.io/en/latest/usage/#starting-a-server)#2018-07-3113:00bozhidarIn a nutshell - starting a ClojureScript REPL is now as simple as:#2018-07-3113:00bozhidarclj -R:nrepl -m nrepl.cmdline --middleware "[cider.piggieback/wrap-cljs-repl]"
#2018-07-3113:00bozhidarAnd can be made even simpler with extra aliases.#2018-07-3113:06dominicmThat's awesome, I guess I should look at porting that 🙂#2018-07-3113:07bozhidar@dominic You started all of this a while ago with your work in cider-nrepl. 🙂#2018-07-3113:09bozhidarI plan to tweak the cmdline functionality in nREPL a bit more in the upcoming releases, but the foundation is here. Btw, now it also outputs exactly the same message as lein repl and boot repl, so clients parsing the output to find the port should work without any changes.#2018-07-3113:38bozhidarOps, I meant to write @dominicm 🙂#2018-07-3115:48Drew Verlee@bozhidar thanks for your work on this! sadly i upgraded to piggieback 3.8 and i still get the same error. im sketching out a github issue and ill post it to cider-nrepl... though im not sure which lib needs to change 🙂
here is the issue. thanks again
https://github.com/clojure-emacs/cider-nrepl/issues/541#2018-07-3115:50bozhidar@drewverlee And I guess that works with 0.3.6, right?#2018-07-3115:52bozhidarMy best guess is that lein figwheel android is not loading nREPL the same way lein repl does. @bhauman can enlighten us here.#2018-07-3115:53bozhidarI’m puzzled why the cider-nrepl middleware is having problems, though. Which version are you using?#2018-07-3117:05Drew Verleeit seems it might have been due to a mismtach between the version of cider-nrepl installed on emacs and that i was injecting into the project. i downgraded to cider nrepl 18 and everything worked!#2018-07-3117:06Drew Verleei really appreciate your time on this. im going to donate some money to the cause as the world needs you and emacs and cider!#2018-07-3117:48bozhidarlambdalove#2018-07-3119:19dpsuttondowngraded to 18 is a funny sounding phrase#2018-07-3116:17mhcatholy cow I just M-.'d from a clojure buffer right into my hugsql raw sql file to a query definition - when did that happen? ❤️ the ever increasing awesome#2018-08-0118:41richiardiandreais there a function in clojure-mode to read the namespace at point? (say I am on a namespace :require entry in the buffer#2018-08-0119:27dpsuttonclojure-find-ns?#2018-08-0119:35richiardiandrea@dpsutton that is basically finding the namepace of the current buffer - the ns entry#2018-08-0205:20vemvSay I have a pretty vanilla clj (not cljs) setup with Leiningen, clojure.test and the 'reloaded' workflow (in some or other variation). I put test in :source-paths so I can interact with the tests as I develop them (completions, jump-to-def, etc).
The test namespaces aren't required anywhere - as we know there isn't a big file where all tests are listed.
But now, when I visit a given test ns with CIDER, there are no interactive features until you require that ns. Sometimes, I think I have to go one step beyond and M-x cider-load-buffer.
Is this a common problem? What would be a solid solution?
Currently I piled up some hacks to do this requiring and loading, but that's not integrated with 'reloaded' at all (it loads individual ns's on demand, instead of refreshing the test dir cleanly and as a whole).
Maybe the solution I seek is outside CIDER/Emacs? i.e. have a clever function that lists all ns's in the test dir and requires them dynamically.#2018-08-0212:35plexusNot sure if this has been asked yet, I use jump-to-definition quite a lot, and with the sesman changes when it jumps to a third party library the buffer I end up in ends up not having a sesman link, and I need to do a sesman-link-directory or similar before anything cider related works (including jump-to-definition from there). Would it be possible to automatically link these buffers to the session I navigated from?#2018-08-0320:45jumar@plexus not ideal, but just evaling the buffer should work.#2018-08-0212:36plexusin general I'd really like to have the old behavior back of just using whatever connection it finds, especially if there's only one. (yes I know this makes me sound like this: https://xkcd.com/1172/)#2018-08-0214:52vemvYou always can use a cider git submodule pinned to a specific version (cider itself will load fine like that, but clj-refactor will need to have its package-requires altered to avoid downloading cider again)#2018-08-0212:59bozhidar@vemv I think a very long time I changed this and made CIDER eval the ns form automatically if you try to eval something before it. But the fact remains that normally the first thing you should do when interacting with a buffer is to eval it. Not sure what exactly is so problematic with this, though. You don’t want to have to require tests manually?#2018-08-0213:01bozhidar@plexus Vitalie is not active here, so it’s best to just file tickets on the sesman issue tracker. I never change code in third party libs (I normally just read it), so this didn’t look like a problem to me before you brought it up. Probably those temp buffers should just be auto-associated with the current session. I think Vitalie would agree that’s a good approach.#2018-08-0213:01bozhidarAnd yeah - maybe we should add a mode to funnel everything unliked to a predefined connection. I think he’d agree this makes sense as well.#2018-08-0213:03plexus@bozhidar ok, thanks!#2018-08-0214:48vemv> first thing you should do when interacting with a buffer is to eval it. Not sure what exactly is so problematic with this
It's simply a manual step (though automatable), and one that I don't have to perform with regular source code - just with tests. plus this manually-evaled buffer can get out of date.
None of these happen with regular src code (as opposed to tests), thanks to the 'reloaded' workflow#2018-08-0214:49vemv> You don’t want to have to require tests manually?
As in, creating a big 'requires' file? It's a possibility but it seems tedious and controversial (particularly for Cursive users who don't want to see the project poulluted due to emacs-isms)#2018-08-0214:52richiardiandreaI usually use a user.clj file for that or just go to the buffer I want to test and require it before inspection. #2018-08-0214:52richiardiandreaCider does not do much static analysis#2018-08-0214:55richiardiandreaProbably something that lists and autorequires tests in test could be added but I don't think it is there at the moment#2018-08-0217:36bozhidar> in general I’d really like to have the old behavior back of just using whatever connection it finds, especially if there’s only one. (yes I know this makes me sound like this: https://xkcd.com/1172/)#2018-08-0217:36bozhidarSo true! 😄#2018-08-0217:37bozhidar> Maybe the solution I seek is outside CIDER/Emacs? i.e. have a clever function that lists all ns’s in the test dir and requires them dynamically. (edited)#2018-08-0217:39bozhidar@vemv Btw, there a few functions even now to load all namespaces within a project. Implementing some eval-on-visit functionality would be trivial, but there’s always the problem with namespaces which will produce side-effects when evaluated.#2018-08-0217:40bozhidarAnd for a very long time I was thinking of adding some small indicator showing that some ns is out of sync with the code in the source file. If only I had time to pursue all those cool ideas.#2018-08-0217:40bozhidar🙂#2018-08-0217:42vemvGotchu! Thanks for the support 🙌
I guess that historically there hasn't been a canonical solution for this problem, which is what I was most curious about#2018-08-0217:47bozhidarThat’s an opportunity to create one. 😉#2018-08-0217:47bozhidarI guess my problem is that I’m so used to the default workflow that for me it’s hard to see fundamental problems with it.#2018-08-0218:30dominicmSo much to do, and so little time. #2018-08-0219:11bhaumanpreach it#2018-08-0219:24bhaumanI updated figwheel.main to support nrepl/nrepl#2018-08-0219:24bhaumancurrently working on lein-figwheel#2018-08-0305:36bozhidar@bhauman Great news!#2018-08-0305:37bozhidarBtw, not sure if I mentioned it here or not, but shadow-cljs also supports the new nREPL. We’re almost completely done. 🙂#2018-08-0306:11dumratHi, how do I get two repls (clj, cljs) running with cider? (I'm using spacemacs).#2018-08-0307:46bozhidarIf you’re on 0.18 just do M-x cider and select clj&cljs from the prompt you’ll see.#2018-08-0309:09dumratDoesn't work for me#2018-08-0309:10dumrat[nREPL] Direct connection to localhost:62698 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
#2018-08-0309:10dumratI get this error or something like this always#2018-08-0309:11dumratI followed instructions#2018-08-0309:11dumratAnd doesn't work#2018-08-0308:49manuelIs it possibile (maybe in .dir-locals.el) to specify a default build when the CLJS REPL is run with figwheel-main? Just to bypass the prompt#2018-08-0308:57manuelok, obviously you already thought of that: cider-figwheel-main-default-options. Thanks!#2018-08-0309:07bozhidarYep. A problem that solves it self. Sounds like a job for me! 😉#2018-08-0309:21dumrat1. Reinstalled spacemacs
2. Freshly create project with luminus template
3. Try to run clj and cljs repl together
4. ERROR!!!#2018-08-0309:22dumratExasperating#2018-08-0309:23dumrat[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- repl :headless :host ::...
[nREPL] server started on 62773
[nREPL] Establishing direct connection to localhost:62773 ...
[nREPL] Direct connection to localhost:62773 established
[nREPL] Establishing direct connection to localhost:62773 ...
[nREPL] Direct connection to localhost:62773 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
mwheel-scroll: End of buffer [19 times]
#2018-08-0309:23dumratCan someone help?#2018-08-0309:35bozhidarI don’t see piggieback injected in the command line string you’ve shown, so I assume it’s not a dependency of your project as well.#2018-08-0309:36dumrat[com.cemerick/piggieback "0.2.2"] inside dev profile#2018-08-0309:36bozhidarOh, that’s ancient.#2018-08-0309:37dumrato.O#2018-08-0309:37bozhidarYou should have cider/piggieback there.#2018-08-0309:37bozhidarI think the current version is 0.3.8.#2018-08-0309:37dumratok#2018-08-0309:38dumratHow about
:figwheel
{:http-server-root "public"
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
instead of having :nrepl-middleware in repl-options?#2018-08-0309:38dumratIs that also an issue?#2018-08-0309:38bozhidarYep.#2018-08-0309:38bozhidarIt’s cider.piggieback/...#2018-08-0309:39bozhidarWhen Chas handed us over the project we had to change the deployment coordinates.#2018-08-0309:43dumratJeez, it's working now#2018-08-0309:43dumratThanks @bozhidar very much. /\#2018-08-0309:46bozhidarYou’re welcome!#2018-08-0317:09mikerodIs there anyway in lein to configure the middleware that is used by cider-nrepl - rather than just taking all the defaults? If so, can it not be accomplished via the plugin?#2018-08-0317:11mikerodPretty sure I have hit a problem with cider.nrepl.middleware.out/print-stream, which is in the wrap-out middleware.
Using figwheel + piggieback, during a CLJS compilation pass, it looks like (resolve *out*) returns nil and I get a NullPointerException here - I think the bound *ns* is cljs.user at the time and potentially is why.#2018-08-0317:11mikerodAnyways, that’s some more background, but in general, I am now just wondering about the configurability of the middleware that you get with cider-nrepl#2018-08-0317:22devnhey, anyone here have a working org-babel setup with cider these days?#2018-08-0317:23devnI have ob-clojure loaded up, and org installed via source, but it doesn't seem to be able to connect to CIDER#2018-08-0317:23devnWhen I attempt to evaluate the code block, it says "Not connected" in the minibuffer#2018-08-0317:26devni followed the instructions here: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html#2018-08-0317:33devnlooks like there's a new package ob-clojure-literate#2018-08-0317:39devnhttps://github.com/stardiviner/ob-clojure-literate in case the internet comes knocking#2018-08-0317:44devnwhile i got it basically working, it seems to include nil in every result evaluated:#2018-08-0317:44devn#+begin_src clojure :results value
(+ 1 4)
#+end_src
#+RESULTS:
: nil5
#2018-08-0318:35richiardiandreatoday I learned this, for .dir-locals.el awesome!
((nil . ((projectile-grep-default-files . '("*.clj" "*.cljs" "*.cljc"))
(cider-preferred-build-tool . "clojure-cli")
(cider-default-cljs-repl . shadow-select)
(cider-clojure-cli-global-options . "-A:test:dev")
(mode . cider)))) <- super useful!
#2018-08-0318:53bozhidar> Is there anyway in lein to configure the middleware that is used by cider-nrepl - rather than just taking all the defaults? If so, can it not be accomplished via the plugin?#2018-08-0318:54bozhidarYou’ll have to list all the middlewares you want to use in Lein’s repl options. You can use the plugin for this, as it generate options with all the middleware in it. 🙂 We can probably improve the plugin, but no one asked about this.#2018-08-0318:54bozhidar@mikerod ^^#2018-08-0318:55bozhidarBe sure to also report the bug you encountered. There’s also a config somewhere to disable this particular middleware as not everyone likes it. Don’t remember the exact name, though.#2018-08-0319:01mikerod@bozhidar Ok, I wasn’t sure if I could list them all there. I was thinking it was a “whitelist” only thing and not a “blacklist” - meaning I have to list everything i want to leave 1 out.
I haven’t seen anything about how to disable with-out middleware#2018-08-0319:01mikerodas far as the bug, it’s complicated#2018-08-0319:03mikerodI’m still hunting down a complete understanding, but there is an issue having resolve called during macroexpansion in CLJS compilation.
The code was actually calling (.println System/out ^String s), but this middleware has System/out set to something that uses resolve. resolve results in nil, so there is a NPE due to it assuming (resolve *out*) won’t be nil in this with-out middleware.#2018-08-0319:38reefersleepI’m trying to use CIDER more effectively. I just tried using cider-eval-last-sexp-and-replace, great functionality. However, when doing so in a CLJS file, using a function I’ve defined after starting the repl, I get
#object[TypeError TypeError: Cannot read property 'call' of undefined]
#2018-08-0319:38reefersleepThis is regardless of whether I do cider-load-buffer beforehand.#2018-08-0319:39reefersleepOh, and the sexp gets replaced with nil.#2018-08-0319:39reefersleepSo, a sequence like this:#2018-08-0319:44reefersleep;; This is my buffer initially
(defn add [x]
(+ x 10))
(add 30)
;; If I do cider-eval-last-sexp-and-replace here, the sexp gets replaced by 40
;; Now I add a new function
(defn subtract [x]
(- x 3))
;; and save the file, and do cider-load-buffer
(subtract 10)
;; If I do cider-eval-last-sexp-and-replace here, the sexp gets replaced by nil, and I get #object[TypeError TypeError: Cannot read property 'call' of undefined] in the repl
#2018-08-0319:44dpsuttonI just tried (+ 1 1)| where | is point and i eval it and i got 2#2018-08-0319:44dpsuttoncan you eval the expression you think should work in the repl?#2018-08-0319:45dpsuttonand did you eval subtract's definition?#2018-08-0319:45dpsuttoni just used your subtract definition and it works for me TM.#2018-08-0319:47reefersleepIf I eval the sexp calling subtract after calling cider-load-buffer, I get the same error and returning nil as the result.#2018-08-0319:47reefersleepIf I send the subtract definition to the repl first and then send the calling sexp, I get the correct behaviour.#2018-08-0319:49reefersleepThe implication is that for every sexp that I would like to call cider-eval-last-sexp-and-replace (or similar functionality), I would first need to send each of the vars involved to the repl… individually.#2018-08-0319:49reefersleepRather than just loading in all buffers to my repl.#2018-08-0319:50reefersleep@dpsutton do you follow?#2018-08-0319:50reefersleep🙂#2018-08-0319:55dpsutton> f I eval the sexp calling subtract after calling cider-load-buffer, I get the same error and returning nil as the result.
this is a bug here. that needs to be solved before anything else happens#2018-08-0319:55dpsuttonthere's no sense in doing anything if you have undefined things after calling cider-load-buffer#2018-08-0319:57reefersleepTrue that#2018-08-0319:57reefersleepI thought it was related to the eval functionality only, but it’s a general problem. Hm.#2018-08-0319:58dpsuttonyeah. that's just things fundamentally not wired up correctly#2018-08-0319:58dpsuttonwhat kind of cljs repl are you using?#2018-08-0320:00reefersleepI get no errors in my cljs repl when loading in the buffer, but I do get an error in the browser console#2018-08-0320:00reefersleepHadn’t noticed that#2018-08-0320:01reefersleepIt’s a Figwheel repl#2018-08-0320:01reefersleepioc_helpers.cljs?rel=1532007149410:42 Uncaught TypeError: goog.net.jsloader.load is not a function#2018-08-0320:03dpsuttonno idea. there is #figwheel and #figwheel-main if you want to ask questions#2018-08-0320:03dpsuttoni wish i could help you further but i think things are breaking before CIDER gets a chance to have a bug 🙂#2018-08-0320:03reefersleepoh yeah, I think you’re right about that 🙂#2018-08-0320:04reefersleepcheers!#2018-08-0320:16mikerod@bozhidar
> Be sure to also report the bug you encountered. There’s also a config somewhere to disable this particular middleware as not everyone likes it. Don’t remember the exact name, though.
I did this https://github.com/clojure-emacs/cider-nrepl/issues/542#2018-08-0320:16bozhidar@mikerod You’re looking for cider-redirect-server-output-to-repl.#2018-08-0320:17bozhidarMiddleware can only be whitelisted with lein, that’s true, but… This middleware has to be explicitly initialized when a connection is established and when this option is nil it won’t be initialized.#2018-08-0320:19bozhidarAnd thanks for looking into the bug!#2018-08-0320:19mikerodInteresting, I’ll look into cider-redirect-server-output-to-repl#2018-08-0320:20dpsuttonhttps://github.com/dpsutton/cider/blob/master/cider-connection.el#L243#2018-08-0320:23mikerodI actually just updated that issue#2018-08-0320:24mikerodI think it can be reproduced easily:
(ns fail-wrap-out-middleware
(:refer-clojure :exclude [*out*]))
(.println System/out "10")
#2018-08-0320:24mikerodfun#2018-08-0320:25reefersleep@dpsutton I figured it out. Had updated my figwheel dep without also updating piggieback and figwheel-sidecar. CIDER works great now! 😄#2018-08-0320:25mikerodand thanks for the reference @dpsutton#2018-08-0406:05rhansenAnyone here have issues with datomic.ion.cast and cider?#2018-08-0406:35bozhidarWhat kind of issues?#2018-08-0407:50rhansenWhen calling (cast/initialize-redirect :stdout) so cast will output messages to stdout instead of ignoring the calls, my application crashes when calling said functions 😕#2018-08-0407:50rhansenIt only happens when using cider, and I haven't yet been able to see what exception get's thrown 😞#2018-08-0407:53bozhidar@rhansen I’m reasonably sure you’ve hit https://github.com/clojure-emacs/cider-nrepl/issues/542#2018-08-0407:53bozhidarIt’s trivial to address and I’ll try to find some time for it later today.#2018-08-0407:53bozhidarI’m already exhausted now after spending my entire morning working on wrapping#2018-08-0407:54bozhidarhttps://github.com/clojure-emacs/cider-nrepl/commit/15d87747f790d300b0f13eef2e5bdc87b9dfd4ec#2018-08-0407:55bozhidarSo, yeah - mainline cider-nrepl 0.18 now support nREPL 0.4! That’s a very big success! partywombat#2018-08-0407:55bozhidarNow someone has to do the same exercise for refactor-nrepl…#2018-08-0408:09rhansenAhh, ok. There's no need to rush on my account. Get some well deserved rest 😃#2018-08-0409:52bbssI restarted my shadow-cljs watch and I saw it downloaded a [cider-nrepl "0.18.0-SNAPSHOT"] dep, which I had previously installed locally. Now my cider-connect-cljs doesn't work anymore. I've tried updating my emacs cider dep and removing any cider packages and re-installing cider-nrepl from a fresh clone. After entering host+port+repl-type shadow I get asked which shadow build I want to use (as usual). But after that I don't see the repl switch to cljs as it used to do before. Any evals time out.#2018-08-0410:12bozhidar@bbss Likely you experienced this https://github.com/clojure-emacs/cider-nrepl/commit/6727f9fd59836d0c22bea21b895c3d833f4c53f3#2018-08-0410:13bozhidarI’ve cut a new snapshot. I tested only with 0.4 locally, that’s why I didn’t notice the problem.#2018-08-0410:15bbssOkay, trying it! Thanks! 🚀#2018-08-0410:20bbssThat worked! Thanks @bozhidar#2018-08-0410:21bozhidarYou’re welcome! And sorry for the mess!#2018-08-0410:21bbssThat's okay. Risk of living on the 0.18.0 edge 😎#2018-08-0411:50bozhidar@rhansen https://github.com/clojure-emacs/cider-nrepl/commit/54bef72c29d9f01f5e109fa515f06595c454438f#2018-08-0412:08rhansen@bozhidar awesome! Does this mean that I just need to update my melpa packages and I should be all good?#2018-08-0412:11bozhidarOnly cider-nrepl snapshot from Clojars.#2018-08-0412:12bozhidarThere are no changes in CIDER itself (the Elisp code).#2018-08-0412:12rhansenOkay. Thanks again!#2018-08-0414:06soulflyerGetting problems with Cider. Trying to do a cider-jack-in starts a repl but throws an error like this:
2018-08-04 20:42:24,140 [clojure-agent-send-off-pool-5] ERROR clojure.tools.nrepl.server - Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session 8dd8ceb1-2573-46d3-8f52-84ea5b8890f5, :id 8}
clojure.lang.Compiler$CompilerException: java.lang.IllegalStateException: response-for already refers to: #'nrepl.misc/response-for in namespace: cider.nrepl.middleware.inspect, compiling:(cider/nrepl/middleware/inspect.clj:10:1)
This is with a luminus/swagger project that has been working fine for some time now. Just tried building a new one with lein new luminus +swagger +mongodband I get the same error. Could this be something to do with the recent changes to cider-nrepl?#2018-08-0416:09soulflyerLooks like it is the latest cider-nrepl. I can start a repl via lein, and connect to it using cider-connect. This works, but complains about cider and cider-nrepl versions not matching. If I add this to profiles: :repl {:plugins [[cider/cider-nrepl "0.18.0-SNAPSHOT"]]} I get the error again and the repl won't start. Reverting to cider/cider-nrepl "0.17.0" makes the error go away.#2018-08-0419:51michalyeah, the same here: [WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-apropos, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-classpath, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-complete, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-debug, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-enlighten, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-format, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-info, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-inspect, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-macroexpand, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-slurp, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-ns, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-out, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-content-type, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-slurp, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-pprint, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-pprint-fn, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-profile, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-refresh, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-resource, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-spec, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-stacktrace, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-test, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-trace, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-tracker, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-undef, see clojure.tools.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-version, see clojure.tools.middleware/set-descriptor!
#2018-08-0419:52michaland lot of exceptions when trying to connect from emacs#2018-08-0419:53michalsomething bad happened, guys#2018-08-0419:57michal@bozhidar that came with the latest snapshot of cider/cider-nrepl (0.18.0-SNAPSHOT). any clue where is the problem?#2018-08-0420:34bozhidarSeems like some mismatch between the nREPL versions, but I can’t understand how something like this can be happening.#2018-08-0420:36bozhidar@soulflyer’s problems seems like what I fixed here https://github.com/clojure-emacs/cider-nrepl/commit/6727f9fd59836d0c22bea21b895c3d833f4c53f3#2018-08-0500:57soulflyerOk thanks. Seems to be working again now.#2018-08-0420:37bozhidarVery simply put - after the most recent update cider-nrepl assumes you’re running nREPL 0.4.x unless it can find that clojure.tools.nrepl is loaded (which is true if you’re running lein repl or boot repl).#2018-08-0420:37bozhidarI tested this both with lein repl and with clj and it seems to work fine.#2018-08-0420:38bozhidarThe middleware descriptor problems are a complete mystery - they imply that set-descriptor was set with the nREPL 0.4 function, but it’s trying to be resolved by nREPL 0.2, which should not be happening.#2018-08-0420:39bozhidarAnyways, the bulk of the changes are here https://github.com/clojure-emacs/cider-nrepl/commit/15d87747f790d300b0f13eef2e5bdc87b9dfd4ec#2018-08-0420:39bozhidarEveryone’s welcome to go over this and check for irregularities.#2018-08-0421:22pauldI get similar errors trying to jack-in to my clojurescript project. Here is the trace in my *nrepl-server buffer:#2018-08-0421:23pauld#2018-08-0421:24pauldIt's a clojure tools cli project (deps.edn), using the figwheel-main template.#2018-08-0421:25pauldresult is after cider-jack-in-cljs + choosing figwheel-main#2018-08-0421:26pauldI wasn't prompted for the build (ie :dev) this time.#2018-08-0421:27bhauman@pauld try bumping up to figwheel-main 0.1.5#2018-08-0421:29pauld@bhauman already did#2018-08-0421:30pauldalso, I'm using spacemacs develop branch - in case that becomes relevant#2018-08-0421:31pauldI'll try with a bare clojure tools cli project next.#2018-08-0421:32lilactownmy emacs just straight-up freezes (also using spacemacs develop) with cider-jack-in in brand new deps.edn project. I was able to stop it from freezing by removing refactor-nrepl.middleware/wrap-refactor from the startup params, now I get the same error as @pauld#2018-08-0421:34pauldI guess the next step is to rule out spacemacs (it does some dependency injections of it's own).#2018-08-0421:37lilactownremoving the sayid middleware fixes it#2018-08-0421:38lilactownadding the refactor (without the sayid middleware) middleware reintroduces the freeze#2018-08-0421:38pauldah, thanks - that one has broken my cider before#2018-08-0421:39pauldhow did you remove it?#2018-08-0421:39lilactownI used SPACE u SPACE m ' to test it out#2018-08-0421:43lilactownI think that the way to remove it is via the cider-jack-in-nrepl-middlewares var#2018-08-0421:47lilactownis there a way to print the whole command that CIDER uses to start the nREPL process for cider-jack-in?#2018-08-0421:48pauldit prints it to the messages buffer as far as I know#2018-08-0421:48lilactowndoesn’t help when my Emacs freezes though 😛 I don’t want to run it#2018-08-0421:49lilactownah I was quick enough to switch the buffers before I barfed 😉#2018-08-0421:50pauldwould reading .emacs.d/layers/+lang/clojure/packages.el help?#2018-08-0421:51pauldin the past I deleted the sayid import at the top to stop it from loading sayid middleware#2018-08-0421:51pauldeverything the clojure layer does is in there I think#2018-08-0421:54lilactownI got it#2018-08-0421:54lilactownFYI to fix this in the interim I added this to dotspacemacs/user-config:
(setq cider-jack-in-nrepl-middlewares '("cider.nrepl/cider-middleware"))#2018-08-0422:05lilactown:thinking_face: that doesnt’ seem to be picked up on starting Emacs#2018-08-0422:10pauldyeah, noticing this too#2018-08-0422:11pauld<spc> f e R gets it working but <spc> q R (restarting) does not.#2018-08-0422:12pauldprobably needs to go in /init#2018-08-0422:13lilactownthat didn’t take either#2018-08-0422:15pauldmaybe in the layer configuration?#2018-08-0422:16pauld(clojure :variables cider-jack-in-nrepl-middlewares '()#2018-08-0422:16pauld)#2018-08-0422:16lilactowni’m not even sure where the variable gets set#2018-08-0422:18lilactownah. sayid and clj-refactor add themselves to the list#2018-08-0422:19lilactownit looks like at least sayid has a `sayid-inject-dependencies-at-jack-in var you can set to nil#2018-08-0422:20pauldmy idea didn't work#2018-08-0422:22lilactownokay. adding ;; sayid and refactor-nrepl are broken right now QQ
(setq sayid-inject-dependencies-at-jack-in nil)
(setq cljr-inject-dependencies-at-jack-in nil)
to my user-config worked#2018-08-0422:22lilactownthat was very frustrating#2018-08-0422:24pauldOk, can confirm it works!#2018-08-0422:25pauldthanks! I wonder if these are only broken for us spacemacs develop users?#2018-08-0422:26pauldsayid is part of the layer in develop only if I recall correctly#2018-08-0422:27pauldI guess nobody using refactor-nrepl in regular emacs is complaining here yet#2018-08-0422:28lilactownyeah, sayid seems to only be in the develop branch#2018-08-0422:28lilactownI’m surprised that others aren’t having issues with clj-refactor but it is a weekend 😛#2018-08-0422:29lilactownI feel like master also used an older version of CIDER?#2018-08-0422:29lilactownbut I can’t find any confirmation of that in the repo#2018-08-0422:34pauldyeah, not sure they are even able to pin cider version easily#2018-08-0422:34pauldi just read a long issue discussion about it#2018-08-0422:35pauldonly choice is to use MELPA-Stable but I don't think that comes pre configured#2018-08-0422:38pauldCan a non-spacemacs user with sayid or refactor-nrepl in use confirm they are broken?#2018-08-0501:58hoppyoddity after upgrading many things today, including cider. cider-version is a variable defined in ‘cider.el’.
Its value is "0.18.0-snapshot"#2018-08-0501:59hoppyI run cider-jack-in-clj&cljs, and find a .clj file in the project, and then do ^C^K to reload, and it looks like it's trying to feed it to clojurescript, rather than clojure#2018-08-0502:00hoppy#2018-08-0502:01hoppydid something change in this regard, am I doing it wrong, or am I finding bugs?#2018-08-0504:36bozhidarSorry for the problems people using extra middleware encountered, but I simply can’t run after everyone and fix everything in each project. I’ve notified the maintainers of both sayid and refactor-nrepl of what they need to do. It’s really simple. If you’re frustrated by this, you have no idea how frustrating it has been for me to coordinate the nREPL switch over a dozen projects. 🙂#2018-08-0505:32soulflyer@bozhidar No need to apologise. You are doing great work that is very much appreciated. A few hiccups along the way are to be expected.#2018-08-0505:49bozhidarAnyways, I’ve just push this to refactor-nrepl https://github.com/clojure-emacs/refactor-nrepl/commit/548ee3ebc173b06417d115a5f8e2748521632a60#2018-08-0505:50bozhidarI don’t have deploy rights there, so I can’t issue an updated snapshot myself.#2018-08-0505:57bozhidarI also opened https://github.com/bpiel/sayid/pull/40#2018-08-0505:57bozhidarSo I quite literally went and fixed this everywhere. 🙂#2018-08-0506:20bozhidar@pauld Yeah, they are sort of broken right now. Hopefully someone will cut new releases really soon now that the necessary changes for them have been made.#2018-08-0508:40michal@bozhidar I may only imagine how frustrating those things can be. As @soulflyer mentioned, no need to be sorry about it. we are all really grateful for your tremendous work, even if some dependency blows up sometimes. and by the way, it was good to hear you in latest defn podcast 🙂#2018-08-0510:00bozhidarThanks!#2018-08-0518:15thheller@bozhidar the find-ns trick turns out is pretty unreliable and breaks as soon as the user has a user.clj. https://github.com/thheller/shadow-cljs/issues/360#2018-08-0518:15thhellerthings would be much easier if there was an actual cider-nrepl release with 0.4 support#2018-08-0518:15thhellerany idea when that will be done?#2018-08-0519:07bozhidar@thheller The 0.18-SNAPSHOT support 0.4 in exactly the same manner. 😄#2018-08-0519:08bozhidarFor me it’s very easy to cut a release with a hard dep on 0.4, but this will mean that it will no longer be usable with lein repl and boot repl.#2018-08-0519:11bozhidar> things would be much easier if there was an actual cider-nrepl release with 0.4 support#2018-08-0519:12bozhidarBtw, how would that help exactly? And are you suggesting that I just have a hard dep on 0.4 instead of the current conditional trick (which seems to work for most users).#2018-08-0519:54thheller@bozhidar the problem right now is that I can't tell which version of cider-nrepl the user is going to use. I need to spin up the correct nrepl server version otherwise since things go boom otherwise.#2018-08-0519:55thhellerso if I start the 0.4 version the non-snapshot versions break. I'd be nice if I could tell people to upgrade to 0.18 but I do not like recommending snapshot versions#2018-08-0520:20bozhidarGot it. I’ll likely cut a release tomorrow and finally break the cycle of lock-stepping the cider-nrepl and cider versions.#2018-08-0520:22thhellerI think I found a solution. Although I thought that the last time time. This time I'm going to check which nrepl namespace the cider.nrepl is actually referencing and start the server accordingly#2018-08-0522:27bherrmannHumm….. I have a small project which uses deps.edn … it seems like cider correctly pulls in the jar dependencies, but doesnt do the “path” correctly. Is this a known limitation??#2018-08-0522:28bherrmann$ ls
b.clj c.clj deps.edn
$ cat deps.edn
{ :paths ["."] }
$ cat b.clj
(ns b)
(defn beep []
(println "beep"))
$ cat c.clj
(ns c
(:require b))
(defn -main [& args]
(b/beep )
(println "I got" args))
$ clj -m c
beep
I got nil#2018-08-0522:30bherrmannbut when I cider-jack-in from the c.clj buffer, eval of “(ns c (:require b))” always yields, “Could not locate b__init.class or b.clj on classpath.”#2018-08-0603:12samarthI have a clojurescript project using shadow-cljs and I want cider to connect to a node repl. I tried running cider-jack-in-cljs but it throws an error. This is what I see in the Messages buffer:
[nREPL] Starting server via /usr/local/bin/npx -d org.clojure/tools.nrepl:0.2.13 -d cider/piggieback:0.3.5 -d refactor-nrepl:2.4.0-SNAPSHOT -d cider/cider-nrepl:0.18.0-SNAPSHOT server...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: npx: installed 226 in 8.863s
command not found: server
error in process sentinel: Could not start nREPL server: npx: installed 226 in 8.863s
command not found: server#2018-08-0603:13samarthI think it’s trying to run the command npx server but I want it to run something like npx shadow-cljs node-repl. Any ideas how to fix this?#2018-08-0604:52bozhidar@samarthkishor1 I think @dpsutton fixed this a while ago. It should actually run npx shadow-cljs server.#2018-08-0605:28bozhidar@bherrmann As CIDER simply runs clj I can’t imagine how this can be some CIDER-specific problem. Likely if you start the server using the same command that CIDER does you’ll get a similar result.#2018-08-0605:40dpsutton@samarthkishor1 this should be fixed. can you try upgrading CIDER and seeing if you it works for you then? If not file an issue with some particulars and I can correct that codepath. It's also not too difficult if you want to dive in yourself#2018-08-0606:16bozhidar@thheller I’ve issued cider-nrepl 0.18 just now. Hopefully this makes your life easier. 🙂#2018-08-0606:48bozhidarThe release notes for cider-nrepl 0.18 are here https://github.com/clojure-emacs/cider-nrepl/releases/tag/v0.18.0#2018-08-0608:04dominicm@bozhidar I'm getting middleware descriptor errors with cider-nrepl 0.18 & the included cider/nrepl 0.4.4#2018-08-0608:04dominicmHmm, eval failed with Exception in thread "nREPL-worker-0" java.lang.ClassCastException: cider.nrepl.middleware.track_state$make_transport$reify__11014 cannot be cast to nrepl.transport.Transport too#2018-08-0609:42bozhidar@dominic Let me see your deps and how are you starting the server.#2018-08-0609:43dominicmclj -A:dev -Sdeps '{:deps {refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init [ "refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware"])
#2018-08-0609:43dominicm@bozhidar#2018-08-0609:43bozhidar@dominicm remove refactor-nrepl 🙂#2018-08-0609:43dominicmOh, I thought you said that had been updated 🙃#2018-08-0609:44bozhidarI did update it on master, but never pushed the updated version, as I didn’t have permissions to do it.#2018-08-0609:44dominicmah, much better 🙂#2018-08-0609:48bozhidar@dominicm Btw, any suggestions how to make code like this safe to re-evaluate? https://github.com/clojure-emacs/refactor-nrepl/blob/master/src/refactor_nrepl/middleware.clj#L13#2018-08-0609:48bozhidarThe end users won’t be bothered by this, but require seems to blow up if you eval this a second time.#2018-08-0609:50dominicmA message about x being already aliased?#2018-08-0609:50dominicmprobably not an issue if you use cider-refresh, because that unloads the ns.#2018-08-0609:51bozhidarYeah, not a big deal. I was just wondering I should not wrap this in some ns-aliases check or something.#2018-08-0609:52bozhidarAnd this affects only people hacking on the tooling projects, so it’s not a big deal, but it’s an annoyance.#2018-08-0610:00manueljust upgraded CIDER from MELPA. Is it just me or C-c M-n M-n doesn't work any more? It shows a spinner next to REPL[clj] in the mode-line, but the REPL stays on user namespace. Do you want me to file an issue?#2018-08-0610:03bozhidar@manuel Sure.#2018-08-0610:03manuelI also get nrepl-send-sync-request: Sync nREPL request timed out (op ns-load-all) when doing cider-load-all-project-ns. But maybe that's another issue.#2018-08-0610:04manuel(only 4 namespaces in this project, it's a tiny one)#2018-08-0611:01vinaiStarting up CIDER on a cljs node project I started a few weeks back I now get the error Sync nREPL request timed out after selecting figwheel-main
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/piggieback {:mvn/version "0.3.5"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"])'...
[nREPL] server started on 60580
[nREPL] Establishing direct connection to localhost:60580 ...
[nREPL] Direct connection to localhost:60580 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1 time-stamp 2018-08-06 12:54:36.011701000)
error in process filter: Sync nREPL request timed out (op clone id 1 time-stamp 2018-08-06 12:54:36.011701000)
I'm only getting rather old and closed (and it looks like they are different) issues when searching. Any idea what is causing this?#2018-08-0611:12manuel@bozhidar done for both issues 🙂#2018-08-0611:48bozhidar@manuel Can you show us your deps?#2018-08-0611:48bozhidar@vinai You can’t really do this. If you’re using clj you have to use nREPL 0.4. 🙂#2018-08-0611:48bozhidarRemove the nREPL dep, update piggieback to 0.3.8 and this will work.#2018-08-0611:48manuelI posted the deps.edn fcontent in both issues, do you want to copy it here?#2018-08-0611:49vinai@bozhidar thanks, will try it now#2018-08-0611:49bozhidar@manuel Ah, didn’t have time to check the issues, but I assume you’re problem must be something similar. That’s why I asked.#2018-08-0611:51vinaiI think CIDER is injecting the nrepl and the piggieback dependencies into the start command itself. How can I update them? Do I need to add them as deps to deps.edn?#2018-08-0611:52bozhidarAh, sorry. Just update the latest CIDER snapshot then. I certainly changed the injection to use piggieback 0.3.8 earlier today.#2018-08-0611:52vinaiHow do I update the latest CIDER snapshot? Thank you for the handholding.#2018-08-0611:53bozhidarFrom the M-x package-list-packages menu.#2018-08-0611:54bozhidarYou find cider there, then press u to mark it for upgrade and then x to do the upgrade.#2018-08-0611:54bozhidarAfterwards you have to restart your Emacs.#2018-08-0611:54bozhidar(that’s the standard procedure for all Emacs packages, btw)#2018-08-0611:55vinaiOh yeah - I checked this morning if there was an update and didn't see the snapshot from today. Thanks installing now.#2018-08-0611:55vinaiLots of errors during compilation.. should I ignore them?#2018-08-0611:56bozhidarErrors or warnings? 🙂#2018-08-0611:56bozhidarBut yeah, normally you can ignore those.#2018-08-0611:56vinaicider-apropos.el:28:1:Error: Cannot open load file: No such file or directory, sesman-browser
;; lots more of those...
In end of data:
nrepl-client.el:1338:1:Warning: the following functions are not known to be defined:
cider-format-connection-params, cider--gather-connect-params
#2018-08-0611:57bozhidarYou’ll have to update the sesman package as well.#2018-08-0611:57vinaiokay!#2018-08-0611:57bozhidarIt’s an internal CIDER dep.#2018-08-0611:58vinaiIs there a good way to get cider to recompile?#2018-08-0611:59vinaiRemove and reinstall?#2018-08-0612:00vinaiseems do do the trick.#2018-08-0612:04vinaiStill no luck though, CIDER can't find piggieback
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'...
[nREPL] server started on 61808
[nREPL] Establishing direct connection to localhost:61808 ...
[nREPL] Direct connection to localhost:61808 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
in package-list-packages I can see Status: Installed in ‘cider-20180806.728/’#2018-08-0612:05bozhidarHmm, can’t imagine how this happened. You can just add piggieback your deps.edn as a workaround.#2018-08-0612:05bozhidarSeems now it wasn’t added at all for some reason.#2018-08-0612:06vinaiI'm restarting emacs one more time and if that doesn't help I'll add it to the deps#2018-08-0612:15vinaiOkay, seems like I'm back in a working state. Adding piggieback to deps.edn worked.#2018-08-0612:15bozhidarI’m just puzzled why it wasn’t auto-injected.#2018-08-0612:16bozhidarLikely that’s some regression from the last batch of changes done by @vspinu.#2018-08-0612:16vinaiAnything I can do to help debug?#2018-08-0612:16bozhidarJust file a ticket, please. He was doing some refactoring to the jack-in code and I assume somewhere something went wrong.#2018-08-0612:17vinaiTo https://github.com/clojure-emacs/cider/issues?#2018-08-0612:17vinaiJust asking if that is the right repo#2018-08-0612:18bozhidarYep.#2018-08-0612:29vinaiThanks for your help @bozhidar#2018-08-0612:34bozhidarYou’re welcome!#2018-08-0615:45Garrett Hopper@bozhidar Using piggieback 0.3.8 doesn't throw any errors, however when I start a cljs repl, it seems like it isn't identified properly (or at least not in the same way it used to be). I'm getting a Stdin: prompt now. I'm starting my cljs repls using figwheel.main/start from a clj REPL.#2018-08-0615:46Mario C.How do I actually run something in the repl? If I enter (+ 1 1) and hit enter I get
no input at point#2018-08-0615:47dpsutton@mario.cordova.862 did you have a prompt visible when you started typing?#2018-08-0615:47Mario C.What do you mean? I had user>#2018-08-0615:48Mario C.Okay now it works#2018-08-0615:48dpsutton¯\(ツ)/¯#2018-08-0615:49Garrett HopperMagic 😉#2018-08-0615:49dpsuttoni think i've seen this before and just hitting enter once or twice to get a new prompt knocks the cobwebs out 🙂#2018-08-0615:49Mario C.Its exactly what I did. Smashed enter a good couple times#2018-08-0615:49Mario C.lol#2018-08-0615:53Mario C.If I load a file with SPC m s b can I just switch to it with (in-ns my.proj)#2018-08-0615:56dpsuttoncider-load-buffer-and-switch-to-repl-buffer is my go to. i hit that with a prefix and it loads the buffer and sets the namespace#2018-08-0615:56dpsuttoni haven't typed a (in-ns in two years#2018-08-0615:59Mario C.I don't see that in the menu#2018-08-0616:08dpsuttonthat's the name of the function. in emacs it's C-u C-c M-z. No idea in spacemacs#2018-08-0618:54bjaSPC u , s B in spacemacs#2018-08-0618:58bjaactually, I kinda think that doesn't work#2018-08-0618:58bjasince its bound to an approximation of the function#2018-08-0618:58bjaI'm inclined to think this is a bug in spacemacs#2018-08-0619:30bozhidar@dpsutton Seems we forgot to document this one and I completely forgot it existed. 😄#2018-08-0619:30dpsuttonah. it's what i use every single day 🙂#2018-08-0619:59benedek@bozhidar i’ve fixed the conditional requires problem on refactor-nrepl.middleware there are still some test failures and an error as well (both locally and on travis)#2018-08-0620:00benedekalso it seems that clojure 1.7 is not supported anymore by orchard i guess, or?#2018-08-0620:02bozhidarYeah, yeah.#2018-08-0620:02bozhidarThat one is easy to fix.#2018-08-0620:03bozhidarI’ve dropped the Clojure 1.7 support everywhere, after seeing that in last State of Clojure it’s usage had gone to around 5% (and this was over 6 months ago).#2018-08-0620:03bozhidarI was planning to update the Travis setup, but had too much other work, so you can safely beat me to it. 🙂#2018-08-0620:05benedekhaha ok#2018-08-0620:11dominicmTime to introduce Orchard to transducers. For no particular reason. #2018-08-0620:13benedekthe test failures tho look like incompatibilities between new and old nrepl?#2018-08-0620:14benedeki am just guessing for now#2018-08-0700:42stbgzhey all I am seeing this error while starting up cider
Caused by: java.lang.RuntimeException: Unable to resolve var: cemerick.piggieback/wrap-cljs-repl in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
brand new lein new reagent template app#2018-08-0700:42stbgzhas anyone see this error before?#2018-08-0700:43dpsuttonsubstitute the cemerick.piggieback dep for cider.piggieback#2018-08-0700:44dpsutton[cider/piggieback "0.3.8"]#2018-08-0700:44dpsuttonalso if you see something like :nrepl-middleware [cider.piggieback/wrap-cljs-repl] make sure its using cider.piggieback not cemerick piggieback#2018-08-0700:45stbgzgreat tanks @dpsutton#2018-08-0700:45dpsuttonif it works you're welcome. if it doesn't work i'm sorry 🙂#2018-08-0704:33bozhidarGuess someone should update this template.#2018-08-0704:35bozhidar> Time to introduce Orchard to transducers. For no particular reason.#2018-08-0704:41bozhidar@dominicm You’ve got it! 😉 Btw, I just removed 1.7 from the build matrix as the builds were taking forever. And it was actually piggieback which is really using something from 1.8, not Orchard (yet).#2018-08-0704:47bozhidar@benedek There’s no incompatibility - from what I see some piggieback tests are failing to pass as the middleware descriptor is not properly set. It might be possible that for some reason in the tests piggieback required the tools.nrepl namespaces instead of the nrepl ones. Nothing else can produce such a problem IMO.#2018-08-0707:00benedekok thx @bozhidar will try to have a look#2018-08-0707:04bozhidarYou’re welcome!
Basically this is the key thingy in the log:
lein test refactor-nrepl.ns.resolve-missing-test
[WARNING] No nREPL middleware descriptor in metadata of #'cider.piggieback/wrap-cljs-repl, see nrepl.middleware/set-descriptor!
#2018-08-0707:05bozhidarI guess if you dump the metadata you’ll see whether I was wrong.#2018-08-0707:05bozhidarThe tests afterwards fail simply because piggieback doesn’t start at all.#2018-08-0707:21bozhidarIt must the dep on cider-nrepl 0.18 which pulls and loads the old nREPL. I’ve updated this, so now I’m optimistic the tests will pass.#2018-08-0708:04bozhidar@benedek Yay, the build is green again!#2018-08-0708:15benedekcoolio#2018-08-0708:15benedekwill attempt a snapshot deployment then ;)#2018-08-0708:19benedeknice teamwork haha :D#2018-08-0708:35bozhidar:thumbsup:#2018-08-0708:35bozhidarBtw, what’s holding us back from finally cutting some release?#2018-08-0708:36bozhidarLars already deleted everything about hot-loading deps, so I guess we’re back in business, right?#2018-08-0709:18benedekha ok. sorry i am a bit behind tbh...#2018-08-0709:19benedekshall we cut the last snapshot today then if all cool can cut a stable in a few days#2018-08-0709:19benedekhopefully the same code as the snapshot#2018-08-0709:20bozhidarFine by me. 🙂#2018-08-0710:27reefersleepI’ve made it a habit to delete the last paren of whichever sexp I’m working on, so that I can press RET without actually executing it. Is this the “right” way to do it, or is there a smarter way? It’s starting to feel a little repetitive with that “navigate to last closing paren -> delete it” manoeuvre all the time.#2018-08-0710:28reefersleepIn the CIDER repl, that is.#2018-08-0710:29bozhidarI just use C-j.#2018-08-0710:29reefersleepGreat, just what I was looking for! Is it called anything?#2018-08-0710:30bozhidarI think it’s called newline-and-indent or something like this. In paredit it’s paredit-newline.#2018-08-0710:31reefersleepCheers @bozhidar cider#2018-08-0710:31bozhidarYou’re welcome!#2018-08-0710:31euccastro@reefersleep although some would argue that the "right" way to do it is to edit expressions in a (non-REPL) buffer and evaluate them / send them to the REPL from there#2018-08-0710:31reefersleep@euccastro I’ve considered this approach as well, and I think I’ll give a it a go now, to see how it feels 🙂#2018-08-0710:31reefersleepThanks!#2018-08-0710:50reefersleep@euccastro regarding that approach; once I’m done editing a sexp, I usually end up just before the last paren, or somewhere deeper inside. IntelliJ has something like “send top form to REPL”, whereas in CIDER, I can only find “cider-send-last-sexp-to-repl”. It’s a bit of a hassle that I have to navigate to a specific point in my text before sending to the repl. Is there some better functionality that I can’t see?#2018-08-0710:55bozhidar@reefersleep We’ve got a bit of weird terminology - `top-level form” is “defun” in CIDER (legacy from Elisp). Almost every command has a version that operates on the current form and the current top-level form.#2018-08-0710:55reefersleepBrilliant!#2018-08-0710:56bozhidarE.g. eval sexp is C-c C-e and eval defun is C-c C-c, etc.#2018-08-0710:56reefersleepcider-eval-defun-at-point does what I want, then#2018-08-0710:56bozhidarYes.#2018-08-0710:56reefersleepI’m experiencing leaps forward in my REPL efficiency and joy today 😄#2018-08-0710:56reefersleepCheers again! cider#2018-08-0711:13dominicmif only you could compose actions and targets somehow? You could call them operators and text objects... troll#2018-08-0712:28reefersleepRight? I use spacemacs in hope of getting the best of both world, but sometimes that means I’m fumbling around in a mishmash of two separate and, by themselves, streamlined paradigms. Pretty happy, though 🙂#2018-08-0712:36dominicmI use vim for reals, I couldn't handle the two worlds colliding in spacemacs. I was searching for text objects & operators, and they didn't exist.#2018-08-0712:37dominicmended up worse than my vim setup, so I bailed.#2018-08-0712:44reefersleepI may try to go back at some point. I’m just getting more and more config fatigue every day in my developer carreer, and spacemacs has been pretty good in that regard… Though, of course, not perfect. 🙂#2018-08-0712:45dominicmspacemacs out of box is amongst the best, that's correct. I don't have that fatigue, quite happy tweaking things 🙂#2018-08-0713:28bozhidarNot sure what those abstractions are, but I guess vim must have gotten something right. 😄#2018-08-0713:29reefersleep@bozhidar I can’t believe you haven’t had someone try to mansplain the brilliance of vim to you yet… ? 😄#2018-08-0713:33bozhidarI used to be a vim user, before I discovered Emacs. :_)#2018-08-0713:34bozhidarThis, however, was 15 years ago and I was a pretty basic vimmer at the time. I loved the navigation/editing experience, but I hated VimScript with a vengeance.#2018-08-0713:37reefersleepAh, alright 🙂 I switched to Emacs hoping to be boosted tool-wise by everyone else’s love of Elisp and hate of VimScript. But only because evil-mode is the best vim emulation that I know, otherwise I would still be fighting with installing Vim plugins 🙂 The text navigation and editing of Vim is superb, imo.
Do you use evil-mode or something similar, then?#2018-08-0713:54dominicm@bozhidar do you remember both y and w?#2018-08-0723:20euccastroin spacemacs "evaluate expression before point" is , e e and "evaluate top-level form at point" is , e f, so while this is not really implemented in terms of operators and text objects, it kind of feels like that. in cleverparens there is actually a "form" text object bound to f, further reinforcing the illusion (I can see how this could be dangerous). but I'll take spacemacs over vim for the same reasons I'll take Clojure over Scheme#2018-08-0723:22euccastroeven if I have to deal with emacs <-> vim impedance mismatches just like I have to deal with Java and JS ecosystems more than I'd like#2018-08-0723:23euccastroas soon as someone comes with the perfect editor and language I'll be happy to switch, but I'm not holding my breath#2018-08-0723:24euccastrobecause both the perfect (kernel for a) language and the perfect (kernel for an) editor will have to catch up with decades worth of work poured into emacs and Java/JS#2018-08-0723:25euccastro(rant over) 😛#2018-08-0713:23dpsutton@reefersleep I do the same thing with this:
;; make cider repl indent and newline on enter and eval on
;; control-enter
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
this makes enter do a newline and control enter send the form. I cannot imagine using the repl without this change any longer#2018-08-0713:24dpsuttonalso @reefersleep check out the "insert" commands map at C-c C-j. has commands to insert defun, expression, and region#2018-08-0713:25dpsuttonthese are useful for that as well
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-after-insert-p nil)
(setq cider-eval-toplevel-inside-comment-form t)
#2018-08-0713:31reefersleep@dpsutton the enter->newline, control+enter->send form is what I’m used to from my IntelliJ-using colleagues, as well 🙂 It’d probably make sense for me to remap this as well, so cheers! I’ll have a look at the other things!#2018-08-0713:32dpsuttonit makes working with multiline forms incredibly useful#2018-08-0713:40reefersleep@dpsutton I’m trying to find the SPC foo bar entry into the C-c C-j menu, but I don’t know how to look for it, exactly#2018-08-0713:41reefersleep(I use Spacemacs)#2018-08-0713:41dpsuttoni have no idea sorry#2018-08-0713:42dpsuttoncider-insert-defun-in-repl is the name of one of the functions#2018-08-0713:44reefersleepYeah, I can enter the menu with C-c C-j and see the function names in helm. Normally I use SPC foo bar, though, and I’d like to reuse that pattern, also because it is (re-)discoverable, as helm shows all of the foos and bars for each keypress.#2018-08-0713:50reefersleepI can search shortcuts with SPC ?, I found out 🙂 And it turns out that cider-insert-commands-map is not mapped to a SPC foo barish sequence, only C-c C-j, which explains why I couldn’t discover it through normal means. However, now that I give the functions a thorough look, I see that they are the ones that I’ve been learning today 😄 and which are available through other sequences, such as SPC m s. Thanks a lot, it’s been great getting more intimate with CIDER today!#2018-08-0714:02dpsuttonnext step is you customize CIDER to your needs. Then the next step is you identify a missing feature and submit a PR adding it for yourself and your fellow developers 🙂#2018-08-0715:01myguidingstarI can connect a cljs buffer to cider and evaluate from there. But if the namespace has a huge list of other namespaces it depends on (those in :require), evaluating doesn't work and a temp buffer shows up with a list of namespaces#2018-08-0715:01myguidingstarI guess it's something to do with js stack limit#2018-08-0715:02myguidingstarcan we do anything about it?#2018-08-0715:02dpsuttonwhat is huge in this case? I can't imagine stack limits and dep count being anywhere near each other#2018-08-0715:02dpsuttondo you have a namespace with 2000 required namespaces?#2018-08-0715:03dpsuttoni can't imagine why a list of namespaces would come up.#2018-08-0715:03myguidingstarno, just ~15#2018-08-0715:04dpsuttoncan you explain more clearly how you are triggering this error and what you are evaluating?#2018-08-0715:04dpsuttoni think we might be jumping towards an unfounded conclusion#2018-08-0715:06myguidingstarI just eval simple things to test cider connection#2018-08-0715:06myguidingstarlike (+ 1 2) 🙂#2018-08-0715:07myguidingstarit works in a cljs file that is small#2018-08-0715:07myguidingstarbut in another file, it has the said behavior#2018-08-0715:09dpsuttonAnd how are you evaluating forms?#2018-08-0715:10myguidingstarI eval with cider-eval-last-sexp, cider-eval-print-last-sexp etc#2018-08-0715:11dpsuttonAnd you said it pops up a new buffer? Is it just a list of name spaces or is there other text in it? Do you know the name of the buffer#2018-08-0715:14myguidingstarthe buffer (or is it a buffer?) disappers whenever I press any key#2018-08-0715:14myguidingstarI don't see it's buffer name or status bar#2018-08-0715:14myguidingstarmaybe it's a special kind of popup? I don't know Emacs well#2018-08-0715:15myguidingstarI use emacs prelude btw#2018-08-0715:16dpsuttonCan you post the exact form you are evaluating?#2018-08-0715:17myguidingstarjust (+ 1 2) really#2018-08-0715:19bozhidar@myguidingstar Maybe you can show us some screenshot or a gif?#2018-08-0715:19myguidingstarok, wait a minute#2018-08-0715:21dpsuttonOh you get a list of namespaces when you evaluate that form#2018-08-0715:23myguidingstaractually it's a long buffer and I can't scroll up to see what's in the beginning#2018-08-0715:29dpsuttonhow did you connect with CIDER?#2018-08-0715:30dpsuttonalso, now that its a buffer does the buffer have a name?#2018-08-0715:30dpsuttoni'm not confident in what you are seeing to be able to answer what might be the cause#2018-08-0715:36myguidingstarhere the screenshots https://i.imgur.com/QCGqJRr.png#2018-08-0715:36myguidingstarhttps://i.imgur.com/cVSi0ji.png#2018-08-0715:37myguidingstarI have two cljs buffers as seen on the screenshot#2018-08-0715:37myguidingstarI used cider-eval-print-last-sexp at the end of the expression (+ [] {}) in both these buffers#2018-08-0715:38myguidingstarthe buffer on the left succeded with the output string#2018-08-0715:38myguidingstarthe buffer on the right didn't and the popup is in the bottom of emacs#2018-08-0715:40dpsuttoncan you try m-x nrepl-toggle-message-logging and try again? we can see what's going across the wire#2018-08-0715:40dpsuttonthis will create a buffer called *nrepl-messages* or something similar so we can look at the traffic#2018-08-0715:40myguidingstarwait a minute#2018-08-0715:48dpsuttonit looks like it is evaling the ns form and correctly returning nil. Did this evaluation pop up the results in the minibuffer as in your screenshot?#2018-08-0715:57myguidingstarthere was no result. When I tried (js/alert "abc") there wasn't such side effect in the browser, either#2018-08-0716:11dpsuttonhow did you connect to the clojurescript project?#2018-08-0716:13myguidingstarwith a custom code: (require '[figwheel-sidecar.repl-api :as ra])(ra/cljs-repl)#2018-08-0716:18myguidingstarI have a .dir-locals.el with this content ((nil
(cider-default-cljs-repl . super-cljs)
(cider-cljs-repl-types . ((super-cljs "(require '[figwheel-sidecar.repl-api :as ra])(ra/cljs-repl)")))))
#2018-08-0716:18myguidingstar(as in cider doc cljs guide)#2018-08-0716:18myguidingstarthen I just use cider-connect-cljs#2018-08-0715:46myguidingstarhere's the whole nrepl log buffer https://gist.github.com/myguidingstar/91866e7681942f6af0cf015fc3ecba7c#2018-08-0715:46myguidingstar(I killed the buffer before eval so I guess it's clean)#2018-08-0715:55myguidingstarwhen I focus to other windows, Emacs automatically saves the file and the said popup "buffer" show the message "Wrote ..." https://i.imgur.com/XND8Kby.png#2018-08-0720:19richiardiandreaTrying make build in the cider folder but it fails that cannot find sesman-browser#2018-08-0720:22dpsuttonupdate sesman. i believe that's a recent addition#2018-08-0721:12richiardiandreauhm does not seem to work weird#2018-08-0721:13richiardiandreaoh I need to update cask deps#2018-08-0721:13richiardiandreano 😞#2018-08-0721:19richiardiandreauhm it tells me:
For more information about these matters, see the file named COPYING.
cask install
Some dependencies were not available: sesman, spinner, queue, pkg-info, clojure-mode, markdown-mode, buttercup, elisp-lint
Makefile:23: recipe for target 'elpa-emacs' failed
make: *** [elpa-emacs] Error 255
#2018-08-0721:19richiardiandreawhich is weird#2018-08-0722:18richiardiandreasolved, I had compiled with no gnutls#2018-08-0723:13richiardiandreaalso I had just moved to 18.04 and needed to blow ~/.emacs.d/.cask and all the other ones#2018-08-0805:15bozhidarGreat!#2018-08-0806:58sofraHi all, I am trying to jack in to the latest Cider from a project using :pedantic? :abort and I am getting the following errors:
Starting nREPL server via lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- repl :headless :host ::...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Possibly confusing dependencies found:
[org.clojure/tools.nrepl "0.2.13" :exclusions [org.clojure/clojure]]
overrides
[org.clojure/tools.nrepl "0.2.12" :exclusions [org.clojure/clojure]]
Consider using these exclusions:
Aborting due to :pedantic? :abort
I am guessing the tools.nrepl “0.2.12” is coming from leiningen itself?
I have had not luck excluding it. Anyone have any ideas?#2018-08-0807:00bozhidarYes, it’s coming from lein itself.#2018-08-0807:02bozhidarOne option for you would be to override cider-jack-in-dependencies (the list of deps that get auto-injected).#2018-08-0807:23sofrahmmm, ok thanks#2018-08-0807:26bozhidarI personally use pedantic just from time to time to audit the state of deps, but I don’t run every single command with it.#2018-08-0807:27bozhidarToo much noise, like this example you outlined - clearly this was done on purpose to supply a newer version of the library.#2018-08-0809:09rickmoynihanwhen is cider 0.18.0 planned to be released? Is it relatively soon or some way off?#2018-08-0809:43bozhidar@rickmoynihan Relatively soon, but there’s no concrete date for this. @vspinu asked for a bit more time to collect feedback about the new connection management system and improve it, before we cut the release.#2018-08-0809:43bozhidarGenerally nothing more is planned for it. Adding the support for nREPL 0.4 was the final big item on the todo list.#2018-08-0809:44bozhidarI’d love to also incorporate @gonewest818’s improved handling of big responses, but it’s unlikely this will make it in 0.18.#2018-08-0810:04rickmoynihanthanks @bozhidar … how usable is the current melpa (non -stable) build? And what needs to be done to update to it? Do I just unpin cider and clojure-mode, M-x package-install cider / clojure-mode and bump cider/cider-nrepl to 0.18.0-SNAPSHOT in my profiles.clj?#2018-08-0810:04rickmoynihanbtw amazing job :thumbsup: on keeping the CHANGELOG updated for master https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md#master-unreleased#2018-08-0810:09bozhidarI think it’s pretty usable. I would have probably declared it stable if Vitalie didn’t insist on squeezing more work into it.#2018-08-0810:09bozhidar🙂#2018-08-0812:47alexdavisSince a few days ago my emacs completely freezes up when doing cider-jack-in after Direct connection to localhost:58363 established The only way to regain control is to kill the emacs process. Running the repl from the command line and using cider-connect works however#2018-08-0812:48alexdavisIncase it helps, heres what jack-in is doing Starting nREPL server via clojure -A:dev:build:dev/cljs -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} com.billpiel/sayid {:mvn/version "0.0.16"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...#2018-08-0812:52dpsuttontry it without refactor nrepl and sayid. I believe there is a release of refactor-nrepl that plays nice. I haven't heard anything about sayiid#2018-08-0812:52dpsuttoni believe this is a nrepl tools.contrib.nrepl collision#2018-08-0813:02alexdavisAny idea whats injecting sayid? Removing refactor nrepl didn’t fix it#2018-08-0813:12alexdavisSeems to be spacemacs, is it possible to edit the clojure layer to stop those thing being injected when I do cider-jack-in? Sorry I’m new to all of this stuff#2018-08-0813:28soulflyer@alex395 There was a whole load of stuff a couple of days ago. Sorry, I don't remember the details, I'm not a spacemacs user, but if you scroll back a bit I think you might find some helpful stuff.#2018-08-0813:37bozhidarrefactor-nrepl, should work now. In this instance likely the problem is caused solely by sayid. I’ve opened a PR for it, but it hasn’t been merged yet.#2018-08-0813:50bhaumanI used C-c C-p more often than I used C-x C-e the new format is having an impact, of course I can change it back#2018-08-0814:14bozhidarYeah, @plexus also mentioned it. Didn’t know people were using this so much. After I’ve reverted the conflicting change in Projectile I can bring this back.#2018-08-0815:33lilactown@alex395 https://gist.github.com/Lokeh/a6163def4362e276c73b815302d1a064#2018-08-0815:34lilactownI’m not sure how I get the latest version of refactor-nrepl tbh. should it just download the latest?#2018-08-0815:55alexdavisThanks @lilactown that did the trick!#2018-08-0815:55alexdavisAlthough a bit annoying to not have clj refactor anymore.. Guess its just until they update things#2018-08-0815:56bozhidar@lilactown Yep.#2018-08-0815:56bozhidarA few people already reported that the latest snapshot works fine for them with CIDER 0.18 and nREPL 0.4.#2018-08-0815:56lilactown@alex395 try enabling the cljr-inject... var and see if it still freezes. like said above, a new release has been cut#2018-08-0815:57lilactownI’m going to try it after I finish this code-thought 😛#2018-08-0815:57bozhidarBut as I said - sayid is not updated and should not be used for the time being.#2018-08-0815:58lilactown@bozhidar got it. I really appreciate the work you do and the quick action#2018-08-0815:58lilactownI honestly have never used sayid, so I doubt I’ll miss it in the meantime#2018-08-0815:59bozhidarHmm, what’s injecting it then? Is this something done by Spacemacs?#2018-08-0815:59pauldyes spacemacs#2018-08-0816:00alexdavisStill get a freeze when I enable cljr, I’m using CIDER 0.18 although I’m not entirely sure I’m using nREPL 0.4, can’t see it in my deps.edn#2018-08-0816:00alexdavisOr does CIDER bring in nREPL by itself?#2018-08-0816:00bozhidarcider-nrepl depends on nREPL 0.4.4#2018-08-0816:01bozhidarIt will use it by default, but if it seems that nREPL 0.2.x is already loaded (e.g. because you did lein repl, it will use nREPL 0.2 instead.#2018-08-0816:01pauldspacemacs develop branch: https://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/clojure/packages.el#2018-08-0816:02dominicm@bozhidar when was the snapshot cut?#2018-08-0816:02bozhidarYesterday morning (at least for me).#2018-08-0816:03bozhidarAnd here’s a ticket which verifies that it works https://github.com/clojure-emacs/cider/issues/2399#2018-08-0816:03alexdavisIs there any way for me to figure out if its loading the right version of nREPL?#2018-08-0816:03bozhidarYou see what version was chosen when CIDER boots.#2018-08-0816:04alexdavisHmm this is what I get [nREPL] Starting server via /usr/local/bin/clojure -A:dev:build:dev/cljs -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
[nREPL] server started on 55686
[nREPL] Establishing direct connection to localhost:55686 ...
[nREPL] Direct connection to localhost:55686 established
#2018-08-0816:04alexdavisAhh#2018-08-0816:04alexdavisIn the cider buffer#2018-08-0816:04alexdavisYeah it is 0.4.4#2018-08-0816:05bozhidarHmm, I see your using cljs.#2018-08-0816:05bozhidarNot sure what the deps are there, but you need the latest and greatest piggieback, figwheel, shadow, etc.#2018-08-0816:05alexdavisIt works when I have (setq cljr-inject-dependencies-at-jack-in nil)#2018-08-0816:05bozhidarOlder versions don’t work with nREPL 0.4.#2018-08-0816:05bozhidarInteresting.#2018-08-0816:06alexdavisI’ll go through and make sure everything else is up to date though#2018-08-0816:06benedekre. what is injecting sayid. just like with the other packages the emacs package has some code injecting it the same way as cljr#2018-08-0816:07benedekso if you disable/remove the emacs package for sayid that should do the trick too#2018-08-0816:07dominicmYou may need to rm -rf a folder in m2 cache to get latest snapshot#2018-08-0816:08bozhidarI tested this same invocation command myself and CIDER works just fine with the latest refactor-nrepl.#2018-08-0816:09benedeksayid is an awesome idea, not sure it is maintained, cared for nowadays#2018-08-0816:09bozhidarWe can ask the author to transfer it to our org, but I’m not maintaining one more project. 😄#2018-08-0816:10benedekhaha i don’t think it really took off tbh…#2018-08-0816:41dominicmI think he wanted to commercialize it, not sure where that went 🙂#2018-08-0816:55dpsuttonWish it would have worked. Bill piel I think?#2018-08-0816:55dominicmyep#2018-08-0818:16lilactownI noticed that my dir-locals aren’t working now ((clojure-mode
(cider-clojure-cli-global-options . "-A:server:dev")))
could that be related to the latest snapshot release?#2018-08-0818:22lilactownnvm, I just needed to reopen the buffer#2018-08-0818:22lilactownweird#2018-08-0818:46bozhidarSeems there’s just one commit in the past year and something and it’s from @benedek 🙂#2018-08-0818:46bozhidarI think someone should advise the Spacemacs team to remove this from the default config.#2018-08-0819:03lilactownI opened an issue: https://github.com/syl20bnr/spacemacs/issues/11146#2018-08-0819:50bja@mario.cordova.862 https://github.com/syl20bnr/spacemacs/pull/11148#2018-08-0820:48michalanyone here already uses cider 0.18.0 with figwheel? I'm getting tons of exceptions trying to connect to already started repl.#2018-08-0820:49michal#2018-08-0820:51michalas I noticed, it's enough not to require [figwheel-sidecar.system] to have connection working. so I guess something's wrong with figwheel?#2018-08-0823:12bhaumanoh somehow you are getting cider.nrepl instead of clojure.tools.nrepl#2018-08-0823:12bhauman@michal ^#2018-08-0823:13bhaumanif you add clojure tools nrepl to your project I think things should work#2018-08-0903:12Garrett Hopper@bozhidar Whenever I start my custom cljs REPL (using a custom clj script which uses figwheel-main), I get prompted for Stdin:. I did some git bisect work to figure out what caused it (it doesn't happen on v0.17.0), and it's showing this commit... https://github.com/clojure-emacs/cider/commit/dcba258ab 😕 I have no idea what's going on. Any ideas?#2018-08-0903:30Garrett HopperMaybe my methodology is wrong, but 0a652cc does indeed work while dcba258 doesn't. 😕
Is there some other package that's looking at cider-version or cider-codename?#2018-08-0903:34Garrett HopperI'm sure this is a red herring, but changing cider-version from 0.17.0 to 0.18.0-snapshot from 0a652cc does indeed turn the problem on and off. Changing the version from the lastest master doesn't fix it though.#2018-08-0903:37Garrett Hoppersigh Upgrading figwheel-main from 0.1.4 to 0.1.6-SNAPSHOT fixed it. I'm bamboozled, but I'm done for the night.
Thanks 🙂#2018-08-0904:46bozhidar@bhauman There’s no cider.nrepl, it’s simple nrepl 😉 @ghopper Seems to me that likely the older version of figwheel-main had some hard dependency on tools.nrepl and that caused your problem.#2018-08-0904:47bozhidarVirtually all people here report the same issues they have in their deps something outdated and that causes them pain. Anyways, at this pace we’ll sort that out in a week or two. 🙂#2018-08-0905:44manuel@michal if it can be of any help, I recently wrote about moving to Figwheel Main, detailing my setup with CIDER: https://manuel-uberti.github.io/programming/2018/08/03/figwheel-main/#2018-08-0906:01bozhidar@manuel You can also write a similar post about upgrading to CIDER 0.18. 🙂 I think it’s going to be a hit. 😉#2018-08-0906:04manuelTrue. But I track CIDER on MELPA, always the latest release. I didn't tinker too much with it. 😊#2018-08-0914:43ackerleytngwhen i do C-x C-e in cider, i'm getting Namespace not found#2018-08-0914:43ackerleytngbut if i do C-c C-k, everything works fine#2018-08-0914:43ackerleytngwhy might that be?#2018-08-0914:45dpsuttondid you recently create a new file and change the ns form?#2018-08-0914:46dpsuttonoddly specif questions but there is a bug in a namespace cache in an older version of clojure-mode that remembers the original namespace name if so. an easy way to fix it is to kill the buffer and revisit the file#2018-08-0914:48ackerleytngoh that fixed it#2018-08-0914:48ackerleytngthanks so much!#2018-08-0914:48dpsuttoni think there's a newer release of clojure-mode without this but i'm not positive#2018-08-0914:48dpsuttonand you're welcome!#2018-08-0914:51bozhidar@dpsutton I changed this only on master. I’ll cut a new release.#2018-08-0914:52bozhidarWanted to actually fix the caching, but never had the time for this.#2018-08-0914:52dpsuttonyou disabled the cache by default though right?#2018-08-0914:52dpsuttonseems like people aren't seeing the issue that much if you want to sit on it until there's time to properly fix it#2018-08-0914:54bozhidarYes, but it’s not disabled for people on the stable version.#2018-08-0915:03lilactownI’m noticing, using the latest snapshot and shadow-cljs, that when I run cider-switch-to-repl-buffer, it has trouble finding the buffer sometimes#2018-08-0915:04lilactownespecially when I have two REPLs running (e.g. clojure-cli for my server + shadow-cljs for front-end)#2018-08-0915:31bozhidar@lilactown Report this as a bug. Maybe some regression of the transition to sesman.#2018-08-0916:08alvinahello I am getting user=> (require (quote cider-nrepl.main))
nil
user=> (cider-nrepl.main/init [ "refactor-nrepl.middleware/wrap-refactor" "cider.nrepl/cider-middleware"])
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: cljs.util, being replaced by: #'cljs.util/boolean?
[WARNING] No nREPL middleware descriptor in metadata of #'refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-apropos, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-classpath, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-complete, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-debug, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-enlighten, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-format, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-info, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-inspect, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-macroexpand, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-slurp, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-ns, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-out, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-content-type, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-slurp, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-pprint, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-pprint-fn, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-profile, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-refresh, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-resource, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-spec, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-stacktrace, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-test, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-trace, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-tracker, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-undef, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-version, see nrepl.middleware/set-descriptor!
nREPL server started on port 36025 on host localhost - <nrepl://localhost:36025>#2018-08-0916:09alvinapreviously it worked#2018-08-0916:10alvinaswitched to leingen#2018-08-0919:35bozhidarLooks like outdated deps to me.#2018-08-1002:06stardivinerSometimes my computer does not have Internet access, but I have package like openjdk8-doc installed, it is local Java Doc resource. Can CIDER doc open java doc link support to open this local resource (file:///usr/share/doc/java8-openjdk/...) ?#2018-08-1002:09richiardiandrea@stardiviner I was on this piece of code today and I saw that the middleware uses clojure.java.javadoc under the hood, which iirc is configurable#2018-08-1002:09richiardiandreaYeah: https://clojuredocs.org/clojure.java.javadoc/javadoc#2018-08-1002:11richiardiandreaThe orchard info namespace should contain more info, on the phone now. If you find it please let me know, I have been looking for that too 😄 #2018-08-1002:11richiardiandreaOn mobile now 😉 #2018-08-1002:11stardivinerok, thanks @richiardiandrea#2018-08-1002:23stardivinerWhen I'm running CIDER debugger, Emacs is on high 95% CPU!! Is this normal?#2018-08-1002:30stardiviner@richiardiandrea I found javadoc will invoke private function javadoc-url which decide use @*local-javadocs* or @*remote-javadocs*. In my CIDER debugging session, @*local-javadocs* is empty (). I found function add-local-javadoc used to add local javadoc, but I have not found it is used in namespace clojure.java.javadoc.#2018-08-1002:31stardivinerHere is all the code of it. @richiardiandrea#2018-08-1002:31richiardiandreaYou probably need to call it before first usage or around the call to it...meaning that maybe it needs to be part of the middleware?#2018-08-1002:31richiardiandreaWow ref#2018-08-1002:32richiardiandreaHaven't seen that in a while#2018-08-1002:33richiardiandreaIf you have a user.clj you could try to set! but I do not think it will work#2018-08-1002:33richiardiandreaActually you could try calling add-local-javadoc#2018-08-1002:34richiardiandreaFrom user.clj or something...if you use lein you can inject that call#2018-08-1002:34richiardiandreaSomething akin to this: https://stackoverflow.com/questions/20654178/is-there-a-way-to-inject-a-method-into-clojure-core-at-lein-repl-startup#2018-08-1002:38richiardiandreaYou know @stardiviner it a actually seem that orchard does its own custom thing: see bottom of https://github.com/clojure-emacs/orchard/blob/master/src/orchard/info.clj#2018-08-1002:39richiardiandreaLooking in the resources first, then only looking for remote#2018-08-1002:40richiardiandreaI would open a feature request of some sort 😄#2018-08-1002:42stardivinerI'm trying to invoke the function with path (add-local-javadoc "/usr/share/doc/java8-openjdk/"), it is very slow. still waiting.#2018-08-1002:48stardivinerAfter I execute upper sexp, it does have local javadoc, except this path exists but does not math in javadoc-url function. I should use specific sub-directory upper path.#2018-08-1002:55stardivinerNow it works with (add-local-javadoc "/usr/share/doc/java8-openjdk/api/").#2018-08-1002:55stardiviner@richiardiandrea ^^^#2018-08-1002:55stardivinerI think this should be automatically detected on system. auto added for available. WDYT?#2018-08-1002:57richiardiandreaOh awesome! #2018-08-1002:57richiardiandreaI think it should be documented for sure simple_smile #2018-08-1002:58richiardiandreaCider could try standard locations for Linux and win maybe yeah + optoonally read from a defcustom#2018-08-1003:03stardivinerYes, me too. Will you add this feature request issue on GitHub?#2018-08-1003:04stardivinerI don't know CIDER uses orchard (still using it now?), should this added to clojure.java.javadoc or orchard, CIDER ?#2018-08-1003:49richiardiandrea@stardiviner can put a reminder, probably cider is fine#2018-08-1004:40stardivinerHmm, I will add an issue right now.#2018-08-1004:48stardivinerI added it. https://github.com/clojure-emacs/cider/issues/2406#2018-08-1006:14bozhidar> I don’t know CIDER uses orchard (still using it now?), should this added to clojure.java.javadoc or orchard, CIDER ?#2018-08-1006:15bozhidar@stardiviner Sure it does. 🙂 Orchard is a pretty new thing - it was extracted from cider-nrepl just a few months ago to separate cleanly the middleware from the non-middleware part of the functionality.#2018-08-1006:15bozhidarReporting this in CIDER is fine, as it has to expose some interface to configure this anyways.#2018-08-1006:16stardivinerAha, great.#2018-08-1006:22dominicmit's worth finding out if it's possible to automatically discover that directory by some means.#2018-08-1006:25dominicmI can't see anything in the package I have that looks like it might help, such as a bin.#2018-08-1006:26stardivinerMight check out whether that directory contains specific structure, like some files?#2018-08-1006:27dominicmyep, the problem is, as always, NixOS and other Linux OS which place that directory elsewhere.#2018-08-1006:27dominicmif the docs went into $JAVA_HOME, that would be much easier.#2018-08-1006:30dominicm/usr/share/doc isn't actually standardized https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard#2018-08-1008:37stardiviner@dominicm Hmm, I checked out $JAVA_HOME, it does not include doc. You're right, this makes it find doc automatically more complex in order to work on many platforms.#2018-08-1008:38dominicmdetection > configuration. Only about 5 people tend to change their configuration otherwise.#2018-08-1008:39stardivinerActually, we have realized that this will be complex for different platforms, just don't know how many different cases need to be considered. That's why keep an simpler solution use an Elisp defcustom, let CIDER to handle this variable path to do automatically initialize.#2018-08-1008:40stardivinerI use Emacs do some configuration, this is necessary to change behavior or toggle somethings.#2018-08-1016:02euccastrowhen I cider-jack-in-cljs in spacemacs develop I get the dependency cider/piggieback {:mvn/version "0.3.5"} injected into my -Sdeps. shouldn't it be 0.3.8? and how do I override that? I know it's defined in cider-jack-in-cljs-dependencies, but I tried overriding that in user-init, user-config and dotspacemacs-emacs-custom-settings and none took.#2018-08-1016:03euccastrocider-jack-in-dependencies is likewise (("org.clojure/tools.nrepl" "0.2.13")) for some reason#2018-08-1016:22bozhidar@euccastro Likely you haven’t updated CIDER in a while.#2018-08-1016:22bozhidarThe current snapshot certainly injects 0.3.8.#2018-08-1016:25euccastrothis is probably a lame question and more of a spacemacs one than a cider one, but how do I update my CIDER snapshot in spacemacs?#2018-08-1016:26euccastroOK, I just wiped spacemacs and cloned it again and now I get 0.3.8 (and different errors, but I'll ask again later if I can't figure these out)#2018-08-1016:27euccastrocider-jack-in-dependencies is still at (("org.clojure/tools.nrepl" "0.2.13")) though#2018-08-1016:28bozhidarYeah, I’ll change this before the final release. Had a very busy end of the week and I forgot about this.#2018-08-1016:30bozhidarGenerally this injection was there mostly because boot and lein tended to ship older versions of nREPL. Now the boot and the clj tasks run the latest version and switch to nREPL 0.4 won’t really affect lein repl or boot repl, so I was wonder how exactly to best approach this.#2018-08-1016:45alexyakushevI've updated to the snapshot version of CIDER today and stumbled upon a behavior change. Previously, I was able to jump into the definition of a library which opened the file from the JAR. There, I could disable read-only mode and re-evaluate forms to my liking. Now, I get the error No linked CIDER sessions. I managed to work around this by calling sesman-link-to-buffer. Is this how I suppose to do it now, or is there a better way?#2018-08-1016:45pauld@euccastro I had to put this: (setq sayid-inject-dependencies-at-jack-in nil) into my dotspacemacs/user-config section of my .spacemacs file to workaround a bug in sayid that gets injected if you are using the develop version of spacemacs.#2018-08-1016:46euccastro@pauld thanks! yes, I had seen this and I have that in my dotspacemacs/user-config too#2018-08-1016:46euccastrosame for clj-refactor#2018-08-1016:46pauld@euccastro Also to update all your packages in spacemacs I usually just hit enter while on the 'update packages' link an the spacemacs splash page.#2018-08-1016:47pauldthen you have to restart emacs#2018-08-1016:48pauldI don't think the clj-refactor one is needed anymore - at least not for me#2018-08-1016:48lilactown@alexyakushev I too have had issues with CIDER not being aware of linked REPLs. trying to put together a way to confidently reproduce it#2018-08-1016:48bozhidar@alexyakushev That’s something we didn’t really consider initially - we wanted to map the connection sessions more tightly to a context, but we didn’t think that some people might want to eval stuff within a session outside the session context.#2018-08-1017:37jumarI don't usually change library code but I tend to read such code often and in current state, it's not possible to even jump to definitions (besides "dumb jump") without associating buffer with connection explicitly#2018-08-1016:49bozhidarPlease, file a ticket for this so we can discuss it further, but in general this is a side-effect of the intended behaviour as document here.#2018-08-1016:50bozhidarhttps://cider.readthedocs.io/en/latest/managing_connections/#2018-08-1016:50bozhidarI think that a simple fix for this would be to propagate the context automatically in such situations, but Vitalie might suggest some alternatives.#2018-08-1016:56euccastroOK, this is strange. after pulling latest spacemacs develop cider-jack-in-cljs-dependencies is correctly set to (("cider/piggieback" "0.3.8")) but I don't see that picked up in the startup line (`[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...`, and I get the following error after doing cider-jack-in-clojurescript and picking figwheel-main:
error in process filter: user-error: ClojureScript is not available. See for details
error in process filter: ClojureScript is not available. See for details
#2018-08-1016:57euccastroadding piggieback and clojurescript itself to my deps.edn doesn't seem to change anything#2018-08-1016:59euccastrocider-version says CIDER 0.18.0snapshot (package: 20180808.1857)#2018-08-1017:01pauldtry making sure your dependencies are in the main deps section of the deps.edn file if they are not already. I had some issues when they were in :additional-deps or whatnot#2018-08-1017:04alexyakushev@bozhidar Thanks, Bozhidar. I don't think my usecase deserves some thoughful explicit handling. But I will file a ticket in case it can be solved easily.#2018-08-1017:14euccastrothanks @pauld! I had cleared -A:dev from my command line overrides. piggieback is still not auto-injected, but adding the dependency to my deps.edn works#2018-08-1023:23bbrinckIs there a way to customize the REPL (or automatically start a custom sub-REPL) once CIDER connects via nrepl? I’d like to be able to adjust the way errors are handled (namely to use expound if the error is a spec error)#2018-08-1023:24bbrinckI’d love a way to configure the REPL via some file so I can share my specific REPL configuration with others on my team#2018-08-1112:48dottedmagDo I need to add piggieback manually to jack-in to a project using Figwheel Main?#2018-08-1112:51pauldIt seems to be the case for me (I'm using spacemacs develop branch).#2018-08-1112:51dottedmagSo, how does it work? Should I start figwheel main separately, and let Cider connect to it?#2018-08-1112:51pauldAlso it had to be in the main deps section (not :additional deps or whatnot)#2018-08-1112:52pauldno cider-jack-in-cljs works#2018-08-1112:53pauldit will ask you what repl you want to start#2018-08-1112:53pauldchoose figwheel-main#2018-08-1112:54pauldmake sure you have a dev.cljs.edn file as described in the figwheel main docs.#2018-08-1112:55pauldBut you also have the option of connecting to an existing repl if you want to start figwheel main seperately.#2018-08-1112:56dottedmagOh, I do want to start figwheel main from CIDER.#2018-08-1112:57dottedmagHowever I don't see how to pass -A to clojure#2018-08-1113:19dottedmagGot it working.#2018-08-1113:19dottedmag:aliases {:cider {:extra-deps {cider/piggieback ... com.bhauman/figwheel-main ...}}} to deps.edn#2018-08-1113:20dottedmagAnd set cider-clojure-cli-global-options to "-A:cider"#2018-08-1113:20dottedmagI think I also can put piggieback into existing :fig alias and run it instead.#2018-08-1114:09pauldAh, cool - I think you know as much as I do now#2018-08-1114:10pauldmore even - haha#2018-08-1114:16bhauman@dottedmag did it let you choose a build?#2018-08-1114:16dottedmag@bhauman Yes#2018-08-1114:40bhaumanI thought I'd heard that the piggieback injection was slated to be fixed, is that right?#2018-08-1206:09bozhidar@bhauman Haven’t had time to look at this. Hopefully next week will be less busy.#2018-08-1206:25bozhidar@bbrinck I not quite sure what you want to configure and how you want to do it. Generally you can configure certain things on a per-project basis using .dir-locals.el, and potentially you can have an on-connect hook that loads some file after you’ve connected.#2018-08-1214:03bbrinckAn on-connect hooks sounds promising. I’ll look into that. Thanks!#2018-08-1209:36dottedmagIf i'm starting a Figwheel Main project from CIDER, and Figwheel Main fails to start due to a syntax error, CIDER is unable to start CLJS REPL and does try not recover afterwards.#2018-08-1209:39dottedmagNow nREPL is running, but I don't see a way to deal with it beyond killing and starting anew.#2018-08-1209:44dottedmag@bhauman ^ maybe it's something figwheel-main should handle?#2018-08-1215:43bhauman@U07HVGQJ3 yes figwheel.main is vulnerable to your initial build failing#2018-08-1215:43bhaumanit does seem that it should not launch the REPL or server if it fails#2018-08-1215:44bhaumanbut no you can recover if you fix the code and reload the page#2018-08-1215:45bhaumanat least I think thats how it works on the command line#2018-08-1215:45bhaumanit should work that way with nREPL as well#2018-08-1216:33richiardiandreaThere should maybe be a cider command that sends the figwheel-main (or others) forms over the same connection - maybe there is already but haven't investigated the new API in depth enough#2018-08-1218:38Karol WójcikHow to force the repl to show user.ns=>?
The context:
The figwheel-main prints the info about compilation to the repl. After the message repl does not return to user.ns=> while it should. Is there a way to somehow send a request to repl which triggers the cider user.ns=>?#2018-08-1220:46cjsauerGetting this error suddenly on a project I've been working on for weeks while trying to jack in:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} com.billpiel/sayid {:mvn/version "0.0.16"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate nrepl/server__init.class or nrepl/server.clj on classpath., compiling:(cider_nrepl/main.clj:5:1)
#2018-08-1220:54dpsuttoncider switched to nrepl 4.0 from tools.nrepl 2.x.#2018-08-1220:55dpsuttonthat said, you're going to run into issues with sayid and refactor-nrepl. I think there is a new release of refactor-nrepl and I think there is an unaccepted PR to fix sayid#2018-08-1220:55dpsuttonif you don't feel like mucking about with that i think you can go back to cider 0.17.0 or you can play the update game and see what happens#2018-08-1221:06cjsauer@dpsutton how do I go back to 0.17.0 and stay there?#2018-08-1221:07cjsauerThis is probably the third time that I've sat down to work only to find my Clojure environment completely broken#2018-08-1221:07cjsauerI just want something stable, don't care about latest nrepl stuff#2018-08-1221:23pauldPutting `(setq sayid-inject-dependencies-at-jack-in nil) in your dotspacemacs/user-config is all that is required now as far as I can tell (under spacemacs develop branch).#2018-08-1221:24pauldomit the `#2018-08-1221:24pauld@cjsauer#2018-08-1221:27cjsauer@pauld thanks, what does that do exactly? I'm eager to find a way to "freeze" spacemacs to stop it constantly changing out from under me.#2018-08-1221:28cjsauerEvery google turns up mountains of Github issues of people requesting the same, but to no avail#2018-08-1221:29pauldSomeone else gave me that tip, but I think it just prevents the broken say-id package from pulling in it's obsolete dependencies.#2018-08-1221:30pauldThat's the workaround until sayid is fixed#2018-08-1221:30pauldrefactor-nrepl was fixed#2018-08-1221:31pauldAs far as spacemacs breaking, I don't have a good solution. It seem more of an issue with using MELPA. You can switch to MELPA stable - that may help.#2018-08-1221:32pauldThat would pin cider to an older version, etc.#2018-08-1221:32cjsauer@pauld ah I see, thanks. Yeah I've read lots of discussion around MELPA on Github, but it doesn't seem to be moving anywhere. I've tried every "workaround" for using MELPA stable I can find and none of them seem to work anymore.#2018-08-1221:33pauldyeah there's also a way of using melpa stable for particular packages if I recall correctly#2018-08-1221:34pauldor was it the other way around? specifying which packages using non-stable...#2018-08-1221:35cjsauerEverything I've read is pinning packages to MELPA stable#2018-08-1221:35cjsauerBut none of them seem to work unfortunately#2018-08-1221:35cjsauerIt seems like MELPA itself might be fundamentally flawed#2018-08-1221:35pauldSo far it's been sayid that has broken things for me twice, but I've learned 2 trick on how to disable it now#2018-08-1221:36cjsauerHm...why is sayid able to break an editor that was working yesterday is my question#2018-08-1221:36cjsauerI think maybe spacemacs is too bleeding edge for my taste haha#2018-08-1221:37pauldI think it's just that spacemacs clojure layer uses sayid. Sayid would have broken regular emacs users too if they were using it - I think.#2018-08-1221:37pauldJust like refactor-nrepl broke too.#2018-08-1221:38pauldIt's more a problem of cider and some of the plug-ins or related packages in the ecosystem.#2018-08-1221:42cjsauerBummer...this might be the straw that breaks the camel's back for me as far as using spacemacs goes. Think I'll switch to something with a proper package manager.#2018-08-1221:43pauldI don't think this is a spacemacs specific issue technically.#2018-08-1221:44pauldBut I feel your pain#2018-08-1221:45cjsauerSure, maybe the "emacs ecosystem" is more accurate. I really need to be confident that I can start the REPL and work day-to-day...need my editor to be rock solid.#2018-08-1221:47richiardiandreaMy very idealistic view on this is that emacs is notoriously THE hacking editor, so I would say that you kind of need to be prepared for some breakage and, if time allows it, try to help with the fix/fix it yourself. I have choosen emacs because I like to hack on it emacs#2018-08-1221:48richiardiandreaI enjoy not to be productive for some time and help other fella in the meantime 😄#2018-08-1221:49cjsauerIt does indeed feel like emacs is constantly being "hacked" 😛#2018-08-1221:49cjsauerI can empathize with that though. I like sharpening my tools as well, but sometimes I really want to sit down and try an idea, only to find that emacs won't boot#2018-08-1221:50richiardiandreayeah well, that happens to me as well, but the fix is usually a small tweak#2018-08-1221:50richiardiandrea(or maybe now I now how to take cider and nrepl 😄 )#2018-08-1221:51richiardiandreaAnother way to see it is that I so hate to get stuck that I have always preferred to dig into the problem...#2018-08-1221:57bozhidarWell, for what is worth - the big changes are more or less behind us, so we should be looking at a period of much improved stability down the road. But I have to say again that I find it amusing that people tracking CIDER’s development branch expect it to be super stable - it’s called “development branch” for a reason. 😉#2018-08-1221:58bozhidar0.18 experienced an unusual amount of massive changes, but this should certainly make things much more stable down the road.#2018-08-1221:58bozhidarObviously we don’t plan to do another nREPL migration or another connection management rewrite ever again. 🙂#2018-08-1221:59cjsauerIf it were possible to not track CIDER's development branch, I'd definitely be doing so. I haven't found a way as of yet.#2018-08-1222:00bozhidarAnd, of course, if Spacemacs stuck just to bundling CIDER without any extensions almost no one would have experienced any nREPL-related breakages. CIDER’s ecosystem is outside the control of any single person, so coordinated updates between many packages can be painful.#2018-08-1222:01bozhidar@cjsauer Stop using Spacemacs, install it from MELPA Stable, end of story. It’s as simple as that. 🙂 (and it’s documented in the manual).#2018-08-1222:02bozhidarAnyways, at this point it’s pointless to go back to 0.17. There are no more changes planned for 0.18. I think it’s in a decent shape and it will be promoted to the new stable in the next couple of days most likely.#2018-08-1222:30cjsauerI’ll give it a go. Wish I would’ve known what a crutch Spacemacs would be...reimplementing the layers I’ve come to know seems a bit daunting. #2018-08-1222:33cjsauerThere should be a big yellow warning on the homepage: “can not use stable packages of anything”, lest more Clojure users amuse you in the future. #2018-08-1309:15bozhidar🙂#2018-08-1309:16bozhidarWell, it is what it is. I’m happy with being amused, but I definitely think we can do a bit better down the road. 😄#2018-08-1314:40cjsauer@bozhidar really do appreciate the help and your support of CIDER et al
I did successfully get my environment back up and running this morning by customizing the clojure command a bit:
clojure -Sdeps '{:deps {nrepl {:mvn/version "0.4.4"} com.billpiel/sayid {:mvn/version "0.0.16"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'
Mainly updating to nrepl 0.4.4 and removing the "com.billpiel.sayid.nrepl-middleware/wrap-sayid" middleware. Is sayid crucial to CIDER's operations? I still seem to be able to debug code strangely enough.#2018-08-1314:43dpsuttonSayid is a separate stand alone tracing library#2018-08-1314:43dpsuttonNot related to cider at all#2018-08-1314:46cjsauerGotcha. Reading up on it now, seems like a really interesting tool. Once PR #40 is merged I think I'll try it out (https://github.com/bpiel/sayid/pull/40)#2018-08-1315:19bozhidar@bhauman The piggieback auto-injection problem was just fixed on master.#2018-08-1315:25bhaumanfantastic!!!#2018-08-1315:25bhaumanthanks @bozhidar#2018-08-1315:25bhaumannow I can start writing the editor integration docs for figwheel.main#2018-08-1315:47bozhidar:thumbsup:#2018-08-1318:39Mario C.When I try to start CIDER it errors out but I don't really get to view the stack trace. The moment I click on any key the buffer/window goes away. Is there anyway to keep it up?#2018-08-1318:41Mario C.The error I can see is java.io.FileNotFoundException: Could not locate ring/server/standalone__init.class or ring/server/standalone.clj on classpath.#2018-08-1318:41Mario C.Subprocess failed#2018-08-1318:41Mario C.When I would run the repl in Cursive it would give me those errors as well but for some reason would go ahead and start a working repl anyways.#2018-08-1318:44Mario C.I had set the Cursive configuration for the repl to
1. Run nREPL with Leiningen
2. Profiles: clj,dev,repl#2018-08-1319:02bozhidarSeems like you’ve got some missing dependency or something like that.#2018-08-1320:17Mario C.Is profiles.clj required in the .lein directory?#2018-08-1320:21dpsuttonpurely optional#2018-08-1320:22dpsuttonalso you can check the *Messages* buffer to see that message that appeared in the minibuffer#2018-08-1320:29dorabC-x b is switch-buffer in an unmodified emacs. In other words, control-x and then b. Then *Messages* to specify which buffer you want to switch to.#2018-08-1323:11richiardiandreahas cider-nrepl 0.19.0-SNAPSHOT been pushed with the new cljs-tooling by any chance?#2018-08-1410:48bozhidar@richiardiandrea Not yet. I can do this later today.#2018-08-1411:29bozhidarDone.#2018-08-1412:20otfromok, M-x cider-inspect-last-result has completely changed my RDD workflow. I tend to prototype things in a buffer now and C-x C-e them so that I never blow up my repl with a line that is too long. I then use the inspector to step through what I've made if I want to eyeball the results. thx @bozhidar!#2018-08-1412:38otfromand now I'm using the debugger too. Thx again!#2018-08-1414:00bozhidarHappy to hear this, @otfrom! cider#2018-08-1414:02otfromnot as happy I was to use them 🙂#2018-08-1415:00bozhidar😄#2018-08-1422:21dottedmag@bozhidar I see in current master the following issue: opening a .cljc file produces an error thrown. I have traced it down to (sesman-current-session 'CIDER) returning a #<killed buffer>.#2018-08-1422:22dottedmagFor .clj and .cljs this buffer is not a problem as it gets filtered out in cider-repls, but for .cljc it gets returned and cider-current-repl chokes on it.#2018-08-1422:45dottedmag@bozhidar I have a fix, but it does not pass checkdoc due to some reason. Please have a look at #2416#2018-08-1423:39richiardiandrea@dottedmag you need to have TYPE before BUFFER in the docstring ....`checkdoc` is super picky ... https://github.com/clojure-emacs/cider/pull/2416/files#diff-1d74a90af3008c8072afc63f23ae8392R662#2018-08-1423:45dottedmagMy checkdoc also complains about matches and insists it should be replace with match.#2018-08-1423:46richiardiandreaah yeah#2018-08-1423:46richiardiandreait wants imperative language#2018-08-1423:47richiardiandreafor the first sentence#2018-08-1423:48richiardiandreaalways forget that 😉#2018-08-1511:52trisshey all. I’m using spacemacs and my refactoring doesn’t appear to work. I can’t rename symbols. It tries to analyze the project and then comes back with an error in the minibuffer I don’t manage to read.#2018-08-1511:52trissI’m on OS X… does anyone know whats up?#2018-08-1512:14bozhidar@triss some version information will be useful. What’s your CIDER, cider-nrepl and refactor-nrepl.#2018-08-1512:15triss;; CIDER 0.17.0snapshot (package: 20180207.2103), nREPL 0.2.13…#2018-08-1512:16trissjust double checking I have refactor-nrepl maybe thats the missing piece!#2018-08-1512:17trissmaybe my refactor nrepl is a bit old#2018-08-1512:21trissOk I just updated to refactor-nrepl latest version#2018-08-1512:21trissstill the same issue.#2018-08-1512:22bozhidarWhat’s the error you’re getting?#2018-08-1512:23trissI can’t see - just abig stack trace that flashes by in the mini-buffer#2018-08-1512:23trissIt asks me if I want to analyze the project#2018-08-1512:24trissIt sasy Fetching symbol occurences just before bombing out#2018-08-1512:25trissoh sorry I jut found it in Messages#2018-08-1512:27trissI think it’s an issue with some of my namespaces… sorry for all the noise. just finding my way in to CIDER properly…#2018-08-1512:27vinaiI've trying to get CIDER running in a lein based project after upgrading emacs and CIDER.
The currently installed CIDER package version is 20180813.1518.
In the project.clj I removed all references to org.clojure/tools.nrepl (and com.cemerick/piggieback) because my understanding based on http://docs.cider.mx/en/latest/installation/ is CIDER will inject the new moved versions automatically.
Please note that nrepl/drawbridge "0.1.3" also is a project dependency.
As a first step, I would like to get the JVM Clojure repl running again. Once that works I'll tackle the (figwheel) cljs repl.
When I run cider-jack-in-clj, Clojure fails to start and in *Messages* I find
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.dataformat.smile.SmileFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at clojure.lang.RT.classForName(RT.java:2204)
at clojure.lang.RT.classForName(RT.java:2213)
at cheshire.factory__init.__init0(Unknown Source)
at cheshire.factory__init.<clinit>(Unknown Source)
... 233 more
Note: com.fasterxml.jackson.core/jackson-core is not explicitly referenced or excluded in the project.clj).
This project was up and running 2 weeks ago the last time with the old version of emacs and CIDER.
Can someone hold my hand and help me get up and running again? Is more of the stacktrace useful?#2018-08-1512:30bozhidar@vinai Is this from drawbridge?#2018-08-1512:30bozhidarI’ve never even heard of this XML library.#2018-08-1512:31vinaiI think auth.buddy uses it#2018-08-1512:31vinaiMaybe it's easier to start from the unmodified project.clj.#2018-08-1512:37vinaiOkay, I reset the project so it contains the old drawbridge and nrepl dependencies and run cider-jack-in-clj and it comes up!#2018-08-1512:38vinaiNow, I'll try replacing nrepl and drawbridge with the new versions again.#2018-08-1512:39mgrbytewondering if anyone can help with me fix this error.
I'm using emacs 26.1, and cider from MELPA (`0.18snapshot`).
I like to use a stand-alone repl, and have followed the cider manual's troubleshooting section , but not having any luck.
I have the same version specified in the :repl the lein profiles.clj (`0.18.0-SNAPSHOT`) as I'm using in emacs.
I'm using Leiningen 2.8.1 on Java 1.8.0_171 OpenJDK 64-Bit Server VM.
The error I'm getting when running cider-connect is:
Debugger entered--Lisp error: (error "Version must be a string")
signal(error ("Version must be a string"))
error("Version must be a string")
version-to-list(nil)
version<=("0.18.0" nil)
cider--check-middleware-compatibility()
cider--connected-handler()
run-hooks(nrepl-connected-hook)
nrepl-start-client-process("localhost" 36225 nil #f(compiled-function (_) #<bytecode 0x29233bd>))
cider-nrepl-connect((:project-dir "~/git/wormbase-names/" :host "localhost" :port 36225 :repl-init-function nil :session-name nil :repl-type "clj"))
cider-connect-clj(nil)
funcall-interactively(cider-connect-clj nil)
call-interactively(cider-connect-clj nil nil)
command-execute(cider-connect-clj)
I'm using lein, here the profiles.clj I'm using: https://github.com/mgrbyte/dot-files/blob/master/lein/.lein/profiles.clj
My emacs cider setup: https://github.com/mgrbyte/emacs.d/blob/master/init.el#L333-L340
cider-jack-in works for me, so I assume I've missed something simple, but can't see what after a couple of hours staring at this.#2018-08-1512:40vinaiShould I remove the explicit dependency on [org.clojure/tools.nrepl "0.2.13"] or should I replace it with nrepl "0.4.4"?#2018-08-1512:47vinaiJust removing the references to the old tools.nrepl seems to work. Next, I'll try to replace drawbridge.
1. Dependency changed [com.cemerick/drawbridge "0.0.7"] to [nrepl/drawbridge "0.1.3"]
2. Require changed [cemerick.drawbridge :as drawbridge] to [drawbridge.core :as drawbridge]
Aaand it seems like that worked, too.
So it looks like before I was taking a too large step at once. Sorry for wasting your time.#2018-08-1513:00vinaiNow I'll try cider-jack-in-cljs with ClojureScript REPL type figwheel with the old piggieback in the project.clj.
That works. I'll try to move piggieback now:
In the :dev profile I replace [com.cemerick/piggieback "0.2.2"] with [cider/piggieback "0.3.8"]
And in :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]} I replace it with cider.piggieback/wrap-cljs-repl.
Now when running cider-jack-in-cljs with REPL type figwheel I get the error
!!! Unable to load a ClojureScript nREPL middleware library
Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
A) not providing piggieback as a dependency and/or
B) not adding piggieback middleware into your nrepl middleware chain.
example profile.clj code:
-----
:profiles {:dev {:dependencies [[com.cemerick/piggieback <current-version>]
[org.clojure/tools.nrepl <current-version>]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
-----
Please see the documentation for piggieback here
I'm confused that the error is still referencing the old piggieback and nrepl locations.#2018-08-1513:04vinaiIt seems I'm running CIDER 0.18.0snapshot (package: 20180813.1518) with the old nREPL 0.2.13. I thought they where incompatible?#2018-08-1513:23bhauman@vinai you probably need a newer version of figwheel-sidecar#2018-08-1513:23vinaiCurrently using 0.5.15, will check#2018-08-1513:23bhauman0.5.16 is what you need#2018-08-1513:24bhaumanthat's when I changed it so that it could work with cider/piggieback#2018-08-1513:25vinaiI guess I should use figwheel 0.5.16, too?#2018-08-1513:25vinaiAnd yes, that worked! Thank you!!#2018-08-1515:45Mario C.I keep getting could not locate ring/server/standalone__init.class on classpath. I have no idea how to fix this issue.#2018-08-1515:46Mario C.Would running Cider with with-profiles fix this issue?#2018-08-1515:57mgrbytesounds like it. You can set cider-lein-parameters to "with-profile +profile1 +profile2 repl :headless via customize-variable, in your .emacs/init.el or .dir-locals#2018-08-1515:58mgrbytefor example.#2018-08-1516:09Mario C.Is that all in double quotes when I prompted with
Set cider-lein-parameters globally to value: #2018-08-1516:10mgrbyteif you're setting it via customize-variable, then no quotes required around it I don't think.#2018-08-1516:11Mario C.I am running the commands.
1. SPC SPC
2. set-variable
3. cider-lein-parameters#2018-08-1516:11Mario C.The I get that prompt from above#2018-08-1516:13Mario C.It seems like I do need the quotes#2018-08-1516:21Mario C.@mgrbyte Thanks! So basically it was
with-profile profile1, profile2 repl :headless#2018-08-1516:22Mario C.The comma was needed#2018-08-1609:12mgrbytedoh, of course, sorry#2018-08-1515:46Mario C.I have two profiles I normally use to run the project.#2018-08-1516:27Mario C.Feels so good having a REPL now 😅#2018-08-1516:27Mario C.Not having it was the bane of my spacemacs experience#2018-08-1516:52bozhidar@mgrbyte Your profiles setup seems correct, but the error you got indicates that cider-nrepl is not loaded at all.#2018-08-1516:52bozhidarTherefore the nil version.#2018-08-1612:26mgrbyteYou were right! 🙂#2018-08-1612:26mgrbyteI'm using deps.edn (via lein-tools-deps), and it seems it's not merging the lein profile#2018-08-1612:27mgrbyteI added cider-nrepl to the :extra-deps of my :dev alias, and now it connects#2018-08-1612:27mgrbyteAlthough now I get:
WARNING: CIDER 0.18.0-snapshot requires cider-nrepl to work normally. Please, install it!
More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT (package: 20180808.606) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
#2018-08-1612:28mgrbyteSo am guessing a similar issue :thinking_face:#2018-08-1612:43mgrbyte~Noticed that in the cider manual it mentions that it's a common mistake to put cider-nrepl in ~#2018-08-1612:45mgrbyteI misread.#2018-08-1613:07mgrbyteFWIW, I have successfully resolved my issue (using 0.18.0-SNAPSHOT) - working from both cider-connect and cider-jack-in-clj. The trick was to remove the configuration in ~/.lein/profiles.clj and move it to my :dev profile in project.clj.
Something not quite right, but probably because I'm using tools-deps and lein and latest snapshot. Something not quite right with profile merging when tools-deps in place. TBH I've always experienced issues with lein profile merging, something I hope goes away! 😆#2018-08-1516:58richiardiandreawhere can I find how to add metadata to Clojure for formatting?#2018-08-1517:11richiardiandreaok found, but I have a problem, I have a macro like let and I am using {:style/indent 1} like clojure-mode...but I do not get the body forms aligned right#2018-08-1519:39fenton@vinai could you post your project.clj that has a final working version of all the new cider settings. would be very useful to see it all in one place 🙂#2018-08-1519:57vinai@fenton sure, it's rather big, but if it helps...#2018-08-1519:58fenton#2018-08-1519:59fentoncider-jack-in-cljs seems to create a clojure not clojurescript repl...#2018-08-1520:00fenton@vinai i think i gleaned what was required... , but not sure i've got a cljs repl in the end....#2018-08-1520:00vinai#2018-08-1520:01vinaiThis works now with clj + cljs figwheel repl#2018-08-1520:01fenton@vinai what function are you running to get a cljs repl?#2018-08-1520:01vinaicider-jack-in-cljs or cider-jack-in-clj&cljs#2018-08-1520:01bhaumanoh darn I'm getting the slow down in cljc files again#2018-08-1520:04fenton@vinai thx I'll try to compare with what I've got as ...&cljs isn't bringing up a cljs repl 🙂#2018-08-1600:19fenton@bozhidar typo in cider version: cider-20180815.1700
https://github.com/ftravers/cider/blob/8372d4df41e37ff1695c78627f24a9ca82d57509/cider-connection.el#L207#2018-08-1601:25stardivinerI just updated CIDER, and got same error:
error in process filter: cider--connected-handler: Symbol’s value as variable is void: middlewar-version
error in process filter: Symbol’s value as variable is void: middlewar-version
#2018-08-1603:22fenton(use-package el-get)
(el-get-bundle cider
:url ""
:checkout "12674b3de377d6ae6f67ac155caea12f5de3c743")
#2018-08-1603:22fentonthat'll get the previous version of cider, current one is broken.#2018-08-1606:09bozhidarOps, sorry about this! I’ve fixed this.#2018-08-1606:29bozhidar> oh darn I’m getting the slow down in cljc files again#2018-08-1606:30bozhidar@bhauman Are you on the latest clojure-mode? How the profile data looking?#2018-08-1606:31bozhidarThere were no changes after adding the project dir cache, so your message is surprising to me.#2018-08-1612:01bhauman@bozhidar oh my god, I meant to tell you that it was a false alarm#2018-08-1612:02bhaumanI pictured sending you the message, then promptly forgot. sorry about that#2018-08-1612:02bhaumanit was a processor slow down, from a low battery, which in turn made it harder for my computer to perform heavier tasks#2018-08-1612:20bozhidarRoger that! A problem that solves itself - my favourite kind! 😉#2018-08-1613:52vemvwondering if there's some prior art in implementing a "jump to definition" that works with javascript sources (for clojurescript environments obviously)#2018-08-1614:59tanzoniteblackI've historically used http://ternjs.net/doc/manual.html#emacs for this. but I know that https://indium.readthedocs.io/en/latest/ also does similar stuff#2018-08-1615:00tanzoniteblackBoth work by having external servers do the heavy lifting. There might be something similar using this new, fancy dancy lsp thing: https://github.com/emacs-lsp/lsp-javascript , but I haven't tried that.#2018-08-1615:03vemvHmmm, running a(nother) process just for this seems heavy. I was hoping one could derive goog.date/Date to a (.jar + file + line) location, more-or-less statically. CIDER classpath tools might help. clojurescript's strict ns system should also make things relatively easy#2018-08-1618:34bozhidar@U0C8489U6 Might have some ideas about this. Not sure what’s the deal with the location metadata there. Maybe @bhauman has some ideas as well.#2018-08-1619:24richiardiandreaI think there could be a new middleware piece that talks with piggieback and provides back info from the JS word. I was thinking about that for providing JS completions.#2018-08-1615:05mhcatThis seems like an unhelpful warning given the actual numbers: WARNING: CIDER 0.18.0-snapshot requires cider-nrepl 0.18.0+, but you're currently using cider-nrepl 0.18.0. Things will break!
#2018-08-1618:33bozhidar@j0ni Fixed on master.#2018-08-1618:41mhcatthanks @bozhidar!#2018-08-1622:37richiardiandreaI was wondering where is the clojure-mode code that does the alignment using the :style/indent metadata#2018-08-1622:38richiardiandreaseems like it is in the nrepl but I do not see a command for sending the op code#2018-08-1706:26lmergeni believe there have been changes to cider recently which causes the repl session to be somewhat 'permanent' -- i can restart cider without killing the REPL now, which is a good thing. however, especially when doing stateful work, it can sometimes be desirable to get the old behavior back, where cider completely kills the JVM and re-starts a new REPL session.
i was unable to find this in the docs, is this still possible?#2018-08-1706:52bozhidar@richiardiandrea clojure-mode doesn’t know about :style/indent at all. Only CIDER knows about it.#2018-08-1706:53bozhidarThere’s an nREPL middleware (named track-state) that constantly relays var metadata to CIDER and that’s used to generate at run-time dynamic indentation rules for clojure-mode.#2018-08-1706:55bozhidarSee https://github.com/clojure-emacs/cider/blob/84b67f44af64d8b543bdd916359ad6c0e9e843d4/cider-mode.el#L720#2018-08-1706:56bozhidar@lmergen Not sure what you mean. I’m assuming you’re restarting just a connection right now instead of the entire connection session.#2018-08-1706:56bozhidarSee http://www.cider.mx/en/latest/managing_connections/#2018-08-1706:56lmergen@bozhidar yes i used to call cider-restart which would restart the entire repl session, now it seems to be just reconnecting#2018-08-1706:57lmergenah right, sesman-restart looks like what i need?#2018-08-1706:58lmergenmaybe not#2018-08-1706:58bozhidarAh, I see what you mean. I’m actually not certain if now we have a command that will actually restart the server as well.#2018-08-1706:59bozhidarsesman-restart will reconnect all REPLs in the session to the running nREPL server. It’s best to file a ticket for this as I’m pretty busy now and that’s something worth discussing more.#2018-08-1706:59lmergenwill do, thanks!#2018-08-1707:00bozhidarBefore the new session manager I had written the code in a way that it checked if a connection was the result of a jack-in or connect. If was the result of a jack-in the server was restarted as well. Not sure how the logic about this looks right now.#2018-08-1707:01lmergenworkaround is to quit and do a new jack-in#2018-08-1707:01lmergenbut it would be nice to have the 'old' cider-restart behavior back, it's rarely that i care about the connection, and more about the actual server being restarted 🙂#2018-08-1707:08lmergenhttps://github.com/clojure-emacs/cider/issues/2420#2018-08-1814:19Karol WójcikIs there a way to jump to Java source code from cider?#2018-08-1814:21dominicm@kwcharllie379 I think step one is to add the source artefacts to your project. I think it works though, you could try jumping to source against some clojure java.#2018-08-1814:22Karol WójcikHow can I add them?#2018-08-1814:24dominicman example of something that I expect would work: java.util.concurrent.ThreadPoolExecutor#2018-08-1814:25Karol WójcikWell it works perfectly with your example but what if I am trying to jump to the source of 3rd party library?#2018-08-1814:30dominicm@kwcharllie379 you add an additional dependency, so say you depend on [foo/bar] there is usually a source jar deployed as well, so you add an additional dependency on [foo/bar :classifier "sources"].#2018-08-1814:31dominicmSorry, that's sources* not source#2018-08-1814:38Karol WójcikThank you very much ❤️#2018-08-1814:51Karol Wójcik@dominicm Funny thing is that although I can jump to the sources after adding classifier I am receiving the error with not matching ctor. It's funny because without classifier it works as expected. http://central.maven.org/maven2/commons-codec/commons-codec/1.11/#2018-08-1814:52dominicm@kwcharllie379 do you have both?#2018-08-1815:01Karol WójcikNope ;(#2018-08-1815:02Karol WójcikOk sory that’s my bad. You emphasized that it should be an additional dependency. #2018-08-1815:02Karol WójcikThank you one more time#2018-08-1815:04dominicm@kwcharllie379 that's okay, it's an easy mistake, I quite expected it 😛#2018-08-1906:51bozhidarOne idea we’ve had a for a while was to auto-add sources when possible. Shouldn’t be very hard, but we never got to adding this.#2018-08-1906:51bozhidarI imagine some middleware op like fetch-source and fetch-all-sources.#2018-08-1908:01dominicmI suppose that would need to dynamically modify the classpath. #2018-08-2006:39bozhidar@dominicm Exactly.#2018-08-2015:55plexusToday after upgrading CIDER I can't jack in any more, it shows "[nrepl] Direct connection established ..." in the minibuffer, and then Emacs sits there frozen#2018-08-2015:56plexusIf I interrup it with SIGUSR2 (which I recently learned you can do, very useful :)) it shows this stack trace#2018-08-2015:57plexusthis is what the nrepl buffer looks like https://gist.github.com/92f9097055ccce9163c3116aa1569653#2018-08-2015:57plexus#2018-08-2015:58plexusNo implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: nrepl.transport.FnTransport
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: nrepl.transport.FnTransport
at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:583)
clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:575)
clojure.tools.nrepl.transport$eval1554$fn__1555$G__1545__1562.invoke (transport.clj:16)
refactor_nrepl.middleware$version_reply.invokeStatic (middleware.clj:144)
refactor_nrepl.middleware$version_reply.invoke (middleware.clj:143)
refactor_nrepl.middleware$wrap_refactor$fn__9261.invoke (middleware.clj:214)
#2018-08-2015:59plexusSorry, I deleted the stack trace again, a bit too much noise, here it is in a gist https://gist.github.com/87aa21a04b296374b7f7af42db51f173#2018-08-2015:59plexus#2018-08-2016:05plexusAnyone know how I can tell clj-refactor not to inject its middleware on cider-jack-in? seems that would be a good thing to try#2018-08-2016:14pauld(setq cljr-inject-dependencies-at-jack-in nil)#2018-08-2016:14pauldmight be worth a try#2018-08-2016:15pauldnot sure if that is spacemacs-only#2018-08-2016:16bozhidar@plexus Also seems that sayid got injected for you, which is not compatible with nREPL 0.4 yet.#2018-08-2016:17bozhidarNot sure what’s the version of refactor-nrepl you’re using - the newest snapshot should work with nREPL 0.4.#2018-08-2016:17bozhidarYou’ve definitely hit some middleware compatibility issues.#2018-08-2016:19pauld(setq sayid-inject-dependencies-at-jack-in nil)#2018-08-2016:27bozhidarYeah, a closer look in the stacktrace reveals that nREPL 0.4 was started, but sayid required something from nREPL 0.2 and broke everything.#2018-08-2019:11plexusthanks @bozhidar @pauld, I'll try that. Seems the spacemacs Clojure layer is pulling in Sayid.#2018-08-2019:14pauldyes it does. if you put the setq line I showed you under .spacemacs file's user-config section, things will be good again#2018-08-2019:15pauldyou shouldn't need the line that disables clj-refactor as it has been updated#2018-08-2021:29bozhidarhttps://github.com/syl20bnr/spacemacs/issues/11146#2018-08-2021:30bozhidarThat’s the relevant spacemacs issue.#2018-08-2108:37plexusI'm having trouble with sesman-link-with-project. I can pick a connection, and I can see the project link in sesman-browser, but the modeline still says "not connected", and I can't eval.#2018-08-2108:37plexusDoing sesman-link-with-directory from the same buffer does work...#2018-08-2108:44plexusI think this may have been brought up in the past but could there be room for a discussion around CIDER's release process? Currently I'm guessing most people essentially run off master, since that's how MELPA works, but that does mean that every year or two everyone is taken along for a rollercoaster ride of instability. The docs do mention pinning to melpa-stable, but for most people it really should be the default.#2018-08-2108:46plexusI'm not sure which model would be ideal, but a relatively small change with big impact could be to develop on a develop branch, and use master for pre-release testing.#2018-08-2110:27plexusI've been having an issue where evaluating certain forms will cause Emacs to hang. It seems it's blocking on a call to (accept-process-output nil 0.01) in nrepl-send-sync-request, which is strange because apparently that 0.01 is supposed to be a timeout, so it's not expected to block#2018-08-2110:32plexusactually scratch that, seems it's not breaking out of the loop around it, that's what's locking it up... investigating.#2018-08-2110:49plexusok, figured it out. I'll file an issue, the problem was that I had a clj and cljs repl open, but the browser hadn't opened yet, so the cljs repl wasn't functional, causing it to be seen as a "clj" repl instead. CIDER tries to send it the eval, and fails to do so, so it's waiting forever on a response#2018-08-2114:20bozhidar> I’m not sure which model would be ideal, but a relatively small change with big impact could be to develop on a develop branch, and use master for pre-release testing.#2018-08-2114:21bozhidarThe problem with this approach is that we’d simply be postponing the discovery of certain bugs until things are merged to master. Very few people outside the core devs actually would run from this develop branch, which would make it pretty useless for testing purposes.#2018-08-2114:24bozhidarObvious the real problems are:
• not enough to time to work on CIDER and related projects
• which leads to cutting corners everywhere
• and making it very hard to reliably execute big changes
If the project had an extensive test suite (for instance), that would have helped with many of the problems people are failing on a daily basis. Unfortunately when we were starting out it was pretty hard to develop such a test suite and after a while it was hard to backfill it. Ultimately it was a comprise of either making some progress with the humble amount of time available to work on the project vs freeze everything for a very long time until we clean up all the internal mess.#2018-08-2114:31bozhidarLong story short - I really don’t think that there’s some magic recipe to stability that won’t entail a lot of extra leg work that I don’t see anyone volunteering to do. 🙂#2018-08-2114:33plexus> Very few people outside the core devs actually would run from this develop branch
By that logic why does anyone ever release alpha/beta/RC versions?#2018-08-2114:49bozhidar@plexus In my experience those only make sense for really big projects (in terms of users). Most of the time alphas, betas, etc are simply ignored by the majority of the users. The only alphas I’ve used in the Clojure world are the “forever” alphas by Cognitect (e.g. core.async).#2018-08-2114:50bozhidarI can certainly tag more releases down the road, but I’m skeptical that would amount to much, as almost all the time I asked people to try some CIDER branch I would get between 0 and 3 people willing to do so. 🙂#2018-08-2114:53bozhidarTL;DR; I understand very well the theoretical purpose of pre-releases, but for them to work in practice there should be people willing to provide feedback and testing with respect to them.#2018-08-2115:01bozhidarAnyways, I’m always open to improve the release process. I really think that decoupling the release cycles of CIDER and cider-nrepl was a major step forward, as now at least users of MELPA won’t be running cider-nrepl snapshots all the time.#2018-08-2207:40magnarsAny thoughts on why I get No cljs REPL in current session after starting a with C-c C-x j m (`cider-jack-in-clj&cljs`)? (using custom form) - I have two nREPL-buffers (same port number), one with a clj-repl, the other with cljs.#2018-08-2207:40magnarsCan I instruct CIDER/sesman to mark the current repl-buffer as a cljs-buffer somehow?#2018-08-2207:43bozhidarBuffers become cljs buffers automatically when piggieback starts up. Even if you mark a buffer manually as a cljs buffer if piggieback’s not running normally this wouldn’t help much.#2018-08-2207:43bozhidarWhen exactly do you get the error?#2018-08-2207:49magnarsI get the error when doing C-c C-z from a cljs-buffer.#2018-08-2207:49magnarsMaybe it is not part of the current sesman-session somehow?#2018-08-2207:51magnarsthe infobar says cider[not connected] in the cljs-buffer (clj-buffers are connected)#2018-08-2207:54magnarssesman-info gives work/trip-trap:localhost:62550 [*cider-repl %s(clj)*<2>, *cider-repl %s(clj)*] linked-to proj(~/work/trip-trap/)#2018-08-2207:54magnarswhich looks to me like both repl-buffers are linked#2018-08-2207:55magnarsit is <2> that is a cljs-buffer#2018-08-2208:12bozhidarSeems to me that the ClojureScript upgrade did go well for you and that’s causing the problem. You should take a look an the nREPL message exchange on startup and see what’s happening with respect to track-state.#2018-08-2208:13magnarswill do. ~How do I look at the nREPL message exchange?~#2018-08-2208:21magnars@bozhidar I have now enabled the nREPL-logging, and connected again (fresh emacs). This time, C-c C-z from my clj-buffers go into the cljs-repl. I also found this:
(<--
id "10"
session "523c9f17-8533-4cfa-8445-f338ae9b6424"
time-stamp "2018-08-22 10:17:50.454340000"
changed-namespaces (dict ...)
repl-type "clj"
status ("state")
)
right after figwheel connects to the browser in the log.#2018-08-2208:22magnarsof note, I also get the server-side log messages interspersed with cljs-log messages in the cljs-repl-buffer#2018-08-2208:23magnarsthe custom code to connect to figwheel is basically fw/start-figwheel! followed by fw/cljs-repl#2018-08-2208:28bozhidarWell, it really seems the repl type detection is broken for you for some reason. Are you using the latest piggieback, figwheel, etc?#2018-08-2208:30bozhidarThe check in the middleware is pretty trivial - it just checks for some vars being present.#2018-08-2208:30bozhidarIf the REPL is truly a cljs repl you can force the type with M-x cider-set-repl-type, but if it’s not that’s going to revert on each eval.#2018-08-2208:31magnars[com.cemerick/piggieback "0.2.2"] and [figwheel-sidecar "0.5.16"] seems to be the latest?#2018-08-2208:31magnarsyeah, it reverted after the eval#2018-08-2208:32bozhidarOh, problem solved then. 🙂#2018-08-2208:33bozhidarIt’s now cider/piggieback and it’s something like 0.3.8 🙂#2018-08-2208:33magnarsaha!#2018-08-2208:33magnarsdoh, sorry for taking so much of your time on something like that#2018-08-2208:33bozhidarNo problem.#2018-08-2208:36magnarsthanks for on point and quick help 🙂#2018-08-2208:45bozhidarAny time!#2018-08-2208:47bozhidarBtw, I was in Oslo until yesterday. Should have thought of checking up on you for a beer and an Emacs/Clojure chat. 🙂#2018-08-2208:51magnarsooh, yeah! Next time 🙂#2018-08-2208:57bozhidarDefinitely!#2018-08-2218:57richiardiandrea@bozhidar is the new nrepl-cmdline writing a .nrepl-file somewhere?#2018-08-2218:58richiardiandreawas trying to connect automagically with cider and/or cursive#2018-08-2219:00richiardiandreano it looks like it does not#2018-08-2219:39aptHi. Not sure if this has to do with Cider: Is there any way to make projectile-find-file or something similar include all dependencies from the current lein project?#2018-08-2220:54bozhidar@richiardiandrea No, it’s not. That was on my todo, but I ran out of time.#2018-08-2220:55bozhidarThe only reason I didn’t add it was that I wasn’t sure where exactly to write it. I was thinking of the current directory with an option to supply the path to it.#2018-08-2303:21richiardiandreathis is the perfect solution imho, you probably 80% of the times run clojure in the project root and that is where tools like Cursive read it#2018-08-2220:55bozhidarPRs welcome! 😉#2018-08-2220:56bozhidar@andre.peric Include them how? Projectile’s meant to search only within a project’s directory, so likely the answer to your question is no.#2018-08-2221:03apt@bozhidar by listing them, basically. Yeah, I was looking for something similar to Intellij, which can list dependencies files as well#2018-08-2221:09ennAfter upgrading to the latest Cider snapshot (today’s), I’m getting this when I try to cider-jack-in:#2018-08-2221:12ennSame error if I pick clojure-cli from the list#2018-08-2221:12dpsutton(cider-jack-in-command "lein") returns "lein" for me. what does it say for you?#2018-08-2221:14dpsuttondo the same with cider-jack-in-resolve-command, cider-jack-in-global-optionsand cider-jack-in-params to see which one is problematic. or you could set toggle-debug-on-error and see which one is complaining#2018-08-2221:14dpsuttonI would guess the resolve command one#2018-08-2221:16enn(cider-jack-in-command "lein") gives the same error#2018-08-2221:16dpsuttoninteresting#2018-08-2221:17dpsuttonthat's quite strange. that function is just pattern matching#2018-08-2221:17dpsuttoncan you navigate to that function and see what's up with it? debugging won't help much but just see what it looks like and maybe re-eval it?#2018-08-2221:18ennhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L321-L329 <-- looks like it expects a symbol, not a string?#2018-08-2221:18dpsuttonah maybe i'm out of date 🙂#2018-08-2221:19dpsuttonok. pulled changes 🙂#2018-08-2221:19dpsuttondo you have dir locals for your project?#2018-08-2221:20ennI’m not sure what that is#2018-08-2221:21dpsuttonbecause errors with 'lein as a symbol show up as
> user-error: Unsupported project type ‘lein’
and errors with "lein" as a string show up as
> user-error: Unsupported project type ‘"lein"’#2018-08-2221:21dpsuttonhave you restarted emacs since upgrading?#2018-08-2221:21ennyes#2018-08-2221:24dpsuttondo you know how to evaluate random snippets of emacs lisp?#2018-08-2221:24ennyes#2018-08-2221:25dpsuttonok. there are so many different levels of emacs comfort#2018-08-2221:25dpsuttondidn't mean to sound condescinding#2018-08-2221:25dpsuttoncan you eval cider-project-type from a buffer in your project#2018-08-2221:25ennNo, that’s fine, my level of knowledge is pretty low, but I know how to eval#2018-08-2221:25ennsure#2018-08-2221:25dpsuttonperfect#2018-08-2221:27ennHmm, maybe I don’t understand how to do that. I know how to eval emacs lisp in emacs lisp buffers and with M-: but I don’t know how to eval an Emacs lisp expr in the context of a Clojure buffer.#2018-08-2221:28dpsuttonexactly as you just said. with M-:. We just need it to be rooted in a buffer in the filesystem which that will do#2018-08-2221:28dpsuttonit's gonna go searching the directory for build files to identify what type of project you're in so we need it to run from a good starting point.#2018-08-2221:28ennOK. When I do that I get an error: Debugger entered--Lisp error: (void-variable cider-project-type)#2018-08-2221:29dpsuttonwell that's interesting. CIDER doesn't appear to be loaded#2018-08-2221:29ennI see cider[not connected] in the modeline, if that means anything#2018-08-2221:32dpsuttoncan you execute `(cider-version) and tell me what you see?#2018-08-2221:41ennCIDER 0.18.0snapshot (package: 20180822.1325)#2018-08-2221:44dpsuttonand (cider-project-type) throws that error above about void variable?#2018-08-2221:47bozhidar@enn Are you sure you’re on the latest build? I had made a small mistake that would explain your problem, but I addressed it only a few minutes later and I’d be pretty surprised if MELPA managed to build the package exactly then.#2018-08-2221:48enn@bozhidar that version is the same listed as the latest at https://melpa.org/#/cider. I’m not sure how to check beyond that.#2018-08-2221:49bozhidarHmm, maybe they really built then. Can you check if the locally installed package looks like the code before or after this commit https://github.com/clojure-emacs/cider/commit/cc458a4b2c1ab3ebd4ff6e955021eb3b12c4be34#2018-08-2221:50ennchecking…#2018-08-2221:52enn@bozhidar the package looks like the code after that commit#2018-08-2221:55bozhidarWhat’s the full backtrace for your error? I simply can’t imagine where is the "lein" string coming from.#2018-10-0422:38dumratIs there some bug that causes multiple windows to be opened when clojure throws an error (and neotree is open)?#2018-10-0504:22bozhidar@dumrat I’ve never used neotree, so I have no idea. 🙂#2018-10-0504:23bozhidar@richiardiandrea Can you be more specific?#2018-10-0504:23bozhidarI guess you want fdef font-locked as a special form/macro and whatever comes after it as a function name, right?#2018-10-0504:25dpsuttonI think anything with def in it's name is special case#2018-10-0504:25bozhidarNot really. 🙂#2018-10-0504:25bozhidarImagine default-something. 😉#2018-10-0504:26bozhidarRight now it’s a special case - there’s some regexp checking for forms starting with def-something, but we plan to remove this because of the false positives here and there.#2018-10-0504:29bozhidarBut to answer the original question - yeah, that’s very possible, although I’m not certain we should be using the same font-locking as for definitions.#2018-10-0504:29bozhidar(because those aren’t exactly definitions)#2018-10-0504:32bozhidarmaybe def and fdef should be with the def face and whatever is after them should just be font-locked a keyword (green this in this example) and as a function in the second example?.#2018-10-0504:40richiardiandreaYes I was talking about s/fdef specifically sorry... I guess I am ok to leave white the symbol after it..it is a symbol after all.#2018-10-0504:41richiardiandreaOk I will try to work out the code#2018-10-0506:52orestis@dumrat @bozhidar yes, I saw the exact same thing with neotree. A cider pop up will give you at least 10 new splits. Completely funky. #2018-10-0508:34bozhidarThat’s one weird package interaction.#2018-10-0510:11orestisI have my CIDER/Figwheel-main terminology confused. I successfully (awesome!) jacked in to a Clojure REPL and a Figwheel-main CLJS repl. Everything works very nicely so far — but: I exited the CLJS repl by typing :cljs/quit and now I’m in the figwheel.main “parent” repl. How do I start again a CLJS repl and connect CIDER to it?#2018-10-0510:16orestisIf I try to do cider-connect-cljs, I eventually get: user> ExceptionInfo A build with id "dev" is already running. clojure.core/ex-info (core.clj:4739)
#2018-10-0510:16orestisThat is of course, because a build with the same id is indeed running.#2018-10-0510:18orestisI ended up killing my REPL and starting it again.#2018-10-0510:19orestisAlso I’m not sure what (if anything) should I put in my deps.edn. I don’t suppose CIDER injects anything figwheel related, right?#2018-10-0512:19bhauman@orestis you should be able to restart the REPL with (figwheel.main/start "dev")#2018-10-0512:20bhaumanhmmm that might not work#2018-10-0512:21bhaumanyou could also try (require 'figwheel.main.api) (figwheel.main.api/cljs-repl "dev")#2018-10-0512:34orestisI’ll give it a shot. The rationale for this was that I changed my build settings slightly and wanted to restart the build, which is possible via the REPL, but not within the CLJS repl AFAICT?#2018-10-0522:14agin project with project.clj and deps.edn what do I need to set up, so it wouldn’t ask me again on jack-in lein or clojure-cli?#2018-10-0522:14agI’m setting cider-jack-in-default to 'lein - that ain’t helping#2018-10-0522:15agit still prompts me#2018-10-0522:29agNevermind! I guess I have found it: it is cider-preferred-build-tool#2018-10-0619:48dominicmtime to write some perl cracks knuckles#2018-10-0621:23dominicmhttps://github.com/SevereOverfl0w/nREPL/tree/SevereOverfl0w/adoc/doc progress looks good.#2018-10-0707:59bozhidar@dominicm Looking forward to see the final result!#2018-10-0708:00dominicm@bozhidar http://s01.geekpic.net/di-P3Z4O7.png just got a first build#2018-10-0708:01bozhidarNice!#2018-10-0710:46dominicmhttps://severeoverfl0w.github.io/nREPL.org/nrepl/0.4.5/index.html#2018-10-0716:46richiardiandreaVery cool#2018-10-0716:47richiardiandreaDidn't know that there was an O'Caml client!#2018-10-0813:07fabraoHello all, every time I start a cider session from eshell, I have go to build.boot, execute Alt-X cider-connect [ENTER] localhost [ENTER] 9000 [ENTER]. Is there any way to do this with a shortcut ?#2018-10-0815:38bozhidarWhy don’t you just do (cider-connect :host ... :port ...) there?#2018-10-0815:38bozhidarWith cider-connect you don’t really have to be in a project to run it.#2018-10-0816:08fabrao@bozhidar just call (defun init-connect-cider () (cider-connect :host "localhost" :port 9000)) with (global-set-key [f3] 'init-connect-cider) but got error#2018-10-0816:09fabraowrong type argument: commandp#2018-10-0818:21bozhidar@fabrao You need to put (interactive) after the prototype to make the function a command.#2018-10-0820:14ordnungswidrigI’ve run into a weird issue since upgrading to 0.18.0. It resembles #2470 (`[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl/wrap-apropos`). The effective jvm startup command is:
clojure -Adev -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} com.billpiel/sayid {:mvn/version "0.0.16"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["com.billpiel.sayid.nrepl-middleware/wrap-sayid", "refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'
deps.edn is empty (`{:alias :dev {}}`)#2018-10-0820:17ordnungswidrigChanging cider-nrepl to 0.17.0 starts the nrepl server successfully#2018-10-0909:57bozhidar0.18 will work if you remove sayid or update it to the version 0.0.17.#2018-10-0909:57bozhidar(it’s the first version which added support for nREPL 0.4)#2018-10-0904:19Michael FianoCan I have cider auto-require and switch ns when I jack-in with clojure-cli like it does for lein?#2018-10-0909:58bozhidar@mfiano Not sure what you mean by this. There’s no functionality apart from the jack-in that’s build-tool specific.#2018-10-0910:43dominicm@bozhidar maybe the init ns of Leiningen? #2018-10-0913:45bozhidarAh, got it.#2018-10-0913:47bozhidarYeah, that’s lein specific indeed. I guess think we need to pass some namespace be evaluated in the command-line string for the cli-tools. @mfiano If that’s what you meant - please, file a ticket with CIDER.#2018-10-0913:51bozhidar@dominicm Btw, we can also add an initial ns to nREPL itself. I recall I discussed this idea with Chas back in the day. I never liked that the best approach we had was to just evaluate some (in-ns after we connected. (I think this can some param we send clone for instance).#2018-10-0913:57bozhidar(but that being said - doing something with the command-line would certainly be easier)#2018-10-0914:19Michael Fiano@bozhidar Well I have a deps.edn alias {:dev {:main-opts ["-e" "(require,'[mfiano.crawler.core,:as,crawler]),(in-ns,'mfiano.crawler.core)"]}} and set cider-clojure-cli-global-options to "-A:dev", but for some reason only the code is required and the ns stays at user, unlike running clj from a shell.#2018-10-0916:07dominicm@mfiano that won't have an effect on nrep l think#2018-10-1008:55kiemdoderI have not used cider for a while now and found editing to be very laggy. When I start typing there are often delays of a second or more before the text shows up in the editor.#2018-10-1008:56kiemdoderI did update to the latest packages of everything#2018-10-1009:58bozhidar@kiemdoder See http://www.cider.mx/en/latest/troubleshooting/#2018-10-1009:58bozhidarSome profiling info would be useful. It relatively unlikely that the slowdown is coming directly from CIDER, but I can’t tell you anything if you don’t gather some profiling data.#2018-10-1009:59bozhidar@mfiano Yep, that code is being executed outside the nREPL session, so it will have no effect on it.#2018-10-1010:47magnarsDoes refactor-nrepl work with JDK11? It seems maybe there are some issues with mranderson'ed deps? I get namespace ’refactor-nrepl.ns.slam.hound.search’ not found when trying to use it.#2018-10-1011:29kiemdoderI disabled flycheck-clojure and the lag while editing is gone.#2018-10-1011:29kiemdoderso cider is not causing any lag#2018-10-1018:20mccraigmccraigafter updating CIDER i'm getting errors like "No linked CIDER sessions" when i'm trying to compile a file outside of the current project... can i force that file to be sent to the CIDER session ?#2018-10-1018:25mccraigmccraigah, got it - sesman-link-with-project does the trick#2018-10-1018:25mccraigmccraigneat!#2018-10-1102:44fabraoHello all, I that possible to do defmulti and defmethod debug with cider-debug-defun-at-point?#2018-10-1106:48jumar@U0YJJPFRA Yeah, that should be possible. At least in a simple case like this:
(defmulti login (fn [user-role credentials] user-role))
(defmethod login :admin [_ credentials]
(println "Admin credentials: " credentials))
(defmethod login :user [_ credentials]
(println "User credentials: " credentials))
(login :admin {:licensee "jumarko" :license-key "xyz"})
(login :user {:licensee "jumarko" :license-key "xyz"})
#2018-10-1121:17fabraodebug is with println message#2018-10-1121:17fabrao?#2018-10-1206:10jumarNo, cider-debug-defun-at-point - println doesn't have any special meaning here, just a dummy implementation.#2018-10-1208:29bozhidar@magnars Haven’t tried JDK 11 yet.#2018-10-1215:08borkdudewhat’s up with all the [WARNING] No nREPL middleware descriptor in metadata of #’cider.nrepl/wrap-test, see nrepl.middleware/set-descriptor! in boot 2.8.2 + cider?#2018-10-1218:49pauldI'm getting this error when trying to cider-jack-in
#2018-10-1218:49pauldcider--check-existing-session: Symbol’s function definition is void: sesman-linked-sessions
#2018-10-1218:49pauldIt was working a few days ago, but I just updated cider.#2018-10-1218:50pauldUsing spacemacs with say-id and clj-refactor are disabled.#2018-10-1218:52pauldI get same error using basic project created by lein new app test
#2018-10-1218:54pauldsame issue with cider-connect
#2018-10-1218:55pauldI noticed that my emacs also updated sesman, so the problem may stem from that.#2018-10-1219:04pauldYeah, that likely triggered the breakage as the commit from 3 hours ago shows that sesman-linked-sessions
has been removed in favor of sesman--linked-sessions
#2018-10-1219:12pauldI submitted the issue to sesman github.#2018-10-1219:14pauldadding the extra -
in cider.el fixes the issue.#2018-10-1308:53valtteriI was coming here to complain about the same issue. Luckily you’d already figured out a workaround. wizard#2018-10-1310:26bozhidar@borkdude Seems you’ve got some outdated middleware that’s not compatible with nREPL 0.4.#2018-10-1310:26bozhidarWhich CIDER version are you on?#2018-10-1310:27bozhidar@pauld defalias can also help with this. I can hotpatch sesman, but I guess Vitalie will update CIDER soon.#2018-10-1310:44bozhidar(I didn’t fix this directly myself as he made this function private and I’m not 100% what did he intend to replace it with)#2018-10-1311:16borkdude@bozhidar this is my entire profile.boot:
(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
concat '[[cider/cider-nrepl "0.18.0"]
[refactor-nrepl "2.4.0"]
])
(swap! boot.repl/*default-middleware*
conj
'cider.nrepl/cider-middleware
'refactor-nrepl.middleware/wrap-refactor)
#2018-10-1311:16borkdudeit works with boot 2.8.1 but not with 2.8.2#2018-10-1311:38bozhidar@borkdude And what’s in your project?#2018-10-1311:38borkdudeno cider middleware#2018-10-1311:38bozhidarEverything here seems fine and should definitely work with nREPL 0.4#2018-10-1311:39borkdudehmm, I’ll check the deps tree#2018-10-1311:39bozhidarThere must be something, as what you’re experiencing can only be caused by something with a hard dep on tools.nrepl loading before CIDER’s middlewares.#2018-10-1311:41bozhidarA few people reported issues like this one (e.g. https://github.com/clojure-emacs/cider/issues/2459) and always the problem was the same. 🙂#2018-10-1311:43borkdudeThanks. It turns out we have a hard dependency on tools.nrepl somewhere. Should I upgrade to nrepl 0.4.5?#2018-10-1311:44bozhidarWhere’s this hard dep exactly?#2018-10-1311:44borkdudeproject#2018-10-1311:44bozhidarGenerally tools.nrepl is dead and buried at this point and everyone should switch to nREPL 0.4.#2018-10-1311:44borkdudeI’m not even sure why we have it, it’s been there since ages… I’ll try to remove and see what happens 😉#2018-10-1311:45bozhidarThe only reason why cider’s middleware conditionally support tools.nrepl still is that Lein hasn’t yet issued a new version that uses nREPL 0.4.#2018-10-1311:45bozhidarBoot was another holdout but they fixed this in 2.8.2 (therefore your current problem 😉 ).#2018-10-1312:09borkdudeproblem solved now, project works with boot 2.8.1 and 2.8.2#2018-10-1312:09borkdudethanks!#2018-10-1312:11borkdudehmm, one weirdness: when starting this project I get:
java.lang.Exception: No namespace: reply.eval-modes.nrepl found
but the repl seems to work fine#2018-10-1317:58ghey guys and girls. is there any way to immediately break out of a deftest if an assertion fails (or some other condition occurs)?#2018-10-1317:58gor rather, not a deftest but a running test#2018-10-1319:45reefersleepThrow an exception? 😄#2018-10-1401:43Michael FianoDoes anyone know why I would only get eldoc signature hints in the REPL, and not a source buffer?#2018-10-1401:44Michael FianoThis is making it really difficult to learn Clojure 😞#2018-10-1402:43dpsuttoncouple things to check. 1) is the buffer connected to CIDER? can you evaluate code from it? 2) is eldoc-mode enabled there? might be that simple#2018-10-1402:44dpsuttonif those don't pan out for you and you suspect that its something a bit deeper, you can use m-x toggle-nrepl-message-logging (might be different command but it is similar)`, and look for the info command going out in the *nrepl-messages-[project-name]* buffer#2018-10-1402:44dpsuttonthere you can see what is going across the wire to your app which is responsible for answering the eldoc question#2018-10-1408:25bozhidarI’d bet that eldoc-mode is not enabled in clojure-mode buffers.#2018-10-1408:26bozhidar@borkdude Yeah, turns out there’s a small bug in reply that needs to be fixed. An oversight of mine.#2018-10-1409:32bozhidar@dominicm http://nrepl.xyz/nrepl/0.4.5/index.html 😉#2018-10-1409:32bozhidarGreat work!#2018-10-1409:34dominicmnow we can have callouts in cljdoc! 😂 oh the yak shaving...#2018-10-1409:46martinklepschnice! 🙂 What's the motivation behind also having an Antora setup?#2018-10-1409:47martinklepschand funny that the domain is http://nrepl.xyz 😄#2018-10-1409:48bozhidarI guess we still wanted a standalone site, @dominicm came with Antora. I just assumed he picked something great. 😉#2018-10-1409:48bozhidar> and funny that the domain is http://nrepl.xyz 😄#2018-10-1409:49bozhidarThat’s on @arrdem. 😄 He has the http://nrepl.org domain and I could never get him to update the DNS settings, so I just bought the cheapest domain I could for people not to have to type a long URL. 🙂#2018-10-1409:50bozhidar@dominicm Btw, seems you never updated the config file for cljdoc. 😄 😄 😄#2018-10-1410:02martinklepschThought about this a few times before but just logged this issue as well: https://github.com/cljdoc/cljdoc/issues/145#2018-10-1415:26Karol WójcikHello guys 🙂 Does anyone experience very slow cursor move when trying to look into some namespace inside jar file? If yes do you know some kind of remedy for that?#2018-10-1415:28kommen@kwcharllie379 a profiler report would be very helpful to see what is going on https://cider.readthedocs.io/en/latest/troubleshooting/#profiling-cider-commands#2018-10-1415:31Karol WójcikMemory report#2018-10-1415:32Karol WójcikCPU report
- command-execute 6223 61%
- call-interactively 6223 61%
- funcall-interactively 6223 61%
- counsel-M-x 6219 61%
+ ivy-read 6172 60%
+ counsel--M-x-externs 47 0%
- evil-next-line 2 0%
+ evil-line-move 2 0%
- evil-previous-line 2 0%
- evil-line-move 2 0%
+ previous-line 2 0%
- redisplay_internal (C function) 3675 36%
- eval 3658 35%
- spaceline-ml-all-the-icons 3655 35%
+ projectile-project-p 1851 18%
+ spaceline-all-the-icons--buffer-path 1763 17%
powerline-render 6 0%
+ powerline-raw 4 0%
+ run-hooks 3 0%
+ spaceline--get-face 3 0%
+ spaceline-all-the-icons--face-background 2 0%
+ spaceline-all-the-icons--flycheck-status 1 0%
+ spaceline-all-the-icons--highlight 1 0%
make-mode-line-mouse-map 1 0%
+ spacemacs//evil-state-face 1 0%
spaceline-all-the-icons--separator 1 0%
- linum-after-scroll 15 0%
+ linum-update 15 0%
+ #<compiled 0x4162d34f> 1 0%
+ cider-connected-p 1 0%
+ linum-update-current 140 1%
+ ... 84 0%
+ timer-event-handler 47 0%
+ evil-repeat-pre-hook 2 0%
+ winner-save-old-configurations 1 0%
sp--post-command-hook-handler 1 0%
#2018-10-1415:33Karol WójcikQuestion is why in file from jar it is so slow compared to normal clj buffer#2018-10-1415:43kommenok, I don’t see anything obvious, but it seems you’re using spacemacs? you may want to try the current develop branch, recently they merged my performance improvements which could address at least the high projectile-project-p percentage in your report: https://github.com/syl20bnr/spacemacs/pull/11418#2018-10-1415:44Karol WójcikIt is all because the evil-mode 😛#2018-10-1415:45Karol WójcikI think it is high time to stop using vim keybindings and switch to emacs one#2018-10-1416:01kommenI would find it very surprising that evil mode is that… evil. 😉#2018-10-1416:18bozhidar@kwcharllie379 Is powerline calling like crazy projectile? I certainly didn’t expect to see something like this in the profiler.#2018-10-1416:19bozhidarSeems to me the modeline is being updated on every keypress, which is not a very good idea for something doing expensive computations.#2018-10-1416:19Karol WójcikI think I know what caused the issue. I was using spaceline-all-the icons theme 🙂 I removed it and now I’m using the regular spaceline and the issue is gone 🙂#2018-10-1416:21bozhidarAnyways, it’s good to know that everything’s fine with CIDER! cider#2018-10-1416:22Karol Wójcik@bozhidar I must say that I’m impressed how neat the cider code looks like 🙂 You can be very proud of yourself 🙂 Good job you did and doing all the time 🙂#2018-10-1416:31bozhidar@kwcharllie379 Thanks! I’m obsessed with neat code, but I have to admit that due to time limitations I’ve definitely didn’t do the best job possible with CIDER. Still, as far as Emacs packages go I think it’s in a pretty good shape. 🙂#2018-10-1416:33Karol WójcikCompared to other packages all tools you provide are in best standards possible IMHO. Love Cider, Projectile, super-save. 🙂#2018-10-1416:41Chasei'm going through a tutorial that is now introducing cljs. they use lein and "Rhino" but i'm trying to use cider instead. When I try cider-jack-in-cljs it asks me which repl but it tells me it doesn't recognize rhino Also when I kill the repl and try to jack-in again to try and different spelling it won't restart the repl. it says "selecting deleted buffer". Any advice on how I should better approach this?#2018-10-1416:49bozhidar@chase-lambert Use nashorn instead.#2018-10-1416:49bozhidar(it’s rhino successor)#2018-10-1416:50bozhidarWe’ve dropped support for Rhino, as it’s a big mess and it was pretty painful to support it.#2018-10-1416:51Chaseaha! got it. yeah the book is Living Clojure and I think it came out in 2014 so that explains that. thank you! any advice on how to kill a repl and start a new one or just to restart the current repl? I usually just end up closing out emacs completely and trying again but i know that is not ideal#2018-10-1416:54Chaseand i just remembered I can hit tab and it gives me my autocompletion options which would have guided me a bit better!#2018-10-1417:12bozhidar@chase-lambert See http://www.cider.mx/en/latest/using_the_repl/ (`C-c C-q` kills a REPL) and http://www.cider.mx/en/latest/managing_connections/#2018-10-1417:12bozhidarYou definitely don’t have restart Emacs for something like this.#2018-10-1421:37ChasePerfect! Thank you! I'll make sure to start reading the manuals more before asking but I already had you in convo. haha#2018-10-1417:13bozhidarC-c M-r restarts a REPL.#2018-10-1500:30vigilancetechsection 4.3.1 of the shadow-cljs user guide says:
If the popular cider-nrepl is found on the classpath it will be added automatically. No additional configuration required.
but the cider's man page says:
Much of CIDER's functionality depends on the presence of CIDER's own nREPL middleware. Starting with version 0.11, When cider-jack-in (C-c C-x (C-)j (C-)j) is used, CIDER takes care of injecting it and its other dependencies.
so, should I remove the cider-nrepl from my system to have it work with shadow or is that the nrepl shadow is looking for?#2018-10-1508:57bozhidar@vigilancetech Depends on how you start shadow-cljs I guess. You don’t really need cider-nrepl in your profiles if all you do is use cider-jack-in....#2018-10-1510:53sundbp@bozhidar the reply issue causing the reply.eval-modes.nrepl error in 2.8.2 - is there a workaround or safe to just ignore for time being?#2018-10-1510:53bozhidarYou can just ignored it.#2018-10-1510:54bozhidarHere’s the patch I’ve created https://github.com/trptcolin/reply/pull/190#2018-10-1510:54sundbpthanks!#2018-10-1514:52hyankov👋
I've been working extensively with CIDER without being Emacs expert. I updated my emacs packages today (including CIDER). Later I had some weird problems with the REPL on a project I've been assigned. Trying to understand what's going on I decided to start a new blank project and I can't start a REPL there.
Here're the steps I do:
1. lein new test
2. in Emacs I open src/test/core.clj
3. execute cider-jack-in
4. Get this exception:
Oct 15, 2018 5:50:23 PM clojure.tools.logging$eval579$fn__582 invoke
SEVERE: Unhandled REPL handler exception processing message {:op init-debugger, :print-level 10, :print-length 10, :session cc619163-753b-46b1-9334-cf6e9459aac4, :id 8}
java.lang.ClassNotFoundException: clojure.tools.reader.reader_types.SourceLoggingPushbackReader, compiling:(cider/inlined_deps/toolsreader/v1v3v0/clojure/tools/reader.clj:1:1)
at clojure.lang.Compiler.load(Compiler.java:7526)
at clojure.lang.RT.loadResourceScript(RT.java:379)
at clojure.lang.RT.loadResourceScript(RT.java:370)
at clojure.lang.RT.load(RT.java:460)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.core$require.doInvoke(core.clj:5947)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867$loading__6434__auto____2868.invoke(parse.cljc:9)
at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867.invokeStatic(parse.cljc:9)
at cider.inlined_deps.toolsnamespace.v0v3v0_alpha4.clojure.tools.namespace.parse$eval2867.invoke(parse.cljc:9)
... skipping some lines ...
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: clojure.tools.reader.reader_types.SourceLoggingPushbackReader
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2204)
at clojure.lang.RT.classForNameNonLoading(RT.java:2217)
at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532$loading__6434__auto____3533.invoke(reader.clj:9)
at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532.invokeStatic(reader.clj:9)
at cider.inlined_deps.toolsreader.v1v3v0.clojure.tools.reader$eval3532.invoke(reader.clj:9)
at clojure.lang.Compiler.eval(Compiler.java:7062)
at clojure.lang.Compiler.eval(Compiler.java:7051)
at clojure.lang.Compiler.load(Compiler.java:7514)
... more
Here's my emacs.d: https://github.com/hristoyankov/.emacs.d#2018-10-1514:53hyankovI'm pretty sure I've messed up my setup just no sure how and where. Any ideas are greatly appreciated#2018-10-1516:32bozhidar@hyankov Hmm, I did bump this dep today (it used to be 1.1), but the tests passed just fine with it. Seems like some version conflict with tools.namespace, but I’m not sure what’s the root cause of all this.#2018-10-1519:00hyankov@bozhidar I was using and marmalade for I don't know reason. It's reproducible - if you care to check it for yourself. However, I can imagine you have better things to do with your time but it's worth knowing there might be issues with that.
As for me - moved to and I'm back on track 🙂#2018-10-1519:46dpsutton@hyankov try this:
(setq cider-jack-in-lein-plugins '(("cider/cider-nrepl" "0.18.0")))#2018-10-1519:47dpsuttonmy coworker is setting up CIDER on a new machine and was running into issues. just use an older cider-nrepl until the latest gets resolved#2018-10-1520:17arrdem:ie: I’m covered in shame @bozhidar#2018-10-1520:18dpsuttonand this guy only uses power tools from the 1920s and refused to upgrade CIDER because "it always breaks" lol#2018-10-1520:19dpsuttonsure proved him wrong#2018-10-1520:21arrdem😄#2018-10-1520:22dominicmMy colleagues also are afraid to update cider 😄. And Arch Linux.#2018-10-1520:27dpsuttonhe uses a lathe from 1920s and an emacs config from 7 years ago. and is angry when things change#2018-10-1520:28dominicmA literal lathe?#2018-10-1520:28dpsuttonyeah like woodworking#2018-10-1520:28dominicmfor fun?#2018-10-1520:29dpsuttonyeah. he's got quite the diverse set of interests. embedded lisps all the way to antique wood working tools#2018-10-1520:31dominicmInteresting. I was trying to picture him bringing his lathe into a city office, and I was wondering if it was safe to have near laptops.#2018-10-1521:28bozhidar@dpsutton Same problem with tools.reader?#2018-10-1521:29bozhidarIf so I’ll revert this, although I checked the recent commits and nothing seems out of place there.#2018-10-1521:30bozhidar> (setq cider-jack-in-lein-plugins '(("cider/cider-nrepl" "0.18.0")))#2018-10-1521:30bozhidarI’d recommend doing#2018-10-1521:30bozhidar(setq cider-latest-middleware-version "0.18.0")#2018-10-1521:31bozhidar(by default we inject the latest compatible version with the assumption it’s the best)#2018-10-1521:33dpsuttonnot sure. we didn't really have a good handle on how to debug it. any calls to eval just spun#2018-10-1521:34dpsuttonre: setq cider-latest middelware, it adds to the list at require time so setting that var after CIDER is loaded may not affect anything#2018-10-1521:35dpsutton(cider-add-to-alist 'cider-jack-in-lein-plugins
"cider/cider-nrepl" cider-latest-middleware-version)
#2018-10-1521:35dpsuttonso that code is run when cider is required. need to make sure cider-latest middleware version is updated before cider does that#2018-10-1521:35bozhidarAh, yeah. It should be set before loading CIDER.#2018-10-1521:35hunterit was a new machine, had just installed cider from melpa#2018-10-1521:36hunterno specific configuration done for cider, just trying to jack-in#2018-10-1521:37hunter@bozhidar 20181014.2104#2018-10-1523:17richiardiandreahas anybody ever seen this: Boxed math warning, cider/inlined_deps/fipp/v0v6v13/corerrb_vector/v0v0v12/clojure/core/rrb_vector/nodes.clj:88:11 - call: public static boolean (long,java.lang.Object).#2018-10-1523:30dpsuttonJvm 11? They added a new overload so now the call is ambiguous#2018-10-1600:27richiardiandreano this is normal JVM 8...#2018-10-1607:20bozhidarI’ve noticed those warnings as well yesterday, but I decided they are not a big deal.#2018-10-1607:24bozhidarI love it how the JVM 8 is now “normal”. 😄#2018-10-1614:42richiardiandreaIt seems to happen only the first time for is called btw#2018-10-1523:45Michael FianoI found my first bug!#2018-10-1523:45Michael FianoIn CIDER's REPL, try evaluating #uuid 1, or #uuid <anything> for that matter.#2018-10-1523:49dpsuttonWhat error are you getting. I use #uuid "string-value" all the time#2018-10-1523:50Michael FianoIt crashed the REPL completely#2018-10-1523:52dpsuttonAh. Interesting#2018-10-1523:53Michael FianoIt actually erased the input I had typed, and produces this, with no way to get a prompt again https://gist.github.com/mfiano/186642e923d360c3e7abcd975df727c7#2018-10-1523:54Michael FianoThis is when giving that reader tag anything but a string#2018-10-1600:03dpsuttonok so i can see the bug. i was able to get a new prompt by just pressing enter, and once i eval'ed something again the spinner calmed down#2018-10-1600:03dpsuttonit looks like it just stops the eval immediately but cider isn't aware that it is done#2018-10-1600:06dpsutton@mfiano can you confirm that for me? just press enter. it's not "stuck" it just doesn't know that its no longer doing anything#2018-10-1600:06Michael FianoAh yes I can confirm#2018-10-1600:07dpsuttonawesome. still a bug. but less buggy#2018-10-1600:07Michael FianoOk not as fatal as I thought. I saw the SEVERE at the top, and no prompt, and assumed it was worse than it is#2018-10-1600:54arrdemFor all that I’m an absolute CIDER stan, I am seeing inlined deps issues in tools.reader somewhere 😕 falling back to MELPA stable#2018-10-1605:11Michael FianoHello. Anyone available to try reproducing an issue before I submit it?#2018-10-1605:26wallydragDebugger entered--Lisp error: (error "Version must be a string")
signal(error ("Version must be a string"))
error("Version must be a string")
version-to-list(nil)
version<=("0.18.0" nil)
cider--check-middleware-compatibility()
cider--connected-handler()
run-hooks(nrepl-connected-hook)
nrepl-start-client-process("127.0.0.1" 8011 nil #f(compiled-function (_) #<bytecode 0x40d48779>))
cider-nrepl-connect((:project-dir "~/workspace/gojek/allocation-service/" :host "127.0.0.1" :port 8011 :repl-init-function nil :session-name nil :repl-type "clj"))
cider-connect(nil)
funcall-interactively(cider-connect nil)
call-interactively(cider-connect record nil)
command-execute(cider-connect record)
helm-M-x(nil "cider-connect")
funcall-interactively(helm-M-x nil "cider-connect")
call-interactively(helm-M-x nil nil)
command-execute(helm-M-x)
#2018-10-1605:27wallydraggetting this error when doing cider-connect, i can connect to repl but go-to-defn fails and falls back to gtags and dumb search#2018-10-1605:29wallydragI am using
spacemacs - 0.200.13
emacs - 26.1
cider - 0.18.0 SNAPSHOT
#2018-10-1607:01bozhidarI’ve reverted the cider-nrepl tools.reader dep and pushed a new snapshot.#2018-10-1607:02bozhidarAnd this time around I’ve even tested that cider-jack-in works normally. 🙂 That being said - I’ve got no idea why the breakage happens.#2018-10-1607:07bartukahi @bozhidar, if I reinstall the package from melpa now, I’ll already get the rollbacked version?#2018-10-1607:07bartukaI still get that error from cider-jack-in#2018-10-1607:14arrdemThanks Bozhidar!#2018-10-1607:19bozhidarThe bug was not in the MELPA package, but in the cider-nrepl itself.#2018-10-1607:20bozhidarYou should delete cider-nrepl-0.19-SNAPSHOT locally for .m2 to force it to be refetched.#2018-10-1607:22bozhidar@wallydrag How did start the nREPL server you’re connecting to?#2018-10-1608:17wallydragi have an nrepl server in the my code which i run on terminal and then connect to that port#2018-10-1608:18wallydragi also came across this chat https://clojurians-log.clojureverse.org/cider/2018-08-15#2018-10-1607:23bozhidar(seems you don’t cider-nrepl loaded and that we forgot to add a nil check in the version comparison)#2018-10-1607:24dominicmDon't you check the describe output first to see if cider-version is supported?#2018-10-1607:25dominicm(Not that I do this, but I figured cider would do this implicitly)#2018-10-1607:34bartukaworks fine now @bozhidar#2018-10-1607:35bozhidar@dominicm We do, but afterwards there’s some version parsing code that used to be nil safe, but I guess now it’s not. 🙂#2018-10-1607:35dominicm@bozhidar so that would mean that cider must be loaded, no?#2018-10-1607:36bartukawhen I evaluate cider-eval-last-sexp in any function it works fine, but if I try that in the namespace definition I receive this message error in process filter: Wrong type argument: characterp, nil#2018-10-1607:41bozhidar@iagwanderson Some stacktrace would be useful here.#2018-10-1607:41bozhidar> @bozhidar so that would mean that cider must be loaded, no?#2018-10-1607:43bartuka@bozhidar I’m trying to figure it out how to get a proper stacktrace because there is nothing in the cider-repl#2018-10-1607:43bartukano error msg#2018-10-1607:50bartukaemacs -Q for the rescue. something I configured break it. o/ one more dawn in the dungeons#2018-10-1607:59bozhidar@dominicm Well, it means that nREPL is loaded and then you start going the describe keys and check what’s there, which is where this code breaks. You can’t really get a nil version if cider-nrepl is loaded.#2018-10-1607:59dominicm@bozhidar the code isn't nil safe around checking whether the cider-version op is present, you mean? That makes more sense.#2018-10-1608:01bozhidarYep. I guess I broke this when I changed a check from “is there some version” to “is the version higher than some required version”. Weird mistake if I did it, but completely plausible given the stacktrace.#2018-10-1608:05bozhidarAs for tools.reader and tools.namespace - see https://dev.clojure.org/jira/browse/TRDR-55 Seems that’s some bug in tools.namespace, which I assume no one is going to fix any time soon.#2018-10-1608:17wallydragi have an nrepl server in the my code which i run on terminal and then connect to that port#2018-10-1608:56solfHello, a question about packages: for CIDER and other related clojure packages, is it better to be on melpa-stable or melpa?#2018-10-1609:08manuel@dromar56 I've always been on MELPA, and the CIDER team is pretty quick at bug-fixing whenever I find a problem 🙂#2018-10-1609:08manuelTBH, I don't think I've ever used melpa-stable in my Emacs-life.#2018-10-1702:02jrychterYou mean I should not be on melpa-stable? Hmm. I always thought this is the way to go if you care mostly about getting things done…#2018-10-1705:06manuelI care too, but I don't seem to have that many problems tracking MELPA. #2018-10-1707:53lmergeni think emacs usually picks the latest version of cider possible -- i pin cider to melpa-stable by doing this:
(use-package cider
:pin melpa-stable
....)
this has improved the stability of cider for me a lot#2018-10-1707:54lmergenmaybe i'm using cider differently from everyone else, though, but the past months i feel like cider has been moving forward a lot, and other packages are not necessarily keeping up with that speed#2018-10-1709:06bozhidarTrue.#2018-10-1709:07bozhidarWe’ve had a massive push in the past 3-4 months and the master wasn’t always stable.#2018-10-1709:07bozhidarAs the manual says - “unless you’re the adventurous type it’s best to stick to melpa-stable”. 🙂#2018-10-1710:00edwardkI'm not sure what I was doing wrong but I just now had problems with melpa-stable and sesman, all good on master though!#2018-10-1712:56bozhidar@edwardk There were many improvements that happened for sesman on master. I hope we’ll cut a new stable release which includes them relatively soon.#2018-10-1721:57danierouxI'm doing a cider-connect to a clojure -Acider-clj
Loading a buffer with C-c C-k gives me this:
Exception in thread "nREPL-worker-0" java.lang.ClassCastException: nrepl.middleware.pr_values$pr_values$fn$reify__11007 cannot be cast to clojure.tools.nrepl.transport.Transport
Can anyone help me get to the bottom of this? (this is 0.18)#2018-10-1801:18richiardiandreaI get this error with Prelude on a colleague laptop:
Prompt will show when REPL connects to evaluation environment (i.e. Node)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
2018-10-17 18:15:05.167:INFO::nREPL-worker-0: Logging initialized @11986ms
Starting node ...
IOException error=2, No such file or directory java.lang.UNIXProcess.forkAndExec (UNIXProcess.java:-2)
user>
Has anyone seen it?#2018-10-1807:13martinklepschWhen I use jack in with clj it briefly shows the CLI invocation that’s used to start the nrepl server. Can I somewhere find the full command for copy-pasting? #2018-10-1807:24martinklepschIs it just this?
clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.18.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'#2018-10-1807:36jumarFor my leiningen project I see this in *Messages* buffer:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- repl :headless :host ::...
#2018-10-1807:41martinklepschthanks @U06BE1L6T I also found the line above in the messages buffer but wasn't sure if it's complete due to trailing ellipsis 😄#2018-10-1807:43jumarI think it's complete: https://github.com/clojure-emacs/cider/blob/c936cdad4c944b716e2842f11c373f69a452c4b2/nrepl-client.el#L1031#2018-10-1814:10bozhidarYep. The ... stand for work in progress. 🙂#2018-10-1814:13martinklepschyeah that makes sense. 🙂 Once I saw it in the messages buffer I was a bit more confident it's complete but in the minibuffer I guess an abbreviation would have been just as likely 🙂#2018-10-1814:14martinklepschenjoyed your defn podcast btw, many good points! @U051BLM8F#2018-10-1814:14bozhidarThanks!#2018-10-1813:52bmillsSo I just started using shadow-cljs, and noticed that all of the sudden trying to jack in will ask if I'm in a lein or shadow-cljs project. Problem is, no matter which one I pick, I get an error like unsupported project type '"lein"'. It looks like (cider-project-type) is resolving to a string instead of a symbol. BUT, if I remove the shadow-cljs.edn file from my project, the error goes away.#2018-10-1813:55dpsutton@bryan778 if i remember right i think there was a release for a few hours where this confusion existed. strange that this is happening. any chance you have some dir-locals laying around?#2018-10-1813:59bmillsI don't think so...but I am also a mediocre spacemacs user at best. Those are project local vars I would set myself?#2018-10-1814:00dpsuttonyeah. dir-locals are variable overrides for a directory tree. so you can override cljs repl types for particular projects without setting the value globally#2018-10-1814:00dpsuttonsee if there's a .dir-locals.el at the root of your project#2018-10-1814:01bmillshm, nope#2018-10-1814:01dpsuttonand what may be happening: if there are two build systems present -- like lein and shadow-cljs -- there's a notion of preferred build system. perhaps this is set to "lein" rather than 'lein#2018-10-1814:02dpsuttondefcustom cider-preferred-build-tool#2018-10-1814:02dpsuttonif you want to check the value of this var#2018-10-1814:04dpsuttondo you know how to do that? there are always different levels of emacs experience with CIDER users. sometimes 20 years in emacs, sometimes only emacs experience is booting up prelude or spacemacs and running CIDER#2018-10-1814:05bmillsI'm in the latter category, but that's a M-x : (cider-preferred-build-tool)?#2018-10-1814:06dpsuttonM-x is how you invoke "interactive" functions. we want to check the value of a variable so m-x isn't quite what we want to do#2018-10-1814:06bmillsah#2018-10-1814:07dpsuttonSPC h d v describe a variable#2018-10-1814:07dpsuttonthat's what we want#2018-10-1814:08dpsuttonspace to activate stuff, help describe variable#2018-10-1814:10bmillsgreat. thank you! That evals to nil#2018-10-1814:15dpsuttondo you know how to evaluate arbitrary lisp code?#2018-10-1814:15dpsuttonthere's a way to have a little prompt down in the minibuffer and you can evaluate (cider-project-type) from within your project#2018-10-1814:33bmillsis that the M-:? If I try that, I'll get the popup asking me which project type, and depending on what I choose, I'll get eiterh "lein" or "shadow-cljs" printed to the minibuffer#2018-10-1819:35dpsuttonoh i'm sorry i missed your reply#2018-10-1819:35dpsuttondid you make any headway?#2018-10-1814:11bozhidar@richiardiandrea Seems like node being on the PATH or something like this.#2018-10-1818:26richiardiandreafiled an issue in figwheel, it was a problem with the js file#2018-10-1814:13bozhidar@danie You’ve got some version mismatch between the nREPL server your starting and the middlewares you’re loading. What’s in your deps?#2018-10-1818:58danieroux- org.clojure/tools.nrepl {:mvn/version "0.2.13"}
+ nrepl {:mvn/version "0.4.5"}
This changed on my top-level deps (as oppose to dev deps) fixed it.
That, and (setq nrepl-sync-request-timeout nil) for the next problem.
Thank you.#2018-10-1814:13bozhidarLikely you’ve got some old middleware that doesn’t work with modern nREPL.#2018-10-1820:52vigilancetechwhat is this tool the guy demonstrates that allows one to click down thru a highly nested data structure return result from the REPL while still in the source code buffer? I realize this might be a different editor than emacs, but has anyone seen such a tool for emacs/cider?
https://youtu.be/rh5J4vacG98?t=1086#2018-10-1820:54dpsuttonhttp://www.cider.mx/en/latest/miscellaneous_features/#value-inspection ?#2018-10-1821:16vigilancetech@dpsutton hmm.. I'm getting an "inspector error" on that (with nothing in the messages buffer)
inspector error for: {:name "Hyundai Electronics PC3-12800", :type :memory, :used {:value 5311229952}, :total {:value 8579297280}}
#2018-10-1821:18vigilancetechand nothing in the cider error buffer either#2018-10-1821:20dpsuttonwhat is the "on that" in your case? I called cider-inspect on {:a :b} with C-c M-i and it worked for me#2018-10-1821:20dpsuttonby putting point at the end of that form and hitting the chord. what are you doing and where?#2018-10-1821:30vigilancetechIts simply:
(first (mapv :memory @hist))
#2018-10-1821:31vigilancetechI guess I could try it on the literal data structure that came back#2018-10-1821:33vigilancetechsame result#2018-10-1821:34vigilancetechREPL had no problem with it#2018-10-1821:48vigilancetechah, had a middleware mismatch. Thanks @dpsutton!#2018-10-1821:49dpsuttonglad you got it resolved. what do you mean middleware mismatch?#2018-10-1902:05vigilancetech@dpsutton I was trying to use the use the cider-nrepl 0.19.0-SNAPSHOT with refactor-nrepl 2.4.0 and it didn't like it apparently.#2018-10-1907:06MartinI’m having trouble running a cljs repl#2018-10-1907:07MartinI have figwheel and piggieback setup in my dev profile:#2018-10-1907:08Martin{:dependencies [[figwheel-sidecar "0.5.14"]
[com.cemerick/piggieback "0.2.1"]]
:source-paths ["src" "env/dev"]
:cljsbuild {:builds [
{:id "ios"
:source-paths ["src" "env/dev"]
:figwheel true
:compiler {:output-to "target/ios/index.js"
:main "env.ios.main"
:output-dir "target/ios"
:optimizations :none
:target :nodejs}}
{:id "android"
:source-paths ["src" "env/dev"]
:figwheel true
:compiler {:output-to "target/android/index.js"
:main "env.android.main"
:output-dir "target/android"
:optimizations :none
:target :nodejs}}
#_($DEV_PROFILES$)]}
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}#2018-10-1907:10Martin[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- with-profile +dev repl :headless...
[nREPL] server started on 63506
[nREPL] Establishing direct connection to localhost:63506 ...
[nREPL] Direct connection to localhost:63506 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
#2018-10-1907:08Martinand (setq cider-lein-parameters "with-profile +dev repl :headless") in my init.el#2018-10-1907:09bozhidar@martincharlesrichards You need cider/piggieback instead.#2018-10-1907:10bozhidarThe project artifact was changed when Chas handed it over to us.#2018-10-1907:10Martinah, thank you#2018-10-1907:10Martinlet me give that a try#2018-10-1907:13Martinfixed! thank you#2018-10-1909:41bozhidarYou’re welcome!#2018-10-1911:20klausharboI’m working towards a deps.edn-based setup — can I start up a Cider session with -A aliases specified?#2018-10-1911:20klausharboCan’t seem to find it in the docs#2018-10-1911:59dpsuttonI'm surprised that works with figwheel 0.5.14. I thought 16 was the first with cider piggieback support#2018-10-1914:43bozhidar@dpsutton The first with nREPL 0.4 support. 🙂#2018-10-1914:43dpsuttonah i had it backwards. thanks#2018-10-1914:56magraHi, i updated packages and my repl is spewing a few screens of messages messages like the following:
Boxed math warning, cider/inlined_deps/fipp/v0v6v13/corerrb_vector/v0v0v12/clojure/core/rrb_vector/nodes.clj:88:11 - call: public static boolean http://clojure.lang.Numbers.lt(long,java.lang.Object).#2018-10-1914:56magraSeems to be working though.#2018-10-1914:57magracider-version: CIDER 0.19.0snapshot (package: 20181019.812)#2018-10-1915:03dpsuttonhow old was your CIDER before?#2018-10-1915:04dpsuttoni bet you've been getting these warnings forever, they've just gone to the server process buffer rather than your repl#2018-10-1915:05dpsuttonah. i see these are the inlined cider deps#2018-10-1915:10mhcatI just started seeing this too fwiw#2018-10-1915:12bozhidar@j0ni It’s from the upstream dep.#2018-10-1915:12mhcatI also see a full exception at the end#2018-10-1915:12bozhidarThey have to fix the warnings themselves.#2018-10-1915:12mhcatis that the same deal?#2018-10-1915:12bozhidarNope.#2018-10-1915:12bozhidarThat’s different.#2018-10-1915:12mhcatworth a bug report?#2018-10-1915:12bozhidarSeems a recent change is misbehaving.#2018-10-1915:13bozhidarhttps://github.com/clojure-emacs/cider-nrepl/pull/551#2018-10-1915:13bozhidarThat’s the PR which introduced the problem (it added compatibility with Clojure 1.10).#2018-10-1915:13bozhidarDon’t have time to debug this, but I assume the problem is trivial by looking at the stacktrace.#2018-10-1915:15bozhidar@kharbo You can just change cider-clojure-cli-global-options.#2018-10-1915:16klausharbo@bozhidar Thanks#2018-10-1917:13timvisherI have an instance of emacs 25.1.1 install with cider 0.18.0. My project directory looks like this vagrant@taps-tvisher1:/opt/code/docs/scripts/tap-generate-docs$ tree -I 'bin|test'
.
├── deps.edn
└── src
└── tap_generate_docs.clj
and I'm editing tap_generate_docs.clj.
When I M-x cider-jack-in RET, cider prompts me with Are you sure you want to run cider-jack-in' without a Clojure project?`.
Is this a known issue or is there something I can do to fix it?#2018-10-1917:15dpsuttonyou can eval this (clojure-project-dir (cider-current-dir)) to see what it thinks is going on directory wise#2018-10-1917:15timvisherThanks. Sec.#2018-10-1917:16dpsuttonand then (cider-project-type project-dir)#2018-10-1917:16timvishernil#2018-10-1917:16dpsuttonah. anything funky going on? sym links, remote systems, anything like that?#2018-10-1917:16timvisherI guess I should also say that the buffer is TRAMP.#2018-10-1917:16timvisherThat would've been helpful to state up front facepalm 🙂#2018-10-1917:17timvisherBut with emacs 26.1/cider 0.17 this set up works fine.#2018-10-1917:17dpsuttoni have no experience with that. i can only point you towards places#2018-10-1917:17dpsuttonso you downgraded emacs and upgraded CIDER lol#2018-10-1917:17timvisherHeh. Well this is for a friend who's not running my blessed config. 😛#2018-10-1917:18timvisherBut yes, essentially that's what's going on.#2018-10-1917:18timvisherIt would be nice if ELPA allowed installing previous versions.#2018-10-1917:18dpsuttoncheck out clojure-cache-project-dir'`#2018-10-1917:18timvishervariable?#2018-10-1917:18dpsuttonthat might be holding onto something before TRAMP is run. set that to nil if not already#2018-10-1917:18dpsuttonyes#2018-10-1917:18dpsutton(defun clojure-project-dir (&optional dir-name)
"Return the absolute path to the project's root directory.
Call is delegated down to `clojure-project-root-function' with
optional DIR-NAME as argument.
When `clojure-cache-project-dir' is t the results of the command
are cached in a buffer local variable (`clojure-cached-project-dir')."
(let ((project-dir (or clojure-cached-project-dir
(funcall clojure-project-root-function dir-name))))
(when (and clojure-cache-project-dir
(derived-mode-p 'clojure-mode)
(not clojure-cached-project-dir))
(setq clojure-cached-project-dir project-dir))
project-dir))
#2018-10-1917:18dpsuttoni think this is what you need to step through#2018-10-1917:19dpsuttonpossibly its cached locally and not aware to check remotely?#2018-10-1917:19timvisherOh. I have an idea now.#2018-10-1917:19dpsuttongood luck and update us for sure#2018-10-1917:19timvisherI didn't know that cider had a direct dependency on clojure-mode.#2018-10-1917:19dpsuttoni'm sure a PR would be incredibly welcome.#2018-10-1917:19dpsuttonyup#2018-10-1917:19timvisherTheir version of clojure-mode is ancient.#2018-10-1917:20dpsuttoneasy fixes are best fixes 🙂#2018-10-1917:30timvisherSo new nrepl claims to come up correctly but we fail to attach to it over localhost:<port>.#2018-10-1917:30timvisherWhich is probably definitely a weird TRAMP thing.#2018-10-1917:38dpsuttonso you've solved the first bug and now on to a second bug?#2018-10-1917:38timvisherYep. Downgrading to 0.17 gets us past that. So some regression.#2018-10-1917:38dpsuttonoh so the first bug is still present in 0.18? upgrading clojure-mode didn't solve it?#2018-10-1917:39timvisherSorry. No. We're past the first bug. It was a classic melpa v. melpa-stable problem.#2018-10-1917:39timvisherI would've seen that if I had remembered the dependency. 🙂#2018-10-1917:39dpsuttonoh. the bug in 0.18 is in connecting over tramp#2018-10-1917:39timvisherAppears to be yes.#2018-10-1917:39dpsuttonso you can work normally if you downgrade to 0.17#2018-10-1917:39timvisherI can but he can't, it seems. 🙂#2018-10-1917:40timvisherStill digging.#2018-10-1917:40dpsuttonworks on my machine is the worst#2018-10-1917:40timvisherHeh.#2018-10-1917:40timvisherThis is why I have a carefully curated bash/emacs/etc. environment that is shared with all my coworkers so they don't have to think about it.#2018-10-1917:40timvisherBut my friend here doesn't feel like using that. 🙂#2018-10-1917:40timvisherSo we're getting an nrepl op error.#2018-10-1917:41dpsuttonok. that sounds like a more familiar error. any plugins? older versions of clj-refactor?#2018-10-1917:41dpsuttoncheck lein profiles for offenders#2018-10-1917:41timvisherDebugger entered--Lisp error: (error "Invalid byte opcode: op=183, ptr=2")
signal(error ("Invalid byte opcode: op=183, ptr=2"))
error("Invalid byte opcode: op=%s, ptr=%d" 183 2)
cider-jack-in-command("clojure-cli")
cider-jack-in(nil)
funcall-interactively(cider-jack-in nil)
#<subr call-interactively>(cider-jack-in nil nil)
ad-Advice-call-interactively(#<subr call-interactively> cider-jack-in nil nil)
apply(ad-Advice-call-interactively #<subr call-interactively> (cider-jack-in nil nil))
call-interactively(cider-jack-in nil nil)
command-execute(cider-jack-in)
#2018-10-1917:42timvisherI mean his emacs install has a bunch of stuff that I don't run so that could definitely be something. I could emacs -Q and get cider installed and see where we go.#2018-10-1917:42dpsuttonah i think that's easy#2018-10-1917:42dpsuttonnuke *.elc files#2018-10-1917:42dpsuttonthat looks like incompatible emacs byte code which results from emacs X compiling elc and emacs Y running#2018-10-1917:42timvisherAh. Interesting.#2018-10-1917:43dpsuttonyou mentioned differing versions of emacs#2018-10-1917:48timvisherI did. And actually now that you mention it I downgraded him to 0.17 by copying it out of my emacs 26 config. 🙂#2018-10-1917:50dpsuttonah yeah. that'll do it#2018-10-1917:50dpsuttonsource should be fine just wipe those elc files#2018-10-1917:52timvisherGot it. We're in. Thank you for the help. 🙂#2018-10-1917:53dpsuttonfor sure#2018-10-1917:53dpsuttonif yall could take a minute to lodge a ticket about the tramp jack in regression it would be appreciated#2018-10-1917:53dpsuttoni've never really used tramp so i can't put the salient details in#2018-10-1917:59Lyn HeadleyI have a cljs / figwheel project with an ns containing a simple spec: (s/def ::content string?). Is it expected that upon jacking in I would see the ns as an option to select from M-x cider-browse-spec ? Because I don't see it.#2018-10-1918:01timvisher@dpsutton I'll try for it.#2018-10-1918:03creeseI upgraded Cider on Thursday and now this happens. I can’t jack in. Any ideas?#2018-10-1918:42timvisher@creese You may be mixing melpa and melpa-stable reqs.#2018-10-1919:25jeremyI am trying to set the following in spacemacs in the user-config but it doesn't seem to be working. Any idea how to go about debugging it? I have tried with (progn (require 'cider-repl-mode-map) ...)
and without but nothing.
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
#2018-10-1919:25jeremyMaybe a spacemacs question?#2018-10-1919:26dpsuttonyou can't require cider-repl-mode-map#2018-10-1919:27jeremycider-repl-mode instead?#2018-10-1919:27dpsutton(require 'cider-repl)#2018-10-1919:28dpsuttonif you want to require the file that has that var do that with (require 'cider-repl), else just use the var#2018-10-1919:28dpsuttonsince (defvar cider-repl-mode-map ...) is in cider-repl.el#2018-10-1919:29dpsuttonwhat error are you seeing?#2018-10-1919:29jeremyNo error, it just isn't binding.#2018-10-1919:30dpsuttonand those forms are in the init part of the use-package form in spacemacs?#2018-10-1919:30dpsutton(use-package foo
:init
(setq foo-variable t))
(i am neither spacemacs nor use-package user)#2018-10-1919:31jeremyThat's beyond me. I'm pretty new at this. Lol#2018-10-1919:32dpsuttonfair enough#2018-10-1919:32dpsuttonso where in your config are you writing these statements#2018-10-1919:32jeremyI have put them inside of (defun dotspacemacs/user-config () ...) which says it's called at the very end of the spacemacs init after layers config.#2018-10-1919:32dpsuttonok. so what's happening (i think) is that use-package is lazy so even though the config has "run" it hasn't done anything (yet)#2018-10-1919:33dpsuttonso that variable cider-repl-mode-map isn't avaialble since the source hasn't been required yet#2018-10-1919:33dpsuttonso try
(require 'cider-repl)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
#2018-10-1919:33jeremySo that's where I got
(progn
(require 'cider-repl)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return))
#2018-10-1919:34dpsuttonand when you evaluate that (if you know how) does it not add those bindings?#2018-10-1919:34jeremyI'm not sure how to evaluate it. I just restarted emacs (or reloaded the spacemacs dotfile) and it didn't seem to bind them.#2018-10-1919:35dpsuttonno worries 🙂#2018-10-1919:35dpsuttonput your cursor at the closing ) and we want to run eval-last-sexp#2018-10-1919:36dpsuttondo you know how to invoke m-x? I'm not sure how to do that in spacemacs#2018-10-1919:36dpsuttonand in fact #spacemacs might prove more helpful#2018-10-1919:36dpsuttonat this point#2018-10-1919:36jeremyYep alt-x 😉#2018-10-1919:36jeremyI can ask there though. I didn't realize it existed before posting here.#2018-10-1919:37dpsuttonso its the same. alt is "meta" which is the m in m-x#2018-10-1919:37jeremyYep#2018-10-1919:37dpsuttonyeah if you have questions about cider specific stuff i'm happy to help. i just think that channel will be able to quickly get you up and running with your config#2018-10-1919:39jeremyJust to answer the last bit. I eval'd it and it worked. :thumbsup: I'll move this to that channel to figure out how to get it to load with the user-configs. I appreciate the help.#2018-10-1919:42dpsuttonawesome. yeah i'm sure there's a convention they can show you#2018-10-2115:16theeternalpulseI have cider-auto-test mode running and am testing something that deals with namespaces, so in the test I set up a namespace before the test namespace and every time it loads it adds a (:require... statement to the topmost namespace, which isn't necessary. Even if I use in-ns it does this.#2018-10-2115:18dpsuttonIt adds text to the ns form you mean?#2018-10-2115:18theeternalpulseso i have (in-ns 'top-level)
(defn...)
(defn...)
(ns my-proj.core-test
(:require [my-project.core :as core]))
#2018-10-2115:19theeternalpulseand when I do something like core/ <--- insert slash and it does a lookup#2018-10-2115:19theeternalpulseit throws a runtime error and does this
(in-ns 'top-level
(:require [my-project.core :as core])
(defn...)
(defn...)
(ns my-proj.core-test
(:require [my-project.core :as core]))
#2018-10-2115:21dpsuttonThis is almost certainly a bug in clj refactor. I think lots of tooling assume the first form of a file is the ns form#2018-10-2115:21theeternalpulsemaybe creating a temp namespace is not the proper way to do it, should it just go in it's own file?#2018-10-2115:22theeternalpulseyeah, I figured it was the case. but I was thinking there was a variable that can control that behavior, or tell it to ignore in-ns forms#2018-10-2115:24theeternalpulsemaybe it's this cider-test-infer-test-ns is a variable defined in ‘cider-test.el’.
Its value is ‘cider-test-default-test-ns-fn’
Documentation:
Function to infer the test namespace for NS.
The default implementation uses the simple Leiningen convention of appending
’-test’ to the namespace name.
#2018-10-2115:24theeternalpulseI'll just save the headache and do the one ns per file#2018-10-2115:25dpsuttonI doubt it is that#2018-10-2115:26theeternalpulseright, I see my dummy ns doesn't end with -test#2018-10-2115:26dpsuttonIt's clj refactor automatically adding a required ns. And also noticing that you lack a ns declaration (according to it's logic)#2018-10-2115:28dpsutton(i'm guessing)#2018-10-2115:31bozhidarYeah, that’s true.#2018-10-2115:32bozhidarThere’s https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L51#2018-10-2115:33bozhidarIt’s the only config that can result into an auto-added ns form to my knowledge.#2018-10-2115:34bozhidarGenerally much of the code in clojure-mode assumes a single ns form, so using in-ns is a recipe for problems.#2018-10-2115:34bozhidar(although there’s also code that checks for the closes ns preceding the point)#2018-10-2115:42theeternalpulsegotcha, I updated my test to avoid it#2018-10-2116:45kingcodeIs there a way to setup lein with-profile +cljs-dev figwheel from within my project file? I am trying to use core.matrix from clojurescript, following the instructions, but am running figwheel from within CIDER…Thanks for any advice..#2018-10-2116:47dpsuttonCIDER has defvars that you can set globally or override per project. here are the dir locals for my work project:
((nil . ((cider-lein-global-options . "with-profile dev")
(cider-default-cljs-repl . figwheel))))
#2018-10-2116:47dpsuttonmore info: http://endlessparentheses.com/a-quick-guide-to-directory-local-variables.html#2018-10-2116:48kingcodeThanks @dpsutton, will look at that..#2018-10-2116:56kingcode@dpsutton Actually, I just found out from the shell prompt that cljs-dev profile doesn’t exist. I know this isn’t CIDER related…#2018-10-2117:21dpsuttonIt looks like it's just cljs not cljs-dev#2018-10-2117:22dpsuttonAlso bump the piggieback and figwheel versions. #2018-10-2117:22dpsuttonTo the cider versions#2018-10-2118:29kingcode@dpsutton ok thx…I restarted CIDER and it’s working now - probably just a hiccup#2018-10-2118:29kingcodeStill working with CIDER 15, need to upgrade…#2018-10-2119:23mathpunkIs there a way to find unbalanced parentheses? Last night I was able to run new figwheel-main projects in cider, but now when I start a new project, I get an unmatched delimiter error, with no hint as to where to even look#2018-10-2119:27mathpunk:thinking_face: it seems like I can still use old-figwheel --- I don't need to do anything fancier than look at generated svg so this probably works for now#2018-10-2119:23hlollidoes someone know how to inject depdencency (and append it to pre-existing deps) with .dir-locals.el ?#2018-10-2119:23hlolliI'm running Cider with tools.deps if that's a factor#2018-10-2119:32dominicm@hlolli there's two parameters which matter with clojure, one of them pertains to "prefix" flags, put -Sdeps there. I think multiple -Sdeps merge.#2018-10-2119:34hlolli@dominicm Do you know which cider variable defines the prefix flags on top of your head? I could theoretically as well append full path to a .jar to the java classpath?#2018-10-2119:34dominicm@hlolli I don't, I just remember that there's two of them, I think they both start with clojure, one of them has parameters in the name.#2018-10-2119:35hlolliok thanks, I'll grep it out 😉#2018-10-2119:35dominicm@hlolli I'm not sure what happens if you add a :path key with -Sdeps, never tried. But you could definitely do it if you gave it a coordinate.#2018-10-2206:38vigilancetechNow I'm trying to take the shadow-cljs electron example code (https://github.com/shadow-cljs/examples/tree/master/electron) and connect to the main and renderer processes with emacs cider-connect-cljs (renderer first) then with cider-connect-sibling-cljs (main). When I do the renderer everything looks okay (other than a middleware mismatch error cuz I'm using the latest snapshot) but when I do the sibling it appears to give me the same repl and it has a bunch of errors:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; 'cider-repl-display-help-banner' to nil.
;; ======================================================================
shadow.user>
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings. To quit, type: :cljs/quit
[:selected :renderer]
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:55)
WARNING: Use of undeclared Var shadow/watch (<stdin> at 1:55)
WARNING: No such namespace: shadow, could not locate shadow.cljs, shadow.cljc, or JavaScript source providing "shadow" (<stdin> at 1:76)
WARNING: Use of undeclared Var shadow/nrepl-select (<stdin> at 1:76)
cljs.user>
there's a 2nd repl buffer that is created with similar, but not quite exactly the same, results:
...
;;
;; You can remove this message with the <M-x cider-repl-clear-help-banner> command.
;; You can disable it from appearing on start by setting
;; 'cider-repl-display-help-banner' to nil.
;; ======================================================================
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
shadow.user> TypeError: shadow.watch is not a function
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:4:8)
at eval (eval at <anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8), <anonymous>:7:3)
at file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:829:8
at Object.shadow$cljs$devtools$client$env$repl_call [as repl_call] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:139:108)
at Object.shadow$cljs$devtools$client$browser$repl_invoke [as repl_invoke] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:827:46)
at shadow$cljs$devtools$client$browser$handle_message (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:907:44)
at Object.shadow$cljs$devtools$client$env$process_ws_msg [as process_ws_msg] (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.env.js:258:102)
at WebSocket.<anonymous> (file:///home/kevin/0work/examples/electron/app/js/cljs-runtime/shadow.cljs.devtools.client.browser.js:1002:40)
shadow.user>
The 2nd repl's buffer status says it's only pending. The renderer repl doesn't initially have those (non-middleware) errors until after the sibling is created.
From the terminal(s) the repls work perfectly. The renderer can do things like (js/alert "foo") and it works. The main issues an error when trying to do that (as it should because its only the launcher).
Help!?!?#2018-10-2210:20bozhidarLikely you don’t have refactor-nrepl in your deps. I guess if you don’t need it you can simply remove clj-refactor (or its warnings) and you’ll be just fine.#2018-10-2210:21bozhidarFor the other part of your problem you need someone like @thheller. 🙂#2018-10-2210:28thheller@bozhidar I have no clue how emacs handles multiple CLJS repls but to me it looks like code intended for a CLJ REPL is getting sent to a CLJS REPL instead#2018-10-2210:29bozhidarAh, probably you’re right.#2018-10-2210:29bozhidarI missed#2018-10-2210:29bozhidar> The 2nd repl’s buffer status says it’s only pending. The renderer repl doesn’t initially have those (non-middleware) errors until after the sibling is created.#2018-10-2210:31bozhidarWhat’s the type of this REPL buffer?#2018-10-2210:33thhellerno clue. no idea what either cider-connect-cljs or cider-connect-sibling-cljs do#2018-10-2210:33thhellershadow-cljs only provides a CLJ nrepl you can connect to directly. everything else is handled by the user.#2018-10-2210:42bozhidar@thheller Recent changes. Those commands connect to a Clojure REPL and upgrade it automatically to cljs (the difference between the two is that one create a new session in CIDER, the other adds a connection to the existing session).#2018-10-2212:33vigilancetech@bozhidar the 2nd buffer says its a "pending-cljs" type#2018-10-2212:34thhellerthe first one is already broken too .. those warnings also mean that (shadow/watch ...) was eval'd in a CLJS context not CLJ#2018-10-2212:38vigilancetechwell, that was something I meant to ask you. Is the watch command correct on that example? shadow-cljs watch main renderer
My understanding is there's supposed to be two processes. Does that create two? Like I said, from the terminal repl everything seems to be fine so I'm assuming so but just wondering. Shouldn't there be two nrepl's? It seems that both repls are connecting to the same port (at least from cider)#2018-10-2212:38thhellerthere is only one JVM process and 2 build processes (threads) running inside that#2018-10-2212:39thhellerso yes only one nREPL which is CLJ and you can upgrade to CLJS#2018-10-2212:39vigilancetechand so only one nrepl socket port#2018-10-2212:46vigilancetech@bozhidar I have the [refactor-nrepl "2.4.0"] in the shadow-cljs.edn file (along with [cider/cider-nrepl "0.19.0-SNAPSHOT"])#2018-10-2212:59vigilancetechso do(es) my issue(s) above constitute a bug I should report do you think?#2018-10-2213:07vigilancetechwhat is the difference between shadow and shadow-select when selecting the session type?#2018-10-2213:09vigilancetechwhen I just do cider-connect-cljs instead of cider-connect-sibling-cljs for the 2nd repl the pending repl issues this error instead of the namespace ones above:
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.#2018-10-2213:10vigilancetechelectron is running by executing electron . in the project folder#2018-10-2300:00dsiegelRunning tests isn't behaving the way I expect. I have src and test directories in my classpath. If I cider-jack-in on a module in the src directory, and C-c C-t C-n, it reports that it can't find the corresponding test file. If I explicitly load C-c C-K the test file, then go back to the source file, and execute C-c C-t C-n, the tests run as expected. Is cider supposed to find and load the tests, or am I expected to load them manually?#2018-10-2300:29dpsuttonWhat are the namespaces. It can do it if they are identical except for -test#2018-10-2300:59dsiegelThey are identical except for -test. It works as expected if I explicitly load the -test namespace. Is cider supposed to load the -test namespace implicitly?#2018-10-2301:24dpsuttonCider will look for the test ns by tacking on "-test"#2018-10-2302:00dsiegelIF I cider-jack-in from file.clj, and C-c C-t C-n, it tells me no test namespace: file-test. If I go to file_test.clj and C-c C-k, then go back to file.clj and C-c C-t C-n, it runs the tests.#2018-10-2302:04dsiegelSo, it looks as though it correctly identifies the namespace, but can't load it implicitly. If the namespace is loaded explicitly, it uses it.#2018-10-2302:33dpsuttonAre you sure the test dir is on the class path for the current alias or profile?#2018-10-2303:52dsiegelYes. My project's src and test directories are the first 2 entries shown by (println (clojure.string/join "\n" (seq (.getURLs (java.lang.ClassLoader/getSystemClassLoader))))) evaluated in the repl.#2018-10-2303:55dsiegelMy deps.edn file has :paths ["src" "test"]
I'll eventually want to move the test path to a dev alias :extra-paths, but I'm trying to keep things simple while I figure this out.#2018-10-2309:35bozhidar@vigilancetech Please, file some ticket about this so we won’t lose this conversation. I’m super busy these days and those Slack convos disappear too quickly.#2018-10-2312:11bhaumanhow do I set the clojure cmd alias flags again?#2018-10-2312:11bhaumanI have to jot this down somewhere.#2018-10-2312:16bhaumancider-clojure-cli-global-options#2018-10-2312:33dpsutton@bhauman #2018-10-2312:34dpsuttonOh sorry. Those are lein. And I agree these should be easier#2018-10-2312:54bozhidar@dpsutton @bhauman All those conversation make me wonder if we should have just a single config var per “build tool”.#2018-10-2312:54bozhidarRight now there’s command, params and global options for everything.#2018-10-2312:55bozhidarI think we modelled everything that exists after lein, as it was the first (and only) build tool we supported for quite a while.#2018-10-2312:56bozhidarFrankly, even I’m confused by what’s a global param and what’s an option. 🙂#2018-10-2312:56dpsuttonwith clj and even lein profiles, it would be nice if it would paste what the command was and let you add in profiles or aliases. which i'm assuming is what bruce needs#2018-10-2312:56dpsuttonjust quick edit the command in the minibuffer#2018-10-2312:57bozhidarBut that is a step in the other direction - adding more knowledge about the build tools in CIDER.#2018-10-2312:57bozhidarAs some point you could actually treat lein profile specially, but we removed this we added support for boot.#2018-10-2312:58bozhidarOn one hand - that’s one of the simplest part of the codebase, but on the other hand the optimal choices are not really apparent.#2018-10-2312:59bozhidarOps, I misread your message.#2018-10-2312:59bozhidarYeah, that’s true. That’s where we have to go IMO.#2018-10-2313:00bozhidarJust a single string to which we append whatever we have to for the auto-injection to work.#2018-10-2313:04dpsuttonyeah. or it can even be after the injection so we don't have to try to figure out where that has to go#2018-10-2313:05dpsuttonclj tooling has made it dead simple to add aliases which alter class paths, add dependencies, etc. need to be able to react#2018-10-2313:12orestisFWIW due to this I’ve stopped using cider-jack-in and just start a cider-specific nRepl on the terminal, then connect. With tools.deps it’s trivial to inject the dependencies etc etc so I just added an alias that does just that. I guess I have to update that whenever CIDER updates, but that’s fine for now.#2018-10-2313:23bhaumanunfortunately order does matter here and I think in most cases folks want to use the behavior that you have but simply need to change the aliaes and such that comes before the -m nrepl#2018-10-2313:24bhaumanin the case of Clojure CLI#2018-10-2313:27bozhidarYep, I agree.#2018-10-2313:27bozhidarAnyways, I think that’s some simple changes can yield solid usability improvements. We just need to decide in which direction we want to go.#2018-10-2314:38bhaumanyou could even detect the if there is a last -m arg coming from the user and then make a decision from there#2018-10-2317:01jherrlinHey! I am using clj and cljs in my project and facing a problem when evaluating code from
files using cider-eval-last-sexp. Cider dont understand what file I am visiting and
evaluates the code in the correct REPL, instead it's evaluated in the most recent REPL.
This is often a problem as I jump back and forth between clj and cljs files. Can I easily fix
this somehow?#2018-10-2317:15dpsuttonwhat version of CIDER are you using. this sounds like a 0.17 problem#2018-10-2317:23jherrlinCIDER 0.19.0snapshot (package: 20181021.830)#2018-10-2318:53jeremyWhen I use cider connect with a hostname it doesn't allow me to specify the port. It just tries to connect to hostname. If I type in hostname:port, it then asks me to add the port.#2018-10-2321:44bozhidar@jeremy642 Can you be more specific about this? Normally you’ll prompted for the host first and the port afterwards.#2018-10-2415:11jeremy@U051BLM8F When I run cider connect, it ask for host. As soon as I type in the host, it tries to connect (Opening connection for host, waiting for prompts from remote shell message) to the host and does not ask for port.#2018-10-2415:34bozhidarSeems to me you’re using tramp and probably some ssh tunneling is happening automatically.#2018-10-2415:35bozhidarI can’t imagine any other reason why something like this can happen.#2018-10-2415:42jeremyI'm not sure what tramp is. Anywhere I can look it up? SSH tunneling maybe. I have an ssh config for ssh username setting. I also am behind a corporate proxy which is known to cause problems.#2018-10-2415:46bozhidarSo, you’re not trying to connect to a locally running nREPL, right?#2018-10-2415:47jeremyI am trying to connect to a remote repl. I'm not even sure if it's possible to connect to it. I was just trying to get it to let me type in the port. If I type in the host incorrectly such as host:port in the host field, it then asks me for port. But if I just type the host in, it doesn't ask me for port.#2018-10-2416:20bozhidarThere’s some config that we always try to tunnel remote connections via ssh for security reasons. Let me see where this setting was.#2018-10-2416:21bozhidar(defcustom nrepl-force-ssh-for-remote-hosts nil
"If non-nil, do not attempt a direct connection for remote hosts."
:type 'boolean
:group 'nrepl)
(defcustom nrepl-use-ssh-fallback-for-remote-hosts nil
"If non-nil, attempt to connect via ssh to remote hosts when unable to connect directly."
:type 'boolean
:group 'nrepl)
#2018-10-2416:21bozhidarI see both are disabled, but maybe you’re on a different version.#2018-10-2416:30jeremyI am on 0.18.0 snapshot of cider. You know, I never did try with IP instead of the host. I just tried that and it asked for the port and connected.#2018-10-2321:56justinbarclayI have a CLJS app and I am running CIDER 0.19.0snapshot (package: 20181021.830). I think remember being able to call cider-find-var for thing at point and it would find the var declaration in my current namespace or in the some other namespace. Now cider-find-var will only find var if it belongs into another namespace. Is there something I need to change or configure to get back the old behaviour?#2018-10-2322:16dpsuttonwow that is surprising. what does it say when the var is defined in the current ns?#2018-10-2322:17dpsuttonand just to make sure, this isn't a let binding var, right (which has never been supported)#2018-10-2322:24justinbarclayThese are for defn and in the *Message* buffer it outputs user-error: Symbol 'thing' not resolved#2018-10-2322:31richiardiandreaI am putting together a fork of Emacs live but Clojure centric - it is here but this is very very early days and I don't think anything, including installing, works at the moment: https://github.com/arichiardi/clojure-live#2018-10-2323:33prePast Cider user here, currently on 0.18 and upgraded to use new piggieback and figwheel and can’t use both clj/cljs repls anymore (cljs works, clj doesn’t).
In previous versions, I launched an nrepl with cider-jack-in, and started (start-figwheel!) and (cljs-repl) manually to work with clj, cljc, and cljs files. However with 0.18 version I can no longer use the clj repl after firing up cljs-repl. Here’s the error after evaluating a clojure form: “no clj repls in current session”. When i cider-jack in again (from clj file) to start a ‘sibling repl’ cider hangs and no repl is started.
What has changed and how do you enable clj repl after starting cljs repl?
Here’s project.clj
:plugins [[lein-figwheel "0.5.16"]
[lein-cljsbuild "1.1.7" :exclusions [[org.clojure/clojure]]]]
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target" "test/js"]
:cljsbuild {:builds [{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:open-urls [""]}
:compiler {:main basic-component.core
:asset-path "js/compiled/out"
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:pretty-print false
:preloads [devtools.preload]}}]}
:profiles {:dev {:dependencies [[binaryage/devtools "0.9.9"]
[cider/piggieback "0.3.10"]
[figwheel-sidecar "0.5.16"]]
:source-paths ["src/cljs"]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}})
Thanks!#2018-10-2410:11hlolliIs this cider error or error in my code
Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type")
format("%26s:%5d %s/%s" nil nil nil nil)
cider-stacktrace-render-frame(#<buffer *cider-error*> nil)
cider-stacktrace-render-cause(#<buffer *cider-error*> (dict "class" "java.lang.ClassCastException" "id" "25" "message" nil "session" "d697d375-105c-4302-ae23-85a964ca5c76" "stacktrace" (nil)) 1 "Unhandled")
cider-stacktrace-render(#<buffer *cider-error*> ((dict "class" "java.lang.ClassCastException" "id" "25" "message" nil "session" "d697d375-105c-4302-ae23-85a964ca5c76" "stacktrace" (nil))) nil)
cider--render-stacktrace-causes(((dict "class" "java.lang.ClassCastException" "id" "25" "message" nil "session" "d697d375-105c-4302-ae23-85a964ca5c76" "stacktrace" (nil))))
cider--handle-stacktrace-response((dict "id" "25" "session" "d697d375-105c-4302-ae23-85a964ca5c76" "status" ("done")) ((dict "class" "java.lang.ClassCastException" "id" "25" "message" nil "session" "d697d375-105c-4302-ae23-85a964ca5c76" "stacktrace" (nil))))
#f(compiled-function (response) #<bytecode 0x20da169>)((dict "id" "25" "session" "d697d375-105c-4302-ae23-85a964ca5c76" "status" ("done")))
nrepl--dispatch-response((dict "id" "25" "session" "d697d375-105c-4302-ae23-85a964ca5c76" "status" ("done")))
nrepl-client-filter(#<process nrepl-connection> "d2:id2:257:session36:d697d375-105c-4302-ae23-85a964ca5c766:statusl4:doneee")
code (reader error?)
(kick :loop "^5 0*2 0 0 10 0" -6 :rate [1 1 1 2 1] :fx [(freeverb)])
#2018-10-2410:13bozhidar@hlolli Are you on Clojure 1.10?#2018-10-2410:13bozhidarSeems the stacktrace is not the in right format.#2018-10-2410:14hlolliI'm on 1.9.0#2018-10-2410:15bozhidar> format(“%26s:%5d %s/%s” nil nil nil nil)#2018-10-2410:16bozhidarThe error is that here you got a bunch of unexpected nils, but I’m not certain why.#2018-10-2410:16hlolliI'm on the newest tools.deps, thinking if that overwrites my clojure version, I'm aware of all the stacktrace work on 1.10.0, so it would make sense it's being used, I'm cheking the classpath..#2018-10-2410:17bozhidar@pri How do you start CIDER?#2018-10-2410:18hlollicider-jack-in, with profile addition and this stuff as well, I added few days ago
(cider-add-to-alist 'cider-jack-in-dependencies "cfft" "0.1.0")
(cider-add-to-alist 'cider-jack-in-dependencies "net.mikera/core.matrix" "0.62.0")
(cider-add-to-alist 'cider-jack-in-dependencies "rm-hull/markov-chains" "0.1.1")
#2018-10-2410:19hlollidirlocal for this project
((nil
(cider-clojure-cli-global-options . "-A:live") ))
#2018-10-2410:20hlolliand it's for sure 1.9.0, the classpath from tools.deps indicates that#2018-10-2410:24hlolliI think I know what caused it, but no idea why it caused it. I was requireing stuff, that blocks, and the throws error on timeout. I got timeout and still wen on evaluating. In that case, the error came. When it succeds, I don't get this.
added: I realized not afterwards that you were pinging someone else with that quesiton 😄#2018-10-2416:24pre@bozhidar cider-jack-in to start nrepl first before manually starting figwheel/cljs-repl in the nrepl. This was the behavior that worked for me for over 2.5 years.#2018-10-2416:26bozhidar@pri Got it. Please, file a ticket about this.#2018-10-2416:27bozhidar(generally the expectation is for people to use cider-jack-in-cljs, but if something was working for you and we broke it we should at least check if we broke something accidentally)#2018-10-2416:28precider-jack-in-cljs never worked for me with figwheel.#2018-10-2416:31bozhidarIt should be working now. 🙂#2018-10-2416:31bozhidarBut I don’t much cljs outside of testing stuff for CIDER, so what do I know. 😄#2018-10-2416:32preIt takes two minutes to test it out, Try 'lein new fighweel demo and start cider-jack-in-cljs and see yourself.#2018-10-2416:35dpsuttonworked for me#2018-10-2416:35dpsuttonlein new figwheel demo, i bumped the piggieback version to 3.9 from 3.1. cider-jack-in-cljs and chose figwheel from the list of options#2018-10-2416:36dpsuttoni'm on master probably from about 2 weeks ago or so. recent-ish#2018-10-2416:37dpsuttoni run a figwheel app for work every day and now have 2 other figwheel main apps. has been easy going for me. i'm sorry you are running into issues#2018-10-2416:40preI’m on cider 0.18 and I select figwheel after cider-jack-in-cljs and a repl opens with figwheel. But evaluating a form in cljs file throws “npo Cljs REPLs in current session”. You can’t even type (use 'figwheel-sidecar.repl-api) as it throws spec errors.#2018-10-2416:40preMaybe you have some magic in your local?#2018-10-2416:41bozhidar@pri Likely you have an old version of piggieback?#2018-10-2416:41preI pasted my version above.#2018-10-2416:41bozhidarThis can mess up the REPL type detection logic. What are you currently using.#2018-10-2416:41bozhidarHmm, with this you should be solid.#2018-10-2416:41dpsuttoni didn't know 3.10 was out#2018-10-2416:42bozhidarIt’s recent and it can’t possibly break things.#2018-10-2416:42bozhidarIt just adds a couple of new cljs bindings that were missing.#2018-10-2416:42dpsuttonoh yeah. just musing.#2018-10-2416:42dpsuttoni need to follow along with that more#2018-10-2416:42dpsutton@pri when you cider-jack-in-cljs do you see the repl type in the modeline as "pending-cljs"?#2018-10-2416:45preI don’t see anything in modeline but i can see the dropdown of options (this is new in 0,18, I think, and needlessly confusing). When I select figwheel i get “nrepl Direct connection to localshot… established” and a fighweel repl opens.#2018-10-2416:48preCan you confirm if you’re using 0.18 master (not snapshot?) and Jvm/figwheel/piggieback version#2018-10-2416:49dpsuttoni'm tracking master but not completely up to date. figwheel 5.16, piggieback 3.9 and jvm 1.8#2018-10-2416:52preSo you’re not testing on 0.,18 release.#2018-10-2416:56dpsuttonno i have a local copy of the repo#2018-10-2417:00prePerhaps you shouldn’t say ’it works for me” then 🙂
I have a linux and a mac and confirm that on a fresh fighweel demo project cider-jack-in-cljs in cider 0.17 opens up a fighweel cljs repl and I can evaluate forms in all three files (clj/cljc/cljs).
The same doesn’t work in cider 0.18. Besides there are other issues with 0,.18 that make it unsuable (killing buffers will not restart repls).#2018-10-2417:00dpsuttonsorry to waste your time 🙂#2018-10-2417:00preDoes anyone else find these issues and would you recommed downgrading to 0.17?#2018-10-2417:02preI appreciate your time @dpsutton, just saying that I had a detailed explanation of my error with all versions listed and steps to recreate.#2018-10-2417:22preI made some progress: Upgraded to cider 0.19-Snapshot (20181024.1017). Starting cider-jack-in-clj-&-cljs now opens clj and cljs repls; figwheel starts successfully and opens its repl and I can eval cljs forms. However evaluating clj still says “no clj repls in current session”. Suggestions?#2018-10-2420:58richiardiandreahaving all sorts of problems today - not even cider-mode gets assigned to my buffer ...might be unlucky day lol#2018-11-2516:34bozhidar@alexyakushev Not at all. I’ve been swamped with work lately, so delaying the release is fine by me.#2018-11-2516:37alexyakushevThanks! Would you bump the dependency or should I?#2018-11-2517:00bozhidarI’ll do it now.#2018-11-2517:05bozhidarDone.#2018-11-2600:43danielcomptonHey Ciderers, I've opened a thread on Clojureverse about building a common Clojure code formatting tool. https://clojureverse.org/t/clj-commons-building-a-standard-code-formatter/3240. Interested in people's thoughts on the idea, whether it is doable, how it could work in Emacs, e.t.c.#2018-11-2602:13bozhidar@danielcompton Great post! I’ll jot down some thoughts there when I can.#2018-11-2715:53futuroI'm so grateful for add-missing-libspec! It's so nice to type in some namespace alias or class name and then add it super quick with add-missing-libspec. Saves me so much typing!#2018-11-2718:40fiddlerwoaroofSlime has this opt-in feature where you can call something like (swank:eval-in-emacs '(some code))
and get the results of the evaluation (mostly only useful for primitive types.#2018-11-2718:40fiddlerwoaroofDoes Cider/NREPL offer anything similar?#2018-11-2720:55bozhidar@fiddlerwoaroof perhaps https://github.com/clojure-emacs/clomacs?#2018-11-2720:55bozhidarI never used eval-in-emacs, but I assume the resulting code is evaluated as Emacs Lisp, right?#2018-11-2720:56bozhidarProbably this made a lot more sense for Common Lisp, given how similar it is to Emacs Lisp.#2018-11-2721:46fiddlerwoaroofYes#2018-11-2721:46fiddlerwoaroof@bozhidar I use this for things like having emacs pop up a non-echoing password prompt#2018-11-2721:48fiddlerwoaroof(instead of putting passwords in string literals)#2018-11-2721:48fiddlerwoaroofthanks for the pointer to clomacs, it looks like it might help me do what I want to do#2018-11-2721:51michaellindonis there a way to get cider to reformat my code subject to a line length limit#2018-11-2721:51michaellindoni.e. inserting newlines where appropriate,#2018-11-2816:09bmabeyHow do I specify what alias to use in a deps.edn when firing up a cider repl? For example, I'm trying to use this deps file https://github.com/pedestal/pedestal-ions-sample/blob/master/deps.edn and the logging deps are not being loading for my env. I think I would need to use the log alias when starting nrepl.#2018-11-2816:11kardanCreatea a .dir-locals.el and set cider-clojure-cli-global-options to your options e.g. “-A:log”#2018-11-2816:12orestisOr if you want more control, fire up the nrepl outside emacs, then cider-connect to it. You have to copy the command that cider uses (to get the cider-nrepl dependency).#2018-11-2816:17bmabeyGreat, thanks for the quick tips!#2018-11-2910:16ChrisI think there’s yet another way to do this: call cider-jack-in with a prefix arg C-u to get more prompts on the command to use.
You can also customize the clojure-cli command options to add your alias. I’ve done this to always add -Adev because all my projects use this alias. If the alias isn’t found there is no error too. #2018-11-2910:06plexushey folks I accidentally pushed to the clojure-emacs/cider-nrepl instead of my own fork... I undid it as soon as I realized (force pushed back to 4610439e68). It was there for maybe ~20 seconds. If you happened to pull/fetch during that time then I'm very sorry! If you see something weird on CI then... that was me. Apologies!#2018-11-2912:00plexusin related news we could use some help getting CI back on track. I've identified four separate issues that are keeping our builds from going green: https://github.com/clojure-emacs/cider-nrepl/issues/569#issuecomment-442807483#2018-11-2914:28David Renonoob question: if I have cider running and need to add a library (`:require`), it’s not downloaded to the project and won’t work until something like lein gets the code. Does cider use lein or something like it when starting to get code specified in the project.clj file? If not, is there a “best way” to download the library? Should I drop to an eshell and use lein to download? Can I just restart cider and it will trigger the download?#2018-11-2914:32David Renolooks like cider-quit followed by cider-jack-in gets it done. Guessing cider-restart does the same. Still not sure if cider uses lein or something else to download the library.#2018-11-2914:34dpsuttonCider constructs an invocation to lein, boot, or clj to start your app with the cider code inside of it. You should see a message and you jack in of the exact command that it is running#2018-11-2914:35plexus@U11BV7MTK beat me to it 🙂 you can find the exact invocation it uses in your *messages* buffer#2018-11-2914:36plexusthere are some projects which will allow you to add dependencies without restarting (pomegrenate, alembic), but you then need to make sure they are added to the project first. They also have some issues with newer versions of Java unfortunately. If you don't mind rebooting Clojure that's the easiest option.#2018-11-2914:37David Renothanks for the reply. So generally, when changing the project file, I should do a cider-restart?#2018-11-2914:41plexusyes#2018-11-2914:48practicalli-john@UBMFBEWKY if you have clj-refactor enabled, you can use cljr-add-project-dependency which will help you find the available library and version, add it to the project and hotload it into the REPL. https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency#2018-11-2914:54David Reno@U05254DQM, I must not have it added, I can run it but get some error messages at the bottom of my console. I’ll keep it in mind for the future, for now, I need to keep going without getting too stuck on the myriad of cool things I can do. Thanks for the suggestion!#2018-11-2914:59practicalli-john@UBMFBEWKY its optional package in the Clojure layer for Spacemacs. If you do decide to try it, add the following variable to the clojure layer in .spacemacs, rather than just the word clojure
(clojure :variables
clojure-enable-clj-refactor t)#2018-11-2915:05David Renodoes that go in .emacs.d/layers/+lang/clojure/config.el or just the spacemacs dotfile? Anywhere in particular in the dotfile?#2018-11-2915:08David Renotrying here…#2018-11-2915:11David Renothat didn’t seem to work. Restarted spacemacs but still get the error messages.#2018-11-2915:30practicalli-johnthe screenshot of the edit is in the right location, however you should remove the line with just the word clojure, otherwise I assume it ignores the line with clojure and the variable. I do recommend restarting Spacemacs after saving this change, although you can probably just do SPC f e R to reload the config.#2018-11-2915:39practicalli-john@UBMFBEWKY for reference, here is the layer section of my .spacemacs file https://gist.github.com/jr0cket/543b93bfe2b0c38c6c0486b8002c7ab2#file-spacemacs-el-L35-L95#2018-11-2917:12bozhidarBtw, we’ve killed the hotloading feature in the latest clj-refactor, as it wasn’t playing well with Java 9+.#2018-11-2917:13practicalli-johnah, interesting. Good to know.#2018-11-2917:14bozhidarNow this can be done easily without clj-refactor, though - https://nrepl.xyz/nrepl/usage/misc.html#2018-11-2917:14bozhidarYou just need to be using a newer version of nREPL that supports this.#2018-11-2917:32dpsuttonany word on a new lein version with the new nrepl? that's still a blocker yes? it would be nice if someone at the conj could be persuaded to cut a new release#2018-11-2918:25David RenoI have java10 installed which apparently doesn’t have javax.xml.bind.DatatypeConverter, so I’m still getting the error message trying to use clj-add-project-dependency.#2018-11-2919:11practicalli-john@UBMFBEWKY I suggest sticking with Java 8 for Clojure in general. Although Clojure and most libraries will work there are several little gotchas with newer versions of Java. Once Java 11 is more established, then I would consider moving over. I would also recommend openjdk from https://adoptopenjdk.net/ rather than the version from Oracle (which adds a few proprietary things on top of openjdk)#2018-11-3012:43achikinI'm trying to start shadow-cljs repl from cider#2018-11-3012:43achikin[nREPL] Starting server via /Users/achikin/.nvm/versions/node/v8.11.2/bin/npx shadow-cljs -d org.clojure/tools.nrepl:0.2.13 -d cider/piggieback:0.3.9 -d refactor-nrepl:2.4.0 -d cider/cider-nrepl:0.18.0 server...
Quit [2 times]
[nREPL] server started on 54547
[nREPL] Establishing direct connection to localhost:54547 ...
[nREPL] Direct connection to localhost:54547 established
[nREPL] Establishing direct connection to localhost:54547 ...
[nREPL] Direct connection to localhost:54547 established
error in process filter: user-error: Figwheel-sidecar is not available. Please check
error in process filter: Figwheel-sidecar is not available. Please check
#2018-11-3012:44achikinShould I have figwheel-sidecar in dependencies?#2018-11-3013:36bozhidarOnly if you’re using figwheel. That’s very weird.#2018-11-3014:20achikinI'm migrating from figwheel to shadow. Maybe that's because I still have figwheel configuration bits in the project.clj.#2018-11-3014:21achikinAnyway, as far as I understand I can remove sidecar safely and still be able to use shadow-cljs, right?#2018-11-3014:25bozhidarYeah, certainly.#2018-11-3014:40achikinShow: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (23 frames hidden)
1. Unhandled clojure.lang.ExceptionInfo
missing instance
{}
core.clj: 4739 clojure.core/ex-info
core.clj: 4739 clojure.core/ex-info
runtime.clj: 11 shadow.cljs.devtools.server.runtime/get-instance!
runtime.clj: 8 shadow.cljs.devtools.server.runtime/get-instance!
api.clj: 130 shadow.cljs.devtools.api/worker-running?
api.clj: 128 shadow.cljs.devtools.api/worker-running?
api.clj: 207 shadow.cljs.devtools.api/watch
api.clj: 201 shadow.cljs.devtools.api/watch
api.clj: 205 shadow.cljs.devtools.api/watch
api.clj: 201 shadow.cljs.devtools.api/watch
REPL: 1 user/eval55989
REPL: 1 user/eval55989
Compiler.java: 7062 clojure.lang.Compiler/eval
Compiler.java: 7051 clojure.lang.Compiler/eval
Compiler.java: 7025 clojure.lang.Compiler/eval
core.clj: 3206 clojure.core/eval
core.clj: 3202 clojure.core/eval
main.clj: 243 clojure.main/repl/read-eval-print/fn
main.clj: 243 clojure.main/repl/read-eval-print
main.clj: 261 clojure.main/repl/fn
main.clj: 261 clojure.main/repl
main.clj: 177 clojure.main/repl
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 657 clojure.core/apply
core.clj: 652 clojure.core/apply
regrow.clj: 18 refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 657 clojure.core/apply
core.clj: 1965 clojure.core/with-bindings*
core.clj: 1965 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 85 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 222 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 190 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 745 java.lang.Thread/run
#2018-11-3014:40achikinShould I run shadow-cljs server instace separately?#2018-11-3015:08achikinThe same happens if I start shadow-cljs server manually and do cider-connect-sibling-cljs#2018-11-3015:21richiardiandreaI might be able to help here, could you open an issue on cider with the commands that you are running by any chance? I am using shadow day in day out so I can help with the debugging...today is tough cause I am at the Conj but I can have a look at it this evening if you open an issue#2018-11-3016:36achikin@U0C8489U6 I have managed to run it, thanks to Thomas Heller. But I still have some questions. Seems like jump to definition does not work properly for cljs files#2018-11-3016:38richiardiandreaYeah well that was a bug in there that I fixed, if you give me an example or better open an issue I can have a look at it#2018-11-3016:40achikin@U0C8489U6 which set up do you suggest? embedded shadow-cljs server or a standalone one?#2018-11-3016:41richiardiandreaStandalone is what I use but it should not matter for the jump to definition#2018-11-3022:07achikin@U0C8489U6 could you tell me if I'm setting the things up correctly?
1. start shadow-cljs server
2. start shadow-cljs build watch
3. cider-connect#2018-11-3022:14richiardiandreaLast step is cider-connect-cljs for me and usually watch is also starting the server so you should be good with only that#2018-12-0614:05achikin@U0C8489U6 it looks like when I do cider-connect-cljs cider does not parse `.shadow-cljs/.*port files. Am I right?#2018-12-0615:50richiardiandreaUhm It should?#2018-12-0622:41achikin@U0C8489U6 when I do cider-connect-cljs it automatically finds and parses .nrepl-port of a running lein repl.#2018-12-0622:50richiardiandreain my case it does the same with shadow-cljs#2018-11-3015:32djwhittIs there still a desire to get bencode working in ClojureScript?#2018-11-3015:34bozhidarNot really. At this point it seems the EDN transport and the Transit transports are much better options for ClojureScript clients.#2018-11-3015:35djwhittGotcha, makes sense. bencode would probably be a bit of a pain to debug in the browser.#2018-11-3015:36dpsuttonthe only benefit of bencode is that there would be no client/nrepl clash of dependencies to worry about. high probability of there being transit in the project itself and maybe problems arise because of that?#2018-11-3015:36dpsuttonwhat if different transports are registered for edn in cider versus the actual project.#2018-11-3015:37bozhidarEDN has exactly the same benefit.#2018-11-3015:37dpsuttonmy point is that the project might have EDN and transit with special encoders that clash with what cider wants to do. just speculating no idea#2018-11-3015:37djwhittYeah, exactly (re EDN). Transit is pretty slow moving too. I doubt having a newer version would cause problems on either side.#2018-11-3015:37djwhittAh, hmm... hadn't thought about the encoders.#2018-11-3015:39bozhidarI really don’t get the EDN part - nREPL’s messages are usually maps of basic types. Does someone mess with those ever?#2018-11-3015:39djwhittI don't want to go on too much of a tangent re encoding. Mostly I'm just wondering where the best place to help out on the ClojureScript side of things is.#2018-11-3015:40bozhidarI’d start https://github.com/clojure-emacs/cljs-tooling or https://github.com/nrepl/piggieback#2018-11-3015:41bozhidarBtw, I’m not saying that porting nrepl/bencode to ClojureScript is a waste of time, either. I was just under the impression EDN and Transit were adequate solutions for client authors.#2018-11-3015:43djwhittI suspect that's mostly the case which is why I asked. Porting bencode would actually be fun since it's relatively standalone, but I figured it probably wasn't the best investment of time at this point.#2018-11-3015:45bozhidarA few more ideas https://github.com/clojure-emacs/cider/labels/ClojureScript#2018-11-3016:53erwinrooijakkersHi all#2018-11-3016:53erwinrooijakkersHow can I change the cider-nrepl version that is picked up?#2018-11-3016:54erwinrooijakkersI want to use cider/cider-nrepl 0.18.0 and not 0.19.0-SNAPSHOT#2018-11-3016:55erwinrooijakkersMy ~/.lein/profiles.clj looks like:
{:repl {:plugins [[cider/cider-nrepl "0.18.0"]
[refactor-nrepl "2.3.1"]]
:dependencies [[alembic "0.3.2"]
[org.clojure/tools.nrepl "0.2.13"]]}}
and in the app:
{:dev
{:dependencies [[figwheel-sidecar "0.5.16"]
;; [day8.re-frame/trace "0.1.13"]
[org.clojure/test.check "0.9.0"]
[cider/cider-nrepl "0.18.0"]
[org.clojure/tools.nrepl "0.2.13"]
[cider/piggieback "0.3.10"]
[re-frisk "0.5.3"]]
#2018-11-3016:55erwinrooijakkersBut it still picks up 0.19.0-SNAPSHOT from somewhere#2018-11-3016:55erwinrooijakkersI am using Spacemacs#2018-11-3016:59dominicm@erwinrooijakkers it's a cider option in emacs#2018-11-3016:59dominicmnormally derived from your cider plugin version#2018-11-3017:00dpsuttonit's kind of not an option any longer. It's added to risky var which makes it a pain to override in dir-locals because you have to accept the risky values in every file.#2018-11-3017:00dpsutton(defvar cider-jack-in-lein-plugins nil
"List of Leiningen plugins to be injected at jack-in.
Each element is a list of artifact name and version, followed optionally by
keyword arguments. The only keyword argument currently accepted is
`:predicate', which should be given a function that takes the list (name,
version, and keyword arguments) and returns non-nil to indicate that the
plugin should actually be injected. (This is useful primarily for packages
that extend CIDER, not for users. For example, a refactoring package might
want to inject some middleware only when within a project context.)")
(put 'cider-jack-in-lein-plugins 'risky-local-variable t)
(cider-add-to-alist 'cider-jack-in-lein-plugins
"cider/cider-nrepl" cider-latest-middleware-version)
#2018-11-3017:00dpsuttonand cider-latest-middleware-version is read at startup time and added to the list not dynamically at jack in#2018-11-3017:02erwinrooijakkersOkay I ask because I have this problem:#2018-11-3017:02erwinrooijakkersI get this very strange error suddenly when connecting to a MySql database:
Could not create connection to database server.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
(...)
Caused by: java.lang.ClassCastException: java.io.BufferedWriter cannot be cast to java.io.PrintWriter
at cider.nrepl.middleware.out$print_stream$fn__52939.invoke (out.clj:99)
#2018-11-3017:03erwinrooijakkersThis only happens when I run via cider-jack-in#2018-11-3017:03erwinrooijakkersWith lein repl it works#2018-11-3017:03dpsuttoneasiest way to check is to hand edit the cider-latest-middleware-version to 0.18 and try it with jacking in to see if its a regression or not#2018-11-3017:03erwinrooijakkersCan it have to do with https://github.com/clojure-emacs/cider-nrepl/commit/658194a8abb0842cbc3efe4f7cb04917487785d2?#2018-11-3017:03erwinrooijakkersOw so I can overwrite that one#2018-11-3017:03dpsuttonthere were changes to the printout out stuff recently#2018-11-3017:03erwinrooijakkersThanks#2018-11-3017:03dpsuttonyeah. it's all just elisp. just go to the source and change it, restart emacs and bob's your uncle#2018-11-3017:04erwinrooijakkersHaha#2018-11-3017:04dpsuttonif there is a regression then file a ticket#2018-11-3017:25erwinrooijakkersWhere is the cider-latest-middleware-version located?#2018-11-3017:29dpsuttoncider.el#2018-11-3017:29dpsuttonif you hit C-h V it should take you right to it#2018-11-3017:29erwinrooijakkersthanks#2018-11-3017:30erwinrooijakkers#2018-11-3017:30erwinrooijakkersThat’s it#2018-11-3017:31erwinrooijakkersI need to find cider.el#2018-11-3017:31erwinrooijakkersIt’s here: ~/.emacs.d/elpa/cider-20181128.1311#2018-11-3017:32erwinrooijakkersyay got it#2018-11-3017:34erwinrooijakkersNow Cider says: Source file '/Users/erooijak/.emacs.d/elpa/cider-20181128.1311/cider.el' newer than byte-compiled file#2018-11-3017:35erwinrooijakkersAnd it keeps using the old one#2018-11-3017:37erwinrooijakkersM-x byte-recompile-directory RET ~/.emacs.d/elpa/ and Bob’s my uncle#2018-11-3017:38erwinrooijakkersArgh not ye#2018-11-3017:38erwinrooijakkersYES#2018-11-3017:38erwinrooijakkersIt works#2018-11-3017:38erwinrooijakkersHad to restart Emacs#2018-11-3017:38erwinrooijakkersAlright the hour of truth#2018-11-3017:39dpsuttonbob is now officially you're uncle 🙂 also now you know how to edit/patch/hack on CIDER.#2018-11-3017:41erwinrooijakkersYes I work on a need-to-know basis#2018-11-3017:42kah0ona😄#2018-11-3017:49erwinrooijakkersWhen using Cider 0.18.0 the error no longer appears#2018-11-3017:52dpsuttonfile an issue. that was a recent change in a very murky place. would love to have a minimal repro as well if possible ?#2018-11-3017:53erwinrooijakkersWell that’s difficult#2018-11-3017:53erwinrooijakkersI need some help then#2018-11-3017:53erwinrooijakkersStack trace:
Caused by: java.lang.ClassCastException: java.io.BufferedWriter cannot be cast to java.io.PrintWriter
at cider.nrepl.middleware.out$print_stream$fn__53158.invoke (out.clj:99)
cider.nrepl.middleware.out.proxy$java.io.OutputStream$ff19274a.write (:-1)
java.io.PrintStream.write (PrintStream.java:480)
sun.nio.cs.StreamEncoder.writeBytes (StreamEncoder.java:221)
sun.nio.cs.StreamEncoder.implFlushBuffer (StreamEncoder.java:291)
sun.nio.cs.StreamEncoder.flushBuffer (StreamEncoder.java:104)
java.io.OutputStreamWriter.flushBuffer (OutputStreamWriter.java:185)
java.io.PrintStream.write (PrintStream.java:527)
java.io.PrintStream.print (PrintStream.java:669)
java.io.PrintStream.println (PrintStream.java:806)
com.mysql.jdbc.log.StandardLogger.logInternal (StandardLogger.java:318)
com.mysql.jdbc.log.StandardLogger.logWarn (StandardLogger.java:240)
com.mysql.jdbc.MysqlIO.doHandshake (MysqlIO.java:1177)
com.mysql.jdbc.ConnectionImpl.coreConnect (ConnectionImpl.java:2255)
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly (ConnectionImpl.java:2286)
com.mysql.jdbc.ConnectionImpl.createNewIO (ConnectionImpl.java:2085)
com.mysql.jdbc.ConnectionImpl.<init> (ConnectionImpl.java:795)
com.mysql.jdbc.JDBC4Connection.<init> (JDBC4Connection.java:44)
sun.reflect.NativeConstructorAccessorImpl.newInstance0 (NativeConstructorAccessorImpl.java:-2)
sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance (Constructor.java:423)
com.mysql.jdbc.Util.handleNewInstance (Util.java:404)
com.mysql.jdbc.ConnectionImpl.getInstance (ConnectionImpl.java:400)
com.mysql.jdbc.NonRegisteringDriver.connect (NonRegisteringDriver.java:327)
java.sql.DriverManager.getConnection (DriverManager.java:664)
java.sql.DriverManager.getConnection (DriverManager.java:208)
clojure.java.jdbc$get_connection.invokeStatic (jdbc.clj:272)
clojure.java.jdbc$get_connection.invoke (jdbc.clj:193)
clojure.java.jdbc$db_query_with_resultset.invokeStatic (jdbc.clj:848)
clojure.java.jdbc$db_query_with_resultset.invoke (jdbc.clj:818)
clojure.java.jdbc$query.invokeStatic (jdbc.clj:874)
clojure.java.jdbc$query.invoke (jdbc.clj:854)
yesql.generate$query_handler.invokeStatic (generate.clj:89)
yesql.generate$query_handler.invoke (generate.clj:82)
yesql.generate$generate_query_fn$real_fn__32447.invoke (generate.clj:120)
yesql.generate$generate_query_fn$query_wrapper_fn__32454.invoke (generate.clj:142)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
clojure.lang.RestFn.invoke (RestFn.java:421)
#2018-11-3017:54erwinrooijakkersSo at https://github.com/clojure-emacs/cider-nrepl/commit/658194a8abb0842cbc3efe4f7cb04917487785d2#diff-ddde73de35e28688b18e9b4c4b8e2795R99 line 99#2018-11-3017:54erwinrooijakkers(.write ^PrintWriter @printer (String. byte-range))#2018-11-3017:54erwinrooijakkersThe printer is a BufferedWriter#2018-11-3017:54erwinrooijakkersAnd PrintWriter is not a BufferedWriter#2018-11-3017:55erwinrooijakkersThey both inherit from java.io.Writer though#2018-11-3017:55erwinrooijakkersBut I don’t know why in this case we are dealing with a BufferedWriter#2018-11-3018:01erwinrooijakkersAnd I really don’t understand why it only happens when calling the endpoint, but not from the REPL.#2018-11-3018:16erwinrooijakkersI made an issue where I describe what I know:
https://github.com/clojure-emacs/cider-nrepl/issues/570#2018-11-3018:32erwinrooijakkersI don’t see why it can be anything else than a PrintWriter
(defn tracked-sessions-map-watch [_ _ _ new-state]
(let [out-writer (forking-printer (vals new-state) :out)
err-writer (forking-printer (vals new-state) :err)]
(alter-var-root #'*out* (constantly out-writer))
(alter-var-root #'*err* (constantly err-writer))
(System/setOut (print-stream #'*out*))
(System/setErr (print-stream #'*err*))))
#2018-11-3018:32erwinrooijakkersSince forking-printer returns a PrintWriter#2018-11-3018:38erwinrooijakkersI added a PR https://github.com/clojure-emacs/cider-nrepl/pull/571, although I am not yet sure why it happens. My time is up! 😄#2018-11-3018:39erwinrooijakkersThanks for the help!!!#2018-12-0104:57puzzlerAnyone successfully use the new REBL with cider's repl yet?#2018-12-0112:37ChrisNot yet but hoping to try again later today. Got tripped up by needing JavaFX and my distro not providing it, which means using OracleJDK 😒#2018-12-0114:40ChrisI've made a little progress using REBL with cider, but would appreciate if someone with more experience could help me the rest of the way.
First I downloaded REBL and created a dir with this deps.edn:
{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC2"}
org.clojure/core.async {:mvn/version "0.4.490"}
com.cognitect/rebl {:local/root "REBL-0.9.108/REBL-0.9.108.jar"}}
I did cider-jack-in as usual, and could run the UI with (require '[cognitect.rebl :as rebl]) (rebl/ui).
Unfortunately I can't get anything sent to REBL unless I wrap the expression with (rebl/inspect (+ 1 2)). But if I use REBL's "def as" to assign a result to foo I can access foo in the CIDER REPL. Feels like I'm close but missing something.#2018-12-0117:31dpsuttoni think it will be difficult because you rebl has its own main -m cognitect.rebl and i think nrepl does as well. there will need to be something that combines the two#2018-12-0118:12ChrisHuh, that’s a shame. #2018-12-0119:22rickmoynihan@dpsutton: don’t we just need a middleware to trigger a rebl/inspect on every :eval?#2018-12-0210:35bozhidarI’m not sure what REBLs API is, but I recall that in his demo Stu was using it from inferior-lisp (yeah, yeah - I can’t imagine someone is still using this). 🙂#2018-12-0210:36bozhidarLikely basic integration would be trivial, but the real point is whether that’s the right approach. Frankly, I think it’d be much better if we just extended the inspector to support the new nav and datafy protocols.#2018-12-0210:37bozhidarA native Emacs UI will be much better than firing some Swing app IMO.#2018-12-0210:37bozhidarThat being said - I’ve got no plans to work on this, so if it ever happens it will have to be contributed by someone else.#2018-12-0211:29manuelFWIW, I want to stick as much as possible with Emacs when it comes to Clojure development. As much as I appreciate the effort put behind REBL, I really don't want another tool for Clojure interaction.#2018-12-0211:36bozhidarWell, there has also been the Swing inspector as well, but I’ve noticed that almost no one uses it. 🙂 I appreciate the idea of creating something tool-agnostic, but obviously it will never match what you can do with native integration.#2018-12-0212:21dominicmTool agnostic can potentially be better than what Emacs can do, because there are very expressive systems out there#2018-12-0212:21dominicmNrepl can and should support this workflow. #2018-12-0212:24bozhidar@dominicm I meant UI-wise. Emacs users simply don’t like to spin some external apps if they can have a native UI. As for nREPL - I totally agree. Probably using nav will be the solution to our “how to handle big results” conversations. Haven’t had time to think about how exactly to integrate datafy and nav with nREPL, though.#2018-12-0212:48dominicmDon't they? Even if it's convenient to launch, and offers a superior UI? Interesting.#2018-12-0212:58ackerleytngit'll be cool to use cider-inspect's user interface with datafy and nav#2018-12-0213:58orestisI’d gladly drop CIDER inspector for a GUI app, but I’m a recent convert to Emacs land 🙂#2018-12-0214:35Chris@dominicm I’m not sure REBL offers a significantly superior UI to what could be achieved in GUI Emacs. Maybe the web browsing stuff wouldn’t be achievable but the rest would.#2018-12-0214:38ChrisTo me the only big advantage of an external application is that it might have a dedicated maintainer. (Not sure if Cognitect are committed to REBL or it’s a proof of concept?)#2018-12-0214:42Chris@dominicm actually I take that back. I’m not much into ClojureScript but I guess exploring React components visually could be super useful#2018-12-0218:11chris_johnsonFWIW my reluctance to “shell out” to another tool when using Emacs for Clojure work stems from the fact that I don’t have, as Stu briefly alluded to in the REBL talk, “you know, three big monitors, like we all have”#2018-12-0218:13chris_johnsonso when I’m in a fullscreen Emacs session with my buffer and a REPL and maybe an ansi-term tailing logs or watching some kind of output, looking at “another tool” means swiping over to another desktop and back. Maybe REBL is the reason I finally buy some big external monitors and figure out how to drive them from my laptop? 😅#2018-12-0218:19dpsuttonsave your money and alt tab 🙂#2018-12-0219:07lilactownI would appreciate having both tbh#2018-12-0219:07lilactownI work in many contexts - laptop in a coffee shop, laptop + monitor at home, triple monitors at work#2018-12-0219:08lilactownhaving a nice GUI with expressive visualizations would be quite useful. but the current REBL capabilities could be implemented in pure Emacs and would be quite useful as well#2018-12-0219:10lilactownof course the dream would be: implement the core of a REBL-like program in some external program and have it output data to an adapter to be rendered in whatever context, allowing it to be downgraded. but that’s probably way too much work.#2018-12-0221:44bozhidarI highly doubt that the core of REBL is complex, so this is likely pretty doable.#2018-12-0221:45richiardiandreaI like the ideas behind REBL but I think Emacs should embed them, and while contributions flow, we can use that instead at the cost of some (minimal) context switch. At the end of the day Emacs is our Os right?#2018-12-0221:47richiardiandreaThe experience does not seem hard to replicate either within emacs or in webkit - probably easier said than done 😃 #2018-12-0221:48richiardiandreaI actually played with nav at the conj and there is surely the whole of the implementation for core protocols missing at the moment - if I understood things correctly#2018-12-0221:55richiardiandrea@bozhidar so in a cljs conversion frenzy I am bashing on orchard and adding reader conditional whenever it makes sense. Haven't been refactoring any code but the goal as I was telling you at the conj is to have a very business logic-y orchard and a dumber middleware layer (no calls to two libs and if-this-then-that). Starting from info for now. If at any point you start not liking this please stop me ok 😃 it will take a bit of time but I think is worth it - wow this message had numerous grammar mistakes#2018-12-0222:03bozhidar@richiardiandrea Yeah, definitely this is worth it.#2018-12-0222:03bozhidarLooking forward to seeing some of the results!#2018-12-0222:32rickmoynihanFWIW I’m all for the cider-inspector growing some REBL/datafy/nav capabilities; that would be fantastic!! But I think there are still lots of use cases for which a separate sidecar UI makes sense.
An obvious thing tools like REBL could easily offer that emacs would struggle a little with are the charting functions and more graphical things.
Also REBL and/or an opensource equivalent may grow in capabilities too and evolve faster than one in elisp; simply because it could be a tool used by all clojure IDE’s/editors.#2018-12-0222:46bozhidar> An obvious thing tools like REBL could easily offer that emacs would struggle a little with are the charting functions and more graphical things.#2018-12-0222:46bozhidarBut you can say the same for REBL - most people simply use charting tools directly to visualize data. 🙂#2018-12-0222:47bozhidarThat’s why this charting functionality doesn’t make that much sense to me - yeah, it’s somewhat useful, but it’s not like it’s not available today as well.#2018-12-0222:55lilactownI think the power is in ease. Lack of context switching, not having to manage a lot of dependencies, etc.#2018-12-0223:03rickmoynihan@bozhidar currently yes… but if something like REBL gained traction, or if REBL became extensible in renderers then I think these expectations might change.
REBL has a nice, though not unique, idea in it about using specs to dispatch and find available renderers… and Stu mentions things like REBL remembering context and picking the last renderer you used in a given context etc. Having tooling built into the RE(P|B)L/ workflow directly seems to me to be a useful place for these kinds of capabilities to exist…. in particular being able to extend the tool with domain/app specific renderers etc.
Obviously REBL is currently crippled by not being opensource or end user extensible which might make my point somewhat moot.#2018-12-0223:21rickmoynihanOk so I’ve been trying to knock together a basic nREBL middleware that will intercept evals and send the results to REBL… but it seems that you can only intercept requests in nrepl not responses, is that so?#2018-12-0223:22rickmoynihanI can’t intercept the requests because the :code is a string… which I can’t just read and eval because of side effects#2018-12-0223:23rickmoynihanso unless I can intercept the return value I guess I’d need to implement a new message type that would let the client send a specific evaluation directly for viewing in REBL.#2018-12-0223:38lilactownHmm. Is there something stopping us from just using tap to send data to REBL?#2018-12-0223:42lilactownNot saying an nrepl middleware isn't worthwhile. I'm still trying to figure out what kind of workflow I want#2018-12-0223:50rickmoynihanYes you can use tap> to send stuff to REBL it was one of the first things I tried last week with REBL… However rebl/inspect is a macro not a function you need to do this:
(add-tap #(rebl/inspect %))
which corrupts the display of the expr form a bit in REBL#2018-12-0223:50rickmoynihanbut it certainly does work#2018-12-0223:51rickmoynihannot that the expr form is that useful actually#2018-12-0223:54rickmoynihanI was hoping that rebl could listen and capture the complete repl history though; but it seems like it might not be feasible unless we can intercept the results of eval somehow#2018-12-0510:46danielnealdid you get any further with this by any chance?#2018-12-0510:46danielnealI'd like to try the same#2018-12-0510:47rickmoynihanA little… In a meeting just now though.#2018-12-0510:49danielnealcoool#2018-12-0223:56rickmoynihanAdding it as a special op seems to work though… I just need to figure out how to get emacs to send the op… should be pretty easy once I find the right function… I’m guessing it’ll be in nrepl-client.el#2018-12-0223:57rickmoynihanok looks like it’s nrepl-send-request#2018-12-0223:58rickmoynihanI’d actually quite like to integrate REBL with scope-capture and emacs; so I think perhaps a middleware might be the best way to do that#2018-12-0314:28philHey all, how can I set :extra-paths when I do cider-jack-in?#2018-12-0314:33bozhidar@phil You have to set them in whatever build tool you’re using, CIDER will simply shell out to it.#2018-12-0314:35philAh, so, :extra-paths in the top-level of my deps.edn?#2018-12-0314:43bozhidar@phil Yeah, that will certainly do.#2018-12-0314:53dpsuttonif anyone wants to easily cider-connect but add their own profiles, etc this function could help them easily modify the startup command that cider issues:
(defun cider-copy-jack-in-command ()
(interactive)
(kill-new (plist-get (cider--update-jack-in-cmd (cider--update-project-dir '()))
:jack-in-cmd)))
#2018-12-0314:54dpsuttonand it will copy /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.5.0"} cider/cider-nrepl {:mvn/version "0.19.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' so you can add whatever profiles you would like and it will include the middleware for you#2018-12-0314:57phil@dpsutton Thanks.#2018-12-0314:58dpsuttonyou can also use dir-locals
((nil
(cider-clojure-cli-global-options . "-A:fig")))
#2018-12-0314:58dpsuttoni have this in a project so figwheel main is included and its main options are set#2018-12-0314:59philAh! That's the winner.#2018-12-0316:14pesterhazyI'm seeing this issue occasionally error in process filter: user-error: ‘nil’ requires the nREPL op "classpath" (provided by cider-nrepl)
error in process filter: ‘nil’ requires the nREPL op "classpath" (provided by cider-nrepl)
#2018-12-0316:15pesterhazyafter cider-connect#2018-12-0316:15pesterhazyusually this goes away after restarting Emacs#2018-12-0316:22pesterhazynow I went away after I added cider-nrepl to ~/.lein/profiles.clj#2018-12-0316:22pesterhazythough I swear that cider sometimes works without cider-nrepl present?!#2018-12-0316:29dpsuttonIt shouldn't ever work without the middleware I don't think?#2018-12-0319:09macrobartfastcider-doc is producing Wrong type argument: stringp, nil ... ideas on why or how to debug?#2018-12-0322:42ChrisIf you can’t find a solution, try switching to the MELPA Stable version. #2018-12-0418:54Anthony CiacciHas anyone come up with a relatively simple way to make it so that when you use cider-find-var, the result opens up in a new buffer and not the current one you are in?#2018-12-0508:09jumarSpacemacs has jump-to-definition-other-window (g D) but I'm not sure what's the pure emacs equivalent.#2018-12-0511:37bozhidarIt’s M-- M-.#2018-12-0511:38bozhidar(Meta minus, negative prefix argument)#2018-12-0511:40bozhidarHmm, seems we might have broken this.#2018-12-0514:20benzapUsing boot with emacs calling cider-jack-in-cljs produces this error. Anyone seen this before? quickfix?#2018-12-0514:32benzapThe codebase that it's being run from is here: https://github.com/district0x/cljs-ipfs-native/blob/cors-fix/build.boot#2018-12-0514:32benzapIs it possible i'm missing something?#2018-12-0516:14richiardiandreaLooks alright to me at first glance...I would check the dependency 🌲 because it seems somehow cljs.repl is missing...maybe. Do you have a bigger stack trace?#2018-12-0517:50David RenoGiven this project file, when I start my repl with lein ring server it presumably runs my ring handler in the specified namespace: (defn -main []
(jetty/run-jetty handler {:port 3000}))
.
This works fine. When I start a cider session instead of running lein from the command line, I see this message and it doesn’t seem to run -main: [nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.4.5\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost...
I’m sure I’m missing a couple of things, I’d appreciate any comments. My goal is to use cider in place of the command-line lein and have the jetty server run.#2018-12-0517:55David RenoMy best guess is that the project file key :main informs the REPL to automatically call -main and that maybe cider has a different REPL or something and can’t call -main automatically?#2018-12-0517:56lispers-anonymousCider will not run -main on startup. You can start cider and run -main manually. There is also M-x cider-run which will run the -main command in your project#2018-12-0518:06David Reno@UDVJE9RE3, thanks! cider-run is the extra step I was missing. Still not clear to me what cider does differently WRT the REPL but I can figure that out over time.#2018-12-0518:10lispers-anonymousIt’s just starting a repl and not making any assumptions about what you want to do with it. I will usually have a separate user namespace with functions that has functions for me to start, stop, and restart a ring server that I use exclusively in cider. They will start ring and then return control to the repl so that I can continue to re-evaluate other forms as I work. Try playing around with different methods for working in cider and see what works for you#2018-12-0518:13David RenoYou don’t have any github links with that type of setup do you? I haven’t figured out how to do that “return control to the repl so that I can continue to re-evaluate other forms as I work” part.#2018-12-0518:14lispers-anonymousI don’t unfortunately. It’s mostly been using component and compojure frameworks. Component has stuff for doing this for sure.#2018-12-0518:14David RenoThanks, I’ll look.#2018-12-0518:15lispers-anonymousI think this might do it, https://stackoverflow.com/questions/12329677/how-to-stop-ring-server-started-using-ring-util-serve#2018-12-0519:26David Reno@UDVJE9RE3, with that link and others I’ve cobbled the following together which seems to do the following:
1. has a -main to start the server via lein and cider-run
2. :join? false seems to return to the repl and let me run other commands
3. (.start) and (.stop) let me restart the jetty server
(ns hello-ring.core
(:require [ring.adapter.jetty :as jetty]
[clojure.pprint :as pprint]))
(defn handler [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "hello world" })
(defonce -main (jetty/run-jetty #'handler {:port 3000 :join? false}))
;;(.stop -main)
;;(.start -main)
;;(str "hi")
#2018-12-0519:29lispers-anonymousThat sounds about right. You may need :join? true for when you are starting from lein ring server. I believe it will start the server then exit immediately since there is nothing to block the main thread. Not 100% sure about that but you might want to test that out#2018-12-0517:55macrobartfastwhen entering cider debug mode with, in my case, C-u C-M-x I get clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag dbg ... I've updated emacs to 26.1 and reinstalled leiningen with a new .lein to try to resolve this issue; most the posts online about this issue are from around 2015; thoughts?#2018-12-0519:21macrobartfastso, I've replaced emacs; replaced my .lein; replaced my .m2 repo; replaced my .emacs.d and I'm still getting the 'No reader function for tag dbg' error... where else is state stored for emacs/lein/cider?#2018-12-0520:17ChrisDid it ever work for you?#2018-12-0520:25alexyakushev@bozhidar Would you kindly rebuild cider-nrepl? I fixed a bug in compliment that may annoy people (it did me)#2018-12-0520:35dominicmI think cider will need a release soon just to be compatible with 1.10#2018-12-0522:40martinklepschwhen jumping to a namespace with C-c C-. — is there a way to be able to edit and evaluate stuff in the context of that buffer? I often use this kind of workflow to debug/interact with library code#2018-12-0523:28bozhidar@alexyakushev Done. 🙂#2018-12-0523:28bozhidar> I think cider will need a release soon just to be compatible with 1.10#2018-12-0523:29bozhidarTrue. I plan to cut something before the end of the month.#2018-12-0523:31norman@martinklepsch You can toggle read only and edit/eval. You’ll get some annoying auto-save errors if you don’t turn that off, but otherwise it does work.#2018-12-0523:35martinklepsch@U0954HGDQ if you happen to know the commands from the top of your head, please share :)
I guess I can google edit stuff but not sure about eval#2018-12-0523:35normaneval is the same as for your files#2018-12-0523:36normanC-x C-e, for example, or whatever you normally use#2018-12-0523:36normanM-x read-only-mode to make the buffer editable#2018-12-0523:39martinklepschOh and I guess I might have to use sesman to connect the buffer to an existing repl session #2018-12-0523:40martinklepschI thought I tried the regular eval stuff earlier but I’ll give it another go tomorrow, thanks 🙌#2018-12-0523:31normanAnd, of course, you can’t save#2018-12-0523:34bozhidarI guess @martinklepsch is asking mostly because of the changes to session mapping in 0.18. He might have to associate buffers outside the current project manually.#2018-12-0523:34bozhidarThere are some details here http://www.cider.mx/en/latest/managing_connections/#2018-12-0523:38normanLet me try real quick and verify it still works for me. I don’t do this every day, but it’s a fairly regular thing#2018-12-0523:39normanyeah - works fine for me. M-. into something in a JAR dependency. M-x read-only-mode and then edit eval.#2018-12-0523:39normanCIDER 0.18.1snapshot (package: 20181008.1547)#2018-12-0523:42bozhidarThat’s because the friendly sessions were added after 0.18. 🙂#2018-12-0523:42normanOh - I thought you were saying something changed in 0.18 to make this not work.#2018-12-0523:42normanI’ve been doing this for … a long time.#2018-12-0600:13bozhidarIt doesn’t work only in 0.18.0, as we didn’t account for this usecase.#2018-12-0600:14bozhidarThe new eval dispatch refuses to eval stuff outside the context of your project (to prevent you from accidentally evaluating code against the wrong connection) and such third-party libraries were affected by this.#2018-12-0608:03jumarI haven't been watching REBL closely but is there a possibility to integrate it with Emacs/Cider and, preferably, leiningen?#2018-12-0608:09bozhidarLeiningen? By this you mean lein repl, I presume, right?#2018-12-0609:02jumarI just mean that my project is based on leiningen and not on deps.edn - not sure if that changes anything or not.#2018-12-0609:05jumarAnd I want to be able to send expressions from my editor to the REBL.#2018-12-0609:07jumarI guess one thing is that REBL is only available as a local jar....#2018-12-0608:10bozhidarYou can run it from a REPL, so you’ve got some integration for free, but I haven’t used it and I don’t know many details. I hope that we’ll bring some of its features to CIDER’s inspector down the road.#2018-12-0609:21jumarOk, so I did this to install rebl into local repo:
mvn install:install-file -Dfile=/Users/jumar/tools/clojure/rebl/REBL-0.9.109/REBL-0.9.109.jar -DgroupId=com.cognitect -DartifactId=rebl -Dversion=0.9.109 -Dpackaging=jar -DgeneratePom=true
# Then in project.clj
[com.cognitect/rebl "0.9.109"]
Now launch the UI from the REPL:
(cognitect.rebl/ui)
I can "send" expressions to the REBL:
(cognitect.rebl/inspect (+ 10 20))
;;=> true
... but it would be nice to have better integration: just eval inside my emacs and having it sent to the REBL automatically.
In the end, I think that having the features directly in the cider inspector can be more valuable - just wanna play with this REBL now 🙂#2018-12-0609:40plexusmeh I'll wait for the open source clone#2018-12-0610:31bozhidar> In the end, I think that having the features directly in the cider inspector can be more valuable - just wanna play with this REBL now 🙂#2018-12-0610:32bozhidarI share @plexus’s sentiment. 🙂 It’s a cool idea, but I don’t plan to use it, and unfortunately I don’t have time to work on a clone any time soon.#2018-12-0610:32bozhidarI’m certainly someone will tackle this pretty soon, though.#2018-12-0610:45dominicmI'm bothering someone here in JUXT. He's been working on stuff like REBL for years. Now there's helpers in core, he might be able to do something much better than before 🙂#2018-12-0611:35plexusnav and datify seem pretty useful, and I guess it's great to have them in core so people are encouraged to implement the protocols in their own libraries, but it does mean anything you build with them is Clojure 1.10+ only. Had it been a library we could use it today on pretty much any version of Clojure.#2018-12-0622:59rickmoynihanis this really a concern?
Updating clojure is almost always just upgrading a coordinate and have it just work.#2018-12-0707:29plexusIt's a concern for library authors who want to support multiple versions.#2018-12-0710:14rickmoynihanIt certainly is - but the clojure community upgrade pretty quick if you look at the state of clojure surveys.
I think this is a bigger issue for tool smiths than library authors though… but I guess this is #cider 🙂#2018-12-0716:03plexusExactly. For Kaocha I'm targeting 1.9+, which since it's a new tool I'm fine with not bothering about older versions, but I'm not planning to drop 1.9 support until 1.10 has been out for at least a year or two. That's just basic courtesy to your users.#2018-12-0716:22rickmoynihan:thumbsup: ahh I’ve been looking at kaocha, it looks really nice… My understanding though is that it’s only been out a few months - do you think you’ll have lots of 1.9 users?
BTW it would probably be pretty easy to target 1.9 and 1.10 — but conditionalise datafy/navify so you only get them if *clojure-version* is 1.10+#2018-12-0611:37dominicmthe metadata is quite useful to avoid it, because you can do:
(vary-meta '{clojure.core.protocols/datafy (fn)} [])
#2018-12-0611:37dominicmbut otherwise you need to conditionally resolve the protocol#2018-12-0611:39orestisThe core thing in Clojure 1.10 AFAICT is the metadata-protocol-extension, so that you can actually call datafy and nav on everything, not just records. Everything else could easily live in a library, but would be much less useful.#2018-12-0612:29bozhidarYeah, the changes in core were absolutely necessary for this to be universal.#2018-12-0623:01rickmoynihanYeah it’s a big deal being able to hook a protocol onto a map, vector or set value. As it means just data can participate in a protocol now.#2018-12-0713:32philHey. I've never managed to get the #break macro to work for me. Is there anything I might be missing?#2018-12-0713:39philAh, works in another project - safe to assume user error.#2018-12-0716:21mseddonI am doing some custom validation inside a macro. I know the file and line/column information of the error- is there a way to raise an exception in such a way that Cider can report the issue at the relevant position in the right buffer?#2018-12-0716:28mseddonah, I see clojure.lang.Compiler$CompilerException, which is working okay, but if there's a better class to use, I will.#2018-12-0720:38rickmoynihanCan someone clarify this from the nrepl docs for me:
> :requires, a set containing strings or vars identifying other middleware that must be applied at a higher level than the middleware being described. Var references indicate an implementation detail dependency; string values indicate a dependency on any middleware that handles the specified :op.
Does “higher level” here mean that :requires happen before the handler call?#2018-12-0720:44rickmoynihanok further down it expands on the above — so looks like :requires are before#2018-12-0722:00rickmoynihanOk I’ve figured out how to get REBL to spy on an nrepl connection#2018-12-0722:01rickmoynihanseems to work — but likely needs some more work… I need to properly test it#2018-12-0722:02danielnealAwesome. I'm well up for having a go with something not fully tested :)#2018-12-0722:05rickmoynihanwell I have a few more hoops to jump through… I’m currently testing it by starting a server in my cider repl with (def nrep (ser/start-server :port 55801 :handler (ser/default-handler #'wrap-nrebl))) and then sending forms to it via an nrepl client call:
(with-open [conn (nrepl/connect :port 55801)]
(-> (nrepl/client conn 1000) ; message receive timeout required
;(nrepl/message {:op "inspect-nrebl" :code "[1 2 3 4 5 6 7 8 9 10 {:a :stuck_out_tongue: :c :d :e #{5 6 7 8 9 10}}]"})
(nrepl/message {:op "eval" :code "(do {:a :b: :c [1 2 3 4] :d #{5 6 7 8} :e (range 20)})"})
nrepl/response-values
))
#2018-12-0722:07rickmoynihanjust tried sharing a screenshot — but there’s no storage left in this slack#2018-12-0722:07rickmoynihananyway I need to figure out now how to run this middleware with cider#2018-12-0908:04jumar@U06HHF230 Do you know how to run this with leiningen based project and Emacs/Cider?. I tried to look around but not sure how to add nrepl middleware to my project...#2018-12-0908:44rickmoynihanI was trying to get that working last night — but ran into some issues that I haven’t resolved#2018-12-0908:53rickmoynihanI’ve pushed where I got to, though it doesn’t quite work.
I’ve updated the README.md with something close to what you’ll need in profiles.clj.
Though it may be there are code changes needed too.
You’ll also need to lein install nrebl.middleware from source.#2018-12-0908:54rickmoynihanI’m out today — but if you can figure it out that would be amazing#2018-12-0722:08rickmoynihanso I can actually do it from my real repl#2018-12-0722:10rickmoynihanI think I need to modify this command to inject my middleware:
clj -Sdeps '{:deps {nrepl {:mvn/version "0.4.5"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"#2018-12-0722:11rickmoynihanlol turns out I already have the incantation in my repl history… well done me of the past!#2018-12-0722:17danielnealYeah i think that should do it #2018-12-0722:17richiardiandreacan confirm that if you add a middleware in the first position of the vector above it should wrap the cider-middleware#2018-12-0722:18rickmoynihanthanks#2018-12-0722:18rickmoynihansomething else isn’t working now — debugging#2018-12-0811:11bozhidar@rickmoynihan What does the middleware do exactly?#2018-12-0811:13bozhidar> ok further down it expands on the above — so looks like :requires are before#2018-12-0811:13bozhidarYeah, seems you’ve sorted this out.#2018-12-0813:15rickmoynihan@bozhidar: it wraps :transport and basically just calls (ui/inspect (datafy value)) as a side effect.
After you’ve either run (rebl/ui) or have sent :op "start-rebl-ui" the inspected values should display in REBL.#2018-12-0813:22rickmoynihanWondering if someone who actually has experience writing middlewares could take a look at it though… There might be a better way to hook in to the chain.
Also wondering what it would take to include something like this in appropriate community project… e.g. cider/orchard etc…
I’d also started writing some emacs lisp to send the :op "start-rebl-ui" command — so you can open the inspector with a keypress from emacs - but I haven’t got very far with that yet.
Also it would be good to make the setup process a little easier; and find the appropriate incantations for leiningen etc… Though on that point I based it off the latest nrepl… so I’m assuming I’ll have to downgrade it to the contrib version to do that??#2018-12-0813:22rickmoynihanAnyway I’m very keen for feedback on how we can improve it#2018-12-0818:58macrobartfastI need to run a couple figwheel connections at once... where in my project.clj should I put the ':server-port 3450' configuration?#2018-12-0902:28soulflyerI think it goes in a :figwheel section at the top level.#2018-12-0902:31soulflyerThis is one of my project files, look at the last few lines. https://github.com/soulflyer/hinh-anh/blob/master/project.clj#2018-12-0915:32bozhidar> Also wondering what it would take to include something like this in appropriate community project… e.g. cider/orchard etc…#2018-12-0915:33bozhidarI’m not familiar with REBL at all, otherwise I wouldn’t mind helping.#2018-12-0915:33bozhidarSuch middleware sounds like something that should belong in cider-nrepl potentially.#2018-12-0915:33bozhidar> Also it would be good to make the setup process a little easier; and find the appropriate incantations for leiningen etc… Though on that point I based it off the latest nrepl… so I’m assuming I’ll have to downgrade it to the contrib version to do that??#2018-12-0915:34bozhidarThat would also take care of this problem, as cider-nrepl picks the nREPL version to use at runtime, although in a release or two I’ll drop any support for tools.nrepl. I’m just waiting on the new lein release, so there’s something all lein users can easily upgrade to.#2018-12-1008:56rickmoynihanOk I’ll take a look and see how it’s done there…
I’ve currently been trying to do stuff like this:
https://github.com/RickMoynihan/nrebl.middleware/blob/a32a6c74df5a6b2a0c2dd5741bc78908baf58a01/src/nrebl/middleware.clj#L6-L25
but I get some strange problems#2018-12-1008:56rickmoynihanhttps://github.com/RickMoynihan/nrebl.middleware/issues/1#issuecomment-445738334#2018-12-0918:45practicalli-johnReally enjoying the cider-debug feature. Its a great way to help people learn Clojure, showing them the values of symbols and expressions as you step through the code. Thanks.#2018-12-1002:04theeternalpulseI've recently been getting into this as well, I love it. I need to get all the bindings set up as some of the defaults don't work great with some evil conflicts but for next, continue, locals which is mostly what I use it for it's great#2018-12-1006:43theeternalpulsespeaking of, how do you set a breakpoint at a specific point#2018-12-1008:35bozhidarhttp://www.cider.mx/en/latest/debugging/#understanding-breakpoints#2018-12-0918:58bozhidar@jr0cket Happy to hear this!#2018-12-0923:52grzmI’ve been developing using Datomic Ions. One of the features it provides is a logging feature called datomic.ion.cast, which logs to Cloudwatch when running in AWS and with other options (such as logging to stdout) when developing locally. When redirecting to stdout locally, I get StackOverflowError when redirecting to stdout. Redirecting to stderr and files works fine. I’ve got a repro case (including the description and the error) here: https://github.com/grzm/cider-ion-cast-stackoverflow#2018-12-0923:52grzmAny thoughts on where this might be?#2018-12-1002:01theeternalpulseIs there a way to make the stack trace more consice when using cider eval preferably filter out/collapse parts of the stack that are not in the src folder or show only a summary?#2018-12-1003:52dpsuttonCheck out the "project only" button or hit "p"#2018-12-1009:18Daniel TruemperHi, already asked in #beginners and re-posting here: I have a problem with CIDER and reloading namespaces. I can run the application once but as soon as I reload CIDER complains that it cannot find a certain namespace. I've been reading "Reloading Woes" (https://lambdaisland.com/blog/09-02-2018-reloading-woes) and trying to find out the problem but to no help. Does anyone have a hint at the source of the problem?#2018-12-1011:45alexyakushevDoes CIDER have an ability to highlight compilation errors in the code buffer? I see some references to this in the issues, but I don't think it ever worked for me.#2018-12-1013:27bozhidarThat’s one of the oldest features and it always worked for me. 😄#2018-12-1013:29alexyakushevAlright, maybe it's Boot-related. This should work by default, right?#2018-12-1013:30alexyakushevCould you hint at the Emacs function I should debug?#2018-12-1013:32bozhidarTry cider-extract-error-info in cider-eval.el.#2018-12-1013:41bozhidarBasically we just parse the exceptions that happen after eval, extract the location info for the error from them and highlight the offending line.#2018-12-1013:42bozhidarI think this was the very first commit I made to CIDER. 😄 (nrepl.el at the time)#2018-12-1013:44alexyakushevInteresting. I was wrong that it doesn't work for me at all – e.g. reflection warnings are underlined yellow in the buffer. But I don't think I've ever seen red underlines.#2018-12-1013:44alexyakushevIt looks like on compilation errors (failed to compile) Emacs never enters cider-extract-error-info but it does on warnings.#2018-12-1014:09alexyakushev#2018-12-1014:14dpsuttonI've observed that in the past and I don't understand how it can happen#2018-12-1014:15dpsuttonOn startup though#2018-12-1014:15plexusI also haven't seen red underlines in a long time, IIRC I just get an exception buffer pop up when compilation fails#2018-12-1016:10alexyakushevDo you use Leiningen or something else?#2018-12-1016:13plexusmostly tools.deps (clojure cli) these days#2018-12-1014:19alexyakushevInteresting! I restarted the REPL, and it looks like each new stacktrace op message adds another pprint-fn, print-length, and print-level.#2018-12-1014:20alexyakushevHowever, that doesn't seem to be related to the error highlight problem.#2018-12-1015:29bozhidar@dpsutton noticed this problem a while ago. I never had time to debug it, but it seemed like something harmless. It’s unrelated to what you’re experiencing.#2018-12-1015:20pablorecan someone tell me what does this error mean? Could not start nREPL server: WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval3309$fn__3310 to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval3309$fn__3310
This happens after doing cider-jack-in.
Also when doing lein repl on my terminal the process fails and this is printed: REPL server launch timed out.
#2018-12-1015:23plexusyou're running on Java 10 or 11 right?#2018-12-1015:24pablorejava -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
#2018-12-1015:24plexus(one minute, I'm on a call)#2018-12-1015:29pabloreno prob 😉#2018-12-1015:30bozhidarThe warnings are not the problem, it must be something else.#2018-12-1015:30bozhidarTake a closer look at your log, I assume there’s no more info there.#2018-12-1015:34pabloreyeah, the repl its timing out for some reason. Is there a way I can debug lein repl?#2018-12-1015:52plexusis there anything in the *nrepl-server* buffer?#2018-12-1015:53dpsuttonif lein repl fails i don't think there is any hope of CIDER starting your project.#2018-12-1015:53plexusyou can also go to *Messages* and find the command that CIDER uses to launch nrepl, then run that in the terminal#2018-12-1015:54dpsuttonthis sounds like a problem with your project, not CIDER. if you can't get a repl up with lein repl this isn't some bug that CIDER introduces#2018-12-1015:54plexus> the repl its timing out for some reason
maybe it's loading a namespace that blocks for some reason? do you have a user.clj?#2018-12-1016:38pabloreyep, it was an infinite loop i had in a file#2018-12-1016:40dpsutton@truemped did you figure out your issue?#2018-12-1016:45Daniel Truemper@dpsutton No, unfortunately not. @cfeckardt gave me some feedback but in theory everything looks fine. I checked further and in the reply I see that c.t.n.r/refresh lists the namespace but somehow does not seem to find it.#2018-12-1016:52dpsuttonah. so does this seem to be an issue with your project outside of CIDER?#2018-12-1016:57Daniel TruemperI'm really not sure. I do think it must be on my side (it usually is...) but I don't see the one thing that is wrong.#2018-12-1017:00dpsuttonfrom a blank repl can you require each namespace individually?#2018-12-1017:43Daniel TruemperI'm on my way home. Will try later. What is interesting is that initially it works. Only after I run either c.t.n.r/refresh or (cider-refresh) things don't work anymore#2018-12-1020:15Daniel TruemperHm, so yes, I cannot require the namespace even on a freshly started repl session.#2018-12-1020:15Daniel TruemperAny idea?#2018-12-1020:17dpsuttonwhat's up with the namespace. can you figure out a repro of this issue that others can see?#2018-12-1020:49Daniel TruemperI'll copy the repo into a private Gitlab one.#2018-12-1021:13Daniel TruemperYou don't happen to have a Gitlab account?#2018-12-1021:15dpsuttoni sure don't#2018-12-1021:15dpsuttonbut i also don't have time to clone your project. can you poke around the forms and see which ones are preventing your namespace from loading?#2018-12-1021:16Daniel Truemperyeah#2018-12-1021:16Daniel Truemperso, let me copy what I have#2018-12-1021:16Daniel Truemperthis is the error I see: clojure.lang.Compiler$CompilerException: java.lang.Exception: No namespace: felicity-lemon.config, compiling:(felicity_lemon/joining_streams.clj:1:1)#2018-12-1021:17Daniel Truemperthis is the ns declaration in joining_streams.clj:#2018-12-1021:17Daniel Truemper(ns felicity-lemon.joining-streams
(:require [taoensso.timbre :as log]
[metrics.meters :refer (meter mark!)]
[metrics.gauges :refer (gauge-fn)]
[jackdaw.streams :as j]
[jackdaw.serdes.json :as jsj]
[felicity-lemon.config :refer (config)]
[felicity-lemon.kafka-streams.metrics]
[felicity-lemon.kafka-streams.serde])
(:import (felicity_lemon.kafka_streams.serde JsonSerde)
(felicity_lemon.kafka_streams.metrics MetricsBridge)
(org.apache.kafka.streams KafkaStreams)
(org.apache.kafka.streams KafkaStreams$StateListener)
(org.apache.kafka.streams KafkaStreams$State)
(org.apache.kafka.common.serialization Serde Serdes)))#2018-12-1021:17dpsuttonok. can you find the felicity-lemon/config.clj file and try eval'ing it and see what happens#2018-12-1021:18dpsuttonis this clojurescript by any chance?#2018-12-1021:18Daniel Truemper... starting a repl#2018-12-1021:18dpsuttonor cljc?#2018-12-1021:18Daniel Truemperno, clj#2018-12-1021:18Daniel Truemperleiningen#2018-12-1021:18Daniel Truemperconfig.clj:#2018-12-1021:18Daniel Truemper(ns felicity-lemon.config
(:require
[taoensso.timbre :refer (info merge-config!)]
[cprop.core :as cprop]
[cprop.source :as cp-src]
[mount.core :refer (defstate)]
[clojure.string :as str]
[metrics.core :refer (new-registry)]
[clojure.spec.alpha :as spec]
[felicity-lemon.specs :as cs]))
#2018-12-1021:18dpsuttonok. well the error message is saying it doesn't know what felicity-lemon.config is. so start there#2018-12-1021:18dpsuttoncan you eval that file?#2018-12-1021:19Daniel Truemperproject.clj => https://gist.github.com/truemped/22913e9dbdd20ee9cc957e22ffd34d1f#2018-12-1021:20Daniel Truemperwhat do you mean by "eval that file"? I'm in the repl and have all stuff loaded. I can run (start) and it starts my API with felicity-lemon.config evaluated and running#2018-12-1021:21dpsuttonand you're sure that config is required and loaded when you evaluate (start)?#2018-12-1021:21Daniel Truemperyes, it adapts the configuration, i.e. listens on a different port depending on the config, e.g.#2018-12-1021:22Daniel Truemperonly when I reload ...#2018-12-1021:22Daniel Truemperfelicity-lemon.repl> (start)
18-12-10 21:22:32 daniels INFO [felicity-lemon.core:42] - Starting server on port 8080
{:started ["#'felicity-lemon.config/config-merges" "#'felicity-lemon.config/config" "#'felicity-lemon.core/mgmt-server" "#'felicity-lemon.config/joiners"]}#2018-12-1021:23dpsuttonnothing stands out to me sorry#2018-12-1021:24Daniel Truemperthank you anyways. Once I found the issue, this will be a very big aha! for me 🙂#2018-12-1018:04PBHey all. I'm trying to have cider work with deps.edn and I'm having trouble evaluating anything except simple forms such as (+ 1 2). Is the current workflow to create a new alias for your dev? If so. I'm having trouble determining which dependencies to include. It also seems that opening a repl in my terminal doesn't necessarily open a port along with it for cider to connect to?#2018-12-1018:10lilactown@petr are you using aliases in your app's deps.edn?#2018-12-1018:11PBI am. I also have some defined inside my .clojure/deps.edn. Are we able to specify which profiles to load from cider, or do we need to start the repl from teh terminal?#2018-12-1018:11lilactownas in, in order to start your app for development it needs to run with a certain alias to include paths/deps/etc.#2018-12-1018:12PB:nrepl {:extra-deps {nrepl {:mvn/version "RELEASE"}}
:main-opts ["-e" "(require,'[nrepl.server,:refer,[start-server]]),(start-server,:port,60606)"]}
^^ Stolen from sean's gh#2018-12-1018:13lilactownif you're using cider-jack-in, you can specify different params to the command by pressing C-u before the cider-jack-in#2018-12-1018:14lilactownit should come up with an nREPL server command prompt which you can add e.g. -A:dev to#2018-12-1018:14lilactowncider-jack-in will add all of the nREPL dependencies and start the server like you have in the alias, though, so you shouldn't need that#2018-12-1018:16lilactownin a lot of my deps.edn projects now, I add a .dir-locals.el file to configure the way cider starts my app's REPL:
https://github.com/Lokeh/lilac.town/blob/master/.dir-locals.el#2018-12-1018:18lilactownin that project, I have dependencies and source paths defined in both a :server alias and a :dev alias that I want to include when I jack in#2018-12-1018:44PBThis is great, thank you#2018-12-1103:44dadairEarly hours of switching a project over to deps.edn from leiningen, and new to deps tooling in general, so this could be a PEBKAC problem, but I’ve followed the cider-nrepl deps.edn instructions and running the clj command starts the NREPL server but doesn’t provide a follow-up REPL to use. It just hangs/stops after printing the NREPL host/port. Is this expected behaviour? I’m trying to add nrepl/cider so I can connect from Calva in VS Code. No issues running lein repl.#2018-12-1108:33dominicmThere may not be a terminal prompt after starting. The server is running though. Did connecting work? #2018-12-1110:15bozhidarYou can to pass -i (--interactive) if you want to get a REPL as well. Generally it’s not needed if you simply want to connect to a server.#2018-12-1116:52dadairHmm I’ll keep that in mind. I forgot that calva starts its own REPL buffer once you connect#2018-12-1116:52dadairTrying to keep everything simple and tool-agnostic#2018-12-1107:48tianshuWhen using figwheel-main in cider, there're so many output from org.eclipse.jetty in the REPL, make it really slow and unusable, is this is a problem of figwheel-main or cider?#2018-12-1107:54tianshuI fixed this by disabling org.eclipse.jetty log via logback.xml.#2018-12-1112:49mseddon@doglooksgood (setq-default bidi-display-reordering nil) can sometimes prevent emacs performance completely tanking in the case of a lot of line-wrapping output#2018-12-1206:16tianshu@mseddon thanks!#2018-12-1207:46pradyumnahi, i am seeing a strange issue with cljs while using cider-find-ns. Sometimes it shows correct file, but sometimes it says "Can't find namespace 'my.namespace'". I could see no perceptible difference in those files. any clues?#2018-12-1207:50pradyumnaone thing i note, the behavior is file specific. for a particular file, it either works or fails always even after restarting emacs.#2018-12-1209:36pradyumnaon further debugging found that, (cider-nrepl-send-sync-request `("op" "ns-path" "ns" "my.namespace")) returns (dict "status" ("done") "path" nil ...). so in the nrepl process itself not able to find it.#2018-12-1210:03stathissiderishello! I tried to jack-in into a project with deps.edn and CIDER failed to connect with Exception in thread "main" java.io.FileNotFoundException: Could not locate cider_nrepl/main__init.class or cider_nrepl/main.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.. That’s not surprising, because it looks like it’s invoking this: /usr/local/bin/clojure -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'#2018-12-1210:03stathissiderisdo I need cider-specific deps in my deps.edn?#2018-12-1210:06dominicm@stathissideris do you have cider configured to not inject dependencies? #2018-12-1210:07stathissideris@dominicm YES! genius! I remember now I disabled that because of reloading problems in the past#2018-12-1210:07stathissideristhanks#2018-12-1210:24bozhidarLein 2.8.2 is out (https://github.com/technomancy/leiningen/releases/tag/2.8.2) and it bundles the latest and greatest nREPL release! All CIDER users are strongly advised to move from Lein 2.8.1 to 2.8.2. The plan is that CIDER 0.20 will require 2.8.2 or newer for cider-jack-in to work.#2018-12-1212:31lispycloudsFor MacOS users, my PR to upgrade it in homebrew just got merged too. Happy updating! 😄#2018-12-1211:19Saikyunis it possible to enable breakpoints on exceptions? iirc java has this, but I haven't been able to find it for clojure#2018-12-1211:33Saikyunalso is it possible to automatically reload files into the buffer when I save them?#2018-12-1212:09pradyumnaon digging deeper found that the value of :defs is {} in the return from cljs-tooling.util.analysis/find-ns, when the source file doesn't have a single def form. which is typical for subs or event files in re-frame projects. as a result cider-find-keyword fails with "Can't find namespace". @bozhidar any suggestion? as a workaround i can put a dummy def form in those files. is there any other way?#2018-12-1212:15bozhidar> is it possible to enable breakpoints on exceptions? iirc java has this, but I haven’t been able to find it for clojure#2018-12-1212:16bozhidar@saikyun No, currently we don’t have such functionality in CIDER’s debugger.#2018-12-1212:16bozhidarPotentially it’s doable, but I don’t think anyone’s working on this.#2018-12-1212:16bozhidar> also is it possible to automatically reload files into the buffer when I save them?#2018-12-1212:17bozhidarYeah, you can always leverage Emacs’s after-save-hook or something like this.#2018-12-1212:18bozhidar> on digging deeper found that the value of :defs is {} in the return from cljs-tooling.util.analysis/find-ns, when the source file doesn’t have a single def form. which is typical for subs or event files in re-frame projects. as a result cider-find-keyword fails with “Can’t find namespace”. @bozhidar any suggestion? as a workaround i can put a dummy def form in those files. is there any other way?#2018-12-1212:18bozhidarI guess we can work around this in cljs-tooling. You can file a ticket there.#2018-12-1212:21pradyumnathanks @bozhidar, i'll create the ticket#2018-12-1213:10Saikyun>Potentially it’s doable, but I don’t think anyone’s working on this.
@bozhidar okay, good to know.
>Yeah, you can always leverage Emacs’s after-save-hook or something like this.
ah, I see. I was somehow thinking that the nrepl should be the one looking for file changes, but using the save hook makes sense 🙂#2018-12-1213:16manuelWith latest nREPL I get nrepl-send-sync-request: Sync nREPL request timed out on cider-jack-in-clj&cljs. Is it happening to someone else?#2018-12-1213:17manuelI am using latest lein, by the way.#2018-12-1213:22lispyclouds@manuel This is the issue i think: https://github.com/technomancy/leiningen/issues/2497#2018-12-1213:23manuelyes, that's it#2018-12-1213:23lispycloudsGet this error REPL server launch timed out. even when you run lein repl manually#2018-12-1213:26manuelI can confirm that reverting to 2.8.1 works. Thanks for the tip.#2018-12-1214:06bozhidarFuck! Seems I really messed something up!#2018-12-1215:17jumarDo you use clj-refactor, in particular cljr-find-usages and/or cljr-rename-symbol?
This is something that I really miss - I normally just do fulltext search and/or replace
Trying to use aforementioned functions give me these errors in our project:
Caused by: clojure.lang.ExceptionInfo: [line 11, col 0] Invalid keyword: ::specs/warning.
I tried to use cider-load-all-project-ns (as suggested here: https://github.com/clojure-emacs/clj-refactor.el/issues/353) but it just keeps throwing those errors.
I guess that performance also isn't great but it could be usable if it ever worked.#2018-12-1216:26aptHi. Does anyone know if there's a cider command for formatting code in multiple lines? Like, given a {:foo :bar :baz :x} map, format it in the buffer like {:foo :bar \n :baz :x}#2018-12-1217:03bozhidar@manuel The problem is fixed, btw.#2018-12-1217:56futuro@andre.peric look up the cider-pprint- family of functions and options; they should have you covered. #2018-12-1218:06manuelthanks @bozhidar!#2018-12-1218:07manuel@bozhidar should CIDER inject nREPL 0.5.3 now?#2018-12-1218:56bozhidarYeah, it should, but lein repl :headless was never broken, so this won’t really fix the problem for anyone.#2018-12-1218:56bozhidarI know that Phil will issue a bugfix lein release pretty soon. I won’t be surprised if it happens today.#2018-12-1221:32PacoWhen I do cider-jack-in-clj&cljs my cljs repl foes from cljs-pending state to clj repl. Figwheel main works fine and I can eval cljs code in the repl but if I try to eval code in a cljs file it I get a there are no cljs REPLS error.#2018-12-1221:33PacoAnyone else have this issue?#2018-12-1222:10Paco#2018-12-1223:02PacoNVM I had an old cider-nrepl plugin configured in my ~/.lein/profiles.clj#2018-12-1309:52rickmoynihan@bozhidar: Thanks for your recent reply to my github issue.
As an aside will this:
https://github.com/RickMoynihan/nrebl.middleware/blob/6f8f410f2e50b50ee1b554317fda1fdd825c7a75/src/nrebl/middleware.clj#L37-L40
always guarantee that my response middleware occurs after eval and before pr-values? It feels like I need to also specify pr-values in there (presumably as a :requires in order to force mine to always be between those two.#2018-12-1309:56bozhidarYeah, you have to be a bit more specific in the descriptor to make sure the middleware gets inserted properly in the final vector.#2018-12-1310:12rickmoynihanCool. Will give that a try.
Is there an easy way to inspect the order of the final middlewares?#2018-12-1310:10andrea.crottiI just filed an issue to yagni
https://github.com/venantius/yagni/issues/45
but there might be a chance that it's a cider-nrepl issue maybe?#2018-12-1317:39Nick StaresCan the result of cider-interactive-eval be made to be sent to repl? If I get an error it is currently sent to the *Messages* buffer#2018-12-1317:50dpsuttontry using the cider-insert-* style commands. they will do what the interactive ones do but put it in the repl instead. There's a map at C-c C-j [key] where k is defun, expression, and region#2018-12-1317:59Nick StaresThanks! In my case (cider-insert-in-repl "(do (ns user) (reset))" 't) did the trick.#2018-12-1401:55dcji had major issues with lein 2.8.2 involving nrepl. I had to revert back to 2.8.1.
✗ lein repl
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Exception in thread "main" java.lang.AssertionError: Assert failed: transport-fn, compiling:(/private/var/folders/nr/8vbdczz90ps9zfrklvm8jfwm0001yl/T/form-init7457278500009733573.clj:1:125)
at clojure.lang.Compiler.load(Compiler.java:7526)
at clojure.lang.Compiler.loadFile(Compiler.java:7452)
at clojure.main$load_script.invokeStatic(main.clj:278)
at clojure.main$init_opt.invokeStatic(main.clj:280)
at clojure.main$init_opt.invoke(main.clj:280)
at clojure.main$initialize.invokeStatic(main.clj:311)
at clojure.main$null_opt.invokeStatic(main.clj:345)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.invokeStatic(main.clj:424)
at clojure.main$main.doInvoke(main.clj:387)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:702)
at clojure.main.main(main.java:37)
Caused by: java.lang.AssertionError: Assert failed: transport-fn
at nrepl.core$connect.invokeStatic(core.clj:168)
at nrepl.core$connect.doInvoke(core.clj:168)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at nrepl.ack$send_ack.invokeStatic(ack.clj:45)
at nrepl.ack$send_ack.invoke(ack.clj:41)
at nrepl.server$start_server.invokeStatic(server.clj:146)
at nrepl.server$start_server.doInvoke(server.clj:105)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at user$eval39983.invokeStatic(form-init7457278500009733573.clj:1)
at user$eval39983.invoke(form-init7457278500009733573.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7062)
at clojure.lang.Compiler.eval(Compiler.java:7052)
at clojure.lang.Compiler.eval(Compiler.java:7052)
at clojure.lang.Compiler.load(Compiler.java:7514)
... 12 more
#2018-12-1406:49manuelIt's already been reported here: https://github.com/technomancy/leiningen/issues/2497#2018-12-1408:05dcjMine was on MacOS#2018-12-1409:07lispyclouds@dcj this affects leiningen in all OSes. It was an issue with nREPL.#2018-12-1409:18plexusMade a quick video about using Figwheel-main + Clojure CLI + CIDER : https://youtu.be/hcFx-QL5ySM#2018-12-1421:48ChrisSuper, this is exactly what I was looking for recently! Thanks #2018-12-1507:13manuel@bozhidar following the new release of lein (2.8.3), I now get this on a project configured with lein and CIDER:
❯ lein repl
[WARNING] No nREPL middleware descriptor in metadata of #'cider.piggieback/wrap-cljs-repl, see nrepl.middleware/set-descriptor!
nREPL server started on port 41553 on host 127.0.0.1 -
ERROR: Unhandled REPL handler exception processing message {:id b103d5eb-0dad-4eca-90a6-dbce5a8be1da, :op clone}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2292)
at clojure.core$deref.invokeStatic(core.clj:2312)
at clojure.core$deref.invoke(core.clj:2298)
at cider.piggieback$wrap_cljs_repl$fn__22856.invoke(piggieback.clj:274)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__15275.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__14240.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5476.invoke(core.clj:2022)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#2018-12-1507:14manuelDo you want me to file an issue?
(Which one, though, CIDER or nREPL or lein? 🙂)#2018-12-1509:31bozhidar@manuel What’s your middleware version?#2018-12-1509:32bozhidarIt’s certainly not a lein issue anymore - I see some reference to the legacy tools.nrepl, so I assume you’ve got some legacy dependency somewhere.#2018-12-1509:33manuellet me check#2018-12-1509:35manuel@bozhidar you're right. Upgraded all the outdated dependencies in the project, now lein repl works as expected. Thanks for the tip.#2018-12-1509:35bozhidarAny time!#2018-12-1509:36bozhidarIt’s important for people to be on a recent piggieback, cider-nrepl and friends, as support for the modern nREPL was added relatively recently.#2018-12-1608:22ackerleytnganyone here uses stumpwm? how do you deal with the cider shortcuts for testing?#2018-12-1616:37pesterhazyRe: nrepl.cmdline
> You can to pass -i (--interactive) if you want to get a REPL as well.
@bozhidar have you considered a command line option that allows you to daisy-chain a next -main command?#2018-12-1616:38pesterhazyFor example, one could use -m nrepl.cmdline --chain clojure.main [clojure.main options go here]#2018-12-1616:39pesterhazyWith the --chain flag, nrepl.cmdline would spawn the nREPL server in the background. Once that's done, it would defer the daisy-chained -main#2018-12-1616:39pesterhazyInstead of clojure.main you could also specify rebel-readline.main#2018-12-1616:40pesterhazyBoth would give you a terminal-based repl, and these would be more direct (no network connection required) and also faster than the one --interactive gives you#2018-12-1622:04dominicm@pesterhazy this is something I considered as part of the issue I linked you. #2018-12-1622:06dominicmThis would solve it for the common case of nrepl, it would be nice to have a generic interface though.
I think that the new clojure.main flag for calling functions would solve the problem betterish.#2018-12-1622:22pesterhazy@dominicm is there a JIRA for tools.deps for that?#2018-12-1622:22dominicmAlex has mentioned in slack, haven't looked for a jira#2018-12-1622:23pesterhazyYou mean that "start" parameter he's mentioned?#2018-12-1622:24pesterhazyI think that given that Alex has a lot on his plate it would be a good idea to look into alternatives that can do without changes to the cli tool#2018-12-1706:46dominicmWriting our own main would be cool 😊 #2018-12-1706:46dominicmProve the idea#2018-12-1706:58bozhidarSeems you’ve sorted this out by the time I came.#2018-12-1706:58bozhidar🙂#2018-12-1707:02bozhidarBtw, the built-in interactive REPL in nREPL is not really meant for any serious use, as it’s mostly a proof-of-concept (a reference for people looking to implement something on top of nREPL). We can’t really depend on REPLy or rebel, but we can always check if they are present and use them if they are. I know that’s different from the discussion, so far, but I’m mentioning it as well, as another way to get a more capable REPL client.#2018-12-1707:03dominicmI want both for edge. Nrepl client in the terminal is not especially appealing for local development. Rebel doesn't have an nrepl mode.#2018-12-1719:33futuro@ackerleytng I use stump, and I handle any Ctrl-T mappings in programs by doing ctrl-t t to pass it in directly.#2018-12-1815:44ackerleytnghi fellow stump user!! emacs' cider's test mappings all use C-t right?#2018-12-1818:27futuroI believe so, though I don't use them because our tests use test-fn-name instead of fn-name-test, and I haven't had time to fix it lol.#2018-12-1818:28futuroIt might be possible to easily remap those bindings, though my emacs-fu isn't quite strong enough to know how.#2018-12-1914:53ackerleytngi see, yup i don't think it's so straightforward haha#2018-12-1914:54futuroWhat about a different top-level binding for stump?#2018-12-1914:54futuroFor tmux I rebound the ctrl key to ctrl-[ because I use ctrl-a to go to the beginning of the line, and that's been really helpful.#2018-12-2013:32ackerleytngi'm trying out ctrl-i, but i'm finding it a little difficult to adapt to, also i guess because C-i needs both hands#2018-12-2120:31futuroWhat about C-d?#2018-12-2120:31futuroI guess that's "move down half a page" in readline#2018-12-2312:39ackerleytngthat's delete char in emacs! hahah#2018-12-1719:33futuroIf I had to use ctrl-t a lot, or if I found that cumbersome, I'd probably bind a different key, such as ctrl-[ as my main modifier.#2018-12-1719:35futuroIt hasn't bothered me enough yet to go about rebinding the main modifier, but that's what I did for tmux and ctrl-a (as I use readline constantly).#2018-12-1720:00andnilsWeird thing: I have run cider-jack-in-clj on a project. Then, I close the connection and run cider-jack-in-clj on a second project, and this project is of type clojure-cli (deps.edn) I get the following:#2018-12-1720:00andnils#2018-12-1720:02andnilsThis is cider-20181212.1936. No problem when running cider-18.0.#2018-12-1720:12andnilsSeems sesman-friendly-session-p called via cider-repls is involved...#2018-12-1720:56kommen@U05542278 would be helpful to get a stacktrace (set to debug-on-error to t)#2018-12-1721:05andnilshttps://gist.github.com/andnils/5065cc4b489bd20f2753b1b82f8bcbc6#2018-12-1721:16andnilsmeh...couldn't include the whole stacktrace so I had to trim it a bit...#2018-12-1721:16andnilsanyways, I haven't dug into the cider source before so it's new for me...#2018-12-1721:17andnilssaw some stuff about connect-sibling so I reckon that's why I get problem with the second connection#2018-12-1721:24alexyakushev@bozhidar I've pushed out compliment 0.3.8, minus one blocker for 0.19 🙂#2018-12-1723:07alexyakushevOK, this bothered me for a long while: if you evaluate something like this: ({:a} 1), CIDER will pop up a stacktrace saying Unmatched delimiter: ).#2018-12-1723:08dpsutton[dan@fedora clojure]$ clj
Clojure 1.9.0
user=> ({:a} 1)
RuntimeException Map literal must contain an even number of forms clojure.lang.Util.runtimeException (Util.java:221)
1
RuntimeException Unmatched delimiter: ) clojure.lang.Util.runtimeException (Util.java:221)
user=>
seems par for the course#2018-12-1723:08alexyakushev[cont] I understand it is the default REPL behavior to evaluate everything until the input is exhausted, but wouldn't it make more sense to short-circuit that the first time an error happens?#2018-12-1723:09alexyakushevMakes it a real pain in the butt to look through a large function to find that one pesky odd-element map.#2018-12-1723:10dpsuttondo you mean this to be in #clojure-dev or here? seems like you want to change clojure?#2018-12-1723:10alexyakushevConfusing as hell too, not to mention the beginners.#2018-12-1723:12alexyakushev@dpsutton When that happens in regular Clojure REPL, at least you get all the errors at once. Also, it shows line/column then.#2018-12-1723:12alexyakushevIn CIDER though, only the last exception is displayed which doesn't make any sense.#2018-12-1723:13alexyakushevDoesn't necessarily has to be a change to Clojure, might modify "eval" op as well.#2018-12-1723:16dpsuttonah the first error message is not shown, just the unmatched delimiter#2018-12-1723:16dpsuttoni missed that part 🙂#2018-12-1723:19alexyakushevAFAIU, it is probably expected for default Clojure REPL/socket REPL as it's sorta stream-oriented.#2018-12-1723:20alexyakushevBut since nREPL has a strictly defined concept of a "message", it should do no harm to discard the eval operation of the whole message at the first error.#2018-12-1723:20dominicmIf I recall correctly, multiple stacks are sent if available. I'm not sure what's happening to from this. #2018-12-1723:21alexyakushevThat's true, they are all sent, and I think they are actually rendered one after the other. But that happens in a rapid succession, so you only get to see the last one.#2018-12-1723:23alexyakushevBut I'd argue that the whole "read it till the end" approach is counter-intuitive and potentially dangerous.#2018-12-1723:24alexyakushevAs demonstrated in the default Clojure REPL:
user=> (defn send-rockets! [] (println "BOOM!"))
#'user/send-rockets!
user=> (comment {:a} (send-rockets!))
Syntax error reading source at (REPL:1:14).
Map literal must contain an even number of forms
BOOM!
nil
Syntax error reading source at (REPL:1:31).
Unmatched delimiter: )
#2018-12-1723:33dominicm> That's true, they are all sent, and I think they are actually rendered one after the other. But that happens in a rapid succession, so you only get to see the last one.
Cider.el only shows one at a time, and provides no mechanism for backwards and forwards? #2018-12-1723:34alexyakushevIt does show all the lines in the REPL buffer, but only one stacktrace buffer is displayed, with the last error.#2018-12-1807:45manuelhey guys. I moved a project from lein/figwheel to deps.edn/shadow-cljs (already did it successfully for a home project, this is something I'm doing for a work project). I run shadow-cljs watch my-app from the terminal, and then from CIDER:
- M-x cider-connect
- I pick localhost
- I type 8777
And get this in the resulting REPL buffer:
WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly
More information.
WARNING: Can't determine Clojure's version. CIDER requires Clojure 1.8.0 (or newer).
More information.
WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
More information.
This is the shadow-cljs.edn file, if it can help:
{:source-paths ["src/cljs"]
:nrepl {:port 8777
:middleware [refactor-nrepl.middleware/wrap-refactor]}
:dependencies [[bidi "2.1.4"]
[binaryage/devtools "0.9.10"]
[cider/cider-nrepl "0.18.0"]
[cljs-ajax "0.8.0"]
[clojure-humanize "0.2.2"]
[com.cemerick/url "0.1.1"]
[hickory "0.7.1"]
[day8.re-frame/http-fx "0.1.6"]
[kibu/pushy "0.3.8"]
[macchiato/hiccups "0.4.1"]
[re-frame "0.10.6"]
[reagent "0.8.1"]
[reagent-utils "0.3.1"]
[refactor-nrepl "2.4.0"]]
:builds {:my-app {:target :browser
:output-dir "resources/public/js"
:asset-path "/js"
:modules {:main {:entries [gaypa-docs.core]}}}}}
#2018-12-1807:47manueldeps.edn is here:
{:deps
{cheshire {:mvn/version "5.8.1"}
clj-http {:mvn/version "3.9.1"}
com.cemerick/url {:mvn/version "0.1.1"}
compojure {:mvn/version "1.6.1"}
hiccup {:mvn/version "1.0.5"}
http-kit {:mvn/version "2.3.0"}
org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/core.cache {:mvn/version "0.7.1"}
org.clojure/data.json {:mvn/version "0.2.6"}
org.clojure/tools.reader {:mvn/version "1.3.2"}
metosin/ring-http-response {:mvn/version "0.9.1"}
mount {:mvn/version "0.1.15"}
prone {:mvn/version "1.6.1"}
ring {:mvn/version "1.7.1"}
ring/ring-defaults {:mvn/version "0.3.2"}
ring/ring-json {:mvn/version "0.4.0"}
ring/ring-mock {:mvn/version "0.3.2"}
ring-middleware-format {:mvn/version "0.7.2"}
slingshot {:mvn/version "0.12.2"}
tongue {:mvn/version "0.2.5"}}
:paths ["src/clj" "resources"]
:aliases {:run {:main-opts ["-m" "my-app.core"]}
:test {:extra-paths ["test/clj"]}}}
#2018-12-1807:47manuelDon't know what I am missing, to be honest.#2018-12-1808:30lilactown@manuel what version of CIDER are you using?#2018-12-1808:30lilactownand shadow-cljs#2018-12-1808:31manuelCIDER is latest from MELPA. And shadow-cljs: version: 2.7.9 node: v8.14.0#2018-12-1808:31lilactowncan you just cider-version to be sure?#2018-12-1808:32manuelCIDER 0.19.0snapshot (package: 20181212.1936)#2018-12-1808:35lilactownhm#2018-12-1808:35lilactownyour shadow-cljs.edn worked for me#2018-12-1808:35manuelI should also add that doing: (shadow/nrepl-select :my-app) in after cider-connect, gets me a working REPL.#2018-12-1808:37lilactownI have cider 0.18.0 atm so not sure if that’s the reason#2018-12-1808:39manuelnot sure either, especially since everything works fine with no warnings on this project: https://github.com/manuel-uberti/boodle#2018-12-1808:42manuelalso, adding [cider/cider-nrepl "0.19.0-SNAPSHOT"] to shadow-cljs.edn doesn't fix the warning#2018-12-1808:44manuelI noticed this in the output of shadow-cljs watch :my-app:
[2018-12-18 09:39:02.276 - INFO] Using tools.nrepl 0.2.* server!
#2018-12-1809:53manuelFixed it thanks to @thheller. I have to exclude com.cemerick/austin, which is brought in by macchiato/hiccups: [macchiato/hiccups "0.4.1" :exclusions [com.cemerick/austin]]#2018-12-1811:40martinklepschhad some idea on opening cljdoc from cider and other REPL environments, would be curious what people think of this in general: https://github.com/cljdoc/cljdoc/issues/92#issuecomment-448191639#2018-12-1811:45manuel@martinklepsch FWIW, I welcome every new improvement on documentation, especially if integrated within CIDER#2018-12-1814:06andrea.crottiis there a way to kill both cljs and clj processes with cider-quit?#2018-12-1814:07andrea.crottievery time I have to do a "clean restart" I always have to
- kill semi manually the processes
- lein clean
- and finally jack in clj and cljs#2018-12-1814:07andrea.crottiI can automate that but I need at least an easy way to kill both clj and cljs repls in one go#2018-12-1821:09escherizeSo, uh, I want to represent a string like "\newcommand{\itab}[1]{\hspace{1em}\rlap{#1}}" but I am getting EOF - I think it has something to do with the \n \i \h and/or the \r - How can I just have a string that is literally the string in that snippet?#2018-12-1821:09escherizeescape it!#2018-12-1821:24dpsuttonyeah put an extra slash for each one#2018-12-1821:42jonasIs cider 0.18.0 having some issues with clojure 1.10.0? Maybe it’s just my setup but I’m getting NPEs from clojure.string/replace-first on some unrelated errors#2018-12-1821:45jonasnvm, I think I’m having this issue https://github.com/clojure-emacs/cider/issues/2443#2018-12-1914:13erikhow to make *cider-error* pop up without delay after exceptions from repl?#2018-12-1915:44macrobartfastI'm confused about the error message improvements in 1.10... (let [x]) produces
Syntax error macroexpanding clojure.core/let at (form-init1640041536431823190.clj:1:1).
[x] - failed: even-number-of-forms? at: [:bindings] spec: :clojure.core.specs.alpha/bindings
and 1.8 produces:
IllegalArgumentException let requires an even number of forms in binding vector in scratchapp.core:1 clojure.core/let (core.clj:4333)
1.8 seems much more noob friendly/clear... what am I not understanding?#2018-12-1916:36futuroIs this the "error messages got worse so they could get better" conversation that's been happening in the community later?#2018-12-1916:37futuroIn that macro errors are more easily machine consumable, but the printing of their values became less beginner friendly in the interim?#2018-12-1916:51dpsuttonI'm not sure there is much CIDER can/should do here. But i do believe that some of the error messages were hand tailored in older Clojures and these have been removed in favor of the current approach. I think there is a very informative ticket in jira that you should read and then if you still have questions you can chat with alex. although this was a ton of work and was just released two days ago so it may not be the best time to bring up things#2018-12-1920:47macrobartfastI'm for sure am really grateful for all the work in this area and in no way am intending to say it's better or worse... I am just getting familiarized with things, and @futuro’s mention of 'more easily machine consumable' is probably what's going on.#2018-12-1920:49macrobartfastI'm guessing the new error messages are going to be more more amenable to being integrated with things that will really explain things better to the user.#2018-12-1921:03dominicmI think expound being integrated directly into cider would be a big win. It's an idea I've been thinking about for a while. #2018-12-1921:42vigilancetechwhat is the current strategy for getting rid of the WARNING: clj-refactor and refactor-nrepl are out of sync. message?
I have these in my dependencies:
[cider/cider-nrepl "0.18.0"]
[refactor-nrepl "2.4.0"]
#2018-12-1921:44vigilancetechalthough the error message shows Their versions are 2.4.0 (package: 20180826.2149) and n/a, respectively.#2018-12-1921:45dpsuttoncheck the output of (cljr--version)#2018-12-1921:48vigilancetech(cljr--version)
"2.4.0 (package: 20180826.2149)"
(cljr-version)
"clj-refactor 2.4.0 (package: 20180826.2149), refactor-nrepl is unreachable"
#2018-12-1922:13dpsuttonand what is the jack in command that CIDER issued? you can find this in the *Messages* buffer (if you're not familiar)#2018-12-1922:35vigilancetech@dpsutton nvm, I got it. I deleted the clj-refactor cache and restarted emacs#2018-12-2008:59puzzlerIs there a parinfer 2 implementation for emacs?#2018-12-2009:07orestisI’m having trouble wrapping my head around how I can get CIDER to connect to two different nREPL servers at the same time, within the same project. I am running my nREPL servers outside of CIDER: One is a plain Clojure server, the other is shadow-cljs. I can connect to either one of them and the correct thing happens, but when I try to connect at both, suddenly things start to fall apart. I’ve read the http://www.cider.mx/en/latest/managing_connections/ many times and I still can’t figure out how to do it. Any pointers welcome 🙂#2018-12-2009:08orestisAs I understand it, I need to have two different “sessions”, since my sessions won’t share the same nREPL server.#2018-12-2009:09orestisSo I need to do both cider-connect-clj and cider-connect-cljs. I do that, and sesman does report the two sessions running independently.#2018-12-2009:10orestisI tried to link a session with a buffer, and i see the link in sesman, but still I can’t get the expected results — evaluating to my CLJS buffer seems to hang or do something weird.#2018-12-2009:10orestis~Using the shadow-cljs graphical REPL (in the build server webpage) produces the expected results so the nREPL connection is working.~ Apparently not an indicator, the build-browser repl is not using nREPL.#2018-12-2009:11thhellerFWIW the built-in REPL doesn't use nREPL#2018-12-2009:12orestisOh, it shows a list of nREPL-like connections so this is what I assumed.#2018-12-2009:13thhellernah it directly talks to the internals which are a layer below nrepl#2018-12-2009:15orestisThanks for the clarification.#2018-12-2009:16orestisI tried to follow the instructions on the manual but it seems the commands indicated there are named something different in CIDER 0.18 — I’d file a PR to change them but perhaps best to first figure this out 🙂#2018-12-2014:220atmanafternoon gang. Can someone advise me how to use cider debugging inside a deftest?#2018-12-2014:240atman#2018-12-2014:250atmanas you see, my tests are wrapped in a let, which gets debugged as normal: I can hit c to move through the forms until it gets to the deftest#2018-12-2014:250atmanthen the debugger quits, and my-test is highlighted in red, ready to be debugged when run. When I run it with , t t it doesn't debug, it passes as normal#2018-12-2014:250atmanhalp!#2018-12-2014:48onecoder4uNewbie here. I'm getting an error when trying to run coder-jack-in. I'm able to start the repl manually via lein and cider-connect to it. the error is Error loading refactor-nrepl.middleware#2018-12-2014:49onecoder4uI'm using emacs-live to setup everything#2018-12-2014:50onecoder4uA couple things I tried, I deleted my profile file.#2018-12-2014:53onecoder4uI tried the following specifying the following plugins cider/cider-nrepl "0.12.0", refactor-nrepl "2.2.0"#2018-12-2014:53dpsuttonah. you are following the clojure for the brave and true setup?#2018-12-2014:54dpsuttoncider 0.12 is about 4 years old. current version is 0.18#2018-12-2014:54onecoder4uno, i'm used the emacs-live overtone setup for clojure#2018-12-2014:55onecoder4uWould you recommend using the "clojure for the brave and true" setup ? or is there another one?#2018-12-2014:56dpsuttonno i thought that was what was giving you issues 🙂#2018-12-2014:56dpsuttoni wrote a bit about it here: https://github.com/clojure-emacs/cider/issues/2535#2018-12-2014:57onecoder4uok ty, i'll take a look and see if that gets me going in the right direction.#2018-12-2015:12dpsuttonfor sure 🙂 sorry it can be so complicated. i would recommend dropping refactor stuff until you have a known working repl and then add it in#2018-12-2015:22onecoder4utrying to figure out now why cider version is 0.14.#2018-12-2015:23onecoder4uI don't see any thing specifying that version.#2018-12-2017:00mhcatafter upgrading to leiningen 2.8.3 I'm seeing this trying to start a repl: Warning: implicit middleware found: refactor-nrepl.plugin/middleware \nPlease declare all middleware in :middleware as implicit loading is deprecated.\
#2018-12-2017:00mhcatthe repl doesn't start, this is caught by the emacs debugger which I have switched on for errors#2018-12-2017:22mhcatok I fixed the repl by fixing unrelated symbol resolution issues#2018-12-2017:48jumar@tristram I also have issues to debug tests when run via cider utilities.
However, using (clojure.test/run-tests ) works.
See here: https://stackoverflow.com/questions/53870654/use-cider-debugging-inside-a-deftest/53873709#53873709#2018-12-2018:070atmanmany thanks @jumar, that is a great workaround#2018-12-2018:070atmanI can't believe we're the only ones to want to debug inside a test, though - right?!#2018-12-2018:08jumarTo be honest, I faced this issues several times and just gave up.
Your SO question made me thinking and find at least the workaround pretty quickly 🙂#2018-12-2108:58lispycloudsWhen running cider-format-buffer I am getting this error Wrong type argument: arrayp, nil. Im new to the emacs ecosystem and im not sure how to debug this. Any help is much appreciated!#2018-12-2116:54lispycloudsfixed it. was a problem with boot where the nREPL middleware wasnt injected.#2018-12-2112:23bozhidar@alexyakushev Thanks!#2018-12-2117:27eraserhdTHANK YOU CIDER PEEPS! I have got basic stuff working in Kakoune, and I'll have so much more working soon because of your work.#2018-12-2118:03dominicmTell me more! #2018-12-2118:04dominicmIf I can switch to kak, that would be exciting#2018-12-2118:12eraserhdIt's still really really rough. But I have mapped ,ee to evaluate a form, and ,ef to evaluate a file. rep will need a bunch more options. I'll get symbol info next, (clojure-lsp can do this with kak-lsp, but it's stopped working for me and I haven't looked into it).#2018-12-2118:13eraserhdI'm thinking a lot about how to make a Kakoune repl buffer.#2018-12-2118:14eraserhdAnd running tests will be soon, since that's how I work.#2018-12-2118:17dominicmIs the replant code useful at all for figuring this stuff out? #2018-12-2118:26eraserhdI'm not sure. I've been reading cider.el, and I remember some details of vim-fireplace.#2018-12-2118:27eraserhdKakoune really wants tiny shell programs to do things, which is a philosophy I can dig, so I've been making it work that way.#2018-12-2118:52dominicmMe too, but replant has logic which I think you can reuse. #2018-12-2119:02eraserhdOK, queueing up for night-time reading :D#2018-12-2119:03eraserhdI think I've looked at it before, but not while thinking about how to work with Kakoune.#2018-12-2119:05eraserhdI'm thinking about how to make rep have a persistent "session" when rep will never stay around persistently.#2018-12-2119:06eraserhdI've seen evidence in the nrepl code that it's been thought about, but not implemented. Specifically, the ability to subscribe to :out and :err for a session.#2018-12-2118:00futuro@jumar @tristram deftest is a macro which probably explains why trying to attach the cider debugger to it fails, as the macro creates a new function with the name you gave, but the body of the test associated with the :test metadata on that function.#2018-12-2120:24jumarAs I said it works without problems as long as you run tests via run-tests et Al. I believe the problem is that cider evaluates the whole namespace when it runs tests which effectively removes breakpoints#2018-12-2215:520atmantop learning, guys. Thank you very much#2018-12-2215:530atmanwe do TDD at work (currently in Cursive), so debugging tests is a huge part of my life - I'll post here when I figure it all out 👌#2018-12-2118:01futuro(defmacro deftest
"Defines a test function with no arguments. Test functions may call
other tests, so tests may be composed. If you compose tests, you
should also define a function named test-ns-hook; run-tests will
call test-ns-hook instead of testing all vars.
Note: Actually, the test body goes in the :test metadata on the var,
and the real function (the value of the var) calls test-var on
itself.
When *load-tests* is false, deftest is ignored."
{:added "1.1"}
[name & body]
(when *load-tests*
`(def ~(vary-meta name assoc :test `(fn [] ~@body))
(fn [] (test-var (var ~name))))))
#2018-12-2118:01futuroI suspect its the confluence of how cider debugging decides to drop the debugger off of re-evaluated functions, and how deftest builds a test on a function.#2018-12-2119:35bozhidarhttp://www.cider.mx/en/latest/debugging/#debugger-internals#2018-12-2203:56vigilancetechanyone know why I'm getting this (with shadow-cljs)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by cider.inlined_deps.orchard.v0v3v4_20181106v231743_
1.dynapath.v0v2v5.dynapath.defaults$eval30899$fn__30900 to method java.net.URLClassLoade
r.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of cider.inlined_deps.orchard
.v0v3v4_20181106v231743_1.dynapath.v0v2v5.dynapath.defaults$eval30899$fn__30900
#2018-12-2207:34bozhidar@vigilancetech You can safely ignore it. It’s artefact of changes in JDK 9.#2018-12-2207:35bozhidarSee https://github.com/clojure-emacs/orchard/issues/20 for details.#2018-12-2216:36practicalli-johncan someone confirm that M-x clojure-cheatsheet is now replaced with M-x cider-cheatsheet? It seems that clojure-cheatsheet doesnt do anything (at least in my setup) but cider-cheatsheet works just fine.#2018-12-2216:51Chaseclojure-cheatsheet pulls up for me in a browser if that's what you are looking for. It seems to want it to be clojure-view-cheatsheet. When I use cider-cheatsheet it seems to let me dial down to a specific variable. I haven't used these before so not sure if that helps.#2018-12-2217:04bozhidar@jr0cket Yeah, I can confirm this.#2018-12-2217:05bozhidarThe only real difference is that clojure-cheatsheet had a hardcoded dependency on helm and cider-cheatsheet is presentation-agnostic, meaning you can easily render the data with every front-end you can imagine.#2018-12-2217:14practicalli-johnclojure-cheatsheet seems to be broken in Spacemacs, gives the error helm-M-x: Cannot open load file: No such file or directory, cider-interaction. So I was going to update the clojure layer to use cider-cheatsheet instead (which works nicely)#2018-12-2217:16bozhidar:thumbsup:#2018-12-2218:03phillI did cider-connect-cljs (figwheel) and got this message "CIDER requires cider-nrepl..." and also the mode line says (pending-cljs) even though figwheel already displayed its dev:cljs.user=> prompt after node.js connected to it. Was trying to follow the notes at https://github.com/lambdaisland/npmdemo and chose the figwheel option because of that lambdaisland phrased as "the possibility to connect with nREPL (e.g. with Emacs/CIDER)".#2018-12-2218:04phillI put [cider/cider-nrepl "0.18.0"] in both :dependencies and :plugins but somehow CIDER feels a lack of it#2018-12-2218:05bozhidarAre you using figwheel-sidecar?#2018-12-2218:05phillYes it is among the :dependencies#2018-12-2218:06phill0.5.18#2018-12-2218:07phillAlso cider/piggieback 0.3.9#2018-12-2218:08bozhidarHow did you start the repl exactly?#2018-12-2218:08philllein figwheel#2018-12-2218:08phillThe project clj says :figwheel { :nrepl-port 3451} and I connected CIDER to that port#2018-12-2218:09bozhidarGot it. That explains it.#2018-12-2218:09phillThe connection apparently succeeded, (clojure-version) says 1.9.0#2018-12-2218:09bozhidarI think the problem is that figwheel doesn’t add cider-nrepl automatically to the server it starts, so it will probably be best to start the server yourself and then run figwheel manually from the REPL.#2018-12-2218:10bozhidarE.g. something like this#2018-12-2218:10bozhidarhttps://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#launching-figwheel-from-nrepl#2018-12-2218:10bozhidarProbably using cider-jack-in-cljs will work better for you as well.#2018-12-2218:21phillWell! It still says CIDER requires nrepl..., but on the other hand, I learned to do (cljs-repl) and that seems to work!#2018-12-2218:22philloh - I should try cider-jack-in-cljs.#2018-12-2218:22bozhidarCIDER works without cider-nrepl, but in a rather limited way - basically nothing except basic evaluation works this way.#2018-12-2218:35richiardiandreaHaving said that I always wondered whether things like tests should just default to evaluating clojure.test/run-tests for instance#2018-12-2218:37phillWow this is pretty nifty#2018-12-2218:40bozhidar> Having said that I always wondered whether things like tests should just default to evaluating clojure.test/run-tests for instance#2018-12-2218:41bozhidar@richiardiandrea It used to be like this. In hindsight I regret removing the fallbacks and I wanted to add them back to for most basic ops - source lookup, doc lookup, etc.#2018-12-2218:41bozhidarI never found the time for this, though, but it’s relatively simply thing that anyone can do.#2018-12-2218:42bozhidarI guess that’d be extra useful on the ClojureScript front.#2018-12-2218:51richiardiandreaOh yes definitely worth it, should I scan the commits in cider?#2018-12-2218:54phillGoodness gracious, cider-jack-in-clj&cljs is an experience. It totally blows away the silly old advice, "do one thing and do it well"#2018-12-2218:55phillI think I will try Clojure 1.10#2018-12-2219:01bozhidar@phill Happy to hear this!#2018-12-2219:01bozhidar> Oh yes definitely worth it, should I scan the commits in cider?#2018-12-2219:01bozhidar@richiardiandrea Sure. I think you have to go back to CIDER 0.6-0.7 if memory serves.#2018-12-2219:03richiardiandreaOk sounds great#2018-12-2316:26borkdudeI just upgraded CIDER because I used to get a stacktrace when eval-ing some unknown var:
SEVERE: (#error {
:cause nil
:via
[{:type java.lang.NullPointerException
:message nil
:at [clojure.string$replace_first invokeStatic string.clj 165]}]
:trace
[[clojure.string$replace_first invokeStatic string.clj 165]
[clojure.string$replace_first invoke string.clj 138]
[cider.nrepl.middleware.stacktrace$relative_path invokeStatic stacktrace.clj 204]
[cider.nrepl.middleware.stacktrace$relative_path invoke stacktrace.clj 198]
[cider.nrepl.middleware.stacktrace$extract_location invokeStatic stacktrace.clj 219]
[cider.nrepl.middleware.stacktrace$extract_location invoke stacktrace.clj 206]
[clojure.core$comp$fn__5792 invoke core.clj 2569]
[clojure.core$map$fn__5851 invoke core.clj 2755]
[clojure.lang.LazySeq sval LazySeq.java 42]
[clojure.lang.LazySeq seq LazySeq.java 51]
#2018-12-2316:26borkdudebut now I can’t connect to my REPL anymore with cider-connect, because I get:
cider--check-existing-session: Symbol's function definition is void: sesman-current-sessions#2018-12-2316:32borkdudewiping my elpa dir did the trick, sorry for the noise#2018-12-2319:57borkdudesince the upgrade, I do notice that I can’t type as fast as some letters get dropped by the autocompletion or something, does anyone notice this?#2018-12-2320:01borkdudeexample, here is me trying to type “wait-exists”:
https://www.dropbox.com/s/s6abqhmkckbtmhx/cider.gif?dl=0#2018-12-2320:11genmeblogI also have some problems after upgrade, after connection to nrepl (0.5.3) everything works fine. But when I want to open file from other project I'm getting#2018-12-2321:05jonasI’ve seen the same error today. I’m running nrepl 0.5.0 and cider-nrepl 0.19.0-SNAPSHOT#2018-12-2321:07jonasI thought I was running the latest nrepl with 0.5.0 but apparently not. Will try to update#2018-12-2320:11genmeblogFile mode specification error: (wrong-type-argument stringp nil)
string-prefix-p: Wrong type argument: stringp, nil
Error in post-command-hook (global-font-lock-mode-check-buffers): (wrong-type-argument stringp nil)
#2018-12-2320:11borkdude@tsulej did you try to remove your elpa dir#2018-12-2320:11genmeblogI did#2018-12-2320:12genmeblogjust after reading your comment#2018-12-2320:13genmebloghere is bottom part of stacktrace
seq-map(#f(compiled-function (elt) #<bytecode 0x180a03695>) (("~/clojure2d-examples:localhost:60515" #<buffer *cider-repl ~/clojure2d-examples:localhost:60515(clj)*>)))
seq-filter(#f(compiled-function (ses) #<bytecode 0x1809e2a39>) (("~/clojure2d-examples:localhost:60515" #<buffer *cider-repl ~/clojure2d-examples:localhost:60515(clj)*>)))
sesman--friendly-sessions(CIDER sort)
sesman-current-session(CIDER)
cider-repls(clj nil)
cider-current-repl()
cider-connected-p()
redisplay_internal\ \(C\ function\)()
#2018-12-2320:13genmeblogso it looks that something is wrong with sesman#2018-12-2617:11andnilsLooks similar to https://github.com/clojure-emacs/cider/issues/2533#2018-12-2320:14borkdudeI now upgraded my Prelude installation as well. M-x doesn’t give any suggestions while typing…#2018-12-2320:29borkdudeah, the prelude issue was because the personal modules file was moved. fixed.#2018-12-2320:32borkdudethe typing problem also seems to have resolved itself now… 😅#2018-12-2402:21vigilancetechis there any way to have a 2nd cider-inspect session running (like to compare two similar data structures)?#2018-12-2419:52borkdudethis typing problem is happening again. I discovered it only happens in a ClojureScript buffer (not cljc)#2018-12-2419:53dpsuttontyping problem?#2018-12-2421:17borkdude@dpsutton when I type something, emacs tries to autocomplete my keywords, but then the words I type get mangled#2018-12-2421:19bozhidarI think the ClojureScript completion code hasn’t seen any changes in something like 5 years, so that’s puzzling.#2018-12-2421:20bozhidarAnd I guess if it was a global problem with company-mode you wouldn’t be experiencing this just in cljs buffers.#2018-12-2421:20bozhidarYou might play with Edebug and see what’s exactly happening there.#2018-12-2421:22borkdudehmm, it doesn’t seem to be company-mode. when I disable that, it still tries to do autocompletion#2018-12-2421:24borkdudehmm, it seems to be a minor mode that goes by the abbreviation AC. when I turn it off, the problem disappears… gotta go, but thanks for the replies#2018-12-2421:47borkdudeI had this somewhere in my init.el: (global-auto-complete-mode t), turned that off now#2018-12-2509:43stardivinerI have some idea about let Emacs/CIDER use Docker clojure container. Here is my post on CIDER issues https://github.com/clojure-emacs/cider/issues/2552 If you're interested in, please give feedback on the issue.#2018-12-2622:03erwinrooijakkersIs it possible to go a step backward in the debugger?#2018-12-2622:13bozhidarNo, it’s not.#2018-12-2707:33macrobartfastI'm getting ‘cider-find-var’ requires the nREPL op "info". Please, install (or update) cider-nrepl 0.15.0-SNAPSHOT and restart CIDER#2018-12-2707:33macrobartfastI don't have anything in my .lein/profiles.clj... should I? cider-connect and everything else works.#2018-12-2707:41macrobartfastwell, ok... added cider-nrepl 15 to .lein/profiles.clj and 'cider-find-var' now works. I guess that was it.#2018-12-2711:25andrea.crottiis there a way to get leiningen to run a custom command after the Repl is started?#2018-12-2800:21jumarWhat should be that custom command? Perhaps you can use :injections in your :repl profile#2018-12-2814:59andrea.crotti@U06BE1L6T it's just a command to start all the integrant processes#2018-12-2815:00andrea.crottibut the problem is that it should be called in the Clojure Repl but not in the Clojurescript Repl#2018-12-2815:00andrea.crottiand they both initially do a lein repl to start so not sure how to distinguish them#2018-12-2815:01andrea.crottibut well ideally it would just be a config like cider-clj-repl-form set to (go) for example (which however doesn't exist)#2018-12-2815:02jumarI think reader conditionals could be useful and still manageable.#2018-12-2815:33andrea.crottimm not sure how#2018-12-2815:33andrea.crottiboth repl starts in the same way, then one runs figwheel#2018-12-2815:33andrea.crottiand the other runs integrant#2018-12-2815:33andrea.crottibut they are both clj repl at that point#2018-12-2711:25andrea.crottiI can change the lein parameters with cider-lein-parameters but I need to be able to make it do something#2018-12-2711:38andrea.crottithe other alternative could be maybe to send something to do the cider buffer directly and get it evaluated#2018-12-2715:48bozhidar> well, ok... added cider-nrepl 15 to .lein/profiles.clj and ‘cider-find-var’ now works. I guess that was it. (edited)#2018-12-2715:48bozhidar@macrobartfast Btw, 0.15 is pretty old at this point. Consider updating to a more recent version.#2018-12-2715:49bozhidarYou can read more about your particular problem here http://www.cider.mx/en/latest/installation/#ciders-nrepl-middleware#2018-12-2715:50bozhidarand here http://www.cider.mx/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version#2018-12-2803:00ahungryis there a cider option to keep the REPL ns synced with the current clojure buffer ns?#2018-12-2803:41vemvI have such a fn, but it got reeeeeeeally custom so it's not worth sharing
but it should be pretty easy, and a good excuse to learn about Elisp hacking if you're still in that stage!#2018-12-2803:45ahungrythanks, I do enjoy a bit of elisp hacking 🙂#2018-12-2803:18dpsuttonnot that i know of. do you know the shortcut to load the buffer and set the ns though? (`C-u C-c M-z`)#2018-12-2803:19ahungrynice, thank you#2018-12-2803:19dpsuttonthat's built into my muscle memory and i use it the way you are asking#2018-12-2803:22ahungryWow, this is basically perfect! pressing the prefix is a little annoying (I use evil + evil-leader ,so for me its ; u followed by a gz. I guess I could advice cider-switch-to-repl-buffer or just write a wrapper function for it so I only ever need to hit gz to flip/flop#2018-12-2803:23ahungryOk, another one to fire off - is there a convenient way to enable pop up (ac-cider) doc help in the clojure mode buffers, not just in the cider repl? So that when I type, (map in a clojure buffer, I get the ac candidates with the popup.el help tooltip, as I do in the repl? (I know company supersedes ac-cider, but ac-cider still works perfect in the repl and company stated on github they will never support terminal based popup hover tips)#2018-12-2803:25dpsuttonadvice gets spooky. should be trivial to write a function that calls
(defun my-thing ()
(interactive)
(cider-load-buffer)
(cider-repl-set-ns (cider-current-ns)))
#2018-12-2803:26dpsuttonI have no idea how ac-cider works sorry#2018-12-2803:27ahungrythanks again x2#2018-12-2803:32ahungryI should have researched into my own init a bit more, I was just misisng a mode hook#2018-12-2803:32ahungry(that I had on cider repl hook)#2018-12-2803:32ahungry`#2018-12-2803:32ahungry(defun my-cider-ac-hooks ()
(auto-complete-mode 1)
(ac-flyspell-workaround)
(ac-cider-setup))
+ (add-hook 'clojure-mode-hook 'my-cider-ac-hooks)
#2018-12-2816:02pabloreAnyone knows what this error means?
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.17\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- with-profile +dev repl...
[nREPL] server started on 56326
[nREPL] Establishing direct connection to localhost:56326 ...
[nREPL] Direct connection to localhost:56326 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
This happens when doing cider-jack-in on a project#2018-12-2816:03pablorefurther tries give the error: user-error: 'cider-jack-in' requires the nREPL op "classpath" (provided by cider-nrepl)
#2018-12-2816:41bozhidar@pablore It means that probably something blew up while the server was starting. I guess the actual error is not visible in the message you’ve pasted here.#2018-12-2816:41bozhidarYou can try running the command in the shell to see what happens when you run it.#2018-12-2816:42bozhidarYou should also check out the instructions here https://www.cider.mx/en/latest/troubleshooting/#2018-12-2817:09pabloreyep, it’s blowing up when doing lein repl too:
Exception in thread "main" Syntax error compiling at (/private/var/folders/q9/7v8dcy694bj2mc9cykfm8gn00000gn/T/form-init5200111103923137134.clj:1:11480).
#2018-12-2817:10pabloreI don’t know why is it compiling some obscure clj file in /private#2018-12-2817:14bozhidarThat’s a temp storage for code evaluated in the REPL. Check your project’s configuration (and your profiles) it must be something wrong there. If lein repl doesn’t work properly, the problem is not CIDER-related.#2018-12-2821:25ahungryCan cider-doc auto complete from the company or ac-cider completions list at all? #2018-12-2900:30phillI heard a rumor about a breaking change in error messages causing 1.10 not to work well with Cider#2018-12-2900:57mseddonCan anyone substantiate this rumor?#2018-12-2902:48mrgLike what? Seems to work fine for me#2018-12-2906:14dominicmIt is true that 18 has a bug with stack traces. Use the 19 snapshots. #2018-12-2908:46phillHow does one use the 19 snapshots?#2018-12-2909:39bozhidar> Can cider-doc auto complete from the company or ac-cider completions list at all?#2018-12-2909:40bozhidar@m131 ac-cider was deprecated a while ago and I’m not even sure it’s working these days. We encourage everyone to use company-mode together with CIDER (or some other completion engine using the standard completion-at-point functionality of Emacs).#2018-12-2909:41bozhidar@phill You can install CIDER from MELPA (for instance).#2018-12-2909:41bozhidarI haven’t had time to test 1.10 yet, so I’m not certain about the extent of the breakage or whether the fix that was merged to fix this actually fixed the problem.#2018-12-2910:04phillYes, the instructions on http://clojure.org apply to 1.10 now and I wanted to try out the deps.edn technique, specifically because it promises we may depend directly on a Git tag, not via Clojars. Indeed, an announcement already appeared on the Clojure Google Group saying "We'll no longer be publishing ... to Clojars". That library was a special case, but I expect it will be the way forward - more flexible and less hackable surface area.#2018-12-2910:49bozhidarI think that all of this was possible with 1.9 as well.#2018-12-2911:41dominicmThe problem occurred when rendering a stack trace. So just don't have any errors in your code 😊 #2018-12-2915:37macrobartfastI am using cider-find-var to jump to various definitions to see what they are; I then want to jump back to the invocation; is there a binding or function that will do that? I've searched and the various answers I saw require me to set a mark or register before jumping to the definition, but I'd rather just cider-find-var, glance at it, and jump back with one press of a binding. Suggestions?#2018-12-2915:41kardanFor me it’s M-. to find & M-, to cider-pop-back#2018-12-2915:42dpsuttonM-. and M-, should be emacs default shortcuts to navigate back and forth in any particular mode that supports that notion. CIDER follows that convention#2018-12-2915:50macrobartfastomg... cider-pop-back...#2018-12-2915:50macrobartfastwell, I don't get any search engine use and/or documentation review awards today.#2018-12-2915:50macrobartfast😊#2018-12-2915:57kardanNah, it’s difficult when you don’t know what to search for#2018-12-2915:59dpsuttonalso i like a forum for otherwise easily googleable answers sometimes. it might take you 10 minutes to find it, but if you just ask someone can answer in 2 seconds.#2018-12-2916:23macrobartfastwell, I appreciate it! I just managed to rebind M-. from the default evil-mode binding... one last tweak would be nice (a -very- minor one without which I can live with, for sure): when I press M-. (now bound to cider-find-var) with the pointer over a symbol I am prompted in the minibuffer with 'Symbol (default find-title):' and then have to to press Enter... is this your behavior? I'd rather just jump to the definition right away.#2018-12-2916:25macrobartfastusing M-. and M-, are sweet, btw!#2018-12-2916:26macrobartfastthose bindings had been absconded with by another mode, so I was not aware of them.#2018-12-2916:30dpsuttonre: asking for symbol versus just doing it, check out:
(defun cider-prompt-for-symbol-function (&optional invert)
"Prompt for symbol if funcall `cider--should-prompt-for-symbol' is truthy.
Otherwise attempt to use the symbol at point for the command, and only
prompt if that throws an error.
INVERT is used to invert the semantics of the function `cider--should-prompt-for-symbol'."
(if (cider--should-prompt-for-symbol invert)
#'cider-read-symbol-name
#'cider-try-symbol-at-point))
#2018-12-2916:30macrobartfastoh nice!#2018-12-2916:32macrobartfastwhere would you put that... in your init.el, or the cider source, or somewhere else?#2018-12-2916:32macrobartfastI apparently have cider in both elpa and package in my .emacs.d... not sure which is being loaded, lol.#2018-12-2916:33macrobartfast#down-the-rabbit-hole#2018-12-2916:33macrobartfastI should sort that out on my own.#2018-12-2916:43macrobartfastok, figured it out!#2018-12-2916:44macrobartfastthanks for the help in getting this all sorted out. 😀#2019-12-3020:01lilactownhow do I setup additional middleware on cider-jack-in?#2019-12-3020:01lilactownI’m using deps.edn#2019-12-3020:07lilactownalright, I think I figured it out:
; .dir-locals.el
((clojure-mode
(cider-clojure-cli-global-options . "-A:dev")
(cider-jack-in-nrepl-middlewares . ("nrebl.middleware/wrap-nrebl"
"cider.nrepl/cider-middleware"))))
#2019-01-0107:52bozhidarYeah, that looks about right.#2019-01-0107:55bozhidarHappy New Year, everyone! May your forms always eval, your CIDER upgrades never fail and your cider-jack-in never explode! Code long and prosper! cider#2019-01-0110:13bozhidarIn other news - https://github.com/clojure-emacs/cider/releases/tag/v0.19.0#2019-01-0110:35bozhidarThe highlights are:
* lots of improvements to the new connection management system
* some fixes for the changes to the error messages in Clojure 1.10
That’s going to be the final CIDER release that will work with the legacy tools.nrepl, so if you’re a boot or lein user you should definitely upgrade to their latest versions which target the modern nREPL.
Cheers!#2019-01-0116:43richiardiandreaThank you Bozhidar and contributors! May your 2019 contain a lot of happiness and success! 🌈 🎉 cider #2019-01-0117:10Robert A. RandolphHello, I've been trying to figure out how to make errors behave better. Error buffers seem to appear in various windows, sometimes changing their size... which is really annoying.#2019-01-0117:10Robert A. RandolphIs there a way to force cider to use the current window for errors, or a specific window?#2019-01-0117:13bozhidarI guess (add-to-list 'same-window-buffer-name cider-error-buffer) should do the trick.#2019-01-0117:14bozhidarThe default behavior comes from Emacs itself - it tries to be smart about the optimal window in which to display a buffer based on your current window arrangement.#2019-01-0117:15Robert A. Randolph@bozhidar are there any other potential solution for taming where the error buffer ends up? My google-fu has failed me#2019-01-0117:15Robert A. RandolphI tried using same-window-buffer and it's still unreliable#2019-01-0117:15bozhidarProbably there’s a way, but I haven’t looked at this much.#2019-01-0117:16bozhidarI’ve used Emacs for so long that the default behaviour actually makes sense to me. 😄#2019-01-0117:16Robert A. RandolphWell, currently I'm writing documentation for 2 repos and have 2 repls open...#2019-01-0117:17Robert A. Randolphso I end up with cider errors in all sorts of windows 😞#2019-01-0117:18bozhidarYou can check out the code in cider-popup.el. I guess cider-popup-buffer-display can be changed in a way where it’s more rigid about where the popups appear.#2019-01-0117:20Robert A. Randolphhmm, I will look and report back#2019-01-0117:38Robert A. Randolphit seems that turning off cider-show-error-buffer and using cider-selector works... cider-selector opens cider-error in the current window#2019-01-0117:41Robert A. Randolphit also doesn't affect the window size like popup does#2019-01-0118:39manuelProbably display-buffer-alist is what you looking for. #2019-01-0119:47bozhidarYeah, probably you’re right. More details here https://www.gnu.org/software/emacs/manual/html_node/elisp/Choosing-Window.html#2019-01-0119:53bozhidarAnd some practical examples here https://swsnr.de/blog/2015/04/29/configure-buffer-display/#2019-01-0120:10Robert A. RandolphAhh, that blog post may be helpful#2019-01-0120:10Robert A. Randolphthank you#2019-01-0120:10Robert A. RandolphI'll investigate more tomorrow morning#2019-01-0210:41slipsetBah! Did the stupidest thing. Upgraded emacs, lein, and cider at the same time, and now my env is not working 😕#2019-01-0210:41slipsetI can jack in, but I get:#2019-01-0210:41slipset[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[acyclic/squiggly-clojure\ \"0.1.9-SNAPSHOT\"\ \:exclusions\ \[org.clojure/tools.reader\]\] -- update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0\"\] -- repl :headless :host localhost...
[nREPL] server started on 51819
[nREPL] Establishing direct connection to localhost:51819 ...
[nREPL] Direct connection to localhost:51819 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op version prefix-rewriting false debug false)
error in process filter: Sync nREPL request timed out (op version prefix-rewriting false debug false)
#2019-01-0210:42slipsetI get a cider buffer, but it hangs when trying to eval anything in it 😕#2019-01-0210:42slipsetAh 🙂#2019-01-0210:43slipsetmy *nrepl-server ...* buffer says:#2019-01-0210:44slipset#2019-01-0211:22bozhidar@slipset See https://nrepl.org/nrepl/troubleshooting.html#_middleware#2019-01-0211:23slipsetYup, I was starting to get to there. Our project included org.clojure/nrepl#2019-01-0211:23bozhidarSeems some of your deps messed up the server version resolution.#2019-01-0211:23bozhidarAh, I figured as much.#2019-01-0211:24bozhidarI’ve started today to delete the support for tools.nrepl completely, so down the road people won’t see such weird errors.#2019-01-0211:24slipsetSo I might be on the good path now. Just need to get my setup back to where it was before I started debugging 🙂#2019-01-0211:24bozhidarGoing forward if you’re not on the right nREPL it simply won’t work at all.#2019-01-0211:25bozhidar> So I might be on the good path now. Just need to get my setup back to where it was before I started debugging 🙂#2019-01-0211:25bozhidarThat should fairly easy - once you eliminate the rogue deps everything will work just fine.#2019-01-0211:27slipsetYup seems like I just need to change the coords for the nrepl deps in our project#2019-01-0211:29slipsetYay!#2019-01-0211:30slipsetThanks for helping, and a very happy new year to you!#2019-01-0211:39bozhidarThanks! :man-bowing:#2019-01-0214:58andrea.crottiI'm still trying to make cider run something when the clojure repl has loaded, and something like this
(defun start-finops-admin ()
(interactive)
(cider-jack-in-clj&cljs)
(cider-switch-to-repl-buffer)
(insert "(go)")
(newline))#2019-01-0214:59andrea.crotticould work in theory , but of course it doesn't find the repl buffer at that point#2019-01-0214:59andrea.crotticould maybe sleep for a bit but is there a way to wait for that buffer to be ready?#2019-01-0215:12bozhidar@andrea.crotti Did you try using cider-connected-hook?#2019-01-0215:13bozhidarGenerally that’s the way to go.#2019-01-0215:13bozhidarThere’s also the more low-level nrepl-connected-hook#2019-01-0215:21genmeblogwhat about this? https://github.com/clojure-emacs/cider/issues/2538#2019-01-0215:22genmeblogcould this be caused by the fact that I work under Cygwin?#2019-01-0215:29dpsuttonCIDER development now (0.20-snapshot) requires lein 2.8.3 minimum for leiningen projects, correct? It cannot work with 2.7.1 or 2.8.1 correct?#2019-01-0215:30bozhidar@dpsutton Yes.#2019-01-0215:30bozhidarJust committed the changes dropping the support for nREPL 0.2.#2019-01-0215:30andrea.crottiah ok cool @bozhidar, but can I use set it locally on a project?
This variable may be risky if used as a file-local variable. ?#2019-01-0215:31bozhidarIf you want to use an older lein there’s always https://github.com/nrepl/lein-nrepl#2019-01-0215:34dpsuttoni'm stuck on lein 2.7.1 for work so i need to figure a way out#2019-01-0215:34dpsuttonthanks#2019-01-0215:34bozhidar@dpsutton Why so?#2019-01-0215:36dpsuttonwe use a plugin called slothconfig that provides the project.clj map to the application at runtime. We've been wanting to get away from it but its just always at the bottom of the priority heap#2019-01-0215:37dpsuttonlast commit 6 years ago 🙂#2019-01-0215:37bozhidarGot it. That shouldn’t be something hard to solve I guess.#2019-01-0215:38bozhidarI’m not sure whether lein-nrepl will work with 2.7.1, but I assume it does.#2019-01-0215:38bozhidarYou’ll just have to tweak your jack-in config or switch to using cider-connect.#2019-01-0215:39dpsuttoncider connect will probably be the way to go. thanks#2019-01-0215:56dpsutton@bozhidar I'm not seeing a release for lein-nrepl "0.3.2". any chance you could cut one when you have time? That's the version in the readme
> Put [nrepl/lein-nrepl "0.3.2"] into the :plugins vector of your :user profile.
Could not find artifact nrepl:lein-nrepl:jar:0.3.2 in central ()
Could not find artifact nrepl:lein-nrepl:jar:0.3.2 in clojars ()
#2019-01-0215:57bozhidarDone.#2019-01-0216:05andrea.crottianyway @bozhidar your suggestion seems to work, only problem is that it then runs on on both repls, while it should only run on the clojure one#2019-01-0216:07bozhidarJust add some check in your function (if (eq cider-repl-type 'clj) ...#2019-01-0217:17andrea.crottinice it works thanks @bozhidar (I did (equal cider-repl-type "clj") instead but that's it#2019-01-0217:17andrea.crottibtw is there a way to kill automatically both repls? cider-quit only kills the clojure one#2019-01-0217:43bozhidarYou’re looking for http://www.cider.mx/en/latest/managing_connections/#sessions sesman-quit.#2019-01-0217:43bozhidar> nice it works thanks @bozhidar (I did (equal cider-repl-type "clj") instead but that’s it#2019-01-0217:43bozhidarI guess you’re on some older version - it the most recent one the type is supposed to be a symbol.#2019-01-0219:12genmeblogI'll try third time 🙂 What about Unix paths vs Windows paths under Cygwin? Previously cider-to-nrepl-filename-function was used in such occasions. But now sesman-friendly-session-p ignores that combination and expects that Emacs and nRepl operate on the same path styles.#2019-01-0219:25bozhidarHaven’t had time to look into this.#2019-01-0219:25bozhidarUnfortunately I’m not very familiar with Cygwin and Windows.#2019-01-0219:26bozhidarI’d just suggest using Edebug and stepping though the problematic code to see where exactly the problem is coming from.#2019-01-0219:44genmeblogI did it. And this is the case. Emacs and Cygwin are using unix-like paths ie. /home/user/file etc. JVM and nrepl are using Windows paths. So exactly this line fails https://github.com/clojure-emacs/cider/blob/master/cider-connection.el#L438 because of that#2019-01-0219:45genmeblogfile-name-directory expects unix-like-path but classpath is filled by Windows paths#2019-01-0219:47genmeblogin previous versions of Cider cider-to-nrepl-filename-function was the solution. It wraps cygwin-convert-file-name-to-windows which is native Cygwin' Emacs function#2019-01-0220:16genmeblogThe same problem can be observed when repl is run on linux and emacs connects from Windows. I believe that making simple proxy which converts one style into another between nrepl and cider can solve the problem globally.#2019-01-0221:00aaelonyI’m using emacs 26.1 and wanting to try out the new cider version. Even though I’ve added melpa-stable, M-x package-install <ret> cider <ret> refuses to work. It wants me to choose cider-eval-sexp-fu or cider-hydra…#2019-01-0221:02dpsuttonwhat do you mean wants you to choose between those?#2019-01-0221:02aaelonyI mean that <ret> does not start installing and it inserts a hypen indicating the command is unfinished#2019-01-0221:04aaelonyhitting <tab> after it has inserted the hyphen shows: Click on a completion to select it.
In this buffer, type RET to select the completion near point.
Possible completions are:
cider-eval-sexp-fu
cider-hydra
#2019-01-0221:05dpsuttonah. try m-x list-packages and search for CIDER#2019-01-0221:05aaelonyperhaps I need to remove my existing cider first…#2019-01-0221:05aaelonyThe only CIDER I see is: cider 20180717.553 installed Clojure Interactive Development Environment that Rocks
#2019-01-0221:06dpsuttonah yes that would probably do it. it won't offer to install an already installed package#2019-01-0221:06aaelonywhich looks too old#2019-01-0221:16aaelonyhmmm.. it needs the “sesman” package as well. Installed that separately but still problems… Cannot open load file: No such file or directory, sesman-browser
#2019-01-0221:20aaelonyC-c M-j did not work to start the repl, but “cider-jack-in” did#2019-01-0221:39genmeblogwhy not use package-list-packages and press U then x#2019-01-0221:44aaelonydidn’t work#2019-01-0309:29jumarI upgraded to the latest cider version (0.20.0snapshot (package: 20190103.619)) and now I'm getting this warning:
;; CIDER 0.20.0snapshot (package: 20190103.619), nREPL 0.2.12
;; Clojure 1.10.0, Java 1.8.0_171
...
WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly
More information.
WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
More information.
#2019-01-0309:33jumarI don't have any cider specific dependency in my profiles.clj - I thought it would inject the proper deps automatically#2019-01-0309:34jumarIf that matters, I've also upgraded to the latest lein 2.8.3
Leiningen 2.8.3 on Java 1.8.0_171 Java HotSpot(TM) 64-Bit Server VM
#2019-01-0309:51jumarOk, another restart and it seems that it went away.#2019-01-0309:53bozhidarProbably the new leiningen wasn’t on your Emacs’s path initially.#2019-01-0309:53bozhidarGlad to hear you’ve resolved this quickly!#2019-01-0310:06bartukaI am using cider version 0.19.0 and when I try to integrate figwheel on it, I receive a Stdin prompt waiting me to type something#2019-01-0310:07bartukaI tried to cider-jack-in regularly on a .cljs buffer and then used the
(require 'figwheel-sidecar.repl-api)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl)
#2019-01-0310:21bartukaI did a clean start from cider, lein and my repo. The resulting error message was:
nREPL server started on port 60859 on host localhost -
ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2208)
at clojure.core$deref.invokeStatic(core.clj:2228)
at clojure.core$deref.invoke(core.clj:2214)
at cider.piggieback$wrap_cljs_repl$fn__2262.invoke(piggieback.clj:274)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_version$fn__2986.invoke(nrepl.clj:509)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_pprint$fn__2796.invoke(nrepl.clj:120)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_apropos$fn__2822.invoke(nrepl.clj:159)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_format$fn__2864.invoke(nrepl.clj:223)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_enlighten$fn__2856.invoke(nrepl.clj:219)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_refresh$fn__2922.invoke(nrepl.clj:388)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at cider.nrepl$wrap_spec$fn__2938.invoke(nrepl.clj:426)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1894.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__888.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__4676.invoke(core.clj:1938)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)#2019-01-0310:28bartukaFound the error same as cider-jack-in fails #2549 on github. Thanks#2019-01-0310:08bartukaI am using the lein re-frame template with +cider option. No further dependencies in the project. Just run lein new re-frame testCider +cider#2019-01-0310:11fmnGetting an error with the latest cider when evaling with error messages like this "No such namespace: cider.nrepl.pprint"#2019-01-0310:15fmnI'm using ~/.clojure/deps.edn like this:
{:aliases {:nrepl {:extra-deps {nrepl {:mvn/version "0.6.0-SNAPSHOT"}}}
:cider {:extra-deps
{cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}
refactor-nrepl {:mvn/version "2.4.0"}}}}}
invoked with clj -R:nrepl:cider dev.clj#2019-01-0310:37andrea.crottiis this a proper way to do different things depending on the cider version?
(setq cider-minor-version (second (pkg-info-library-version 'cider)))
(defun clojure-repl? ()
(cond ((eq cider-minor-version 18) (equal cider-repl-type "clj"))
((> cider-minor-version 18)) (eq cider-repl-type 'clj)
(t (error "Cider version not supported"))))
#2019-01-0311:05andrea.crottiand another thing, I'm not sure if I'm the only one but I find it quite strange sometimes that when you start Repls you don't get any feedback until they are up and running#2019-01-0311:07andrea.crottiand in projects where it takes a long time you can end up for a while not knowing if it started correctly or not (or if it's starting at all).
Sometimes I switch to the nrepl buffer to see what is going on, but is there another way maybe?#2019-01-0311:13bozhidarThere’s also a cider-version variable. 🙂#2019-01-0311:14bozhidarYou can also use (member '(clj "clj")), which seems better to me than a version check.#2019-01-0311:15bozhidar> and another thing, I’m not sure if I’m the only one but I find it quite strange sometimes that when you start Repls you don’t get any feedback until they are up and running#2019-01-0311:15bozhidarYou’ll have to elaborate on this.#2019-01-0311:15bozhidarGenerally the appearance of the REPL buffer is the signal that everything’s ready.#2019-01-0311:32andrea.crottiyes I saw cider-version and at first I used string-match on that @bozhidar#2019-01-0311:33andrea.crottibut then I saw that i can get the actual minor version number directly with that so I thought it was better#2019-01-0311:33andrea.crottiI'll try the member thanks for the suggestion#2019-01-0311:33andrea.crottirelated to the REPL, well yes I know that when it works you get the REPL(s), but sometimes on big projects it takes 1 minute until you get it#2019-01-0311:34andrea.crottiand until then you have no idea if it's actually starting at all#2019-01-0311:34andrea.crottiunless you check the nrepl buffer#2019-01-0313:52bozhidarI think you also get a message that CIDER is starting up and this can take a while, but I see your point.#2019-01-0313:52bozhidarUnfortunately I can’t think of any meaningful way to show some progress - basically CIDER just sits and waits to see the message that an nREPL server has been booted, so it can connect to it.#2019-01-0314:22andrea.crottiwell @bozhidar there could just be something small spinning in the modeline for example#2019-01-0314:35bozhidarThe problem is that it will keep on spinning in case of some startup error as well. 🙂 Still, you make a reasonable point.#2019-01-0314:36bozhidarProbably we can add some spinner.#2019-01-0323:02vemvI wonder if https://github.com/clojure/tools.analyzer.js is worth rescuing?
as @benedek says here https://github.com/clojure-emacs/clj-refactor.el/issues/191#issuecomment-244399946 it seems to block rich features.
Is the observation still valid?
This could be a nice pet project for me. Another possibility could be to crowdfund it (as I'm not sure I have the availability for such an undertaking; would be happy to pay for it instead)
cc/ @bronsa#2019-01-0323:13bozhidarWell, given the fact that no one has had any bandwidth for the clj-refactor for over a year I think that’s the least of our concerns.#2019-01-0323:14bozhidarIt was a heroic feat we got the last release out and without some extra maintainers we might not get a new one any time soon, which means that any bigger improvements are wishful thinking ATM.#2019-01-0323:21vemvAh I see! Bummed to hear that.
What could be a logical order in which I might contribute? (now from my understanding doing first wouldn't be one)#2019-01-0407:44bozhidar@vemv I’d start with tackling the open bugs on refactor-nrepl and clj-refactor#2019-01-0407:51vemvWill see what I can do!#2019-01-0408:40benedek@vemv there is a worthy discussion here too https://github.com/clojure-emacs/refactor-nrepl/issues/195#2019-01-0408:40benedeksome alternative ways are outlined here to support clj/cljs/cljc without tools.analyzer#2019-01-0408:41benedeki would consider rewrite this feature in cider itself if it is based on different stuff than the one in cljr#2019-01-0408:42benedekan other alternative to write a minimalist analyzer/parser specialised for cider needs#2019-01-0408:42benedekstarted such a thing but did not get far (see bug’s comment above about time… :/) https://github.com/benedekfazekas/utini#2019-01-0408:46benedekeither way (tools.analyzer, jvm.tools.analyzer or homegrown analyzer) it is a big endeavour but surely a very interesting one#2019-01-0408:48benedekhope this helps a bit with context and not too confusing…#2019-01-0409:08vemvThanks much for the reply!
I see. Just make sure, using the cljs compiler itself is not an option, right? Why not?
I guess it either doesn't ever produce the necessary info, or it doesn't provide it in a good way right?#2019-01-0409:24benedeki may be wrong here but using jvm.tools.anayzer is basically that#2019-01-0409:25benedekthe problem is that the AST produced this way is different than the AST produced by tools.analyzer#2019-01-0409:27benedekthis is a good summary of analyzers… confusing landscape… https://github.com/clojure-emacs/refactor-nrepl/issues/195#issuecomment-294373583#2019-01-0409:43vemv> i may be wrong here but using jvm.tools.anayzer is basically that
Got it! Seems likely
> the problem is that the AST produced this way is different than the AST produced by tools.analyzer
The problem being, clj-refactor assumes the latter format, perhaps?#2019-01-0410:41benedekright#2019-01-0411:51benedekhm... https://dev.clojure.org/jira/browse/CLJS-1461#2019-01-0411:52benedeknot 100% sure it was merged but maybe it was. and then the above is not true anymore.. maybe...#2019-01-0412:31benedekseems to be merged last summer#2019-01-0412:54vemvVery nice!
With that in mind jvm.t.analyzer should be a promising approach right? I see no commits since 2017 (1 year before your link), so perhaps some adaptation work is needed#2019-01-0414:19benedekmaybe but as expez tells me in the refactor-nrepl github issue jvm.t.analyzer is just a thin wrapper so perhaps it does not need much work even if the stuff it depends on changes#2019-01-0420:49vemvNice. I'll try to play around with j.t.a + the cljs compiler + refactor-nrepl if that sounds like a good plan#2019-01-0507:54benedeksounds awesome#2019-01-0409:33benedekjust to add one more idea (sorry) cider has many features that only work if the code is loaded in the REPL cider is connected to. probably find usages for loaded code only would much simpler to achieve and would still be quite valuable…#2019-01-0413:49Robert A. Randolphjust checking in to say that my issue with the *cider-error* buffer was indeed fixed with display-buffer-alist#2019-01-0414:41ennGood morning. Can anyone tell me how cider-connect auto-detects the port number chosen by lein repl? I'm working with an in-house script that tries to do what lein repl does, and it starts the REPL correctly, but cider-connect port detection does not work.#2019-01-0415:28aisamuIIRC, there's a .nrepl-port file (or something like it) at the project's root#2019-01-0415:28aisamuIIRC, there's a .nrepl-port file (or something like it) at the project's root#2019-01-0415:29bozhidarIt’s more than this - cider also parses the output of ps and extracts some port information for there.#2019-01-0416:09ennThank you!#2019-01-0418:52dominicmHad an interesting idea today. Inspired by a tool I saw a while ago.
If functions were annotated with metadata, they could be identified as dev helpers automatically. Emacs could render a buffer with buttons to call reset, generate-data, etc. Further extensions could define simple inputs (or use spec?) to allow for prompting for input, and perhaps also delegating to an nrebl-alike for rendering results in tables. #2019-01-0502:03rickmoynihanWhat was the inspiring tool?
Assuming you also mean vars.
And is this effectively like in repl/editor binstubs?#2019-01-0502:05rickmoynihanSomething that bothers me about tools.deps is the lack of consistency it brings, with regards to build tooling.#2019-01-0506:31dominicmI couldn't find the tool with a quick Google#2019-01-0506:37dominicmYou're up late#2019-01-0421:00futuroThat's a pretty neat idea!#2019-01-0422:09agwhat’s the way with the latest cider to force it run something in repl once jack-in… you know via settings in .dir-locals.el#2019-01-0422:09ag?#2019-01-0422:10dpsuttoncider-connected-hook?#2019-01-0422:11agso if I want to run something like (start) what should be the content of .dir-locals.el?#2019-01-0422:11agcider-connected-hook is a variable defined in 'cider.el'.
Its value is (cljr--init-middleware)
#2019-01-0422:11agI guess I should keep that and add whatever I need?#2019-01-0422:11dpsuttongo look at that function and you can see a template#2019-01-0422:12agwhich fn?#2019-01-0422:12dpsutton(cljr--init-middleware)#2019-01-0422:15aghmm… still not clear what content of .dir-locals.el should be?
((nil
(cider-connected-hook . "???")))
#2019-01-0422:37agbasically I’m looking for a new way of setting up what’s used to be cider-cljs-lein-repl var#2019-01-0422:56agso I figured I can probably set cider-custom-cljs-repl-init-form
but how do I set default type (to be “custom”), so it doesn’t bother me with a prompt?#2019-01-0423:02agNah, I think setting up that var had no effect#2019-01-0423:54agI have figured it out.
.dir-locals.el
((nil . ((eval . (with-eval-after-load 'cider
(cider-register-cljs-repl-type
'fw-cc
"(do (start) (start-fw) (use 'figwheel-sidecar.repl-api) (cljs-repl))")
(setq cider-default-cljs-repl 'fw-cc))))))
#2019-01-0510:49bozhidarCan someone help me debugging this https://travis-ci.org/clojure-emacs/clojure-mode/jobs/475661304#2019-01-0510:50bozhidarA trivial change resulted in this failure I cannot figure out. The two failing tests work from Emacs when you run them interactively with ert, but break down with make cask.#2019-01-0510:50bozhidarThat’s the only blocker for a new (long overdue) clojure-mode release. 🙂#2019-01-0510:57bozhidarIt’s some mess with the macroexpansion, but it seems like the test macro expands properly, even if it doesn’t work properly… The many joys of macros. 🙂#2019-01-0510:58bozhidar(macroexpand-1 '(def-full-indent-test align-arguments
'align-arguments
"(some-function
10
1
2)"
"(some-function 10
1
2)"))
(ert-deftest test-backtracking-align-arguments nil
(progn
(with-temp-buffer
(clojure-mode)
(insert "\n" "(some-function\n 10\n 1\n 2)")
(let
((clojure-indent-style 'align-arguments))
(indent-region
(point-min)
(point-max)))
(should
(equal
(buffer-string)
"\n(some-function\n 10\n 1\n 2)")))
(with-temp-buffer
(clojure-mode)
(insert "\n" "(some-function 10\n 1\n 2)")
(let
((clojure-indent-style 'align-arguments))
(indent-region
(point-min)
(point-max)))
(should
(equal
(buffer-string)
"\n(some-function 10\n 1\n 2)")))))#2019-01-0511:18bozhidarAh, forget about this. I finally found the error - turned out that single and double quoting of symbol were visually impossible to discern…#2019-01-0511:19bozhidarAnd by impossible I mean confusing. 🙂#2019-01-0511:25bozhidarhttps://github.com/clojure-emacs/clojure-mode/releases/tag/5.10.0#2019-01-0707:56manuelhi everybody. With latest CIDER from MELPA, I am getting this:
ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :pprint-fn cider.nrepl.pprint/pprint, :print-length 50, :print-level 50, :session f6e79029-f84e-4318-b301-f9273a1ba72e, :id 33}
clojure.lang.ArityException: Wrong number of args (1) passed to: cider.nrepl.pprint/pprint
#2019-01-0707:57manueldo you want me to file an issue on GitHub?#2019-01-0707:58bozhidar@manuel Seems your cider-nrepl snapshot is outdated.#2019-01-0707:58bozhidarThis function takes one or two params.#2019-01-0707:59manuelI see, let me check#2019-01-0708:00manuelI only have this as a dependency in my shadow-cljs.edn: [cider/cider-nrepl "0.19.0"]#2019-01-0708:01manuelCIDER seems to be injecting the latest snapshot on jack-in:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.5.3"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'...
#2019-01-0708:03manuelThis from the REPL upon jack-in:
;; Connected to nREPL server -
;; CIDER 0.20.0snapshot (package: 20190105.1840), nREPL 0.5.3
;; Clojure 1.10.0, Java 1.8.0_191
#2019-01-0708:05bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/pprint.clj#L13#2019-01-0708:06bozhidarThat’s a multi-arity function so if you’re on the current build it should work. You can maybe delete whatever build you have locally in .m2/... to force for it to be fetched again.#2019-01-0708:07bozhidarThat’s one of the problems of making changes in snapshots - they are not refetched on each update. Don’t recall what exactly their update mechanism was.#2019-01-0708:07dominicmThey're cached daily I believe. #2019-01-0708:08bozhidarHmm. I certainly changed this a few days ago.#2019-01-0708:10dominicmLein has a -U option which forces snapshot fetching. #2019-01-0708:11dominicmMaven instructions: https://stackoverflow.com/a/7714058#2019-01-0708:12dominicmWhich indicates it is a once a day check#2019-01-0708:12manuelDeleted the cider directory from .m2. Now I get this:
Caused by: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/cljs__init.class, cider/nrepl/middleware/util/cljs.clj or cider/nrepl/middleware/util/cljs.cljc on classpath.
#2019-01-0708:12manuelon jack-in#2019-01-0708:12manuelAnd I have:
~/.m2/repository/cider/cider-nrepl/0.19.0
❯ l
.rw------- 197 manuel manuel 7 gen 9:09 _remote.repositories
.rw------- 454k manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.jar
.rw------- 40 manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.jar.sha1
.rw------- 6,6k manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.pom
.rw------- 40 manuel manuel 7 gen 9:09 cider-nrepl-0.19.0.pom.sha1
#2019-01-0708:13bozhidarAnd where’s the snapshot?#2019-01-0708:13manuelyou're right, my bad 😄#2019-01-0708:13manuellet me update shadow-cljs.edn to use the latest snapshot#2019-01-0708:15manuelall fixed. Thank you @bozhidar!#2019-01-0708:40bozhidarAny time!#2019-01-0713:19manuelI have a CLJ/CLJS project, with shadow-cljs set up as I wrote at the end of this post: https://manuel-uberti.github.io/programming/2018/11/14/deps-shadow-cljs/
Every time I switch from a CLJ buffer to a CLJS buffer (within the same project), I end up with a buffer without its REPL "attached". If I switch to the relevant REPL and then back to the buffer, I get the REPL "attached" and I can C-c C-z to it as usual.#2019-01-0713:23manuelProblem is I have to do it every time. 🙂#2019-01-0713:23manuelFWIW, I switch buffers with C-x b which is bound to ivy-switch-buffer.#2019-01-0713:35manuelAnd it does not happen if I switch from a CLJ buffer to a CLJ one, or from a CLJS buffer to another CLJS buffer.#2019-01-0713:58Ian FernandezWhat's the enviroment varibale for repl output to have line breaks?#2019-01-0713:59Ian Fernandezon cider?#2019-01-0714:06dpsuttoni'm not sure i'm following what you mean. can you tell me what behavior you are looking to have? output having linebreaks isn't really matching up with anything for me#2019-01-0714:07Ian Fernandezwhen I get a map return and it's having a reaally long output#2019-01-0714:08Ian FernandezI want to have line breaks, like:
{:a "12071906913863921875721521"
:c "idhgsaukgfuksagfsajfgksajfkasjfgaskjfgaskjfgsakjfgsaj"}
#2019-01-0714:08Ian Fernandezcider-repl is giving me#2019-01-0714:08bozhidarIt’s not an environment variable.#2019-01-0714:08Ian Fernandez{:a "12071906913863921875721521" :c "idhgsaukgfuksagfsajfgksajfkasjfgaskjfgaskjfgsakjfgsaj"}#2019-01-0714:08Ian Fernandezon emacs?#2019-01-0714:08Ian Fernandeznot?#2019-01-0714:08bozhidarYou have to enable cider-repl-use-pretty-print ot whatever it was named.#2019-01-0714:09Ian Fernandez(use-package clojure-mode
:ensure t
:config (add-hook 'clojure-mode-hook #'aggressive-indent-mode)
(add-hook 'clojure-mode-hook #'paredit-mode)
(add-hook 'clojure-mode-hook (lambda () (parinfer-mode t)))
(add-hook 'clojurescript-mode-hook #'paredit-mode)
(add-hook 'clojure-mode-hook (lambda () (rainbow-delimiters t)))
(add-hook 'cider-repl-mode-hook (lambda () (parinfer-mode t)))
(add-hook 'cider-repl-mode-hook (lambda () (rainbow-delimiters t))
(setq cider-repl-pop-to-buffer-on-connect 'display-only)
(setq cider-repl-use-clojure-font-lock nil)
(setq cider-repl-use-pretty-printing t)
(setq cider-repl-wrap-history t)
(setq cider-repl-result-prefix ";; => "))
#2019-01-0714:10bozhidarhttps://docs.cider.mx/en/latest/using_the_repl/#pretty-printing-in-the-repl#2019-01-0714:10Ian Fernandezit's on cider, not in clojure mode?#2019-01-0714:10bozhidarWell, it doesn’t really matter where you set it. Your config seems correct.#2019-01-0714:10Ian Fernandez=\#2019-01-0714:11bozhidarYou also need to adjust *print-right-margin* if you want it to break small data structures. I think by default it’s 70 or something like this.#2019-01-0714:11dpsuttonif you have a repl open right now, hit , (comma) in it and select toggle-pretty option in that menu#2019-01-0714:13Ian FernandezI'm starting a repl here, I'll test this#2019-01-0714:11dpsutton(just to see if pretty printing works at all)#2019-01-0714:11bozhidarYeah, but it’s not just having pretty print enabled.#2019-01-0714:11Ian FernandezI don't use spacemacs#2019-01-0714:12dpsuttonme either#2019-01-0714:12bozhidarIt’s also the configuration - the right margin forces when something has to be printed on multiple lines.#2019-01-0714:16Ian Fernandezhow can I activate the margin on repl?#2019-01-0714:13Ian FernandezI'm starting a repl here, I'll test this#2019-01-0714:13bozhidarMore info about the config.#2019-01-0714:14bozhidarhttps://docs.cider.mx/en/latest/configuration/#pretty-printing#2019-01-0714:16Ian Fernandezhow can I activate the margin on repl?#2019-01-0714:16bozhidar(set! *print-right-margin* some-number)#2019-01-0714:16bozhidarSmall number will force almost everything to be printed on multiple lines.#2019-01-0714:17bozhidarJust keep in mind that if you have some print options set in CIDER’s own config they’ll override the REPL dynamic vars.#2019-01-0714:18bozhidarBy defaults those are nil, so you should be good.#2019-01-0716:46richiardiandreaJust an heads up, it seems like the signature of the pprint function has changed and fipp does not comply to it, causing a 💥 - haven't investigated more deeply atm#2019-01-0717:04bozhidar@richiardiandrea sprint function?#2019-01-0717:09richiardiandreaLol no, pprint function#2019-01-0717:11bozhidarI’m puzzled. fipp and pprint always had different signatures, at least if called with more than one params.#2019-01-0717:11richiardiandreaUhm, so then my diagnosis is wrong, getting to the office then I will be able to check. I had to disable fipp yesterday#2019-01-0717:11bozhidarCurrently we’re not using any pprint function directly anymore - all of them have wrappers with the same API in cider-nrepl.#2019-01-0717:12richiardiandreaOh ok maybe that is why#2019-01-0717:12richiardiandreaI had cider-pprint-fn set to 'fipp#2019-01-0717:12bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/pprint.clj#2019-01-0717:12bozhidarYeah, that should work just fine.#2019-01-0717:13bozhidarThe value is the same, it just points to a different function.#2019-01-0717:13richiardiandreaKK will dig#2019-01-0717:13bozhidarNow a pprint function has to take an object and an optional list of config options to control the pprint.#2019-01-0717:14bozhidarAlso - for something to be a meaningful pprint function it should return a string, not write to stdout.#2019-01-0719:05mhcathey @bozhidar is this worthy of a but report: Debugger entered--Lisp error: (void-variable cider-stacktrace-print-length)
cider-default-err-op-handler()
cider-default-err-handler()
#f(compiled-function () #<bytecode 0x1e87921>)()
#f(compiled-function (response) #<bytecode 0xf03f55>)((dict "ex" "class clojure.lang.Compiler$CompilerException" "id" "233" "root-ex" "class clojure.lang.Compiler$CompilerException" "session" "a06ca30f-047f-4d0f-8999-e8b8e74e641a" "status" ("eval-error")))
nrepl--dispatch-response((dict "ex" "class clojure.lang.Compiler$CompilerException" "id" "233" "root-ex" "class clojure.lang.Compiler$CompilerException" "session" "a06ca30f-047f-4d0f-8999-e8b8e74e641a" "status" ("eval-error")))
nrepl-client-filter(#<process nrepl-connection> "d2:ex45:class clojure.lang.Compiler$CompilerException2:id3:2337:root-ex45:class clojure.lang.Compiler$CompilerException7:session36:a06ca30f-047f-4d0f-8999-e8b8e74e641a6:statusl10:eval-erroree")
or am I missing some config or something?#2019-01-0719:05mhcathmm, maybe I should delete my .elc files since upgrading cider this morning?#2019-01-0720:49Ian Fernandezi'll try fipp another day#2019-01-0721:27bozhidar@j0ni This was a genuine mistake of mine. I’ve just pushed a fix.#2019-01-0721:28mhcatcool cool 🙂#2019-01-0721:30mhcathaha "genuine mistake" - how many intentional bugs have you written? 😅#2019-01-0721:50bozhidarYou’d be surprised. 😉#2019-01-0721:56mhcatlol yeah, iirc in the 80s we called that "job security"#2019-01-0801:18fentonis there a way to cider-jack-in, have the repl show up visibly, but not transfer control to it?#2019-01-0805:35wusticalityHey folks, I’m on the latest cider and am having an issue that’s really got me stuck, I filed a bug here: https://github.com/clojure-emacs/cider/issues/2562#2019-01-0805:35wusticalityThis may not be a bug, I’m not sure, but it’s got me totally dead in the water at work, any help would be greatly appreciated!#2019-01-0805:36wusticalityThe high level issue is that when importing LWJGL libraries, company-mode hangs for nearly 15 seconds with every key press. Thanks in advance!#2019-01-0805:56dpsuttonI'm trying to reproduce but is this not sufficient?
(defproject stuff/compliment-bug "0.1.1"
:dependencies [[org.lwjgl/lwjgl "3.2.1"]])
#2019-01-0805:57dpsuttonuser> (import '(org.lwjgl.glfw.GLFW))
nil
[LWJGL] Failed to load a library. Possible solutions:
a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
b) Add the JAR that contains the shared library to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.
ERROR:ERROR: Unhandled REPL handler exception processing message Unhandled REPL handler exception processing message {{:op :op infoeldoc, , :ns user, :ns user, :symbol org.lwjgl.PointerBuffer, :session 0a8a510f-85da-40ce-b140-41ada4dca843, :id 33}#2019-01-0805:57dpsuttonis it possible its silently in a broken state?#2019-01-0806:26wusticalityhey @dpsutton#2019-01-0806:26wusticalityYou may need to load the native library with it - my project.clj looks like this:#2019-01-0806:27wusticalityhttps://gist.github.com/wusticality/13de141a7236d7b392235fb129ace236#2019-01-0806:28wusticalityThe company-mode popup eventually populates, but it literally is taking 15-20 seconds on my brand new MBP#2019-01-0806:28wusticalityafter each character press#2019-01-0806:48bozhidarThe timeout you get likely masks some internal error, which is the real cause of the delay.#2019-01-0807:02bozhidarAt any rate - it’s probably best to have @alexyakushev take a look in this.#2019-01-0807:21manuelhi guys, with latest CIDER evaluating a form in the REPL results in this:
Debugger entered--Lisp error: (wrong-type-argument symbolp "right-margin")
symbol-name("right-margin")
cider--pprint-option("right-margin" pprint)
cider--nrepl-pprint-request-plist(80 nil)
cider--repl-request-plist(80)
cider-repl--send-input(t)
cider-repl-return(nil)
funcall-interactively(cider-repl-return nil)
call-interactively(cider-repl-return nil nil)
command-execute(cider-repl-return)
#2019-01-0807:23bozhidarMy bad.#2019-01-0807:23bozhidarI’ll fix it now.#2019-01-0807:30bozhidar@manuel Fix away!#2019-01-0807:30manuelfantastic, thanks#2019-01-0807:31bozhidarhttps://github.com/clojure-emacs/cider/commit/9e0ded64dfe3a0e16ecb3751080bf6091411e12d#2019-01-0808:14wusticalityHey @bozhidar, should I pass the issue on to @alexyakushev then? It’s worth mentioning that this only seems to happen with the LWJGL library, the regular Java system libraries pop up immediately. I’ve also attached the log you requested to the issue on Github.#2019-01-0808:18bozhidarI’ve noticed in the log you sent that there are some errors about a dynlib failing to load, etc. It also seems that the errors happen in the eldoc logic, not in compliment.#2019-01-0809:22manuel@bozhidar noticed you also added support for zprint. Great stuff! 🙂#2019-01-0809:26bozhidarThanks!#2019-01-0809:27bozhidarI’ve been working on nothing but pretty-printing recently. I thought that it was going to be simple to revamp the pprint implementation, but it was so much more complex than I thought. I guess this never happens in programming. 😄#2019-01-0809:28bozhidarAnyways - seems I’m almost done with the first pass and maybe I’ll cut CIDER 0.20 in a couple of days with only the pprint changes.#2019-01-0809:29manuelyay! Count me in for early-bird installation and complaints! 😉#2019-01-0809:42bozhidar:man-bowing:#2019-01-0810:35manuel@bozhidar just FYI: latest update fixed the error for me, and it seems to work fine with zprint too.#2019-01-0810:36bozhidarExcellent! Thanks for the update.#2019-01-0811:40Macrozuh for a long while I tried to upgrade to latest cider 0.16-snapshot -> 0.19 but I'm really baffled now. Emacs cider from melpa seems to use 0.20.0-snapshot and with that I get an error in cider-jack-in-clojurescript
error in process filter: user-error: ‘exit-minibuffer’ requires the nREPL op "classpath" (provided by cider-nrepl)
error in process filter: ‘exit-minibuffer’ requires the nREPL op "classpath" (provided by cider-nrepl)#2019-01-0811:40Macrozsame time I also tried to move from emacs 24 to emacs 26#2019-01-0811:41Macrozalso tried clearing some customizations I had#2019-01-0811:41Macrozsince the installation instructions don't have anything special and I don't think I have anything special anymore I'm really baffled at what the problem could be#2019-01-0811:41MacrozI guess my last ditch effort will be to start with a completely new ubuntu and .emacs#2019-01-0811:42Macrozrepl also says after starting that
WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly
More information.
WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
More information.#2019-01-0811:43Macrozhere's what it runs
[nREPL] Starting server via .../bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.3.10\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0-SNAPSHOT\"\] -- repl :headless :host localhost...#2019-01-0811:54Macroz;; Connected to nREPL server - <nrepl://localhost:34432>
;; CIDER 0.20.0snapshot (package: 20190108.925), nREPL 0.2.12#2019-01-0811:57Macroz0.5.3 yes but 0.2.12 ???#2019-01-0811:57Macrozand where does that 0.20.0-SNAPSHOT come when my .lein/profiles.clj says 0.19.0#2019-01-0812:09bozhidarYou need also Lein 2.8.3.#2019-01-0812:09bozhidarThat’s going to fix the nREPL version issue.#2019-01-0812:10bozhidarBut overall you’re pretty close to setting up everything properly.#2019-01-0812:16Macrozthanks, I'm running 2.8.1 apparently#2019-01-0812:17Macrozis it normal for cider to override .lein/profiles.clj stuff?#2019-01-0812:17bozhidarYes.#2019-01-0812:18bozhidarIt does it to ensure that the right versions of libraries are used.#2019-01-0812:18Macrozthanks that lein upgrade helped and now I got forward#2019-01-0812:18MacrozI'll try re-enabling clj-refactor#2019-01-0812:18bozhidarIt would never touch anything except nREPL and nREPL middleware, though.#2019-01-0812:57Macroz@bozhidar I get some of these
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op classpath)
error in process filter: Sync nREPL request timed out (op classpath)#2019-01-0812:58Macroz(after cider-jack-in-clojurescript)#2019-01-0812:59Macrozsometimes I get two repls, sometimes only one#2019-01-0813:00Macrozused to get two where in one I would connect to cljs-repl#2019-01-0813:02bozhidarFor the first problem - you’ll have to inspect the error closer http://www.cider.mx/en/latest/troubleshooting/#missing-nrepl-messages-buffer#2019-01-0813:03bozhidarFor the second - keep in mind that the jack-in commands were completely re-written and cider-jack-in-cljs starts just one REPL now.#2019-01-0813:03bozhidarThere’s a dedicated commands for starting two REPLs.#2019-01-0813:03Macrozcider-jack-in-clj&cljs seems to hang#2019-01-0813:03bozhidarPlease, refer to the docs for more details, as I’m just about the leave my computers.#2019-01-0813:03Macrozsure#2019-01-0813:04bozhidarIf you’ve got further issue - feel free to file them as tickets. If something hangs it’s likely outdated deps or something like this.#2019-01-0813:04MacrozI'm trying to reinstall all my packages so I get the latest#2019-01-0813:05Macrozthere's a bunch of documentation that seems to be outdated and it's a bit confusing as there are also a million packages to check#2019-01-0813:26Macrozseems clojurescript-jack-in hangs emacs, clojure-jack-in works in a simple project#2019-01-0813:30Macrozcompletely new figwheel main project seems to jack-in but not my old figwheel#2019-01-0813:33Macrozseems like figwheel-main-template is borked too#2019-01-0813:33Macrozlooks like the rabbit hole goes deeeeeeep#2019-01-0814:07bozhidarDue to the big changes with nREPL you generally need a very recent version of fighwheel and piggieback.#2019-01-0814:07bozhidarBut yeah - it’s a very complex ecosystem with many moving parts.#2019-01-0814:45Macrozcompletely new vm with ubuntu 18.04, emacs 26, latest leiningen, jvm 8, lein new figwheel ..., cider from melpa and jack-in to both works#2019-01-0815:17Macrozthis is where my machine hangs
Debugger entered--Lisp error: (quit)
accept-process-output(nil 0.01)
nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false") #<buffer cider-repl dev/rems:localhost:36200(clj)> nil)
cider-nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false"))
cljr--call-middleware-sync(("op" "version" "prefix-rewriting" "false" "debug" "false") "version")
cljr--middleware-version()
cljr--check-middleware-version()
cljr--init-middleware()
run-hooks(cider-connected-hook)
cider--connected-handler()
run-hooks(nrepl-connected-hook)
nrepl-start-client-process("localhost" 36200 #<process nrepl-server> #f(compiled-function (_) #<bytecode 0x1307f89>))
cider-nrepl-connect((:project-dir "~/dev/rems/" :jack-in-cmd "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :cljs-repl-type figwheel :do-prompt nil :host "localhost" :port 36200 :project-dir "~/dev/rems/" :server #<process nrepl-server> :server-command "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :repl-init-function nil :repl-type clj :session-name nil))
cider-connect-sibling-clj((:project-dir "~/dev/rems/" :jack-in-cmd "/home/markku/bin/lein update-in :dependencies conj \\[nrepl\\ \\\"0.5.3\\\"\\] -- update-in :dependencies conj \\[cider/piggieback\\ \\\"0.3.10\\\"\\] -- update-in :plugins conj \\[refactor-nrepl\\ \\\"2.4.0\\\"\\] -- update-in :plugins conj \\[cider/cider-nrepl\\ \\\"0.20.0-SNAPSHOT\\\"\\] -- repl :headless :host localhost" :cljs-repl-type figwheel :do-prompt nil) #<buffer nrepl-server dev/rems:localhost>)
#f(compiled-function (server-buffer) #<bytecode 0x10b1365>)(#<buffer nrepl-server dev/rems:localhost>)
nrepl-server-filter(#<process nrepl-server> "nREPL server started on port 36200 on host localhost - <nrepl://localhost:36200\n%22|nrepl://localhost:36200\n">)#2019-01-0815:21Macrozhangs with "lein new figwheel my-test -- --reagent"#2019-01-0815:31Macrozok removing .emacs.d I get it to work#2019-01-0815:42Macrozsome line in my 768 lines of .emacs does it#2019-01-0815:49MacrozERROR: Unhandled REPL handler exception processing message {:op version, :prefix-rewriting false, :debug false, :session ff0128b7-c4be-43e4-bc91-28cc6744dec0, :id 10}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: nrepl.transport.FnTransport
at clojure.core$cacheprotocol_fn.invokeStatic(core_deftype.clj:583)
at clojure.core$cacheprotocol_fn.invoke(core_deftype.clj:575)#2019-01-0815:49Macroz;; Connected to nREPL server - <nrepl://localhost:41629>
;; CIDER 0.20.0snapshot (package: 20190108.925), nREPL 0.5.3
;; Clojure 1.9.0, Java 1.8.0_191#2019-01-0816:13Macrozok so the culprit is clj-refactor#2019-01-0816:16Macrozhttps://github.com/clojure-emacs/clj-refactor.el#compatibility#2019-01-0816:16Macrozapparently this really means 0.17 or 0.18 but not 0.19 or 0.20-SNAPSHOT#2019-01-0816:25Macrozhttps://github.com/clojure-emacs/clj-refactor.el/issues/432#2019-01-0816:25Macrozmaybe this is a known issue but now I documented it somewhere#2019-01-0816:59bozhidarHmm, I can’t imagine why. There have been no changes in 0.19 and 0.20 that would affect refactor-nrepl. At least nothing that comes to mind.#2019-01-0816:59bozhidarBtw, I wrote this compatibility note myself. 🙂#2019-01-0817:02bozhidarUnfortunately work on clj-refactor has really stagnated lately and I certainly don’t have time for it, so someone else will have to figure out what went wrong there.#2019-01-0817:11MacrozI can have a look sometime later #2019-01-0817:12Macrozdo you use clj-refactor yourself?#2019-01-0817:12Macrozjust wondering if it's know to work somewhere with the new cider #2019-01-0821:04bozhidarNo, I don’t use it. I help its team from time to time, but that’s all.#2019-01-0812:38Ian Fernandezthere is a way to put cider-repl errors in repl?#2019-01-0812:38Ian Fernandeznot popping into another buffer?#2019-01-0812:38Ian Fernandezpopping and focusing?#2019-01-0812:38Ian Fernandezit breaks my dev flow x_x#2019-01-0812:39bozhidarThey are focused by default, so pressing q is all you need to do to discard them.#2019-01-0812:39bozhidarThat being said you’re not the first to ask for just dumping everything to the REPL - that’d be easy to do, provided I had time, but it’s not supported now.#2019-01-0812:41Ian FernandezThanks =D#2019-01-0821:20weavejesterHas anyone had issues with Lein 2.8.3 and nREPL piggieback? I haven't been able to get them to work.#2019-01-0821:20bozhidar@weavejester What kind of issues?#2019-01-0821:21weavejesterERROR: Unhandled REPL handler exception processing message {:id 0419f2f7-bd7e-4a06-81d2-07df38fa1dae, :op clone}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cemerick.piggieback$wrap_cljs_repl$fn__2218.invoke(piggieback.clj:289)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1814.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1079.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
#2019-01-0821:22weavejesterIt's triggered when I add the :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl] option to :repl-options.#2019-01-0821:22bozhidarAh, that’s simple. 🙂#2019-01-0821:23weavejesterReally? I'm glad to hear it!#2019-01-0821:23weavejesterOh!!#2019-01-0821:23weavejesterI see, duh.#2019-01-0821:23bozhidarThe artifact changed its name a while ago. It’s now cider/piggieback. Use version 0.3.10 and everything will work fine.#2019-01-0821:23weavejesterYes, I just noticed. Thank you for pointing it out! 🙂#2019-01-0821:23bozhidarNo worries!#2019-01-0821:24bozhidarGenerally with the new nREPL it’s important that you’re not using any outdated middleware, as old versions probably support tools.nrepl intead of nrepl/nrepl.#2019-01-0821:25weavejesterYep, it works now. Thanks for your help!#2019-01-0821:28bozhidarYou’re welcome!#2019-01-0902:18plexusI've had this issue for a little while now that when doing a cider-jack-in the cursor will jump to a (seemingly) random line in the buffer. Anyone know where that's coming from? (I'm on spacemacs)#2019-01-0908:40manuelmorning guys. Is it possible to set (in .dir-locals.el presumably) the default parameters for cider-connect-cljs? I'd like to set the host, the port, the REPL type and the build.#2019-01-0908:42manuelOk, cider-default-cljs-repl takes care of the REPL type. Something for the rest? 🙂#2019-01-0908:45bozhidarI don’t think we have have vars for the default host and port, but I guess we can add those. Feel free to open a ticket.#2019-01-0908:45bozhidar@plexus I haven’t noticed this problem. Might be some missing save-excursion or something like that.#2019-01-0908:54manuel@bozhidar done: https://github.com/clojure-emacs/cider/issues/2563#2019-01-0910:10rovanionIs there a command for outputting the last result of an evaluation into the buffer I'm editing?#2019-01-0910:39phill@rovanion I don't know, but I go to the Messages buffer, yank it, and paste it. Org mode does this really nicely (supposing you want an Org document) - every time you eval a Clojure block it inserts (or updates) the result block below it.#2019-01-0910:48bozhidar@rovanion Try C-u C-x C-e#2019-01-0911:00rovanionThat worked, thank you!#2019-01-0916:30lispycloudsWhat is the way to "teach" cider to resolve a function differently? For example I want cider to treat let-flow (https://github.com/ztellman/manifold/blob/master/docs/deferred.md#let-flow) as the usual clojure let so that when i run format buffer it respects the let style of indented bindings in let-flow?#2019-01-0920:18enn@rahul080327 there is a variable called clojure-align-binding-forms which is a list of symbols to treat like let. You can modify it with M-x customize-variable (or M-x customize-group clojure) or add to it with elisp.#2019-01-1011:10lispycloudsThanks for the answer @U060QM7AA, however i added it like this and still doesnt work when i run format buffer.#2019-01-1011:10lispycloudsdo i need to add the manifold namespace as well? I use it as (d/let-flow ...)#2019-01-1011:11lispycloudsI am a new comer to emacs, pardon my ignorance#2019-01-1012:47ennHmm. No, you shouldn’t need to add the namespace or namespace alias. What you have looks right. I’m not sure why that wouldn’t be working.#2019-01-1009:55kommen@plexus I do have the jumping cursor problem, meant to investigate it but didn’t have time yet#2019-01-1020:56borkdudecould it be that cider-pprint-eval-last-sexp is broken? I only see an empty screen now#2019-01-1022:09borkdudeI upgraded to cider 20190109.925 and now it prints at least something again, but it doesn’t seem to be pretty printing#2019-01-1022:59Karol WójcikI would like to ask you what do you usually do to hotload a clj dependency with cider?#2019-01-1106:54bozhidar@borkdude What’s your nREPL version?#2019-01-1106:54bozhidarIt seems to work just fine for me.#2019-01-1108:13bozhidarNote to everyone - early next week I plan to cut a new CIDER release, so if you wanted to get some features in, you don’t have much time.#2019-01-1112:34benedek@kwcharllie379 i think this is your best shot nowadays https://nrepl.org/nrepl/usage/misc.html#_hot_loading_dependencies#2019-01-1112:38manuelclj-refactor used to do it quite nicely#2019-01-1112:45Karol Wójcik@benedek is it works as well with java10?#2019-01-1112:48borkdude@bozhidar
;; Connected to nREPL server -
;; CIDER 0.20.0snapshot (package: 20190108.925), nREPL 0.5.3
;; Clojure 1.10.0, Java 1.8.0_191
#2019-01-1113:12benedek@kwcharllie379 this one should. the one in clj-refactor#2019-01-1113:12benedeknow disabled i think would not#2019-01-1113:19Karol Wójcik@bozhidar May I try to add a support for hot loading to clj-refactor via tools.deps or pomegranate?#2019-01-1113:31benedek@kwcharllie379 i guess you could add the feature back by reimplementing it using the above (clj-refactor maintainer here 😉 )#2019-01-1113:32Karol WójcikThank you @benedek#2019-01-1113:35benedeki thank you 🙂#2019-01-1114:12bozhidar@kwcharllie379 Given how easy it is to support this now, as it’s a native thing in nREPL it can also be added straight to CIDER>#2019-01-1114:12bozhidarThis was also my intention, but I never got to do it.#2019-01-1114:13bozhidarThere’s also the point that hot-loading deps is not really a refactoring.#2019-01-1114:21dominicm@kwcharllie379 the problem is that nREPL will need some shifting around to make the classloader available to middleware. That's probably a good change to make, I was admittedly hacking a bit when I slipped it in.#2019-01-1114:21dominicmI haven't reviewed the latest work on nREPL yet, so that might have some impact.#2019-01-1114:22dominicm@bozhidar I don't know how you find the energy 🙂 Since the new year started I'm just pooped.#2019-01-1114:24bozhidar@dominicm You and me both. 😄 I just push myself to wrap completely the nREPL migration and starting next week I plan to take a vacation from all open-source.#2019-01-1114:33dpsuttonare you going to use that new github status feature?#2019-01-1114:33dpsuttoncan't tell if people are liking it or not#2019-01-1114:33bozhidarIt’s ridiculous.#2019-01-1114:33bozhidarI’ll just turn off my notifications and have people figure out stuff on their own .#2019-01-1114:34bozhidarFrankly, even answering support questions here has become stressful for me.#2019-01-1206:34dominicmI'm finding slack increasingly stressful. Zulip was great when people were interested, because it allowed me to balance my reading more carefully. #2019-01-1114:34dpsuttonthat's what i have been hearing. just wanted to hear if anyone liked it 🙂#2019-01-1114:50benedekgood shout @bozhidar and @dominicm better in cider if possible#2019-01-1114:55benedeki am working on a 0.5x branch of mranderson btw. well, as much as i can#2019-01-1114:56benedekit is a clean up and rewrite-clj rewrite so far#2019-01-1115:00bozhidar@benedek Fantastic news!#2019-01-1115:51bozhidar@borkdude Everything seems good there. I don’t see any reason why the pprint won’t work.#2019-01-1115:51bozhidarGuess you can check your nrepl log.#2019-01-1115:52bozhidarDoes pprint work normally in the REPL?#2019-01-1115:52borkdudepprint works, but it seems to print with a normal pr-str, not with pprint#2019-01-1115:52borkdudeyes works in the REPL#2019-01-1115:52bozhidarIt’s the same code, so it’s highly unlikely it doesn’t work.#2019-01-1115:52bozhidarWhat happens when you eval (range 100)?#2019-01-1115:53borkdudeyou mean with cider-pprint?#2019-01-1115:54bozhidarwith C-c C-p#2019-01-1115:55borkdude@bozhidar screenshot here: https://www.dropbox.com/s/j343giy6u3ucuur/Screenshot%202019-01-11%2016.55.07.png?dl=0#2019-01-1115:55bozhidarYou have to check your nrepl log and your pprint config then.#2019-01-1115:56bozhidarThis certainly provides different results for me.#2019-01-1115:57borkdude(-->
id "45"
op "eval"
session "21325fbb-d5ad-49a1-98ee-85f205e44504"
time-stamp "2019-01-11 16:55:13.560653000"
code "(range 100)
"
column 3
file "/Users/Borkdude/dre/DocSearch/app/src/dre/yada.clj"
line 200
ns "dre.yada"
print-options (dict
right-margin 80)
printer "cider.nrepl.pprint/pprint"
)
#2019-01-1115:58bozhidarEverything looks good.#2019-01-1115:58bozhidarI can’t imagine how this wouldn’t work.#2019-01-1116:27Karol WójcikI will try to figure it out then Ill ping you.#2019-01-1309:43dottedmagI have trouble running a remote REPL session via Tramp.#2019-01-1309:44dottedmagRecent CIDER gives the following error, and it is caused by some weird escaping: [nREPL] Starting server via clojure -A:cider -Sdeps '{:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" clojure.lang.ArityException: Wrong number of args (2) passed to: cider-nrepl.main/init
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.AFn.invoke(AFn.java:36)
at user$eval1154.invokeStatic(NO_SOURCE_FILE:1)
at user$eval1154.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7131)
at clojure.core$eval.invokeStatic(core.clj:3214)
at clojure.main$eval_opt.invokeStatic(main.clj:465)
at clojure.main$eval_opt.invoke(main.clj:459)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
#2019-01-1309:44dottedmagThe command line at the remote host is the following: bash /home/dottedmag/bin/clojure -A:cider -Sdeps {:deps {nrepl {:mvn/version "0.5.3"} org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.20.0-SNAPSHOT"}}} -e (require (quote cider-nrepl.main)) (cider-nrepl.main/init \ ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]) — note the \ in cider-nrepl.main/init#2019-01-1309:45dottedmagBefore I upgraded there was another \ added, before second middleware in the list of middleware passed to init, and it produced different error message.#2019-01-1311:11bozhidar@dottedmag Recent CIDER versions don’t use cider-nrepl.main/init at all. They directly delegate the init to nREPL.#2019-01-1318:29dominicmShould I be doing this in vim? #2019-01-1311:52dottedmag@bozhidar Thanks, apparently I had old CIDER loaded even after el-get-upgrade, restart of Emacs fixed it.#2019-01-1311:55dottedmag@bozhidar Is there a non-hackish way to set an environment variable for a remote clojure instance?#2019-01-1312:14dottedmagNevermind. I only need to set it for a .so I'm loading, so I can as well do (jna/invoke Void c/setenv "WHATEVER" "i need"), as I'm going to use JNA for invoking native code anyway.#2019-01-1413:58mgrbyteAre there any changes to what needs to be configured set with cider 0.19 (Raleigh) ? Getting a weird traceback on starting repl, other than changing cider/nrepl to match the new version, not changed anything else :thinking_face:#2019-01-1413:58bozhidar@mgrbyte Can you share it here?#2019-01-1413:59mgrbyteException in thread "nREPL-worker-0" java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
at clojure.lang.Namespace.find(Namespace.java:188)
at clojure.core$find_ns.invokeStatic(core.clj:4096)
at clojure.core$the_ns.invokeStatic(core.clj:4126)
at clojure.core$ns_name.invokeStatic(core.clj:4130)
at clojure.core$ns_name.invoke(core.clj:4130)
at cider.inlined_deps.orchard.v0v3v4.orchard.namespace$inlined_dependency_QMARK_.invokeStatic(namespace.clj:54)
at cider.inlined_deps.orchard.v0v3v4.orchard.namespace$inlined_dependency_QMARK_.invoke(namespace.clj:50)
at clojure.core$complement$fn__5391.invoke(core.clj:1433)
at clojure.core$filter$fn__5614.invoke(core.clj:2813)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:528)
at clojure.core$seq__5124.invokeStatic(core.clj:137)
at clojure.core$filter$fn__5614.invoke(core.clj:2801)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:56)
at clojure.lang.RT.seq(RT.java:528)
at clojure.core$seq__5124.invokeStatic(core.clj:137)
at clojure.core$map$fn__5587.invoke(core.clj:2738)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:528)
at clojure.core$seq__5124.invokeStatic(core.clj:137)
at clojure.core$apply.invokeStatic(core.clj:652)
at clojure.core$mapcat.invokeStatic(core.clj:2775)
at clojure.core$mapcat.doInvoke(core.clj:2775)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at cider.inlined_deps.orchard.v0v3v4.orchard.query$vars.invokeStatic(query.clj:71)
at cider.inlined_deps.orchard.v0v3v4.orchard.query$vars.invoke(query.clj:43)
at cider.nrepl.middleware.test$test_var_query.invokeStatic(test.clj:248)
at cider.nrepl.middleware.test$test_var_query.invoke(test.clj:242)
at cider.nrepl.middleware.test$handle_test_var_query_op$fn__22406$fn__22407$fn__22408.invoke(test.clj:300)
at cider.nrepl.middleware.test$handle_test_var_query_op$fn__22406$fn__22407.invoke(test.clj:293)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:657)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1965)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1965)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at cider.nrepl.middleware.test$handle_test_var_query_op$fn__22406.invoke(test.clj:291)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__10863.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#2019-01-1414:00mgrbyteI get the same with cider-jack-in as with standalone repl
Have:
:repl
{:plugins
[[refactor-nrepl "2.4.0"]
[cider/cider-nrepl "0.19.0"]]}
in project.clj#2019-01-1414:00bozhidarI haven’t seen this error.#2019-01-1414:00bozhidarSeems you’re hitting some NPE when you run tests right?#2019-01-1414:01mgrbytejust dbl checking now#2019-01-1414:02mgrbyteyep, you'd be correct. strange :thinking_face:#2019-01-1414:03mgrbytethanks, it's probably something dumb I've done, will dig deeper.#2019-01-1414:03mgrbytesorry for the noise#2019-01-1414:03mgrbytethought it was happening on jacking in, but it's not#2019-01-1416:27hkjelsI think cider is looking for deps.edn in the top-level git directory. Is there a setting to override it?#2019-01-1416:29bozhidarNo, that’s not the case. It’s looking for the the first deps.edn above the file you’ve currently visited in the file hierarchy.#2019-01-1416:56hkjelsthat sounds sane. I’m getting a message about missing figwheel-main when I excecute cider-jack-in-cljs. Do you have any idea why?#2019-01-1416:57hkjelsit works when I start a REPL from the terminal#2019-01-1417:00hkjelsI think I see the issue..#2019-01-1417:03hkjelsYeah.. I had figwheel-main as an extra-dep, so it’s loaded to late#2019-01-1507:25manuel@bozhidar FYI: moved cider-nrepl dependency from 0.20.0-SNAPSHOT to 0.20.0. All good here. (`deps.edn` + shadow-cljs project, by the way)#2019-01-1507:25manuelthanks for the release 😉#2019-01-1508:43bozhidarYou’re welcome!#2019-01-1508:44bozhidarAnd yeah - CIDER 0.20 is out! (https://metaredux.com/posts/2019/01/15/cider-oslo.html) Enjoy!#2019-01-1510:44dominicm@bozhidar does the new pretty printing use the same API as cider did? Or do I need to send a patch to fireplace? #2019-01-1510:52bozhidarThe API is documented here https://nrepl.org/nrepl/design/middleware.html#_pretty_printing#2019-01-1510:53bozhidarBasically now it’s printer instead of pprint-fn and print-options instead of individual keys for *print-length* and so on.#2019-01-1510:54bozhidarThe print options are specific to the printer that’s being used. CIDER doesn’t set any by default and assumes the users know how to configure their favourite print engine.#2019-01-1510:54bozhidarSee https://nrepl.org/nrepl/design/middleware.html#_pretty_printing#2019-01-1510:55bozhidarAlso - the old middleware returned a special response, now we’re directly pretty-printing the :value key, which simplifies a lot dealing with pretty-printed values.#2019-01-1511:02bozhidarThe old keys are simply ignored, although we can also have the middleware just translate them.#2019-01-1511:02bozhidarI was short on time, so I didn’t fret on this too much.#2019-01-1511:03bozhidarAh, I just remembered why I didn’t do it - the old API assumed printing to a stream, the new assumed printing to a string.#2019-01-1511:04bozhidarWe’ll likely revisit it once @cichli implements streaming of values for nREPL.#2019-01-1511:36tatutIs there a browse spec at point to show documentation of a keyword’s spec that is under the cursor?#2019-01-1511:37tatutcider-browse-spec doesn’t seem to understand ns aliases in the current ns#2019-01-1511:40tatutI’m not very familiar with cider internals, but I would be interested in patching it#2019-01-1512:05dominicm@bozhidar I suppose cider doesn't bring along any pprinters, so if you want to use zprint, you will need to add it (and potentially mr. anderson it) yourself.#2019-01-1512:09manuel@dominicm I added it as a dependency on my project and configured cider-pprint-fn in .dir-locals.el.#2019-01-1512:11dominicm@manuel that doesn't work if you want your printer to work in multiple projects. I generally try to prevent personal choices, like the printer, ending up in project specific configuration.#2019-01-1512:12manuelI see what you mean#2019-01-1512:12dominicmI also don't have the option for a dir locals, as vim doesn't have a practical equivalent. Especially not one that a plug in would depend on for a setting to be useful. #2019-01-1512:14dominicmAlso, if those dependencies ever conflict with those of your project, things will break. This is why cider inlines dependencies. #2019-01-1513:09stathissideriswhen cider connects to deps projects (jack-in), how do I tell it to use the :dev profile? is this the best way? (setq cider-clojure-cli-global-options "-A:dev")#2019-01-1513:14stathissiderisoh maybe .dir-locals is the answer to that?#2019-01-1514:10orestisYeah I’m using .dir-locals @stathissideris — or used to, I’m now starting my nrepl in a terminal and have CIDER connect to it. Saves me the bother 🙂#2019-01-1514:11stathissideris@orestis thanks, I just tried dir-locals and they work as expected!#2019-01-1514:31tjgLast night I discovered a conflict between figwheel-sidecar vs CIDER, because of conflicting nrepl vs tools.nrepl dependencies.
Does combining figwheel-sidecar & CIDER probably require me submit a pull request to figwheel-sidecar that somehow removes the tools.nrepl dependency?#2019-01-1514:31tjg(Or perhaps there's a deeper issue, once that's solved...)#2019-01-1514:41dpsuttonwhat is figwheel-cider? Do you mean figwheel-sidecar?#2019-01-1514:42tjgOops, let me edit my typo, was up late 😛#2019-01-1514:43tjgYes, figwheel-sidecar 🙂#2019-01-1514:45dpsuttonwhat version are you on? I've been running 0.5.18 with no problem#2019-01-1514:47tjgAh, I've been using 0.5.16. (More context: https://gist.github.com/tjg/43527df81a0dd293a808aea10cf4ccc3#problem)#2019-01-1514:49dpsuttonyeah bump your figwheel deps to 0.5.18#2019-01-1514:52tjgYowza, that did the trick perfectly! Thanks @dpsutton! (Could've sworn I looked at figwheel-sidecar's sourcecode on the proper branch, but guess I missed something)#2019-01-1514:53dpsuttonno worries. this stuff gets tricky with the upgrade to nrepl/nrepl#2019-01-1516:25bozhidar> @bozhidar I suppose cider doesn’t bring along any pprinters, so if you want to use zprint, you will need to add it (and potentially mr. anderson it) yourself.#2019-01-1516:26bozhidar@dominicm It actually brings three in the cider.pprint namespace, but I hope this is going to be a temporary measure.#2019-01-1516:27bozhidarPuget would work as a normal dep, as it has a function to print to string, but for clojure.pprint and fipp I had to write simple wrappers to easy the lives of the end users.#2019-01-1516:28bozhidarThis won’t be necessary if we really implement stream printing, though.#2019-01-1516:44macrobartfastis there a quick way to search for and jump to a symbol definition across a project, either with, I guess, cider or emacs?#2019-01-1516:45bozhidarHave you tried M-.?#2019-01-1516:55macrobartfastI have now! thanks! works perfectly... didn't realize it would go across files.#2019-01-1517:19bozhidarMagic 😉#2019-01-1517:47madstapWhen using cider with lein, when I do cider-jack-in it'll use the :repl profile where I can add extra deps and stuff. How do I accomplish the same with deps.edn ?#2019-01-1518:02dpsutton((nil
(cider-clojure-cli-global-options . "-A:fig")))
@madstap i think this is what you are looking for#2019-01-1518:17madstapI put that in .dir-locals.el, right?#2019-01-1518:17dpsuttonyes. sorry 🙂#2019-01-1518:20madstapIf I've already got a .dir-locals.el containing
((nil . ((cider-refresh-before-fn . "integrant.repl/suspend")
(cider-refresh-after-fn . "integrant.repl/resume"))))
I'd add that like this?
((nil . ((cider-refresh-before-fn . "integrant.repl/suspend")
(cider-refresh-after-fn . "integrant.repl/resume")
(cider-clojure-cli-global-options . "-A:fig"))))
#2019-01-1518:22madstapAlso, you didn't put a . between nil and the list, is that significant somehow?#2019-01-1518:23dpsuttonno idea ¯\(ツ)/¯#2019-01-1518:23dpsuttonbut it seems to work. i need to look into an authoritative source on dir locals#2019-01-1518:24madstapYeah, I need to go through some tutorials so I can start reasoning about this stuff instead of cargo culting everything. Thanks a lot for the help 🙂#2019-01-1520:25macrobartfastwell, dang. I just discovered hydra-cljr-project-menu/cljr-add-project-dependency ... is this a viable alternative to alembic?#2019-01-1520:26macrobartfastat the very least, it seems like it will conveniently add a dependency to my project.clj, which is great. the hot reload ('hd') from the minibuffer menu produces a java 10 related error, but plunging on.#2019-01-1520:28macrobartfasttrying new libraries during exploratory coding has required a lot of web-search->clojars->project.clj-updating->repl-restarting which is a flow breaker, so trying faster routes.#2019-01-1520:29macrobartfastalembic has been handy, but seems at times to fail more often than I'd like, which is a flow disrupter as well.#2019-01-1520:32macrobartfastthis is so enticing: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-project-dependency#2019-01-1520:32macrobartfastbut getting: "error in process filter: Temporarily disabled until a solution for java 10 is found."#2019-01-1520:33macrobartfastalso, the fuzzy finding of libraries isn't working.#2019-01-1520:36macrobartfastit looks like I need to update clj-refactor.#2019-01-1520:42macrobartfastor not. bummer, hot reload doesn't work to enable java 10 (which I do not have installed). do any of you have a dependency install/hot-reloading strategy?#2019-01-1523:36arohnerAfter upgrading to 0.20.0, a few cider methods seem to be missing. When I C-h f cider-mode, functions such as M-., cider-find-var aren’t underlined, indicating the key binding is defined but the fn is not. Where should I start looking?#2019-01-1606:42benedek@macrobartfast i posted the link of the alternative a couple of days ago here#2019-01-1606:42benedekhttps://nrepl.org/nrepl/usage/misc.html#_hot_loading_dependencies#2019-01-1606:43benedek@kwcharllie379 also volunteered to bring this/wrap this up for cider#2019-01-1608:09tatutin CIDER 0.20.0 (package: 20190114.1422) (Oslo) I got a weird exception ERROR: Unhandled REPL handler exception processing message {:op slurp, :url file:/Users/tatuta/..., :session 3274155d-5da6-4885-810a-b45cce1567eb, :id 164}
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.<init>(Matcher.java:229)
at java.util.regex.Pattern.matcher(Pattern.java:1093)
at clojure.core$re_matcher.invokeStatic(core.clj:4796)
at clojure.core$re_find.invokeStatic(core.clj:4838)
at clojure.core$re_find.invoke(core.clj:4838)
at cider.nrepl.middleware.slurp$normalize_content_type.invokeStatic(slurp.clj:57)
at cider.nrepl.middleware.slurp$normalize_content_type.invoke(slurp.clj:52)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:94) #2019-01-1608:10tatutwhen a thing I evaluated returned a java.io.File#2019-01-1608:18Karol Wójcik@benedek it might take some time since I’m also graduating and changing job this month#2019-01-1608:30benedekno pressure and good luck with all those things#2019-01-1609:32bozhidar@tatut Likely you’ve hit some bug in the content-type middleware. You should file a bug and disable this in the mean time.#2019-01-1609:42bozhidar(setq cider-repl-use-content-types nil)#2019-01-1609:47tatutIt seems to crash if it can’t determine a content-type#2019-01-1609:48tatutI locally patched get-file-content-type to return “application/octet-stream” as a fallback and it works (but I get a binary file output to my repl which is not useful)#2019-01-1609:54bozhidar@arohner Which version did you upgrade from? Nothing has really changed there recently.#2019-01-1609:55bozhidarWhat you describe sounds like some missing Elisp autoloads, that should not be happening if you’re using package.el.#2019-01-1609:55bozhidar@tatut Well, probably in such cases we should just return the regular printed value, as would be the case in the absence of the middleware.#2019-01-1609:56bozhidarIf you can do this patch yourself that’d be great - if not you can just open a ticket on cider-nrepl and we’ll get to it at some point.#2019-01-1609:56tatutI’ll try after work… I’d like to get into cider/nrepl internals more#2019-01-1610:56Sampo ToivaHi, I just updated Cider to 0.20.0, and when doing cider-jack-in-clj I get two warnings:
WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly
WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
I have removed all refences to nrepl and cider-nrepl from .lein/profiles.clj, and the cider-jack-in-clj seems to be injecting the dependencies correctly.
My messages have these kind of errors:
error in process filter: user-error: ‘nil’ requires the nREPL op "classpath"
Any idea on what's wrong or how could I debug this further?#2019-01-1611:20bozhidar@sampo.toiva I assume you’re on Lein 2.8.1, right?#2019-01-1611:20bozhidarYou need 2.8.3+ for the new CIDER to work normally.#2019-01-1611:36Sampo Toiva@bozhidar Your assumption was correct. Things are working perfectly now! Thanks a ton for this!
I don't know if it's possible to somehow give a proper error message about that, but it's maybe worth considering.#2019-01-1611:38bozhidarThere’s some check about this in cider-nrepl, but I guess that message ended up in the *nrepl-server* buffer.#2019-01-1611:39Sampo ToivaAh, yeah, didn't occur to me to check that buffer - went through the others.#2019-01-1611:40bozhidarYeah, the situation is certainly not ideal. Probably we should just try to get the version of Lein/Boot when when cider-nrepl loads and send it to the clients.#2019-01-1611:45pjstadigI put a comment here https://github.com/clojure-emacs/cider-nrepl/issues/460. In cider 0.20 I'm still experiencing the problem where the debugger only uses a breakpoint once.#2019-01-1613:45chrisblomis there a way to clear the cider repl output programmatically?#2019-01-1613:46chrisblomfrom within clojure#2019-01-1614:40erwinrooijakkers@chrisblom you might be able to run (cider-repl-clear-buffer) by using clomacs (“Clomacs simplifies calling Clojure code from Emacs lisp and vice versa”)
https://github.com/clojure-emacs/clomacs#2019-01-1614:46chrisblom@erwinrooijakkers thanks, that might work#2019-01-1617:23macrobartfast@benedek thanks for the link for a strategy for hot reloading deps yesterday! tools.deps looks similar to alembic. that's helpful... although I really liked the idea of being able to both add a dep to project.clj and hot reload it via emacs bindings, so hopefully that issue will get worked out (wish I were good enough yet to tackle it!).#2019-01-1617:27benedektbh i don't think the client code needs to change much. only the refactor-nrepl impl needs to rewritten in cider-nrepl#2019-01-1618:59arohnerHi there, when running 0.20.0, stacktraces no longer print in my repl buffer, and the stacktrace window no longer appears. I’m also seeing `Warning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.` which could be related, but I’m not sure where the middleware it’s complaining about is coming from, there’s nothing that stands out in my ~/.lein/profiles or the project.clj#2019-01-1619:00dpsuttonstandard question to ask is if you are on lein version 2.8.3. CIDER no longer plays nice with tools.nrepl but needs the newer nrepl/nrepl#2019-01-1619:07arohner$ lein --version
Leiningen 2.8.3 on Java 1.8.0_144 Java HotSpot(TM) 64-Bit Server VM
#2019-01-1619:08arohnerand running [nrepl "0.5.3"] according to lein deps :tree#2019-01-1619:40dpsuttonone thing that just helped out others: putting deps.edn files allows for others to target branches of piggieback, nrepl quite easily. Someone is trying out a patch to piggieback trivially because i pushed a branch with a deps edn file. Just for consideration going forward#2019-01-1621:41Christian JohansenI'm having problems running figwheel-main with deps.edn in CIDER#2019-01-1621:42Christian Johansenwhen I run cider-jack-in-cljs, the browser pops up, figwheel reports being connected, but the mini buffer just hangs with "Starting server via"#2019-01-1621:42Christian Johansenif I do list-processes I can see the nrepl process running as expected, but I never see a working REPL in emacs#2019-01-1621:42Christian Johansenanyone seen this?#2019-01-1621:43Christian Johansenclojure -A:dev from a shell works just fine#2019-01-1621:43dpsuttoncheck the nrepl process in emacs. I think i've seen this before. you probably have the repl running there rather than in the proper repl buffer#2019-01-1621:44Christian Johansenyes:#2019-01-1621:44Christian JohansenPrompt will show when REPL connects to evaluation environment (i.e. a REPL hosting webpage)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Opening URL
ClojureScript 1.10.439
cljs.user=>
#2019-01-1621:44Christian Johansenbut this doesn't really help me. I can't use it for anything. How can I get it to start the regular cider buffer?#2019-01-1621:47dpsuttonno you can't. i'm trying to remember what i did in this case#2019-01-1621:48dpsuttoncheck your dir locals. it needs to ask you for the cljs repl type. i remember when it doesn't this happens#2019-01-1621:48Christian Johansenhmm, ok#2019-01-1621:49Christian Johansenit doesn't ask, so maybe that's it#2019-01-1621:49dpsuttonsorry its been a few weeks but i'm trying to remember#2019-01-1621:49Christian Johansen((nil
(cider-clojure-cli-global-options . "-A:dev")))
#2019-01-1621:52Christian Johansenhmm, ok. it might be because of this in my deps.edn:#2019-01-1621:52Christian Johansen:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]
#2019-01-1621:52dpsuttonyeah. move that into a build profile and try without that#2019-01-1621:53Christian Johansensort of progress:#2019-01-1621:55Christian Johansenit now starts a CIDER REPL, but it crashes with some syntax errors and drops into a clj repl#2019-01-1621:56Christian Johansen2. Caused by clojure.lang.LispReader$ReaderException
java.lang.RuntimeException: Invalid token: :
#:clojure.error{:line 1, :column 52}
...
1. Caused by java.lang.RuntimeException
Invalid token: :
#2019-01-1621:58Christian Johansenok, seems to be an error on my side#2019-01-1621:59Christian Johansenalright, thanks a log @dpsutton!#2019-01-1708:26Cam SaulHas anyone ever ran into issues with cider-nrepl hanging when evaluating forms?
I have the exact same Emacs version and configuration/`~/.lein/profiles.clj`/project across 3 different computers (3 Macs, 1 running Linux, and 1 running Windows) and only one of them has this issue (one of the Macs). I cannot figure why it's happening.
Basically when I evaluate a form in cider-nrepl it will sometimes hang for 10-20 seconds before printing the result. The hanging is happening in the external process because Emacs is still responsive (and debug-on-exit and the Emacs profiling tools don't really provide useful info).
When I run lein repl however things work perfectly normally. But if I run lein repl :headless and M-x cider-connect to that REPL I run into the hanging again.#2019-01-1708:50dominicm@camsaul how big are the results you are evaluating? #2019-01-1708:54Cam SaulThe form and the results don't matter -- it hangs equally often and long whether I'm evaluating something simple like (+ 1 2) or a bigger function that run a DB query and returns a few hundred rows#2019-01-1710:02pjstadig@camsaul maybe check the heap sizes? the default heap size can vary from computer to computer and memory pressure could cause delays in processing#2019-01-1710:19Cam Saul@pjstadig thanks, I thought it could be that. But (.maxMemory (Runtime/getRuntime)) gives my 8 GB, so I don't think that's the problem#2019-01-1710:25Cam Sauleven when creating a new project and running cider-nrepl I'm running into the lag.
I've enabled nrepl logging (`(setq nrepl-log-messages t)`) to try to figure out what's going on. It's lagging between sending the form to be evaled to the nrepl and getting the response.
(-->
id "17"
op "eval"
session "af0c00af-7bb8-4382-a6bc-44248c420115"
time-stamp "2019-01-17 02:21:58.994293000"
code "(+ 2 3)"
column 9
content-type "true"
file "*cider-repl ~/x:localhost:50767(clj)*"
line 8
ns "x.core"
print-options (dict ...)
printer "cider.nrepl.pprint/pprint"
)
(<--
id "17"
session "af0c00af-7bb8-4382-a6bc-44248c420115"
time-stamp "2019-01-17 02:22:42.249252000"
ns "x.core"
value "5"
)
In the example above I typed (+ 2 3) in the REPL and it took almost a full minute to get a response (as recorded in the timestamps). Annoying to say the least! 😓#2019-01-1710:31Cam SaulI thought it could have been some sort of network configuration issue so I tried 127.0.0.1 instead of localhost but that doesn't seem to make a difference#2019-01-1710:34Cam SaulI think maybe my next step will be to look at the traffic a little more with Wireshark and see what's going on and maybe try to repo some of the queries it's sending manually and seeing if I run into the same lag outside of CIDER#2019-01-1710:35pjstadigi wouldn't guess it is networking related. have you tried hooking up jvisualvm or something similar to the repl server to see what is happening when its evaluating?#2019-01-1710:36Cam Saulthat's a good idea. Let me give that a try#2019-01-1710:38Cam Saulthe reason I thought it might have been networking related is there's no lag when running the nrepl directly with lein repl#2019-01-1710:48pjstadigoh hmm#2019-01-1710:49pjstadigyeah i was thinking the delay in the timestamps indicated a delay in processing as opposed to networking#2019-01-1710:50pjstadigare there any firewalls or network filters possibly interfering?#2019-01-1710:54Cam SaulYeah, I turned of then firewall and antivirus to see if that was a problem and it didn't make a difference. I'm using the same stuff on the other too Macs however without issue. Another other stuff ran locally like databases in Docker containers or web servers aren't having any issues#2019-01-1712:22Cam Saulso profiling didn't get me very far except for finding out that nrepl is basically spending most of its CPU cycles polling for and writing bytes. Nothing surprising.
What is surprising however is comparing packet capture in Wireshark with the `*nrepl-messages* buffer.
I evaled (System/nanoTime) in the REPL at 4:15:15, but didn't see a response for 10 seconds or so.
Wireshark capture:
04:15:15.884979 TCP 324 52718 → 52359 [PSH, ACK] <eval request from cider>
04:15:15.884997 TCP 56 52359 → 52718 [ACK] <ack from nrepl for eval request packet>
04:15:15.890072 TCP 150 52359 → 52718 [PSH, ACK] <nrepl response>
04:15:15.890091 TCP 56 52718 → 52359 [ACK] <ack from cider for response>
*nrepl-messages*
(-->
id "69"
op "eval"
session "2c754a30-4bf0-42ba-aa57-b57977f7f2aa"
time-stamp "2019-01-17 04:15:15.884446000"
code "(System/nanoTime)"
column 9
content-type "true"
file "*cider-repl ~/x:localhost:52359(clj)*"
line 14
ns "x.core"
print-options (dict ...)
printer "cider.nrepl.pprint/pprint"
)
(<--
id "69"
session "2c754a30-4bf0-42ba-aa57-b57977f7f2aa"
time-stamp "2019-01-17 04:15:24.734444000"
ns "x.core"
value "55310219931646"
)
(<--
id "69"
session "2c754a30-4bf0-42ba-aa57-b57977f7f2aa"
time-stamp "2019-01-17 04:15:24.735295000"
status ("done")
)
#2019-01-1712:26Cam SaulThe really strange thing is that I can see the response being sent by nrepl about 5 milliseconds after the eval request is sent, but it doesn't pop up in *nrepl-messages* or the CIDER REPL until 9 seconds later#2019-01-1712:32Cam SaulIn case my Emacs networking was broken somehow I reinstalled it and tried both https://Emacs.app and installing with Homebrew but neither had an effect. FWIW other networking in Emacs seems to be working fine (such as fetching packages)
So I'm guessing there's something weird going on in the CIDER networking code itself. I'm going to try to poke around a bit and see if I can find what's going on#2019-01-1713:23pjstadigNot sure if this is a good idea, but I released this https://github.com/pjstadig/ring-cider-debug#2019-01-1722:40ChaseI use C-c M-; (eval-defun-to-comment) a lot so that I can refer back to the output while studying. But if I do something like this (def words (clojure.string/split example #" ")) and then want to check my output by just putting in words below it I get the expected behavior when pressing C-c C-e but do not get the expected behavior from C-c M-;. Is there a trick to eval-defun-to-comment if I am using it on only variable names without an s-expression? Not sure if this is too much of a corner case for my use only.#2019-01-1722:41Chasethe behavior I get in this case is it evals the next complete s-expression in my source code and inserts the relevant comment for that expression.#2019-01-1723:16jmckitrickHere I am#2019-01-1723:17jmckitrick@dpsutton It looks like my .lein/profiles.clj needs an update.#2019-01-1723:17jmckitrickI’ll start with tools.nrepl#2019-01-1723:18jmckitrickOr do I want the new one?#2019-01-1723:18jmckitrickThe standalone nrepl?#2019-01-1723:18dpsuttonif you can get away with it, an empty one is preferable#2019-01-1723:18jmckitrickhttps://github.com/nrepl/nrepl#2019-01-1723:18jmckitrickActually, most is commented out.#2019-01-1723:18dpsuttonyou shouldn't need any deps in there. CIDER will inject all of its own depepdencies into a project when you are jacking in#2019-01-1723:19jmckitrickI have a few lein plugins#2019-01-1723:19dpsuttonthose are usually a problem when upgrading#2019-01-1723:19jmckitrickSo… I’ll comment out all cider entries.#2019-01-1723:19jmckitrickAh. I’ll comment them all out for now.#2019-01-1723:20jmckitrickFirst complaint: need cider-nrepl#2019-01-1723:20dpsuttonhow are you starting your app?#2019-01-1723:21jmckitrickcider-jack-in#2019-01-1723:23jmckitrickI added [cider/cider-nrepl "0.20.0"] under :user :plugins#2019-01-1723:23dpsuttonget rid of it#2019-01-1723:23dpsuttonCIDER will inject everything it needs when you do cider-jack-in#2019-01-1723:24jmckitrickYeah, that’s when I got the error#2019-01-1723:24jmckitrickI’ll try again clean#2019-01-1723:24dpsuttonin the *Messages* buffer it will show the command it uses to start up your process. can you post that here?#2019-01-1723:24dpsuttonalso, what version of CIDER are you using?#2019-01-1723:24jmckitrick0.21.0-snapshot#2019-01-1723:25dpsutton👍#2019-01-1723:25dpsuttondid you recently update?#2019-01-1723:25jmckitrick Starting server via /Users/jmckitrick/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\] -- repl :headless :host localhost...#2019-01-1723:25dpsuttoncool. yeah there you can see its injecting everything it needs#2019-01-1723:25jmckitrickI update weekly#2019-01-1723:25dpsuttonok. just making sure emacs had been restarted since#2019-01-1723:25jmckitrickYes, it looks like it should work.. however…#2019-01-1723:25jmckitrickerror in process filter: user-error: 'nil' requires the nREPL op "classpath" (provided by cider-nrepl)
error in process filter: 'nil' requires the nREPL op "classpath" (provided by cider-nrepl)
#2019-01-1723:25dpsuttoncan you run that command from a command line and see what happens?#2019-01-1723:26jmckitrickSure.#2019-01-1723:26jmckitrickStarting by that command ends with nREPL server started on nnnn#2019-01-1723:27dpsuttonok. try m-x nrepl-toggle-message-logging#2019-01-1723:29jmckitrickOk, this time CIDER did not give me the same warning. However, in the repl in emacs I’m seeing CIDER requires nREPL 0.4.4 (or newer) to work properly#2019-01-1723:29dpsuttonok. i think we are closer. maybe check lein deps :tree to see if anything is bringing in tools.nrepl#2019-01-1723:30jmckitrickOk, let me RTFM this CIDER troubleshooting page as well…#2019-01-1723:31jmckitrickJust found this [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]#2019-01-1723:32jmckitrickWhen I ran lein deps :tree, that is#2019-01-1723:33jmckitrickSince I’m running cider-jack-in inside a project, I shouldn’t need to force nREPL 0.4.4#2019-01-1723:33jmckitrickAFAICT#2019-01-1723:37dpsuttonright, but we need to keep the old tools.nrepl out#2019-01-1723:37dpsuttonit is poisonous to current CIDER#2019-01-1723:39jmckitrickI don’t see how it’s getting in…#2019-01-1723:39jmckitrickIt’s not in my project.clj, and it’s not in .lein/profiles.clj#2019-01-1723:42dpsuttonare you sure you're on lein 2.8.3?#2019-01-1723:42dpsuttonif you are doing lein deps tree it should show who requires it. if it is "top level" it is just required in your project.clj#2019-01-1723:45jmckitrickOh, I downgraded to 2.8.1 to get my repl to work#2019-01-1723:45jmckitrickLet me try 2.8.3#2019-01-1723:46dpsuttonah sorry. yeah 2.8.3 moves to new nrepl, 2.8.1 was old nrepl#2019-01-1723:46jmckitrickOk, I think I’m in business!#2019-01-1723:47jmckitrickI have both my repl and CIDER working… let me try again fresh#2019-01-1723:47dpsuttonexcellent. sorry its so weird. things just get crazy when core infrastructure like nrepl gets unfrozen#2019-01-1723:48jmckitrickNo problem. I’m really looking for a place to help now. The only catch is I’m not currently in Clojure full time anymore. But I want to contribute something of value…#2019-01-1723:52jmckitrickLooks like CIDER is fully operational. Thanks for the help!#2019-01-1723:53jmckitrickSo for any other projects I want to use, the hard work has been done, right? Upgrade leiningen, clear out .lein/profiles.clj, and that should be it?#2019-01-1723:53dpsuttonpretty much. the only gotcha is that the two versions of nrepl can't coexist right now#2019-01-1723:54dpsuttonwhich means lein 2.8.3 and watch your deps for older versions#2019-01-1723:55jmckitrickGot it.#2019-01-1800:05jmckitrickNow.. in theory it should be easy to open the cider-nrepl project and compile changes there, right? Or is there some recursion I need to be aware of? I want to work on this issue: https://github.com/clojure-emacs/cider-nrepl/issues/530#2019-01-1800:07dpsuttoni think for straight forward things it works. debugging the debugger can get a bit weird#2019-01-1809:12vemvIf I want to immediately add these to a 3rd party library https://github.com/clojure-emacs/cider/blob/master/doc/configuration/indentation.md
then I should use alter-meta! over the 3rd party var, right?
i.e. no CIDER-local way?#2019-01-1814:27pjstadigif you want indentation for a 3rd party library that doesn't have dynamic indentation specs, you probably want to use put-clojure-indent or define-clojure-indent from clojure-mode, instead of altering metadata#2019-01-1814:41vemvsilly me, I completely forgot about it
thanks!#2019-01-1814:41vemvperhaps there's the limitation that those aren't aware of aliases. I will check it#2019-01-1900:04hmaurerCider pprint (C-c C-v C-f e) is opening an empty buffer, but cider eval (C-c C-e) is working just fine. Any idea why?#2019-01-2106:25plexusjava.lang.IllegalArgumentException: No such namespace: cider.nrepl.pprint
#2019-01-2106:25plexusthis was already reported by someone in #beginners#2019-01-2106:34plexusseems I had added some code earlier to make CIDER use cider-nrepl 0.19.0-SNAPSHOT, which is outdated by now.#2019-01-2106:34plexusIs there a better way to opt-in to the latest SNAPSHOT of cider-nrepl?#2019-01-2109:12yuhanI'm can't get shadow-cljs to work with cider - it always errors with
error in process filter: Sync nREPL request timed out (op classpath)
after selecting the REPL type#2019-01-2109:13yuhanand switching over to the cider-repl it says#2019-01-2109:13yuhanWARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly#2019-01-2109:14yuhan`;; Connected to nREPL server - <nrepl://localhost:8230>
;; CIDER 0.21.0snapshot (package: 20190116.1142), nREPL 0.2.13`#2019-01-2109:15yuhantried putting [nrepl "0.5.3"] into :dependencies list in the shadow-cljs.edn but that didn't change anything#2019-01-2109:23manuel@qythium I detailed my setup with shadow-cljs here, if it can be of any help: https://manuel-uberti.github.io/programming/2018/11/14/deps-shadow-cljs/#2019-01-2109:25yuhanThanks, I'll have a look 🙂#2019-01-2109:27manuelI updated to [cider/cider-nrepl "0.20.0"] now, though#2019-01-2109:28manuelbut otherwise, that's my current setup#2019-01-2109:29yuhando I need a deps.edn / project.clj in the folder? I thought shadow-cljs.edn was meant to replace that#2019-01-2109:31manuelWell, shadow-cljs is for ClojureScript. You will still need to use something else to build/configure the Clojure side of your project, if you have one#2019-01-2109:36yuhanohh okay, I was starting with the shadow-examples repo and didn't realise there was a project.clj in the root folder#2019-01-2109:36yuhansorry, still really confused with the entire cljs ecosystem#2019-01-2109:39thheller@qythium you absolutely do not need deps/lein for shadow-cljs if you just want to do CLJS#2019-01-2109:40thhellerthe project.clj in the root folder of the examples is only for Cursive. it is otherwise unused.#2019-01-2109:54yuhanokay, thanks for the clarification!#2019-01-2109:55yuhanI think I finally got it working with the re-frame example#2019-01-2109:56yuhanso the idea is to start npx shadow-cljs watch ... from an external terminal, then use cider-connect-cljs instead of jacking in directly from Emacs?#2019-01-2109:57thhellerI don't use emacs myself and don't know but this was written by a contributor. not sure how current it is though. https://shadow-cljs.github.io/docs/UsersGuide.html#cider#2019-01-2110:03manuel@qythium that's what I do#2019-01-2112:52Saikyunhow do I refresh namespaces automatically when saving a file?#2019-01-2112:58Saikyunthis seemed to work:
(add-hook 'cider-mode-hook
'(lambda () (add-hook 'after-save-hook
'(lambda ()
(if (and (boundp 'cider-mode) cider-mode)
(cider-ns-refresh))))))
#2019-01-2113:11temcowhich el file should these codes be inserted into?#2019-01-2113:11Saikyuninit.el#2019-01-2113:12Saikyunyou need to (require 'cider) before as well 🙂#2019-01-2113:12temcook, thanks#2019-01-2113:12Saikyunnp, happy to help#2019-01-2114:32temcowhat's the difference between ns-refresh and ns-reload?#2019-01-2114:53Saikyunns-refresh invokes clojure.tools.namespace.repl/refresh
ns-reload invokes (require ... :reload)#2019-01-2114:54SaikyunI don't know the implications of the different alternatives though#2019-01-2114:59aisamuI believe refresh reloads all the changed dependencies as well, in order#2019-01-2115:02temcoI found that ns-reload actually did (clojure.core/reload "x.y.z") and made the fn which I had modified really refreshing, and ns-refresh didn't#2019-01-2115:03temcomaybe ns-refresh deletes something?#2019-01-2123:58weavejesterDoes anyone know how to use the old cider-cljs-lein-repl functionality in newer versions of Cider? The latest version of Cider seems to need you to register the REPL type.#2019-01-2200:01weavejesterI can see that I can register a new REPL type with cider-register-cljs-repl-type, but I can't see anything that could be placed in a .dir-locals.el.#2019-01-2208:00agI’ve “hacked” it doing something like this:
((nil . ((eval . (with-eval-after-load 'cider
(cider-register-cljs-repl-type
'fw-cc
"(do (start) (start-fw) (use 'figwheel-sidecar.repl-api) (cljs-repl))")
(setq cider-default-cljs-repl 'fw-cc))))))
I’m sure there are now better ways, but that worked for me#2019-01-2211:49weavejesterThanks for the hint#2019-01-2200:02weavejesterHas this functionality been removed from Cider, and if so, could we have it back? 😉#2019-01-2212:34Saikyunhm, it seems like using cider-ns-refresh and cider-ns-reload messes up defonces?#2019-01-2212:34Saikyuni.e. it defines them again#2019-01-2212:36Saikyunor not...? hm, something strange is going on#2019-01-2212:41Saikyunit seems to define them again sometimes :S#2019-01-2214:13temcocider doc said, "Sometimes, cider-ns-refresh may not work for you. If you're looking for a bit more forceful reloading the cider-ns-reload and cider-ns-reload-all commands can be used instead. " I don't know what's that (some) time......#2019-01-2216:11richiardiandreaYeah I wrote that in the doc, basically I needed a way to introduce the fact that cider-ns-reload has a completely different mechanism for reloading namespace, which is (require :reload)...while refreshing is basically using tools.namespace.
"Might not work for you" is as in "you don't like that workflow".
Rephrasing might make sense if too confusing.#2019-01-2222:57mseddonThat is not how I read that, but that makes total sense for me now. I have been in #nrepl for a few days, should I idle anywhere else to glean other insights like this? Happy to tentaviley PR doc changes myself if I can catch them.#2019-01-2302:35richiardiandreaWell yeah writing here or in #nrepl for this kind of feedback is for sure a good thing#2019-01-2403:53temcoI don't know why but I really found cider-ns-refresh couldn't reload my namespace, while cider-ns-reload could#2019-01-2302:59dhruv1in cider, i see a lot of console logs being printed to my clojure repl buffer.#2019-01-2303:00dhruv1is there a way to shut it off?#2019-01-2303:02dhruv122:00:25.474 [Polling] DEBUG org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Group demo committed offset 4 for partition test-0
22:00:25.475 [Polling] DEBUG org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Group demo committed offset 4 for partition test-0
22:00:25.475 [Polling] DEBUG org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Group demo committed offset 4 for partition test-0
this keeps repeating.#2019-01-2304:04plexusSeems cider-pprint-eval-last-sexp-to-comment stopped working... it just silently does nothing#2019-01-2304:09plexusseems like it might be an issue with the new pprint middleware, the response only has a value, but not pprinted output#2019-01-2304:10plexus(-->
id "220"
op "eval"
session "1c6adcc6-3d0a-4d18-b86d-474191e3ee4f"
time-stamp "2019-01-23 12:06:19.647749420"
code "(+ 3 4)
"
column 1
file "/home/arne/github/lambdaisland/kaocha/test/unit/kaocha/plugi..."
line 35
ns "kaocha.plugin.notifier-test"
print-options (dict ...)
printer "cider.nrepl.pprint/pprint"
)
(<--
id "220"
session "1c6adcc6-3d0a-4d18-b86d-474191e3ee4f"
time-stamp "2019-01-23 12:06:19.671212640"
ns "kaocha.plugin.notifier-test"
value "7"
)
(<--
id "220"
session "1c6adcc6-3d0a-4d18-b86d-474191e3ee4f"
time-stamp "2019-01-23 12:06:19.671727041"
status ("done")
)
#2019-01-2304:24dpsuttonits hard to step through with the debugger#2019-01-2304:34dpsuttoni think the problem is in cider-eval-pprint-with-multiline-comment-handler#2019-01-2304:37dpsuttonok got it#2019-01-2304:38dpsuttonthe result comes back as a value and the handler is supposed to reroute that to a comment writing callback#2019-01-2304:38dpsuttonbut the handler is only set up to handle output, ie, stdout and stderr and just ignores the value result#2019-01-2304:39dpsutton@plexus on line 557 of cider-eval.el, replace the '() with #'multiline-comment-handler so that the value handler is also a multiline commend handler#2019-01-2304:43plexusthanks! it works now. I saw that but I thought the pretty printed result would be under a different key.#2019-01-2304:47dhruv1hello, i am using kafka consumer in clojure and i keep seeing tons of these logs printed to screen:
DEBUG org.apache.kafka.clients.consumer.internals.ConsumerCoordinator - Group some-group committed offset 8 for partition test-0#2019-01-2304:47dhruv1there are thousands of these, any one know how to turn them off?#2019-01-2304:48dpsuttoni think you need to look into configuring your logger#2019-01-2304:48dpsuttonyour logger is writing to stdout or err which ends up in your repl#2019-01-2304:48dhruv1i treid this:#2019-01-2304:48dhruv1(set-logger! :level :warn
:additivity false
:pattern "%p - %m%n"
:filter (constantly true))#2019-01-2304:48dpsuttonyou want to look for a way to get your logging into a file.#2019-01-2304:49dhruv1also this:
log4j.rootLogger=INFO
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
log4j.logger.org.apache.kafka.streams=WARN
log4j.additivity.org.apache.kafka.streams=false
#2019-01-2304:49dhruv1in my log4j.properties file#2019-01-2304:49dhruv1i put it in my respurces folder#2019-01-2304:49dpsuttonah, that ConsoleAppender looks like what is drowning you#2019-01-2304:50dhruv1hmm..#2019-01-2304:50dpsuttontry asking in #clojure to see if they can help you#2019-01-2304:50dhruv1okay perfect!
thanks#2019-01-2304:50dpsuttonno worries. that general problem should solve your CIDER problem#2019-01-2304:50dhruv1awesome!#2019-01-2310:41tianshuhave anyone run into this issue? when quit with C-c C-q, there's an error
this is what I got in *Messages* buffer
[nREPL] Connection closed
error in process sentinel: nrepl-send-sync-request: Wrong type argument: stringp, nil
error in process sentinel: Wrong type argument: stringp, nil
#2019-01-2419:30birdspiderHi, is cider-doc on jvm-11 supposed to give more information ? because I only get the signature : (i.e. doc on java.util.concurrent.PriorityBlockingQueue https://imgur.com/a/TaQXfpS ; I have jvm, jvm-src and jvm-doc installed locally)#2019-01-2500:25richiardiandreanice colors, what theme do you use?#2019-01-2419:33dpsutton#2019-01-2419:33dpsuttoni have similar results on java 8#2019-01-2419:38birdspiderI'm not sure if this is the status-quo or something which has to be extra setup. The question that I keep asking myself - do clojure-pros@cider really work without javadoc - or is my setup wrong.#2019-01-2909:18erwinrooijakkersFor me it works…#2019-01-2909:21erwinrooijakkershttps://i.imgur.com/HfEj2CO.png#2019-01-2909:23erwinrooijakkersOut of the box Spacemacs on macos#2019-01-2909:23erwinrooijakkersJava 1.8.0#2019-01-2909:24erwinrooijakkersDid you solve the problem?#2019-01-2419:39birdspiderI found a debate at https://github.com/clojure-emacs/cider/issues/2269 but I do not understand if its not-working/not-supported/java-version-limited or supposed-to-be-working.#2019-01-2419:39dpsuttonI can't help you there. might be a good reddit or clojureverse question. My work is largely clojure and cljs stuff so I don't go into java.util all that often#2019-01-2419:39birdspiderok thx#2019-01-2419:40dpsuttonits labeled as a bug#2019-01-2419:40dpsuttonit seems this is a problem without a fix right now#2019-01-2421:45pbrown@birdspider It's supposed to be working. I've had this problem when java sources were missing from the classpath. Does ( "java/util/concurrent/PriorityBlockingQueue.java") locate anything? It returns a url to jar:file:/usr/lib/jvm/java-8-openjdk-amd64/src.zip!/java/util/concurrent/PriorityBlockingQueue.java on my system. My version of cider adds sources to the classpath via https://github.com/clojure-emacs/cider-nrepl/blob/v0.16.0/src/cider/nrepl/middleware/util/java.clj, but this seems to have moved to orchard since then.#2019-01-2510:35birdspider@pbrown nope, returns nil, and its not on the classpath#2019-01-2510:44birdspiderit seems that the code (`jdk-sources`) is gone from cider-nrepl 0.20.0 (the version I use), and adding clojure-emacs/orchards [cider/orchard "0.4.0"] to the projects deps does not really do anything for me#2019-01-2511:55birdspider@pbrown I commented what I think is happening here https://github.com/clojure-emacs/cider/issues/2269#issuecomment-457549361#2019-01-2511:57vxedoes anyone have a version number of nrepl/nrepl that is compatible with cider/cider-nrepl 0.20.0 ?#2019-01-2512:02birdspiderwhen I use cider-jack-in it auto-uses cider-0.20.0 with [nrepl "0.5.3"] - does this not suffice ?#2019-01-2512:02birdspiderI mean it automaticly injects it#2019-01-2512:03vxeyeah im doing cider-connect where it needs specified 0.4.4 and 0.5.3 arent working#2019-01-2512:05vxeugg, using spacemacs for the first time, its apparently using 0.21.0snapshot. jack in works connect does not#2019-01-2512:07birdspideryou could try in dotspacemacs/user-init to fall back to the stable cider (whatever that is currently)
(add-to-list 'configuration-layer-elpa-archives '("melpa-stable" . ""))
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
#2019-01-2512:12temcolein 2.8.1 connects to nrepl 0.2.12, while 2.8.3 to 0.5.3#2019-01-2512:13birdspider@vxe I just tried with spacemacs@develop + cider0.20.snapshot and after a lein repl I can cider-connect without problems#2019-01-2512:13vxemines pulling in 0.21snapshot#2019-01-2512:13birdspider@vxe mine too / typo#2019-01-2512:13vxeah, ok#2019-01-2512:14vxeanything in your profiles.clj?#2019-01-2512:14birdspider@vxe try what @temcoemail said and check lein version#2019-01-2512:20vxe2.8.3#2019-01-2512:21vxelet me try 0.5.3#2019-01-2512:22vxethe stacktrace btw after attempting cider-connect https://gist.github.com/vxe/783d4f8d5a38462759da2d14b295bded#2019-01-2512:33vxeI quit. Out of curiosity does spacemacs default with the bleeding edge cider, or is that configured somewhere?#2019-01-2512:56birdspider@vxe afaik spacemacs@develop defaults to MELPA which AFAIK is bleeding/snapshots#2019-01-2512:57birdspiderI wrote before how you can pin cider to ELPA (which is the emacs stable repo)#2019-01-2512:58birdspideror melpa-stable (haven't wrapped my head aroud this emacs repos yet)#2019-01-2513:05MacrozI use cider-pprint-eval-last-sexp a lot and in the Cider 0.16 series it used to print stdout to the same buffer as the result which was nice. Is this still somehow possible? stdout seems to go to either repl or its own buffer only?#2019-01-2513:08MacrozI almost never use or look at the repl buffer#2019-01-2520:17pbrown@birdspider thanks for taking a look! I replied on the ticket. As a sanity check, you can find your copy of src.zip and add it to the classpath manually. If that doesn't fix it, something else might be broken too.#2019-01-2614:22syverHey! New to clojure, and just installed CIDER, but I'm facing an issue. Every time I try to evaluate a function in my file, after M-x cider-jack-in, it returns fine if the function returns a value, but if it returns nil, i get the following error: error in process filter: eval: Wrong type argument: characterp, nil, and the REPL takes a few seconds to print the result, then hangs. I'm running Emacs 26.1 on Win10 using the newest version of CIDER from melpa. I saw someone else with the same problem on reddit (https://www.reddit.com/r/emacs/comments/9kii09/cider_any_prompt_that_returns_nil_yields_error_in/) but couldn't find any followup in GitHub, so I wanted to post here before posting a new GitHub issue, in case it's an already solved problem.#2019-01-2614:30dpsuttonthat post mentions that sayed might be an issue. Are you running any plugins? Is this in spacemacs which brings a few more of the ancillary CIDER projects?#2019-01-2614:31dpsuttoni'm up to date with master and can't reproduce. but happy to walk through it with you#2019-01-2614:31syverNo this is my own Emacs config, not many other plugins installed (except clj-refactor and smartparens)#2019-01-2614:32dpsuttonand any trivial project, anything returning nil triggers this? nothing special?#2019-01-2614:32dpsutton(and clj-refactor is up to date)?#2019-01-2614:32syverI have attempted deleting my elpa folder multiple times, so should have the newest version of all plugins#2019-01-2614:33dpsuttonok. and in your project file (project.clj or deps.edn) are you specifying versions of cider nrepl and refactor-nrepl or letting CIDER inject those for you?#2019-01-2614:34syverCIDER injects them, the only dependency is clojure 1.9.0#2019-01-2614:35syverthe error also happens when actually typing out a command in the CIDER repl, for instance (println "Hello")#2019-01-2614:35dpsuttonok. can we try this without cider refactor then?#2019-01-2614:35dpsuttonsee if we can isolate the layer causing the problem. I suspect it is there since i can't reproduce#2019-01-2614:37syverlet's see. I do that by just removing clj-refactor as an emacs package, I guess?#2019-01-2614:39dpsuttonyes. that should be it. i vaguely remember it having some kind of sticky setting somewhere but its been a while since i've used it#2019-01-2614:43syveralright, I removed clj-refactor (had to delete the package folder manually to make the nREPL not add nREPL-refactor as a plugin. the first eval works fine, but the same issue happens on subsequent evaluations.#2019-01-2614:44dpsuttonhow versed in emacs are you? could you set the debugger to begin on errors and find your way through stack traces?#2019-01-2614:44dpsuttoni wish i could replicate#2019-01-2614:45syverI'll try enabling the debugger!#2019-01-2614:45dpsuttontoggle-debugger-on-error should be what we want#2019-01-2614:50syverThat pointed me to pretty-mode! disabling it seemed to work. I think pretty mode wanted to redraw nil to some other symbol, which caused the system to hang#2019-01-2614:52dpsuttonAh! No idea what that is but it sounds bad. #2019-01-2614:52syverBy the way, thanks for a very patient and thorough guide through the issue! Makes me feel very welcome into the community.#2019-01-2614:52dpsuttonOf course!#2019-01-2614:52dpsuttonGlad to have you#2019-01-2614:53syverpretty-mode redraws certain symbols to their mathematical equivalents. lambda to λ etc#2019-01-2614:54syverit's just vanity to have it enabled, so I have no problems turning it off for working with clojure 🙂#2019-01-2615:11dpsuttonah i see. i normally don't like those because copy and paste and alignment get weird#2019-01-2615:11dpsuttonbut for sure they look good in screen shots and on twitter#2019-01-2615:11dpsuttonsame thing with ligatures#2019-01-2620:13TobiHHi there. Could someone help me with getting cider to work with clojurescript and figwheel? I cannot seem to get it working properly.#2019-01-2620:20TobiHMy problem in cider is that I can get cider to start an nrepl, but if I use figwheel as repl type it open the website, but then I have a prompt saying "STDIN:" in the minibuffer at the bottom. Inside that minibuffer I can interact with the clojurescript repl but I can't send any sexp from my core.cljs buffer in emacs to the figwheel repl.#2019-01-2620:20TobiHAnd if I use the newer figwheel-main repl type (and a project created with lein new figwheel-main) cider still opens up the website and tries to create a figwheel repl, but the last thing printed in the cider-repl is "Opening URL http://localhost:9500" and after that nothing happens.#2019-01-2620:20TobiHAlso cider is always showing "not connected" in my modeline in emacs.#2019-01-2703:20stardivinerAnyone interested in improving Clojure dot operator methods completion? I have an idea here. But need some help.
https://github.com/clojure-emacs/cider/issues/2570#2019-01-2704:22stardivinerI have some progress on this idea. I checked out cider-complete and deeper. Now I can manually complete code by specify symbol and context.#2019-01-2704:24stardivinerHere is my manually specified symbol and context code snippet. It tested work as I want. I found it need to make sure the object variable evaluated. So I need have the object definition evaluated before send completion request.#2019-01-2705:30stardivinerNow I realized that the context helped a lot. I just need add an snippet. which input object at first. then put cursor behind dot for get method completion. This is so simple. solved.#2019-01-2910:41tatutI made a PR to orchard so that `cider-browse-spec´ can expand ns-aliased keywords https://github.com/clojure-emacs/orchard/pull/42#2019-01-2920:54Karol WójcikGot a quick question about hot reloading functionality. I think that it still should be a part of clj-refactor. Why?
1. Clj refactor can use the hot reload functionality when adding the library so the user experience will be much more pleasant.
2. Hotreloading was a part of clj-refactor since the beginning so it should be still there
3. In order to make the user experience smooth I would have to copy and paste the existing functions from clj-refactor. (I mean those which touch adding dependencies)
What is your opinion guys?#2019-01-2920:56dpsuttoni thought the discussion was whether it should go into CIDER or clj-refactor. None of those positions argue about where it should live, they just seem to argue that the feature should exist#2019-01-2920:59Karol WójcikThe question is where the feature should land. Should I put it in clj-refactor?#2019-01-2921:48Karol Wójcik@dpsutton Do you know how I can add the library with specific hash commit? I wanted to add tools.deps.alpha on jack in but the thing is that for instance leiningen does not allow hash commit as a version of dependency.
What I plan to do is simply wrap the call to ’add-lib with emacs-lisp.#2019-01-2921:52dpsuttonno i haven't waded into that stuff#2019-01-2921:52dpsuttoni'm always fine with restarting my repl#2019-01-2921:55enn@kwcharllie379 I'd argue for it going into CIDER. Hot-loading of dependencies is not really a refactoring task to me. (Along similar lines, I'd argue for separating the functionality of hot-loading a dependency in the running process from the functionality of updating projects.clj or deps.edn to add that dependency--the latter fits more with the spirit of clj-refactor, IMO. I would love to be able to hot-load dependencies without my project files being modified.#2019-01-2922:22Karol WójcikI see your point @enn. The case is that if I move the code to cider regarding the hot-load functionality I would then have to move a lot of functions from clj-refactor to cider as well.#2019-01-2922:22Karol WójcikI would rather avoid it for now#2019-01-3005:26dpsuttonsomeone had asked about an issue here but did they delete it? I'm looking into what is going on#2019-01-3006:40dpsuttonif you posted here about oz.core, i think you can fix this issue by adding [org.clojure/tools.reader "1.3.2"] to your project.clj file. CIDER-nrepl is requiring 1.2.2 and causing your issue. I'm surprised that this is an issue as I thought Mr. Anderson would take care of this#2019-01-3009:00hkjelsso I’m trying to eval clojurescript blocks in org-mode without having to narrow into them, but cider-read-and-eval does not evaluate on the correct REPL. Any ideas how I would go about this?#2019-01-3009:03hkjelscider-eval-defun-at-point works when I narrow into the code-block#2019-01-3011:40benedeki think nrepl is not inlined/shadowed by mranderson#2019-01-3011:40benedekcc @dpsutton #2019-01-3011:41benedeki suppose you can't really do that due the way messaging is implemented between the nrepl server and client. but can't quite remember the details#2019-01-3013:32dpsuttonYes nrepl is not. But tools reader is and it is resolving to the 1.2.2 version of tools reader from nrepl (which is inline) rather than the 1.3.4 that enlive declares#2019-01-3014:16benedekah misunderstood#2019-01-3014:16benedekand still confused a bit tbh#2019-01-3014:17benedeklet me recheck the github issue#2019-01-3014:20dpsuttoni just updated but there's an easy test to show what is going on#2019-01-3014:21benedekhm... checking on clojars#2019-01-3014:22dpsuttonlein update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\] -- deps :tree | less#2019-01-3014:22achikinI have a little bit confusing behavior with figwheel-main#2019-01-3014:22dpsuttoncheck this for cider-nrepl versus 0.18.0#2019-01-3014:22achikinI have set up figwheel-main as per documentation#2019-01-3014:22benedekit seems to me that since 0.19 the cider-nrepl jar is published on clojars with all its deps#2019-01-3014:22achikinThen I did lein repl and then (figwheel.main.api/start {:mode :server} "dev")#2019-01-3014:23benedekso 0.18 looks ok, it has only nrepl declared as a dep#2019-01-3014:23achikinThen I'm trying to connect to that repl with cider#2019-01-3014:23dpsuttonthat's what i'm seeing as well#2019-01-3014:23achikincider-connect-cljs#2019-01-3014:23achikinAnd I'm getting an exception#2019-01-3014:23benedekas it should if the mranderson ing was done properly when deploying#2019-01-3014:23achikin1. Unhandled clojure.lang.ExceptionInfo
A build with id "dev" is already running.
{}
core.clj: 4739 clojure.core/ex-info
core.clj: 4739 clojure.core/ex-info
main.cljc: 1959 figwheel.main$start_STAR_/invokeStatic
main.cljc: 1936 figwheel.main$start_STAR_/doInvoke
RestFn.java: 445 clojure.lang.RestFn/invoke
main.cljc: 1939 figwheel.main$start_STAR_/invokeStatic
main.cljc: 1936 figwheel.main$start_STAR_/invoke
#2019-01-3014:24achikinIt looks like figwheel-main is trying to start the figwheel-main repl server by itself...#2019-01-3014:25dpsuttonthat's what you expect to happen with (figwheel.main.api/start {:mode :server} "dev") correct?#2019-01-3014:25achikin@dpsutton yes.#2019-01-3014:25benedekseems to me that 0.19 maybe and 0.20 was not deployed correctly#2019-01-3014:25dpsuttonmake install should mranderson them correctly#2019-01-3014:26dpsuttoni tried that i think and still saw the same behavior#2019-01-3014:26achikin@dpsutton I'm trying to validate that my team members that are using vscode will be able to connect the repl.#2019-01-3014:27dpsuttonok. so your confusion comes from the fact that cider-connect-cljs tries to start another :dev repl is that correct?#2019-01-3014:27benedekyup looking at the makefile#2019-01-3014:27achikin@dpsutton yes, and it fails to connect because of that#2019-01-3014:27benedeklooks ok at the first blink#2019-01-3014:27dpsuttonok. so your coworkers are up and running but now you are a little stuck?#2019-01-3014:28achikin@dpsutton no, they haven't tried yet. We were using lein-figwheel previously and I'm changing it to figwheel-main and I want to be sure that everything goes smoothly.#2019-01-3014:48benedekhm.. not at my laptop atm :/ @dpsutton you mean that when you run make install you still see the the full (wrong) dep tree?#2019-01-3014:48dpsuttoni thought that was the case. but i will check again#2019-01-3014:49benedekis there a pom in your local dir?#2019-01-3014:49benedekwonder if that is outdated..#2019-01-3014:49benedekdoes not get cleaned properly or something#2019-01-3014:50benedeki released refactor-nrepl snapshot lately, same mrandeson version. looks ok on clojars#2019-01-3014:50benedekso something should be with that makefile#2019-01-3014:53dpsuttonah i think i was making 0.20.1-snapshot and checking against 0.20.0 so i was not seeing my test#2019-01-3014:56benedekthis basically means tho that cider-nrepl 0.19 and 0.20 is broken deps wise in a very subtle way#2019-01-3014:58benedekeg deps are still inlined i guess (have not checked) but these versions are messing with projects' deps trees#2019-01-3015:03dpsuttonfeasible to cut new release with a corrected deploy pipeline?#2019-01-3015:04benedekyup looking at my 0.19 jar at work. the jar looks ok the pom looks not mrandersoned#2019-01-3016:25Michael Griffiths@dpsutton @U0508JT9N i tracked the cause to this commit: https://github.com/clojure-emacs/cider-nrepl/commit/f2b83f8af8def64b8e140fc590b5230d69152201#2019-01-3016:26Michael GriffithsI will revert and push a new snapshot now#2019-01-3016:36benedeknice one! thanks#2019-01-3016:36benedekhow does that causing this issue?#2019-01-3016:38benedekwonder if we should release a 0.20.1 and modify the machinery in cider tho pull that rather than 0.20.0#2019-01-3016:38benedekmaybe this needs a cider release too?#2019-01-3016:39benedektbh this may not cause issues for most of the ppl#2019-01-3016:51Michael GriffithsI’m not sure why it’s causing it, but reverting it fixes it locally#2019-01-3016:51Michael GriffithsYeah it’ll be a 0.20.1-SNAPSHOT#2019-01-3016:56Michael GriffithsI’m not sure r.e. the cider release. I don’t know how the jack-in deps injection works these days – I only use cider-connect. I’ll take a look at the code#2019-01-3016:57Michael GriffithsLikely it doesn’t affect most people but will get worse as more people bump their tools.reader deps#2019-01-3016:57dpsuttonit should affect cider connect as well#2019-01-3016:57dpsuttonif you put cider-nrepl in your project you can step on toes with all cider-nrepl toes#2019-01-3016:59Michael GriffithsYeah, it does, but I mean I don’t know enough about how jack-in works to know if we’ll need to release a 20.1 of the elisp client#2019-01-3017:01Michael GriffithsLooks like we’ll need to bump cider-latest-middleware-version#2019-01-3017:05Michael Griffiths[cider-nrepl "0.20.1-SNAPSHOT"] is built now if you want to test#2019-01-3017:57benedeklooks good to me based on what i see on clojars#2019-01-3017:59benedekand bumping the middleware version means we need a release if we want this fixed in stable quickly#2019-01-3015:04benedekyup only not sure how/where the pipeline is broken#2019-01-3015:05dpsuttonah so the jar is fine but we lied and said we had more dependencies than we had#2019-01-3015:05dpsutton(in the pom)#2019-01-3015:05benedekalso i guess we would need to release 0.20.1 or something#2019-01-3015:05benedekreleases are immutable i guess...#2019-01-3015:05benedeki think so#2019-01-3015:06benedekhave not proven this properly but this is how it looks to me#2019-01-3015:06benedekand the pom is distributed with the jar obviously#2019-01-3015:08dpsutton@achikin is it feasible to let your coworkers start up from the console like that and you just cider-jack-in-cljs and let CIDER start the figwheel server itself?#2019-01-3015:09dpsuttoni am able to make lein and figwheel main "just work" this way#2019-01-3015:13achikin@dpsutton yes, I usually do like that. Was just wondering if I can just connect without starting anything...#2019-01-3015:18dpsuttonok i've got it#2019-01-3015:18dpsuttoni copied the startup that CIDER uses to crank up a repl so it will have the cider nrepl guts in it but made it not a headless repl#2019-01-3015:18dpsutton/home/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.3.10\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\] -- repl
#2019-01-3015:19dpsuttonfrom there, do your incantation of requiring the api and starting the {:mode serve} (not server)#2019-01-3015:20dpsuttonthen cider-connect and run (figwheel.main.api/cljs-repl "dev")) or cider-connect-cljs and when it asks you for the init form give it (figwheel.main.api/cljs-repl "dev")#2019-01-3015:22dpsuttonit looks like there is no good way to do a custom repl with dir locals right now. it just asks the minibuffer for input#2019-01-3015:22dpsutton@achikin this should get you running#2019-01-3015:24eraserhdDoes CIDER have middleware to aid in the selection of text objects? e.g. finding top-level form at cursor, finding element at cursor, and so forth? Or is this done all in elisp?#2019-01-3015:24eraserhdI haven't found any, so I assume its elisp#2019-01-3015:25dpsuttonwhat do you mean aid in the selection of text objects?#2019-01-3015:25dpsuttonthe first one you mean navigate to definition?#2019-01-3015:25dpsuttonoh go to beginning of defun kind of thing?#2019-01-3015:25eraserhdMore like that, yes.#2019-01-3015:26dpsuttongot you. yes emacs has a built in beginning-of-defun#2019-01-3015:26benedekor look at expand-region.el by magnars#2019-01-3015:26dpsuttonthere's also (thing-at-point 'sexp)#2019-01-3015:27benedekif you want something with brains ;)#2019-01-3015:27eraserhdFor context, I'm kind of rebuilding CIDER for kakoune... So I'm trying to figure out what I can reuse.#2019-01-3015:27dpsuttonbut text interaction you are in emacs for better or worse#2019-01-3015:27dpsuttonoh or apparently you aren't#2019-01-3015:27eraserhd:D ... But would this be a good thing to have in middleware, even for emacs?#2019-01-3015:27dpsuttonno that is all elisp. possibly#2019-01-3015:28dpsuttonthere are edge cases that clojure is more aware of than elisp#2019-01-3015:28dpsuttonfor instance stacked comment readers#2019-01-3015:28eraserhdYes, that's one that kakoune has trouble with because it's based on regexs.#2019-01-3015:28dpsuttonbut you'll run into issues of what does the process think the source code looks like versus what are you evaluating#2019-01-3015:29dpsuttonie redefining defuns. if you ask the middleware for the thing at point it would be the last thing that was evaluated and not some potentially unsaved code#2019-01-3015:29eraserhdI mean, the source has to be sent to nREPL for that to work. So you send a 'code' key and an 'op' of 'find-toplevel' or some such.#2019-01-3015:30dpsuttonyes. which means the text editor that does the sending needs to be the one that is aware of the bounds of the defun, what is at point, etc#2019-01-3015:31eraserhdOr it just sends the whole file, which isn't actually prohibitive these days :D#2019-01-3015:31eraserhdI mean, the load-file op does that.#2019-01-3015:31dpsuttonwhen you ask to load a file, yes#2019-01-3015:31dpsuttonbut if there are top level things and you're sending and reading the entire file content every time you have problems#2019-01-3015:31dpsuttonyou also won't be sending what you are currently seeing but what is currently saved which could be very surprising and frustrating#2019-01-3015:33eraserhdI'm not sure how sending the entire file when the user requests selecting a top-level form is a problem. Seeing vs. saved seems easy to solve, as the editor needs to send what you are seeing to the middleware.#2019-01-3015:33eraserhdPerhaps that's difficult in emacs? Not really a problem for Kakoune.#2019-01-3015:34eraserhdI guess I don't really mean "file", but "buffer contents".#2019-01-3015:34eraserhd(words are hard)#2019-01-3021:22Karol WójcikI have no freaking idea why the approach described here https://nrepl.org/nrepl/usage/misc.html#_hot_loading_dependencies
does not work for me. For instance I can see that indeed the clojure.core.memoize was added to classpath but for some reason when I try to require it I receive an error :thinking_face:#2019-01-3021:36dominicmMaybe you're checking the wrong class loader #2019-01-3021:36dominicmThere's a bug report on nrepl#2019-01-3021:36dpsuttonthat is just a scary phrase to me. "wrong class loader"#2019-01-3021:45dominicmClojure has this feature where it uses a different class loader than the context one sometimes. Something about the lein environment causes this flag to be true.#2019-01-3021:45dominicmI have hit a bit of a roadblock in figuring it out there.#2019-01-3108:17Karol WójcikOk I will subscribe to the issue. thank you @dominicm @dpsutton#2019-01-3108:24manuelhey guys. Is there any chance C-c M-n (`cider-repl-set-ns`) in a REPL buffer can limit the namespaces to the project namespaces?#2019-01-3113:19jumarHmm, I (almost) always set the repl ns to the current buffer's ns... I'm not sure what you're trying to achieve.#2019-01-3113:20manuelSay I'm in the REPL, and I want to switch to another buffer, which is not the one I am visiting in the other buffer currently showing beside the REPL.#2019-01-3113:20manuelIdeally, I want to switch to a project-based namespace, not to some external one.#2019-01-3113:27manuelI achieved what I want with:
(defun mu-cider-repl-set-ns (ns)
"Switch the namespace of the REPL buffer to NS.
If called from a cljc buffer act on both the Clojure and ClojureScript REPL
if there are more than one REPL present. If invoked in a REPL buffer the
command will prompt for the name of the namespace to switch to."
(interactive (list (if (or (derived-mode-p 'cider-repl-mode)
(null (cider-ns-form)))
(completing-read "Switch to namespace: "
(projectile-current-project-files))
(cider-current-ns))))
(when (or (not ns) (equal ns ""))
(user-error "No namespace selected"))
(cider-map-repls :auto
(lambda (connection)
(cider-nrepl-request:eval (format "(in-ns '%s)" ns)
(cider-repl-switch-ns-handler connection)))))
Which differs from the original because it relies on (projectile-current-project-files). Problem solved. 🙂#2019-01-3113:30manuelSort of, the REPL looks like this now:
src/cinvat/adapters/arca/core.clj>
Still needs some work.#2019-02-0109:38jumarAh, I didn't even know that it's possible to use cider-repl-set-ns from the repl buffer#2019-01-3108:25manuelthis would help, for instance, when looking for core and not ending up with many candidates from other libraries.#2019-01-3115:38Patrick WinterHi, I'm trying to get CIDER to work with nREPL.#2019-01-3115:40Patrick WinterI've added nREPL as dependency to my profiles.clj.
~/.lein cat profiles.clj
{:repl {:dependencies [[nrepl/nrepl "0.5.0"]]}}
#2019-01-3115:40Patrick WinterHowever cider-jack-in still launches the old version.#2019-01-3115:43dpsuttonyou need to be on lein version 2.8.3. I suspect you are on 2.8.1 or older?#2019-01-3115:43Patrick Winter2.8.1#2019-01-3115:43dpsuttonalso, CIDER will inject that for you so you don't need it#2019-01-3115:43dpsuttonlein upgrade 2.8.3 should solve your woes#2019-01-3115:49Patrick Winter@dpsutton Thanks! I'm on NixOS so leiningen was installed through nix.#2019-01-3115:49dpsuttondo you know how to upgrade it then?#2019-01-3115:51Patrick WinterI guess I need to create an override. I will ask a few people in the NixOS IRC channel.#2019-01-3115:51dpsuttoni don't know how to help you there so i can just wish you good luck!#2019-01-3115:52Patrick Winterthanks for your help!#2019-01-3119:11myguidingstar@patrickwinter 2.8.3 is available on nixos already#2019-01-3119:12myguidingstarI'm a nixos user, too#2019-01-3119:12myguidingstarbut you need to install it from unstable channel(s)#2019-01-3119:15myguidingstareg: nix-channel add https://nixos.org/channels/nixos-unstable-small nus#2019-01-3119:15myguidingstarnix-env -iA nus.leiningen#2019-01-3119:48exit2hi all, anyone have any ideas what this might mean? Unhandled REPL handler exception processing message {:op clone, :id 1}#2019-01-3119:49dpsuttonhow did you trigger this? you are starting a new repl session and dying at the start. got information about the project type, cider version, etc?#2019-01-3119:50exit2yeah its a new cider session, then it fails out with this message#2019-01-3119:50exit2this is a fulcro application#2019-01-3119:51exit2let me see if I can find version.. one moment#2019-01-3119:51dpsuttonalso, how do you expect this to start up? lein, clj, boot?#2019-01-3119:52exit20.19.0-SNAPSHOT#2019-01-3119:52exit2its lein#2019-01-3119:53dpsuttonwhat's your lein version?#2019-01-3119:53exit2actually I think this is the beginning of the error:#2019-01-3119:54exit2[WARNING] No nREPL middleware descriptor in metadata of #'refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
ERROR: Unhandled REPL handler exception processing message {:id 9d733e0f-2b56-43d3-ae83-82c0626e9879, :op describe}
#2019-01-3119:54dpsuttonwhat's your lein version?#2019-01-3119:54exit2Leiningen 2.8.3 on Java 1.8.0_181 Java HotSpot(TM) 64-Bit Server VM#2019-01-3119:54dpsuttontry lein upgrade 2.8.1.#2019-01-3119:55dpsutton2.8.3 requires nrepl 0.5.x and 2.8.1 worked with older tools.nrepl. I'm thinking you can upgrade your CIDER or downgrade your lein. I think you are straddling the changeover#2019-01-3119:56exit2ok let me try that#2019-01-3119:57exit2hooray#2019-01-3119:58exit2thanks @dpsutton#2019-01-3119:58dpsuttonawesome!#2019-02-0100:37prelongtime ubuntu/emacs/lein/cider user here; I upgraded my setup to emacs 26 and cider 0.20 and can't cider-jack-in anymore. "error in process filter: Symbol's function definition is void: clj-refactor-mode". My lein version is 2.8.3. What am I missing?#2019-02-0100:47eval-on-pointon clj-refactor's readme: clj-refactor 2.4 is compatible with CIDER 0.17 and 0.18. Change the cider-nrepl dep to 0.17 if you're using CIDER 0.17.#2019-02-0100:59preDoes that mean cider 0.20.0 is broken and unusable? I'm not pulling cider-refactor-clj directly and assume, from previous issues with upgrades, that cider is bundling this upstream.#2019-02-0101:28eval-on-pointOh, I have no idea. Drank too much cider#2019-02-0104:36futuroDoes anyone know how to specify a deps.edn alias for cider-jack-in?#2019-02-0105:38dominicmSet cider-clojure-cli-global-options#2019-02-0114:31futuroSwanky, thank you#2019-02-0107:31benedek@pri this error usually happens if your emacs tries to load some compiled el that is not compatible with it#2019-02-0107:33benedektry to clean (delete and then reinstall) clj-refactor or all the related packages rather to make sure you get rid of those old elc files#2019-02-0115:02Patrick Winter@myguidingstar Funny I've added the unstable channel but it still installed 2.8.1#2019-02-0115:02Patrick Winternix-env -f -iA leiningen did the job#2019-02-0115:17Patrick WinterIt seems like I am out of luck. CIDER worked for a few hours but now I get Exception in thread "main" java.lang.RuntimeException: No such var: nrepl.transport/uri-scheme, compiling:(/tmp/form-init4741324511529165922.clj:1:2695) when cider-jack-in or lein repl.#2019-02-0115:25dpsuttondid you remove the specified version of nrepl? I remember you put a certain version in your profiles or something. CIDER should take care to inject this correctly without any prodding#2019-02-0115:26Patrick Winter➜ ~ cat .lein/profiles.clj
{:repl {:dependencies [[nrepl/nrepl "0.5.0"]]}}
#2019-02-0115:26Patrick WinterIs still present.#2019-02-0115:28dpsuttonyeah. ditch that#2019-02-0115:29Patrick WinterAh yeah, this was only required with leiningen 2.8.1.#2019-02-0115:30Patrick WinterWorks perfectly fine again 😅#2019-02-0115:30Patrick Winter@dpsutton thanks a lot.#2019-02-0115:32dpsuttonno worries. its a bummer the transition from this took so long. It took so much work from bbatsov to straddle both libs, get lein, boot, etc, to accept patches.#2019-02-0116:53myguidingstar@patrickwinter I forgot to mention nix-channel --update#2019-02-0116:55myguidingstaralso, maybe you'll want to have nixpkgs.leiningen instead of pkgs.leiningen in your configuration.nix. I often do that for packages that often get updates, like programming tools or web browsers#2019-02-0117:31Chasei love the eval-defun-to-comment feature in cider. Is there a way to get that same functionality but with pprint?#2019-02-0117:32dpsuttoncider-pprint-eval-defun-to-comment#2019-02-0117:37Chaseahh yeah! thanks. C-c C-v C-f C-c C-d Now that's a key chord! lol. But when I execute it, nothing actually happens.#2019-02-0117:39ChaseIt might be better for me to just keep using C-c C-p to pprint it into what seems to be a cider result buffer and yanking it from there#2019-02-0117:56dpsuttoni think there's a bug in it right now. @plexus was looking into it the other day and i assumed he would submit a PR#2019-02-0204:12plexusSorry about that, all my open source time has been going to Kaocha...#2019-02-0117:56dpsuttonyou can submit it if you want @chase-lambert. It's a change to the handler gets the report#2019-02-0118:04Chaseno worries. I'm just proud that I can actually find the cider github and even find the source code of the function at this point. Submitting a PR fix is on a whole different level of my abilities. hahaha#2019-02-0118:14dpsuttonnavigating in emacs is very easy once you learn a few things. look up how to navigate around and debug and then you're halfway to being an expert in any emacs package#2019-02-0118:18eval-on-pointDo people actually memorize key chords like that?#2019-02-0118:25dpsuttonnot really. if you use it a lot either your hands learn the muscle memory or you remap it to something more convenient#2019-02-0118:26eval-on-pointI would probably buy a footpedal and map it to control if I were doing stuff like that regularly#2019-02-0118:38dpsuttonthat will put you in an exclusive club 🙂#2019-02-0118:39didibusI'd highly recommend Spacemacs if you're planning on using these more advanced key chords (as opposed to using M-x)#2019-02-0118:40didibusIts mnemonic space based bindings make things more like keyboard based menu navigation#2019-02-0118:44didibusOr at the very least, use which-key https://github.com/justbur/emacs-which-key#2019-02-0118:51didibusHere's tje spacemacs bindings https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Blang/clojure/README.org#key-bindings#2019-02-0118:52didibusI recommend using it in Holy mode (unless you want vim bindings). In which case, SPC is replaced by M-m#2019-02-0118:53didibusAnd SPC m becomes M-enter#2019-02-0118:56eval-on-pointwow those are dope#2019-02-0118:56eval-on-pointthanks I will try them out tonight at home#2019-02-0121:47mseddon@mitchell_clojure emacsen are memory muscle. Use it every day and you will soon be be annoyed by everything else ;)#2019-02-0221:42Gustavo IsidioHello, I started with clojure and spacemacs yesterday and have created an simple project
lein new project_name
When i try run cider on core.clj a bunch of warnings come out and repl does’nt start. Can anyone help me?#2019-02-0221:44dpsuttoncan you tell me your cider version and lein versions Gustavo?#2019-02-0221:45dpsutton(and feel free to ask how to get those versions if you don't know)#2019-02-0221:46Gustavo Isidio$ lein version
Warning: implicit middleware found: refactor-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Leiningen 2.8.3 on Java 11.0.2 Java HotSpot(TM) 64-Bit Server VM
#2019-02-0221:47dpsuttonok. let's get rid of refactor-nrepl until we know we have a working env. I'm not sure of the state of refactor nrepl. There have been lots of changes and I'm not sure if the changes have been reflected there#2019-02-0221:47dpsuttonI'm also surprised as a warning needing 1.7.0 or greater. are you running an older clojure? I thought i saw 1.9 in there#2019-02-0221:47Gustavo Isidiohow can i see cider version?#2019-02-0221:48Gustavo Isidiothis i don’t know#2019-02-0221:48dpsuttonthere's a function M-x cider-version#2019-02-0221:48dpsuttonbut that looks like spacemacs so i'm not sure#2019-02-0221:51dpsuttonmy suspicion is we have an old clojure somewhere and refactor-nrepl isn't playing nice#2019-02-0221:52Gustavo IsidioCIDER 0.21.0snapshot#2019-02-0221:56Gustavo IsidioMy problem looks almost exactly like this. I can’t see clojure version because when i try, those errors come out https://github.com/clojure-emacs/cider-nrepl/issues/574#2019-02-0222:00dpsuttonyou can run lein deps :tree and it will show you the dependencies involved. There's a change there's a clash between tools.nrepl and nrepl.nrepl. ( a recent low level migration that is unfortunately thorny due to how deep it is)#2019-02-0222:00dpsuttonanother easy test might be to just lein new testapp and then try to jack into that. just to see if a clean project works and isolate this problem to dependencies in a certain project#2019-02-0222:01Gustavo IsidioI read this tools.nrepl thing but not understand. I will do this right now#2019-02-0222:03Gustavo IsidioJarvis:/ gustavoisidio$ lein deps :tree
Warning: implicit middleware found: refactor-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: refactor-nrepl requires org.clojure/clojure 1.7.0 or greater.
Warning: refactor-nrepl middleware won't be activated due to missing dependencies.
Warning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Couldn't find project.clj, which is needed for deps
#2019-02-0222:03dpsuttonah, are you starting this without a project?#2019-02-0222:03Gustavo Isidioyes, by the terminal#2019-02-0222:03dpsuttonnormally you are in a directory that has a project.clj file#2019-02-0222:04Gustavo Isidiookay, will do this#2019-02-0222:04dpsuttonok. run lein new testapp which should crank up a new skeleton app for you if you need#2019-02-0222:04dpsuttonor an existing one#2019-02-0222:06Gustavo Isidio$ ls
CHANGELOG.md README.md project.clj src
LICENSE doc resources test
$ lein deps :tree
Warning: implicit middleware found: refactor-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
Warning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
[cider/cider-nrepl "0.10.0-20151127.123841-44"]
[org.tcrawley/dynapath "0.2.3" :exclusions [[org.clojure/clojure]]]
[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
[nrepl "0.5.3" :exclusions [[org.clojure/clojure]]]
[nrepl/bencode "1.0.0"]
[org.clojure/clojure "1.9.0"]
[org.clojure/core.specs.alpha "0.1.24"]
[org.clojure/spec.alpha "0.1.143"]
[org.clojure/tools.nrepl "0.2.12"]
[refactor-nrepl "2.0.0-20160206.122040-20"]
`#2019-02-0222:09dpsuttonok. there's some really wacky stuff going on here#2019-02-0222:10dpsuttoncider-nrepl should be version 20, not 10. Do you have a ~/profiles.clj by any chance in your home directory?#2019-02-0222:10dpsuttonalso that tools.nrepl 0.2.12 is the old version and the nrepl "0.5.3" is the new version and they cannot peacefully coexist. we need to eradicate the tools.nrepl#2019-02-0222:36Gustavo IsidioYes, i have. It’s just change my profiles.clj?#2019-02-0222:36Gustavo Isidioit should look like this?#2019-02-0222:36Gustavo Isidio{:user {:plugins [[refactor-nrepl "2.4.0-SNAPSHOT"]
[cider/cider-nrepl "0.20.0-SNAPSHOT"]]
:dependencies [[org.clojure/tools.nrepl "0.5.3"]]}}
`#2019-02-0222:41dpsuttonyou should be able to leave all of that out. CIDER will inject it for you @gisf#2019-02-0223:12Gustavo IsidioThank you for saving my life#2019-02-0223:12Gustavo IsidioWorks perfectly#2019-02-0223:14Gustavo IsidioSo, this lines on profiles.clj was holding me in an old version of refactor, cider and tools right?#2019-02-0223:16Gustavo IsidioThis may be useful if the updated version of those three has some problems. I’am right? And what more this profiles.clj file is for?#2019-02-0319:15Chaseso cider seems to be locking up my emacs completely every now and then. I'm having a hard time figuring out what exactly causes it. It might be when I'm printing a lot of lines. I have to restart Emacs completely and am not sure how to gather more information to seek help from you folks on the matter. any advice?#2019-02-0319:17ChaseI may have found one suggestion to use for debugging: "`M-x toggle-debug-on-quit` then hit C-g if it hangs and it will print a backtrace. Sound good?#2019-02-0319:17dpsuttonlong lines are the bane of emacs. It should try to limit printing extremely long lines automatically. If you do find yourself with some big output you can check the , (comma) menu at the repl prompt and there is an option to clear the repl output and it should speed back up#2019-02-0319:19Chaseooh, this comma menu might come in handy for other uses too#2019-02-0319:19dpsuttonit most certainly is#2019-02-0319:26ChrisI found these problems mostly disappeared when I set the CIDER pretty print variable to true (sorry can’t remember exact name - you should be able to find it in the CIDER custom group)#2019-02-0319:30ChaseNow that you mention that I was hoping somebody could look at my cider config portion of my init.el and see if I'm doing something really dumb in there. I think I copy and pasted it when first trying to roll my own config.#2019-02-0319:31Chase(use-package clojure-mode
:mode (("\\.clj\\'" . clojure-mode)
("\\.cljs\\'" . clojure-mode)
("\\.cljc\\'" . clojure-mode)
("\\.edn\\'" . clojure-mode))
:config
(add-hook 'clojure-mode-hook #'paredit-mode)
(setq clojure-verify-major-mode nil))
(use-package cider
:init
(add-hook 'cider-mode-hook #'clj-refactor-mode)
:diminish subword-mode
:config
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(setq nrepl-log-messages t
cider-repl-use-clojure-font-lock t
cider-font-lock-dynamically '(macro core function var)
nrepl-hide-special-buffers t
cider-repl-scroll-on-output nil
cider-overlays-use-font-lock t
cider-invert-insert-eval-p t
cider-switch-to-repl-after-insert-p nil)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return)
(cider-repl-toggle-pretty-printing))
(use-package cider-eval-sexp-fu)
(use-package clj-refactor
:diminish clj-refactor-mode
:config (cljr-add-keybindings-with-prefix "C-c C-m"))
(use-package clojure-mode-extra-font-locking)
(use-package flycheck-joker)
#2019-02-0319:32Chasethe only thing I'm dead set on in that cider config is the define key portion#2019-02-0319:34dpsuttonyou are putting cljc and cljs files into clojure-mode rather than clojurec-mode and clojurescript-mode it seems#2019-02-0319:35dpsuttoni would turn off the nrepl message logging. unless you are investigating bugs it is just output you don't need#2019-02-0319:36dpsuttonalso i did you insert and repl functions. I made those changes so its nice to see people using them 🙂#2019-02-0319:40ChaseI'll turn off that logging. what about the font-lock-dynamically and pretty printing stuff? I saw mentions of those in some of the cider locking issues on github so maybe should take that off or it's in there to help?#2019-02-0319:40dpsuttonyes those can slow things down#2019-02-0319:40dpsuttonbut only in larger files#2019-02-0319:40Chasealright, i'm going to cut most of this stuff then.#2019-02-0319:40dpsuttonyou ca nremember those if you find yourself slowing down. this is usually felt in a larger text buffer when adding characters can take a bit longer#2019-02-0319:40Chaseso clojure-mode isn't used now for all the clojure files?#2019-02-0319:41dpsuttonthere are custom ones for cljc and cljs files#2019-02-0319:42dpsuttonbut this is already handled for you in clojure-mode.el. ( a dependency of CIDER)#2019-02-0319:42dpsutton(progn
(add-to-list 'auto-mode-alist
'("\\.\\(clj\\|dtm\\|edn\\)\\'" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojurec-mode))
(add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojurescript-mode))
;; boot build scripts are Clojure source files
(add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode)))
#2019-02-0319:42Chaseso I can take out that whole :mode section?#2019-02-0319:43Chaseand what about these packages:
(use-package cider-eval-sexp-fu)
(use-package clj-refactor
:diminish clj-refactor-mode
:config (cljr-add-keybindings-with-prefix "C-c C-m"))
(use-package clojure-mode-extra-font-locking)
#2019-02-0319:43Chaseam I actually using these?#2019-02-0319:44Chasethanks for your help, I've been wanting to clean this up and keep it as minimal as possible.#2019-02-0319:46dpsuttonhonestly if you don't know what something is you should toss it#2019-02-0319:46dpsuttonbuild it up as you use it and look for it#2019-02-0319:47dpsuttonlots of these might be old and cause problems for you in the future#2019-02-0319:47Chaseright?! lol#2019-02-0319:48Chasenew and improved:
(use-package clojure-mode
:config
(add-hook 'clojure-mode-hook #'paredit-mode)
(setq clojure-verify-major-mode nil))
(use-package cider
:config
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
(define-key cider-repl-mode-map (kbd "C-<return>") #'cider-repl-return))
(use-package flycheck-joker)
#2019-02-0319:51Chasehopefully I didn't cut something crucial.#2019-02-0319:55Chaseand now my entire init.el is back under 100 lines and I feel at peace. hahaha. thanks#2019-02-0319:56dpsuttonanytime 👍#2019-02-0319:57Chasewhat did you mean by you made the changes for the insert and repl functions?#2019-02-0320:01dpsuttoncider-invert-insert-eval-p t
cider-switch-to-repl-after-insert-p nil)
when using the insert commands (C-c C-j [e|d|r]) for insert sexp|defun|region it makes it press return after inserting#2019-02-0320:01dpsuttonthe standard behavior is to put the form in the repl but not submit it#2019-02-0320:02Chaseahh! I'm adding those back in then.#2019-02-0409:32andrea.crottisomething happened with my cider configuration, I can't get a Clojurescript Repl with 2 projects using figwheel-main anymore#2019-02-0409:33andrea.crottiI thought it was something silly I did in one project but it happens for 2 projects at least#2019-02-0409:35andrea.crottiit's quite strange since there are no JS compilation errors, no errors in the browser console#2019-02-0409:35andrea.crottibut it just won't give me a CLJS repl#2019-02-0409:37andrea.crottiI can try to downgrade to 0.19 but I'm quite sure it was working also with 0.20 for a while#2019-02-0409:44andrea.crottimm no downgrading didn't seem to help either#2019-02-0409:53andrea.crottimm ok never mind the flappy bird project works perfectly so definitively something wrong in my projects#2019-02-0409:53andrea.crottivery hard to debug when you don't get errors anywhere#2019-02-0412:03Christian Johansentry list-processes and then open the individual process buffers#2019-02-0412:03Christian Johansenthat helped me in the past#2019-02-0420:30dpsutton#2019-02-0508:58StefMight be a statistical bias, though. 2423 is a small sample imho 😉#2019-02-0420:30dpsuttonfrom the recent clojure survey#2019-02-0509:37minikomiHi guys. Having a bit of trouble trying to get cider-pprint-eval-last-sexp working. The result is printed out in another buffer, but it's not pretty printed.#2019-02-0519:27ChrisThat’s a pretty old version of nREPL, latest is 0.5.3. Try with latest perhaps?#2019-02-0601:41minikomiok thanks i'll give it a go!#2019-02-0602:09minikomiThat, indeed, did the trick. Thanks @UA8TV3QHF#2019-02-0608:38Chris🙂#2019-02-0509:39minikomi;; CIDER 0.21.0snapshot, nREPL 0.4.4
;; Clojure 1.10.0, Java 1.8.0_152
#2019-02-0719:41ChaseIt seems my tweaking and pruning of my cider config didn't help my locking up emacs completely problem. This time I eval'ed the following function: (defn get-eligible-user-ids-3
[users]
(->> users
(filter (fn [user] (>= (get user :age) 21)))
(map (fn [user] (get user :id)))
(into [])))
with C-c C-e. Why do you think this would do anything to lock it up?#2019-02-0719:42Chasenow before that, I had failed to put in the (into []) portion and got a real, long nasty spec kind of error message. Could that have made emacs trip over something?#2019-02-0719:57dpsuttonhow many users were it? how big is a single user. You're (presumably) running into long lines problem#2019-02-0719:58dpsuttonwhich just makes emacs crawl#2019-02-0719:58Chasesuper short if you ask me: (def users
[{:id 1 :age 31
:first-name "Daniel" :last-name "King"}
{:id 2 :age 16
:first-name "Angel" :last-name "Herrera"}
{:id 3 :age 31
:first-name "Jane" :last-name "Smith"}
{:id 4 :age 20
:first-name "Ruth" :last-name "Langley"}])
#2019-02-0719:59Chasebut i didn't even have it print. I just eval'ed the function#2019-02-0719:59dpsuttonoh. i see#2019-02-0720:03Chasethe error message I got before that was brutal though. Super long with spec alpha things in there. I wish I could recreate because maybe that was something.#2019-02-0720:03dpsuttonyeah. hit , (comma) and clear your repl#2019-02-0720:03ChaseIt seems it locks after I do something really dumb and then try to go back to normal behavior. I'm wondering if I need to be clearing stuff#2019-02-0720:03dpsuttonlong lines just make the entire buffer slow#2019-02-0720:03Chaseyup#2019-02-0720:03ChaseI keep forgetting you telling me that!#2019-02-0720:04Chase, clear then when something really ugly happens?#2019-02-0720:05dpsuttonnot following#2019-02-0720:05ChaseI was just trying to reiterate your instructions. If I get a bad ugly long repl message or anything of the sort, clear my repl with , clear and hope I don't get locked again#2019-02-0720:06dpsuttonah yes#2019-02-0720:06dpsuttoni thought you meant something ugly happened when you tried to clear the repl#2019-02-0720:08Chasethank you. I'm kind of concerned I keep experiencing this while others aren't. All I'm trying to do is solve tutorial exercises and such but I must be doing some really dumb mistakes that others don't encounter#2019-02-0720:09Chaseor if repl messages are getting too much for emacs to handle wouldn't we need to look into containing those messages so they aren't long lines?#2019-02-0720:11dpsuttoni don't know. i've never felt this amount of pain before#2019-02-0720:11dpsuttoni clear things often though#2019-02-0720:12Chasefair enough. I'll stop whining! hahaha. clear the repl doesn't sound like a bad solution. especially when my crazy brain is going more drastic like "do i need to leave emacs?!" silly stuff.#2019-02-0720:32futuroI used to have an issue where my repo would cause Emacs to lag/freeze, and it seemed to happen around the 4000 lines mark. #2019-02-0720:32futuroThis was a while ago, so the specific limits escape me, but the resolution was to clear the repo buffer as well. #2019-02-0720:33futuroI have no idea why it happened, but since clearing the repo buffer fixed it, I presumed that font locking had something to do with it. #2019-02-0720:33futuroThis was with spacemacs. #2019-02-0720:33dpsuttonyes font locking can get quite slow#2019-02-0720:35futuroIt would happen unexpectedly, so evaling a defn for example, but only if I was over that rough line limit. #2019-02-0720:36futuroI wish I knew exactly why it happened, and could figure out a better solution than “clear your repl often”, as I only did that as a matter of pragmatism. #2019-02-0720:37futuroOddly, font locking a file with 100k lines of pretty printed edn map worked fine.#2019-02-0720:37futuroHaving cider do the pretty printing inline, however, did not. #2019-02-0720:38dpsuttoncorrect. i guess edn has no locals so its easier? its all just keywords#2019-02-0818:23ChaseThese kind of errors are locking up my emacs frequently:
CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/ns did not conform to spec:
In: [1] val: ((require [clojure.set :as set]) (:gen-class)) fails spec: :clojure.core.specs.alpha/ns-form at: [:args] predicate: (cat :docstring (? string?) :attr-map (? map?) :clauses :clojure.core.specs.alpha/ns-clauses), Extra input
#:clojure.spec.alpha{:problems [{:path [:args], :reason "Extra input", :pred (clojure.spec.alpha/cat :docstring (clojure.spec.alpha/? clojure.core/string?) :attr-map (clojure.spec.alpha/? clojure.core/map?) :clauses :clojure.core.specs.alpha/ns-clauses), :val ((require [clojure.set :as set]) (:gen-class)), :via [:clojure.core.specs.alpha/ns-form], :in [1]}], :spec #object[clojure.spec.alpha$regex_spec_impl$reify__2436 0x1fdf1c5 "clojure.spec.alpha$regex_spec_impl$reify__2436@1fdf1c5"], :value (pegthing.core (require [clojure.set :as set]) (:gen-class)), :args (pegthing.core (require [clojure.set :as set]) (:gen-class))}, compiling:(/home/chaselambert/projects/brave-book/pegthing/src/pegthing/core.clj:1:1)
pegthing.core> #2019-02-0818:24ChaseI'm not getting time to clear the repl before it locks up.#2019-02-0818:24ChaseIs this considered one long line?#2019-02-0818:25ChaseI hate to keep coming here and bugging you folks. Just wondering if it's something fixable I should be doing or something I can help (filing an issue in the appropriate place, etc) for other users#2019-02-0818:25dpsuttonno that should not be long enough to lock up emacs#2019-02-0818:25dpsuttonnot sure what is going on#2019-02-0818:25dpsuttonhow did you install emacs and what version is it?#2019-02-0818:26Chasei'm running on debian, it's emacs 25.1.1 I installed using apt-get install emacs25#2019-02-0818:28dpsuttontry turning on the profiler? M-x profiler-start, do something to lock it up and then m-x profiler-report after a few seconds of lockup#2019-02-0818:28ChaseI'm not even clear on why exactly that would even create an error. it's the first step of a much used tutorial but that's for a different day i guess#2019-02-0818:29dpsuttonyour require form is wrong#2019-02-0818:29dpsutton(:require [...) not (require ...#2019-02-0818:30Chaseinteresting. maybe this is old? From brave and true. https://github.com/flyingmachine/pegthing/blob/master/src/pegthing/core.clj#2019-02-0818:31ChaseI did the profiler-start things. Hopefully I can report back with more info if I lock up again. I haven't been able to use m-x after the lock up though. Are you saying it will save the info for when I restart?#2019-02-0818:34dpsuttonno it won't persist. i misunderstood what you mean by lock up#2019-02-0818:34Chasejust locked on me again. on restart I'm being told profiler-report is not a valid command name#2019-02-0818:34dpsuttoni assumed you meant it locked up (for a few seconds)#2019-02-0818:34Chaseemacs freezes completely and won't recover#2019-02-0818:35ChaseI can't even force kill emacs specifically, i have to shut down my whole linux instance but that might just be my weird system.#2019-02-0818:35dpsuttonoh no. something is messed up with your install#2019-02-0818:35dpsuttonyeah this isn't CIDER at all. you have a messed up install#2019-02-0818:36Chaseinteresting. that gives me hope though right. reboot this whole mofo?#2019-02-0818:36Chasei've already been debating trying to find a way to get emacs 26 on debian. not sure if possible.#2019-02-0818:37dpsutton?#2019-02-0818:37dpsuttoni would uninstall and reinstall the most recent emacs you can#2019-02-0818:37dpsuttonyeah debian is old or "stable"#2019-02-0818:37dpsuttonemacs 26 came out a year ago#2019-02-0818:38Chasefrom what I gathered, debian doesn't care about such things right. 26 isn't available on the debian repositories unless i'm mistaken#2019-02-0818:39dpsuttoncorrect. debian cares about years long stability. i understand debian makes a great application server and a frustrating dev machine#2019-02-0818:39Chaseahhh. the irony is in this case, stability means instability? But this could be some user error on my part#2019-02-0818:40Chasei have to run on debian though so let me explore workarounds. maybe build from source? I'm just using phrases though, not entirely clear on that. I'll leave #cider alone though#2019-02-0818:41justinbarclayBuilding emacs from source in the linux world is pretty easy and straight forward#2019-02-0819:52ChaseAnd now I'm proud to say I've built emacs from source! I guess I've done skipped from 25.1.1 to 27.0.50. I count this as a big +1 in my tech/hacking skills! Thanks again for all the help these last couple of weeks @U11BV7MTK. Fingers crossed I can leave you alone for a bit.#2019-02-0819:59dpsuttonyou're never a both!#2019-02-0819:59dpsuttonbother!#2019-02-0819:59dpsuttonand welcome to the build it from source club#2019-02-0820:10justinbarclayCongrats! 🙂 Hopefully that helps solve your issues.#2019-02-0820:11dpsuttonworth noting: elisp files get compiled into elc files (c is compiled). Worth deleting these when starting up with emacs 27#2019-02-0820:15Chasehmmm. i think you got me playing with fire on that one. not sure what ya mean#2019-02-0822:43futuroFind every .elc file inside of your .emacs.d folder and delete them. #2019-02-0822:44futuroThey’re compiled versions of the elisp files, which emacs makes automatically, and may mess with your newer version of emacs. #2019-02-0822:45futuroWhich only matters now, when jumping from 25->27, or if some change in an elisp file wasn’t being picked up. Aka, you don’t have to worry about it normally. #2019-02-0823:06Chaseahh, thanks for the clarification. I did this all on a brand new fresh install because I'm just weird like that. can't find any .elc files so I think I'm good to go#2019-02-0823:13futuroI don’t think that makes you weird; that sounds like a solid debugging approach 😄#2019-02-0823:25Chaseuntil you just realized you erased a couple of learning files with lots of commented notes. d'oh!#2019-02-0823:34futuro😬#2019-02-1015:54practicalli-johnDebian testing has Emacs version 26.1 available, so you could just upgraded. It would take less time than compiling Emacs (depending on CPU speed Vs internet speed).
I always used to used the testing version of Debian as it was always pretty stable (at least between 1995 and 2005)#2019-02-1016:02ChaseI don't think I can actually switch my Debian distro though. I'm on a chromebook using it's Crostini linux ability but it's still a work in progress. It uses Stretch and I'm not sure if I can use testing packages on that.#2019-02-0900:50nopromptIs there a way to specify an alias with cider-jack-in-clj?#2019-02-0901:16dpsuttonFor clj?#2019-02-0901:16dpsuttonI think there's something like "cider-global-cli-args"? On mobile so I can't look it up right now#2019-02-0901:19noprompt@dpsutton Yeah, there’s that, which I currently use, but I want to do something dynamic. Currently, I’ve resorted to (advice-add 'cider-clojure-cli-jack-in-dependencies :filter-args 'prompt-for-cli-options)
#2019-02-0901:20nopromptA hack for sure. 🙂#2019-02-0901:21nopromptEssentially I want to use cider-jack-in-clj but I’d like to have some fine grained control when I need it.#2019-02-0901:22nopromptSo far digging through the source hasn’t turned up a control like that but I could just be looking in the wrong place.#2019-02-0901:28dpsuttonha. yeah#2019-02-0901:28dpsuttoni've looked at it and if you send a prefix arg to cider jack in you can set like everything manually#2019-02-0901:29dpsuttoni need to make a patch that double prefix does that and single prefix prints the jack in command in the minibuffer and lets you edit it as you like#2019-02-0901:29dpsuttonwhich is probably the easiest thing to do#2019-02-0901:30dpsutton@@ -1156,6 +1156,12 @@ non-nil, don't start if ClojureScript requirements are not met."
(or inferred-type
(cider-select-cljs-repl)))))))
+(defcustom cider-edit-jack-in-command nil
+ "When truthy allow the user to edit the command"
+ :type 'boolean
+ :safe #'booleanp
+ :version '(cider . "0.19.0"))
+
(defun cider--update-jack-in-cmd (params)
"Update :jack-in-cmd key in PARAMS."
(let* ((params (cider--update-do-prompt params))
@@ -1181,8 +1187,11 @@ non-nil, don't start if ClojureScript requirements are not met."
(and (null project-dir)
(eq cider-allow-jack-in-without-project 'warn)
(y-or-n-p "Are you sure you want to run `cider-jack-in' without a Clojure project? ")))
- (let* ((cmd (format "%s %s" command-resolved cmd-params)))
- (plist-put params :jack-in-cmd cmd)))
+ (let ((cmd (format "%s %s" command-resolved cmd-params)))
+ (plist-put params :jack-in-cmd (if (or cider-edit-jack-in-command
+ (plist-get params :edit-jack-in-command))
+ (read-string "jack-in command: " cmd t)
+ cmd))))
(user-error "`cider-jack-in' is not allowed without a Clojure project"))))
(user-error "The %s executable isn't on your `exec-path'" command))))
#2019-02-0901:30dpsuttonor something like this#2019-02-0901:30dpsuttonthis dumps the jack in command to the minibuffer and lets you easily edit it#2019-02-0901:32nopromptNice! Thanks for sharing that @dpsutton.#2019-02-0901:32dpsuttonif you find something that works submit a patch#2019-02-0901:32dpsuttoni think putting this behind single prefix works best so its interactive and not dir locals which are dynamic but not enough#2019-02-0902:32nopromptA prefix argument is nice. Another idea is to have an interactive function which always prompts sort of like sql-postgres etc. though I’d want to spend some time experimenting with that.#2019-02-0902:33nopromptEssentially that’s what the hack I mentioned does. It just prompts for additional args.#2019-02-0902:33dpsuttonI'm for sure interested in what works well for you. I think lots of people want it. Bruce was interested in something like this too I think#2019-02-0902:34nopromptI’m embarrassed to admit I don’t really use prefix args because, heh, I don’t know how to do that in evil. 😛#2019-02-0902:34dpsuttonLots of different aliases during his dev#2019-02-0902:34dpsuttonOh. I don't either I guess#2019-02-0902:34nopromptRight. I was prompted to look in to this because I noticed :style/indent wasn’t being respected in a .cljs file.#2019-02-0902:35nopromptTurned out my suspicion that it was related to not loading up the right :alias was the issue.#2019-02-0902:35nopromptNow that I can specify -A:client (which is my cljs side of the house) the indention works out fine.#2019-02-0902:35nopromptI’ll mess around with this a little more.#2019-02-0902:36nopromptI have nothing to lose picking up a bit more elisp. 🙂#2019-02-0902:36nopromptI always learn new tricks when I dig around in cider’s code too.#2019-02-0908:32danierouxREBL is fun, and rickmoynihan/nrebl.middleware is working for me.#2019-02-0908:33danierouxHas anyone started to think about what datafy could look like in cider?#2019-02-0922:36Chasefollowing a discussion on #beginners i put [cider/cider-nrepl "0.20.0"] in my project.clj file and ran lein deps and restarted a lein repl. When I use cider-connect I'm seeing this warning: WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!#2019-02-0922:37ChaseAm I doing something wrong with that dependency? I put it under dependencies but also tried putting it like this: :repl {:plugins [[cider/cider-nrepl "0.20.0"]]} in it's own place. both attempts gave me that warning#2019-02-0922:37ChaseNow that I think about it, I'm not sure the warning was just obsolete, I couldn't think of a way to test it to make sure I had full cider nrepl goodness#2019-02-1016:53practicalli-john@chase-lambert make sure you are using the latest version of Leiningen. If not, update Leiningen to version 2.8.3#2019-02-1017:02practicalli-johnI suggest always using cider-jack-in rather than cider-connect, as CIDER will manage library versions for you and you do not need to add tool specific libraries to your project or profile settings for all your project that you will have to change each time you update CIDER.#2019-02-1017:03practicalli-johnIf you really need to use cider-connect for all your projects, then put the following code into ~/.lein/profiles.clj and just remember to check if you need to update the version when ever you update CIDER.
{:repl {:plugins [[cider/cider-nrepl "0.20.0"]]}}#2019-02-1017:24Chasea lot of times when people are debugging cider issues they are told to clear out those global profiles.clj right? So I was thinking you put that dependency call in the actual project's project.clj instead#2019-02-1022:17practicalli-johnYou can of course put dependencies in a project.clj file, but this does mean that everyone using that project has extra dependencies to download. Putting the dependency is okay for your personal projects I guess. For production code I avoid adding dependencies to the project that are tool specific.
This is yet another reason why I always use cider-jack-in rather than cider-connect, so the right dependencies are just added (using an update-in) when the REPL starts.
Having had to regularly update the profiles.clj file because of mis-matched versions in CIDER version 0.10 and earlier was a real pain.#2019-02-1100:33Chasegood stuff. I saw your other post about using multiple repls within emacs. makes perfect sense#2019-02-1017:22ChaseI do have leiningen 2.8.3. Yeah, I almost always use cider-jack-in for that very reason. Some tutorials though have you starting servers and such from the repl but then I seem to lose access to the repl. So I use lein repl to do the server initiation and such and then have to use cider-connect.#2019-02-1017:23Chaseor lein figwheel right. You would do that in the terminal and then use cider-connect in that instance too. or am I going about that the wrong way?#2019-02-1022:30practicalli-johnI start ClojureScript / figwheel projects from Emacs/Spacemacs using cider-jack-in as well. The latest version of CIDER now use sesman to manage multiple repl sessions.
http://www.cider.mx/en/latest/managing_connections/
I often have several project running, each with their own REPL and that works just fine. I use layouts in Emacs to keep REPL buffers with their project file buffers. Since then I havent lots a REPL buffer, yet 🙂#2019-02-1023:34phillError message "error in process filter: [nREPL] No response handler with id nil found" - what to do?#2019-02-1023:48phillThe answer seems to be "don't throw an exception" 😕#2019-02-1102:13dpsuttonWhere are you throwing an error message#2019-02-1108:40mikepjbIs there an option to split the REPL input/output like Timothy Baldridge does in his core.async talk? https://www.youtube.com/watch?v=enwIIGzhahw#2019-02-1110:55practicalli-john@mikepjb as Timothy states at 2.19 into the video, he has the *nrepl-server* buffer open as well as the repl buffer because he claims there is a feature of nrepl with threads that prints the output to the nrepl-server buffer instead of the repl buffer. I didnt have this issue the last time I used core.async (more recently than this video).
The easiest way to split input and output (IMHO) is to just evaluate in the source file, but I appreciate that is not what you are asking (for which I dont have an answer)#2019-02-1110:55jumarI'm not sure if it's spacemacs-related or cider-related but I'm getting this error when trying to navigate to a test buffer from the "prod" buffer:
project type 'generic' not supported
Any idea what might be wrong?#2019-02-1110:55jumarthis happens in multiple (at least two) clojure projects#2019-02-1110:58practicalli-john@U06BE1L6T How are you trying to navigate to the test buffer?
I use SPC p a without any issues#2019-02-1110:58jumarthat's what I use too#2019-02-1111:02jumarMaybe it's related to the fact that my leiningen projects are actually in a subdirectory of the "project" (I created an empty .projectile file in parent dirs)#2019-02-1111:02practicalli-johnUsed SPC p a on two different versions of Spacemacs develop (one just updated yesterday) and both worked without issue.#2019-02-1111:03practicalli-johnAh, the .projectile file sounds like a good candidate#2019-02-1111:03jumarYeah, it actually works for me on a "shallow structure" - project like this: https://github.com/jumarko/clojure-experiments#2019-02-1111:04jumarBUT it doesn't work if the lein project root dir is nested - like this: https://github.com/jumarko/functional-design-in-clojure#2019-02-1111:06practicalli-johnProjectile should use git, so if each Clojure project has its own .git folder , then you should just be able to remove the .projectile.
If its all one mono-repo then does putting a .projectile file in the root of each Clojure project help fix switching to tests ?#2019-02-1111:09jumarRemoving .projectile could work in the example I posted but for another project at work I have multiple git repos in a single "project" and I want to be able to work with them as such.#2019-02-1111:12practicalli-johnIf you remove the .projectile file to the twitter folder in your functional-design-in-clojure project, then SPC p a works#2019-02-1111:12practicalli-johnObviously this is going to limit any projectile actions to the contents of that twitter folder#2019-02-1111:14practicalli-johnMy approach to having multiple project in one repo would be to use git sub-modules
http://jr0cket.co.uk/2014/05/git-submodules-pros-and-cons.html#2019-02-1111:25jumarYes I got it - it works if I remove the .projectile file 🙂.
But it doesn't work in case I have multiple git projects under the same projectile project.
Git submodules are an interesting idea but I don't want to use them now.
Maybe there's an alternative approach how to set project type manually?#2019-02-1111:37practicalli-johnmaybe some ideas here.... https://github.com/bbatsov/projectile/issues/1180#2019-02-1111:31Macrozwhen I use the latest cider plugin for emacs I get nrepl 0.5.3 forced to me which doesn't seem to work with Leiningen 2.9.0
when I run lein repl I get the nrepl 0.6.0 which seems to work just fine.
The error I get is long with lots of
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
but the cause is
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context#2019-02-1111:32Macrozit worked just fine with Leiningen 2.8.3#2019-02-1111:32HukkaI have the same thing, except my lein repl is also broken, because cider-nrepl is in my lein profile, because I use vim#2019-02-1111:37Macrozmy cider version is 20190125.1339#2019-02-1111:40Hendrik PoernamaI just came across this, steps to reproduce:
- have cider-nrepl 0.20.0 in ~/.lein/profiles.clj
- have leiningen version 2.9.0
- create a project lein new cider-test
- lein repl breaks with error described above#2019-02-1111:42Macrozlein downgrade 2.8.3 is the work saviour here#2019-02-1111:42Hendrik Poernamayep#2019-02-1111:42Macrozit's not advertised much anywhere 🙂#2019-02-1111:43Hendrik Poernamatrying to debug this, but the error message is really hard to understand#2019-02-1111:43Macrozwrap-apropos package was moved recently?#2019-02-1111:44Macrozso new leiningen gives later nrepl which looks for a dependency with a different name?#2019-02-1111:46Macrozused to be cider.nrepl.middleware.apropos/wrap-apropos but now cider.nrepl/wrap-apropos?#2019-02-1111:46Macrozsomething like that?#2019-02-1111:46Macrozjust guessing#2019-02-1111:46Macrozso I guess I have to wait for a new cider release to get nrepl 0.6.0 to work with leiningen 2.9.0#2019-02-1116:22Michael GriffithsI’ve released [cider-nrepl "0.21.0"] now with support for nREPL 0.6.0 – client release still to come once https://github.com/clojure-emacs/cider/pull/2579 is merged#2019-02-1212:02Macroznice, thanks a lot#2019-02-1112:15dpsuttonI had no idea that a newer lein was out#2019-02-1116:20dehliHi! Are there issues when using the cljs repl and macros?#2019-02-1116:21dehliFor example, the following code prints out both Will print and Will not print
(defmacro unless [pred a b]
`(if (not ~pred) ~a ~b))
(unless false (println "Will print") (println "Will not print"))
#2019-02-1116:28dpsutton[dan@fedora experiments]$ clj -m cljs.main -r
ClojureScript 1.10.516
cljs.user=> (defmacro unless [pred a b] `(if (not ~pred) ~a ~b))
#'cljs.user/unless
cljs.user=> (unless false (println "will print") (println "will not print"))
will print
will not print
(if (cljs.core/not nil) nil nil)
cljs.user=>
#2019-02-1116:28dpsuttoni think this is a cljs issue not a CIDER one#2019-02-1116:28dehliAhh, should have checked there first. Thanks! 🙂#2019-02-1116:29dpsuttonno worries. cljs macros make me a little nervous#2019-02-1116:29dpsuttoni think the state of the art is a clj file with the same name defining that macro and then your cljs file will work just fine#2019-02-1116:30dehliAhhh, I do remember having to do that before. It's been a while since I have written one#2019-02-1116:30dpsuttonI'm assuming that asking for a macro just makes a normal function? I'm assuming this explains what is seen here#2019-02-1116:30dpsutton👍#2019-02-1116:30dehliYa, that could be. I'll go the .clj route. Thanks again!#2019-02-1214:25manuelThere's a cider update that should take care of nREPL 0.6.0 available on MELPA.#2019-02-1219:54Frank Henardnewbie question: why did my project pull the latest nREPL 0.6.0 on lein run and then fail?#2019-02-1219:56Frank HenardI'm guessing it's related to what you mentioned @manuel#2019-02-1220:00dpsuttonbecause that is most likely dictated by your version of lein which i'm guessing is 2.9.0?#2019-02-1220:03Frank Henardyes. Do you recommend downgrading?#2019-02-1220:06dpsuttoni'm just explaining your symptoms. i think you have two choices: upgrade cider to the patch that landed this morning or yesterday or downgrade lein to 2.8.3..
The problem is that nrepl 0.6.0 requires cider-nrepl 0.21 (possibly snapshot?) so you need either lein 2.8.3 / CIDER 0.20.0 or lein 2.9.0 / CIDER 0.21#2019-02-1221:31mhcatheya, do cider (or clojure mode I guess) do anything with eldoc which might result in flickering occuring just prior to eldoc displaying docs in the minibuffer?#2019-02-1222:04mhcathuh, interesting that the flicker goes away if I put the minibuffer in a separate frame#2019-02-1223:01mhcatWelp, if someone has an idea about how to debug this, I'd appreciate the input. The flicker occurs just prior to eldoc displaying a new thing. It only happens in clojure-mode with cider running a repl. Reading the cider-eldoc.el sources didn't immediately yield even a guess.#2019-02-1315:47mhcatFor completeness, I tracked this down to a hook I had installed, though I am not sure why it was being triggered. I'm happy with it not installed though, so ¯\(ツ)/¯#2019-02-1300:09agdo cider-find-*-other-window functions work for you? I can’t force it to open it in a new window#2019-02-1301:17agcould this be a bug in cider-common.el/cider-find-file? It seems at least one of the find-file-noselect should be find-file-other-window conditionally?#2019-02-1301:18agI’d like to jump to result of cider-find-var in other window, but it’s not working 😞#2019-02-1302:16agMy attempt to fix it https://github.com/clojure-emacs/cider/pull/2583#2019-02-1307:19dpsutton@jev i'm sorry i didn't get a chance to help you. We ran really late at work#2019-02-1307:21dpsuttonto anyone else: i notice that there's a prefix argument to jacking in but I've never used it and it does 2 things, one of which seems weird. It lets you specify the base directory of the project (which seems weird to me) and then it lets you edit the options to jack in. I want to rejigger this so that the prefix lets you edit the raw jack in command so its easy to see where different options go. The real question is the current behavior goes with a double prefix arg or if it can just be clobbered. It seems strange to set the project root but just wondering if anyone could chime in on that#2019-02-1309:30Michael GriffithsI suppose if you have a single git repo containing two subdirectories, each with a lein project in#2019-02-1309:31Michael GriffithsEmacs would presume the root of the git repo is the project root#2019-02-1309:32Michael GriffithsBut I think having them the other way around, like you suggest, could make sense. One prefix arg to see/change the options, two prefix args to see/change the options AND change the project root. We could also use a negative prefix arg for one#2019-02-1314:10dpsuttonah. yeah. however, the way the project root stuff works is backtracking so i've never thought to use this in our own "monorepo" of sorts#2019-02-1314:10dpsuttonalso, i've got a patch that rather than doing args you get to edit the entire jack in string and i think i prefer that more#2019-02-1309:01mikepjbDoes anyone know how to jump to java references in clojure code?
I've managed to do this for jdk src with (setq cider-jdk-src-paths '("/usr/lib/jvm/java-8-openjdk/src.zip")) which is great. 🚀
However, I have not been able to do the same for java code written in the same project that the clojure code references e.g
(def java-based-lookup (ImportantJavaClass/THELIST)
#2019-02-1312:24jumarIf sources are on the classpath you should be able to jump there.
I was able to do this before with clojure java sources although, honestly, it's quite annoying and sometimes lead to weird issues (that was the case with mixing both standard clojure jar and "source" artifact).#2019-02-1312:24jumarFor clojure I used this in my project.clj
[org.clojure/clojure "1.10.0" :classifier "sources"]
#2019-02-1315:25mikepjbThanks I will try that out @U06BE1L6T #2019-02-1320:10futuroThat's what I've done in the past as well. It worked, but it would also be neat to have a lein plugin or some such that brought in source jars as well. :thinking_face:#2019-02-1313:01JaimeV@dpsutton No worries, I can wait if you still want to try.#2019-02-1314:08dpsuttonI'm making coffee and then i'm gonna try to recreate. can you put the exact command line snippet i should use to create the app like you did?#2019-02-1314:19dpsuttonok i'm not having the same issues as you#2019-02-1314:19dpsuttonjvm: 11, CIDER 0.21.0snapshot, lein 2.90#2019-02-1314:20dpsuttonbut i had to do two things to the generated project file:#2019-02-1314:20dpsuttonbump figwheel sidecar to 0.5.18, lein figwheel to 0.5.18, and piggieback to 0.4.0#2019-02-1314:20dpsutton@jev sorry the deps are so painful and confusing#2019-02-1314:22dpsuttoni created it with lein new re-frame testapp +cider#2019-02-1314:45JaimeVThat is the snippet, I have used.#2019-02-1314:46JaimeVlein new re-frame figman +cider#2019-02-1314:46dpsuttonah, figman?#2019-02-1314:46dpsuttonoh that's the app name#2019-02-1314:46dpsuttondid you do the changes i did?#2019-02-1314:46JaimeVI also tried with chestnut: lein new chestnut pandapp +re-frame +edge#2019-02-1314:49dpsuttonok. so i did lein new re-frame figman +cider#2019-02-1314:49JaimeVI have the right deps with those settings, it works using the figwheel repl, but no with figwheel-main.#2019-02-1314:49dpsutton1 file changed, 3 insertions(+), 3 deletions(-)
project.clj | 6 +++---
modified project.clj
@@ -19,10 +19,10 @@
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.10"]
- [figwheel-sidecar "0.5.16"]
- [cider/piggieback "0.3.5"]]
+ [figwheel-sidecar "0.5.18"]
+ [cider/piggieback "0.4.0"]]
- :plugins [[lein-figwheel "0.5.16"]]}
+ :plugins [[lein-figwheel "0.5.18"]]}
:prod { }
}
#2019-02-1314:49dpsuttonmade these changes#2019-02-1314:49dpsuttonand then cider-jack-in-cljs works for me#2019-02-1314:50dpsuttonyes ok i think there is some confusion#2019-02-1314:50dpsuttonfigwheel is a set of dependencies to get a clojurescript repl up. figwheel-main is another set of dependencies, kind of the successor of figwheel to achieve the same thing#2019-02-1314:51dpsuttonto use figwheel main you need to remove figwheel deps and switch over. when i said you should use figwheel main i meant as in you should follow the setup for that#2019-02-1314:51dpsuttonhttps://github.com/bhauman/figwheel-main-template#2019-02-1314:51dpsuttoni'm sorry i mislead you#2019-02-1314:52JaimeVAh. What is the best practice?#2019-02-1314:52dpsuttonwell, i think figwheel main is considered the best practice. that said, i'm sure there are thousands of real projects still on figwheel. our main work product, a cljs app of 60k lines is a figwheel project#2019-02-1314:53dpsuttonbut if you're learning i would look at figwheel main. I know this tooling stuff sucks though so make sure not to do too much tooling and get back to actual coding/learning/fun#2019-02-1314:53JaimeVThanks for the clarification. Can you get the chestnut template to work? It doesn't for me.#2019-02-1314:53dpsuttonand i'm always happy to help track down issues with CIDER or clojure/(script) in general#2019-02-1314:53dpsuttonyeah let me try it#2019-02-1315:14dpsuttoni'm unable to get this one working. It does a trick where the compiled output goes to dev-target/public/js/compiled/ and then there's a middleware that exposes this but it's not seeming to work#2019-02-1315:16JaimeVOk. Thanks for the help. I am going to try with the figwheel-main and avoid chestnut for now. I kind of like the bells and whistles that it comes from, but I need to focus on learning and moving fun project forward.#2019-02-1315:16JaimeVAt least, I am not crazy... Tooling is truly a pain.#2019-02-1315:17JaimeVBTW, does your cljs app has a public face?#2019-02-1315:23dpsuttonour work product you mean?#2019-02-1315:23dpsuttoni'm asking in #chestnut if you want to follow along#2019-02-1315:24dpsuttonno our cljs app is an internal app for our doctors. I work at a pediatrician's office but start a new job on tuesday#2019-02-1315:28JaimeVCool#2019-02-1315:29JaimeVWe are building a recall app for a medical equipment company#2019-02-1315:30JaimeV#chestnut seems pretty quiet#2019-02-1315:33dpsuttonCopy that information and open an issue on the repo?#2019-02-1315:34JaimeVWill do#2019-02-1315:34JaimeVThanks for the mentoring#2019-02-1316:32andrea.crottiargh this tripped me up quite a bit, doing C-c C-c C-d to show the docs of s/assert (from spec)#2019-02-1316:32andrea.crottiactually gives you
cljs.core/assert
[x]
[x message]
Evaluates expr and throws an exception if it does not evaluate to
logical true.
cljs.core/assert is defined in jar:file:/Users/acrotti/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljc.
[back]
#2019-02-1316:32andrea.crottithe core assert instead#2019-02-1316:33andrea.crottiI've never notice that happening for other libraries#2019-02-1317:06andrea.crottiactually this problem only happens with clojurescript#2019-02-1317:06andrea.crottiwith Clojure it gives you the right documentation#2019-02-1318:29nopromptIs there a way to use defun-style-indent? IIRC there was a way to do this a while back.#2019-02-1321:48vigilancetechafter updating to cider-nrepl 0.21.0 and the latest cider I'm getting:
CompilerException java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__ini
t.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
clojure.lang.Compiler.load (Compiler.java:7526)
clojure.lang.RT.loadResourceScript (RT.java:379)
clojure.lang.RT.loadResourceScript (RT.java:370)
clojure.lang.RT.load (RT.java:460)
clojure.lang.RT.load (RT.java:426)
clojure.core/load/fn--6548 (core.clj:6046)
clojure.core/load (core.clj:6045)
clojure.core/load (core.clj:6029)
clojure.core/load-one (core.clj:5848)
clojure.core/load-one (core.clj:5843)
clojure.core/load-lib/fn--6493 (core.clj:5888)
clojure.core/load-lib (core.clj:5887)
Caused by:
FileNotFoundException Could not locate nrepl/middleware/caught__init.class or nrepl/middleware
/caught.clj on classpath.
clojure.lang.RT.load (RT.java:463)
clojure.lang.RT.load (RT.java:426)
clojure.core/load/fn--6548 (core.clj:6046)
clojure.core/load (core.clj:6045)
clojure.core/load (core.clj:6029)
clojure.core/load-one (core.clj:5848)
clojure.core/load-one (core.clj:5843)
clojure.core/load-lib/fn--6493 (core.clj:5888)
clojure.core/load-lib (core.clj:5887)
clojure.core/load-lib (core.clj:5868)
clojure.core/apply (core.clj:659)
clojure.core/load-libs (core.clj:5925)
and it fails when I try and cider-connect-cljs with this project: https://github.com/vigilancetech-com/shadow-hoplon-electron.git
It worked (somewhat) before that (with cider-nrepl-0.19.0-SNAPSHOT) but said:
WARNING: CIDER 0.21.0-snapshot requires cider-nrepl 0.20.0+, but you're currently using cider-nrepl 0.19.0-SNAPSHOT. Things will break!y
help?#2019-02-1321:53dpsuttonwhat's your cider version and what's your lein version#2019-02-1321:54vigilancetechshadow-cljs version: 2.6.24 node: v8.11.1#2019-02-1322:04dpsuttonno lein involved?#2019-02-1322:04dpsuttondo you have an explicit requirement on nrepl?#2019-02-1322:10vigilancetechhow do I tell the cider version?#2019-02-1322:10vigilancetechoh, here it is: CIDER 0.21.0snapshot (package: 20190213.1612)#2019-02-1322:11vigilancetechno lein#2019-02-1322:12vigilancetech:dependencies [[refactor-nrepl "2.4.0"]
[org.clojure/clojure "1.10.0-alpha6"]
[org.clojure/clojurescript "1.10.339"]
;; [vigilancetech-com/hoplon "6.0.0-alpha17"]
[hoplon/hoplon "7.1.0"]
[cider/cider-nrepl "0.21.0"]]
#2019-02-1322:13dpsuttonok. maybe try without refactor nrepl?#2019-02-1322:14dpsuttoni know shadow plays nice. but my testing was using a shadow 2.x.30 i think?#2019-02-1322:34vigilancetechstill the same error#2019-02-1322:38vigilancetechcan you clone it and see if you get the same result? Maybe its something else in my environment#2019-02-1322:38dpsuttonhappy to#2019-02-1322:38dpsuttongot a link?#2019-02-1322:39dpsuttondidn't know it would be that easy. lots of time its a private work repo.#2019-02-1322:40vigilancetechhttps://github.com/vigilancetech-com/shadow-hoplon-electron.git#2019-02-1322:40vigilancetechthis is just a demo#2019-02-1322:41vigilancetechlet me make it public#2019-02-1322:42vigilancetechgithub on my end says it already is, but the preview above says it isn't 😕#2019-02-1322:49vigilancetech@dpsutton were you able to get it?#2019-02-1322:50dpsuttoni'm cloning now#2019-02-1322:53dpsuttonso i dropped the refactor-nrepl dep and was able to crank up the electron build#2019-02-1322:53dpsuttontrying client now#2019-02-1322:53dpsuttongot a repl#2019-02-1322:55dpsuttonyeah works for me. i'm not sure where you are getting cider 19 from but that's worrisome#2019-02-1323:17vigilancetech@dpsutton cider 19? You mean 21?#2019-02-1323:18dpsutton> WARNING: CIDER 0.21.0-snapshot requires cider-nrepl 0.20.0+, but you're currently using cider-nrepl 0.19.0-SNAPSHOT. Things will break!y#2019-02-1323:18dpsuttonthis warning you got#2019-02-1323:18dpsuttoni don't like 19 there.#2019-02-1323:18dpsuttonthings work for me because i only have 21 in the mix#2019-02-1323:19vigilancetechwith 21 I can't even get to the repl due to the missing file errors#2019-02-1323:25vigilancetech@dpsutton so maybe something I have has an incomplete/broken install?#2019-02-1323:39dpsuttonHard to tell. Did you try without refactor nrepl?#2019-02-1400:05vigilancetechyes, and on a whole different OS/installation. Same thing#2019-02-1400:17dpsuttonare you still getting the warning about nrepl 19?#2019-02-1400:32vigilancetechno#2019-02-1400:32vigilancetechcan't get that far#2019-02-1400:32vigilancetechconnection fails from cider-connect-cljs#2019-02-1403:54dpsuttonWhen it says this, how are you specifying the cider nrepl version?I haven't had to specify a version ever. Certainly not since v12#2019-02-1405:02dpsutton@vigilancetech i'm removing all references to cider-nrepl from the project and letting my version of CIDER set itself up. On both linux and fedora i'm able to start both client and electron builds. I'm not sure what issue you are having but i would probably look at reinstalling things at this point?#2019-02-1405:13vigilancetech@dpsutton if I take that out I get: helm-M-x: ‘cider-connect-cljs’ requires the nREPL op "classpath" (provided by cider-nrepl)#2019-02-1405:14dpsutton[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.21.0 server this is what my invocation looks like. can you see what CIDER is doing to crank up the project?#2019-02-1405:14dpsuttonit is in the *Messages* buffer. (if you're not familiar. the experience levels are sometimes absolute beginner and sometimes emacs guru so its hard to talk on the right level at first :)#2019-02-1405:15vigilancetechthat's what was in my messages buffer#2019-02-1405:15dpsuttonso its complaining about the caught middleware which was added recently in 0.6.0#2019-02-1405:15vigilancetechand no cider buffer was created#2019-02-1405:15dpsuttonnrepl:0.6.0?#2019-02-1405:16dpsuttonmaybe delete ~/.m2/repository/cider?#2019-02-1405:16vigilancetechI have no nrepl dep any more in the#2019-02-1405:16vigilancetechin the shadow-cljs.edn file#2019-02-1405:16dpsuttonthat's fine. but the command that CIDER uses includes -d nrepl:0.6.0?#2019-02-1405:17dpsuttoncider-nrepl needs it. CIDER takes care to inject piggieback, nrepl, and cider-nrepl for you#2019-02-1405:17dpsuttonjust making sure those values are all mutually compatible#2019-02-1405:18vigilancetechokay, this is really strange. I'm not finding .m2/ anywhere. I'm on msys2#2019-02-1405:18dpsuttonah. i have no idea what's going on there then#2019-02-1405:18dpsuttonis it true that your startup command matches the one i put above? exactly?#2019-02-1405:18vigilancetechyeah, gonna take me a few mins to figure out where this cache is#2019-02-1405:19dpsuttonno worries. just making sure it is definitely the OS weirdness and not anything trivial before we jump into that#2019-02-1405:20vigilancetechI can't find that command in messages or anything like it. I'm using cider-connect-cljs not any kind of jack-in#2019-02-1405:20dpsuttonoohhhhh#2019-02-1405:20dpsuttonwhat are you using to start the server then#2019-02-1405:21vigilancetechI've never had any luck with jack in#2019-02-1405:21dpsuttonhow do you start up shadow?#2019-02-1405:21vigilancetechI just do shadow-cljs watch electron client#2019-02-1405:21dpsuttonah ok. you need nrepl in there#2019-02-1405:21dpsuttonnote how cider does it#2019-02-1405:21dpsutton/usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.21.0 server#2019-02-1405:22vigilancetechso I need to add those -d deps on my command line?#2019-02-1405:22dpsuttonthose deps need to be there: piggieback, nrepl and cider-nrepl. CIDER does it automatically for you. if you want to start it yourself make sure those are there#2019-02-1405:22dpsuttonyeah#2019-02-1405:22dpsuttonand if you do that i'm hopeful that all your problems will evaporate#2019-02-1405:22vigilancetechcan't they be put in shadow-cljs.edn?#2019-02-1405:22dpsuttonthey sure can#2019-02-1405:23dpsuttonat the risk of adding more deps that non-cider users will have. if that's fine go for it.#2019-02-1405:23dpsuttonbut i guess in a cljs project who cares what jvm artifacts are lying around#2019-02-1405:23dpsuttoni'm sorry. i thought you were using cider-jack-in-cljs this whole time. i apologize#2019-02-1405:23vigilancetechyeah, I'm going to run the production version thru the closure compiler anyway#2019-02-1405:24vigilancetechyeah, no I mentioned it above. I've never been able to get any jack-in to work at all. Not sure why#2019-02-1405:25dpsuttonnot sure. my guess would be your many OSes under one roof situation going on. you're doing cygwin stuff is that right?#2019-02-1405:25dpsuttonanyways sorry to waste your time. if you throw those deps in there it should startup just fine#2019-02-1405:27vigilancetechnot really. I have a c# server that has to run under windows so I'm using msys to develop a hoplon front in for it on.#2019-02-1405:28vigilancetechJust so I don't have to have two machines running at the same time (or some kind of VM)#2019-02-1405:28vigilancetechbut, initially at least, its going to be an electron app#2019-02-1405:28dpsuttoni enjoyed my C# years. yeah that makes sense. and windows apps do not make it easy to just throw them on a box or a virtualized thing#2019-02-1405:29vigilancetechWell, fortunately I didn't write the c# and I don't plan on touching it (I got someone else for that).#2019-02-1405:29dpsutton👍 cider#2019-02-1405:30vigilancetechI will say I'm kind of having fun and being amazed how much msys2 tricks me into thinking I'm developing in a Unix environment. If you get it set up just right that is.#2019-02-1405:32vigilancetechnext time I might try WSL but this just came together quicker#2019-02-1405:34vigilancetech@dpsutton that seems to have fixed it somewhat, but I'm getting this:
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled.
#2019-02-1405:34vigilancetech(I turned that refactor-nrepl dep back on)#2019-02-1405:39dpsuttonNot sure how cljs compatible refactor is and perhaps it doesn't "speak" shadow. I have no idea#2019-02-1405:40vigilancetechok, thanks for all your help!#2019-02-1405:40dpsuttonI suppose it's looking for a boot or lein or deps project file#2019-02-1405:40dpsuttonBut I don't know#2019-02-1405:41vigilancetechyeah, gotcha. Considering there's a variable to suppress the message, I guess its one of those "YMMV w/cljs" packages.#2019-02-1409:12manueljust FYI, I found this with latest cider-nrepl and shadow-cljs: https://github.com/clojure-emacs/cider-nrepl/issues/596#2019-02-1409:32manuelFixed with shadow-cljs 2.7.34.#2019-02-1506:55yuhanI'm getting a strange error when trying to run cljr-add-project-dependency:
Retrieving list of available libraries...
cljr--get-error-value: Error in nrepl-refactor: clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(mranderson048/http_kit/v2v2v0/org/httpkit/client.clj:1:1)
at clojure.lang.Compiler.load (Compiler.java:7391)
...
#2019-02-1506:56yuhanfollowed by a hundred lines of stacktraces involving refactor_nrepl, cider.nrepl, and nrepl.middleware#2019-02-1506:58yuhanI'm running the latest versions of cider 0.21.0 and lein 2.90, the same error also happens in projects using deps.edn#2019-02-1511:33benedekthis is a java9+ related bug as far as i remember#2019-02-1511:34benedekyou are better off adding deps to your repl the way it is recommended in the cider docs#2019-02-1511:35benedekthere is a pr in clj-refactor to make this work again but afaik stalled atm#2019-02-1516:50erwinrooijakkersIs it possible to use Cider for ClojureCLR?#2019-02-1520:12Chasethis might be a total shot in the dark but you might want to see what the Arcadia folks are doing. I think it's clojure on the unity game engine which is C#, right? I think they forked clojure clr. And they seem to have some kind of emacs repl goodness going on. https://github.com/arcadia-unity/Arcadia/wiki/REPL#2019-02-1516:51dpsuttonhow do you run ClojureCLR? I'm not sure CIDER speaks any of the build tools for it?#2019-02-1517:07erwinrooijakkersI don’t know how you run it#2019-02-1517:08erwinrooijakkersI was wondering what editor I should use for it#2019-02-1517:08erwinrooijakkersI hoped to be able to use Spacemacs#2019-02-1517:08erwinrooijakkersBut if Cider doesn’t work I don’t know what to use#2019-02-1517:09erwinrooijakkershttps://github.com/clojure-emacs/cider/blob/c698df1c905127f190efee3403822b2b09a811c3/doc/caveats.md#clojureclr-support#2019-02-1517:09erwinrooijakkers>>>CIDER currently doesn’t support ClojureCLR. The reasons for this are the following:
nREPL itself runs only on the JVM (because it leverages Java APIs internally). There’s an nREPL port for ClojureCLR, but it’s not actively maintained and it doesn’t behave like the Clojure nREPL.
cider-nrepl uses a lot of Java code internally itself.
Those issues are not insurmountable, but are beyond the scope of our current roadmap. If someone would like to tackle them, we’d be happy to provide assistance.#2019-02-1517:09erwinrooijakkersHmm that’s a bummer#2019-02-1517:09dpsuttonah, well there we go#2019-02-1517:09erwinrooijakkers🙂 thanks#2019-02-1517:10dpsuttonno problem. perhaps inf-clojure mode can work?#2019-02-1517:10dpsuttonit basically just forms commands that you could write yourself so in theory it doesn't care about which Clojure you talk to. (i think?)#2019-02-1517:10dpsuttonbut that would keep you in spacemacs#2019-02-1517:11erwinrooijakkersclj-refactor does work I guess#2019-02-1517:11erwinrooijakkersExcept for adding dependencies#2019-02-1518:48richiardiandreaso I forgot how to add my custom aliases to a jack in command 😞#2019-02-1518:52richiardiandreaoh right cider-clojure-cli-global-options#2019-02-1518:52dpsuttongrab this patch: https://github.com/clojure-emacs/cider/pull/2586#2019-02-1518:52dpsuttonand use prefix argument to edit the jack in command#2019-02-1518:52dpsuttonway easier. and way easier to randomly set it to whatever you want.#2019-02-1518:53richiardiandreaI saw that, do I understand right that you basically need to modify the whole string?#2019-02-1518:54dpsuttonyou don't have to. it plops the whole command in the minibuffer so you can see exactly where your modifications need to go#2019-02-1518:54dpsuttonso do that, go to beginning of line, and add -A:fig or whatever you need to do#2019-02-1518:54dpsuttonits so that every readme that shows which command line form to use is very easy to follow#2019-02-1518:55dpsuttonby the by, i'm running make autoloads and it doesn't seem to be working for me#2019-02-1518:56richiardiandrea@dpsutton I think I do make and it does it all now#2019-02-1518:56richiardiandreawhat is the error?#2019-02-1518:57dpsuttoni've tried both. i get the classic command-execute: Wrong type argument: commandp, cider-find-var#2019-02-1518:57richiardiandreaah#2019-02-1518:57richiardiandrealet me try here, I am on master#2019-02-1518:59richiardiandreauhm I do not see it either#2019-02-1519:01richiardiandreaweird I see the section in cider-autoloads.el:
;;;### (autoloads nil "cider-find" "cider-find.el" (0 0 0 0))
;;; Generated autoloads from cider-find.el
(autoload 'cider-find-var "cider-find" "\
(autoload 'cider-find-dwim-at-mouse "cider-find" "\
(autoload 'cider-find-dwim "cider-find" "\
(autoload 'cider-find-resource "cider-find" "\
(autoload 'cider-find-ns "cider-find" "\
(autoload 'cider-find-keyword "cider-find" "\
#2019-02-1519:01dpsuttonso its supposed to build up a file .depend and that never has any data written to it#2019-02-1519:04richiardiandreamust be something else, the .depend are not used for autoloads#2019-02-1519:04richiardiandreaalso, in my case it is populated#2019-02-1519:05dpsuttoninteresting. it is not in my case#2019-02-1519:05richiardiandreatry make clean && make .depend what does it do?#2019-02-1519:06dpsuttonits populated on linux but not on mac#2019-02-1519:06dpsuttoni wonder if this is a bsd/gnu sed issue#2019-02-1519:07dpsuttonare you on mac or linux?#2019-02-1519:07richiardiandrealinux#2019-02-1519:07richiardiandreacould be, do you have the gnu package installed, I know you need it for grep for instance#2019-02-1519:08richiardiandreaalso, which command are you using for loading the autoloads?#2019-02-1519:08dpsuttonmake autoloads#2019-02-1519:08dpsuttonbut also make failed earlier for me (on mac). testing on linux#2019-02-1519:08dpsuttonwaiting for project to crank up#2019-02-1519:09dpsuttonyes. the script calls sed -s which isn't supported in the BSD version#2019-02-1519:10richiardiandreano sorry I mean Elisp code you use for loading the autoloads..#2019-02-1519:10richiardiandrealike use-package ...#2019-02-1519:11dpsutton(add-to-list 'load-path "~/projects/dev/cider")
(require 'cider)
#2019-02-1519:11dpsuttonoh i missed "9load "cider-autoloads" t t)#2019-02-1519:13richiardiandreayeah that is needed, I started to use use-package so maybe I am missing something here too 😉#2019-02-1519:14dpsuttonsorry to ask so many questions when i hadn't read the one line that would solve it for me#2019-02-1519:14dpsuttonautoloads are magical comments lol. who knows#2019-02-1519:15richiardiandreayes they are 😄#2019-02-1519:19richiardiandreaquestion for you @dpsutton I still don't really understand if use-package is supposed to load cider-autoloads.el for me (kind a new to it)#2019-02-1519:19dpsuttoni've never used it either#2019-02-1519:20richiardiandreaok cool tnx 😉#2019-02-1519:21dpsutton> If you're not using one of tho mechanisms that registers autoloads, such as :bind or :hook, and your package manager does not provide autoloads, it's possible that without adding :demand t to those declarations, your package will never be loaded.#2019-02-1519:21dpsuttonit looks like it gets a little manual. can you put that (load "cider-autoloads" t t) form right after use-package?#2019-02-1519:22richiardiandreaI was going to try exactly that#2019-02-1519:22richiardiandrea😄#2019-02-1519:23richiardiandreathis is also interesting: https://emacs.stackexchange.com/questions/19695/use-package-defer-t-and-add-hook#2019-02-1519:29richiardiandreaas I understand that you could just declare the function you are interested in and use-package created the autoloads basically#2019-02-1519:30richiardiandreathis one is also a good one to know https://emacs.stackexchange.com/questions/19694/use-package-defer-t-and-autoloads#2019-02-1519:32richiardiandreathis works for me:
(load "cider-autoloads" t t)
(use-package cider
;; This seems enough for cider, see also:
;;
:defer t
:init
(setq cider-popup-stacktraces t
cider-popup-stacktraces-in-repl nil
cider-repl-use-clojure-font-lock t
cider-overlays-use-font-lock t
cider-repl-wrap-history t
cider-repl-history-size 1000
cider-show-error-buffer t)
:config
(add-hook 'cider-mode-hook 'eldoc-mode)
(add-hook 'cider-mode-hook 'paredit-mode)
(add-hook 'cider-repl-mode-hook 'paredit-mode)
(add-hook 'cider-repl-mode-hook 'eldoc-mode))
#2019-02-1519:43richiardiandreaonly thing I am missing is how to bind cider-insert-last-sexp-in-repl to C-c C-c#2019-02-1519:45richiardiandreaalso to scroll the REPL when cider-insert-last-sexp-in-repl is doing its thing, @dpsutton do I have to set something for the scroll part?#2019-02-1519:51dpsuttonNot that I know of. Is it not scrolling with the input?#2019-02-1519:51dpsuttonMight just need to be fixed. #2019-02-1520:07richiardiandreaNope, I think that feature has been changed/tweaked - I will read more#2019-02-1521:47richiardiandreaI put (setq scroll-conservatively 101) like I read somewhere but I don't see it scrolling unfortunately#2019-02-1521:52richiardiandreafrom the CHANGELOG:
> * Option cider-repl-scroll-on-output is now obsolete, and the default REPL behaviour has changed to not recenter the window. The built-in variable scroll-conservatively can be set to 101 (either globally or locally in the REPL buffer) to restore the old behaviour. This change has a dramatic positive effect on REPL performance.#2019-02-1521:53richiardiandreawith (setq scroll-conservatively 0) it does not do it either#2019-02-1523:08Michael GriffithsYeah, scroll-conservatively only has any affect if the point is moved – but it seems the insert-*-in-repl commands leave the point at the start of the input#2019-02-1523:10richiardiandreayes @cichli that's what happens, I see it as well now - maybe @dpsutton I can open an issue? no rush on this, just gathering some thoughts#2019-02-1523:12Michael GriffithsI think the right thing to do is probably move the point to the input end… but I haven’t really used these commands so not sure if there’s a good reason they don’t do that 😄#2019-02-1523:13Michael Griffiths@richiardiandrea I’ve pushed another attempt at fixing https://github.com/clojure-emacs/cider/issues/2589 if you want to test again#2019-02-1523:13richiardiandrealet me try live 😉#2019-02-1523:14Michael GriffithsI’m curious as to why we end up calling buffer-substring-no-properties on the *cider-result* buffer rather than the source buffer… we explicitly don’t select it when we display it, but possibly something in your config is altering that#2019-02-1523:15richiardiandreait can be, I have a possible bloated Emacs Live custom branch#2019-02-1523:15richiardiandreaI am trying to trim it down as much as possible#2019-02-1523:15richiardiandrea@cichli it seems like it is working now#2019-02-1523:15Michael GriffithsAll the possible config around display-buffer is quite confusing so it’s possible we’re missing an edge case in the popup code#2019-02-1523:16Michael GriffithsGreat news! 🎉 Thanks for testing#2019-02-1523:16richiardiandrea😄 no problem, thank you for debugging!#2019-02-1523:17richiardiandreathis is the first time I am trying this feature actually, my workflow is quite different, usually I just send to the REPL buffer, having a dedicated result window has its advantages though#2019-02-1523:17richiardiandreagood stuff#2019-02-1523:20arohnerIn my cider repl buffer, *e used to print stacktraces, now it just prints *e
#object[java.lang.AssertionError
"0x5d79b28d"
"java.lang.AssertionError: Assert failed:. How do I get that behavior, printing the whole stacktrace, back? CIDER 0.20.0#2019-02-1523:24Michael Griffiths(setq cider-print-fn 'pprint)?#2019-02-1523:26Michael GriffithsOr do you mean printed like by clojure.repl/pst?#2019-02-1523:46arohnerI’m not entirely sure who is responsible for printing the exception, but at the moment, it’s behaving as if it’s doing the clojure.core/print-method default, rather than pst#2019-02-1523:46arohnerIs that a cider behavior, or my repl?#2019-02-1523:46arohnerhrm, appears to be cider-related, because the lein repl prints the whole stacktrace, as expected, when I *e#2019-02-1600:23Michael GriffithsIsn’t the print-method default to print #error {:cause ... :via ... :trace ...} now? In lein repl it’s using the equivalent of pr which falls through to print-method#2019-02-1600:24Michael Griffithsbut in CIDER it’ll use cider-print-fn#2019-02-1616:17ChaseSo is C-c C-c the approved solution to stop a function evaluation? I think I'm inadvertently creating some infinite loop situations and then panicky hitting C-c a few times (and throwing in a C-g every now and then just in case). But then the repl and inline evaluation seems to act funky still. Like afterwards, sometimes normal eval'ing something simple like (+ 1 2) doesn't work and I end up killing the repl and starting it all over.#2019-02-1617:03Michael GriffithsIt’s C-c C-c in REPL buffers but C-c C-b in other buffers I think. You should see Evaluation interrupted. in the echo area when it succeeds#2019-02-1720:36MattiasA bit lazy, only tried briefly to find an answer... what’s the easiest way to get things pretty printed on the repl? Mainly thinking of maps and other data structures.#2019-02-1720:37dpsuttonhit , in the repl. it will bring up a menu and there's an option toggle-pretty#2019-02-1721:00MattiasHuh. Like magic. Thanks! Is that , a Cider thing or arcane Emacs? :thinking_face:#2019-02-1721:00dpsuttonits built into cider. i think because slime for common lisp did it like that#2019-02-1721:00dpsuttoni've seen some people misbelieve it is a spacemacs thing but its CIDER native#2019-02-1721:43MattiasCool, thanks. Of course knowing Emacs isn’t halfway enough 😅#2019-02-1816:22alexyakushevI assume something has changed in CIDER recently regarding the initial namespace the REPL starts with? It is now user for me instead of boot.user. Any chance to customize this?#2019-02-1816:39Michael GriffithsSee cider-repl-init-code#2019-02-1816:39Michael GriffithsYou could add "(in-ns 'boot.user)"#2019-02-1816:40Michael GriffithsI’m not sure why the behaviour has changed, though. Possibly related to the changes to how bindings are handled in nREPL#2019-02-1816:41alexyakushevThanks!#2019-02-1816:30Chaselooks like there is:
Customizing the initial REPL namespace
Normally, the CIDER REPL will start in the user namespace. You can supply an initial namespace for REPL sessions in the repl-options section of your Leiningen project configuration:
:repl-options {:init-ns 'my-ns}#2019-02-1816:30Chasehttps://cider.readthedocs.io/en/latest/repl/configuration/#2019-02-1816:32bhaumanHow is cider detecting the root of a project? It currently doesn’t recognize projects that only have a deps.edn file at the root for me.#2019-02-1816:32bhaumanI think I have to update a helper library#2019-02-1816:33alexyakushev@chase-lambert Thanks. I think I found this before but looks like it's Leiningen only#2019-02-1816:35ChaseThat's true. I haven't ventured too much outside of leiningen yet. I'm already getting used to hitting C-c M-n M-n to just set it as soon as the repl is running. C-u C-c C-z puts you in the repl with the ns too.#2019-02-1816:35dpsutton@bhauman it should "speak" deps.edn. check out cider--identify-buildtools-present#2019-02-1816:35bhaumanthanks @dpsutton I’ll check it out 🙂#2019-02-1816:35ChaseI do miss it being defaulted to the project ns though#2019-02-1816:37dpsuttonalthough actually clojure-project-root-path might be the better place to look#2019-02-1816:38dpsuttonalso @bhauman would love comments here (https://github.com/clojure-emacs/cider/pull/2586) about editing jack in command with a prefix#2019-02-1816:39dpsutton(make it trivial to add aliases and profiles)#2019-02-1816:43bhauman@dpsutton I like the proposed behavior, so you are saying you want cider to present the shell command in its entirely every time before launching?#2019-02-1816:44dpsuttonnot every time. there's a defcustom to make that happen or just send a prefix with jack in command#2019-02-1816:44dpsuttonbut yeah, it presents the entire shell command so its easy to know where and what you can edit#2019-02-1816:44bhaumanyeah with prefix emacs arg makes a lot of sense#2019-02-1816:44mikepjbDoes anyone know how to set jvm-opts from cider-lein-parameters?
Extra information:
To pass jvm-opts to lein you declare it with the :jvm-opts key, I'd like to make this portable so I can inject the key in the same way nrepl/cider-nrepl are passed in via cider jack-in
e.g /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\]
I think the answer will be something similar to this (set-variable 'cider-lein-parameters "update-in :jvm-opts conj \\[\\\"-Xmx5g\\\"\\] --")
But somewhere I'm going wrong because lein prints out the available tasks instead of starting a REPL.#2019-02-1816:44dpsuttonshould make following tutorials or doing what coworkers are doing trivial#2019-02-1816:47Michael Griffiths@mikepjb lein also supports the JVM_OPTS environment variable#2019-02-1816:51Michael GriffithsPossibly you want "update-in :jvm-opts conj \\\"-Xmx5g\\\" --" though? i.e. just conj the string rather than a vec containing the string#2019-02-1816:52mikepjbthanks @cichli guessing the first solution might look like (setenv "JVM_OPTS" "-Xmx5g") in my emacs config?#2019-02-1816:52mikepjbI'll try the update-in first and let you know if that works#2019-02-1816:54Michael GriffithsYeah or set cider-lein-command to JVM_OPTS="-Xmx5g" lein#2019-02-1816:56Michael Griffiths(FWIW I generally try and set these kinds of things in lein profiles rather than in editor config, if you really want to use -Xmx5g everywhere you could add it to your :user profile)#2019-02-1816:57dpsuttonthe proposed patch that i linked above will make this trivial. you have full access to the command to be invoked so presumably you can just add this prefix#2019-02-1817:19mikepjb@cichli this works (set-variable 'cider-lein-parameters "update-in :jvm-opts conj \"\\\"-Xmx5g\\\"\" -- repl :headless :host localhost")#2019-02-1820:52borkdudeWhat’s the story with newest CIDER and using the newest 2.8.2 boot version? Are their nREPL versions compatible?#2019-02-1921:27Michael GriffithsSorry, I missed this message! You should include [nrepl "0.6.0"] – I think boot still bundles 0.4.something#2019-02-1919:27soulflyerUm, I'm getting this error message in several projects I haven't run for a little while: ‘cider-jack-in’ requires the nREPL op "classpath" (provided by cider-nrepl)
Both clojure and clojurescript projects are showing similar messages. I did just do updates to cider and lein in an attempt to fix another entirely different problem, but otherwise these are all projects that were working fine about 6 weeks ago. Any idea what might have changed?#2019-02-1919:38soulflyerplease ignore me, looks like deleting .m2/repository/cider fixed it...#2019-02-1921:16mikerodin cider, it shows the current buffer clj file name on the bar above the minibuffer (what’s taht called in emacs?)
is there a way for it to instead show the whole ns name ?#2019-02-1921:16Michael GriffithsThat’s called the mode line#2019-02-1921:16mikerodI can’t think of what to call these things to try to track that one down#2019-02-1921:17mikerod@cichli knowing that term is helpful to communicate about this - thanks for that one#2019-02-1921:20Michael GriffithsNo problem – as always the emacs terminology is non-obvious in this case#2019-02-1921:21Michael GriffithsI’m not sure the best way to customise the buffer name, but you could set cider-mode-line to include the current namespace if it’s available#2019-02-1922:22mikerodah, will take a look#2019-02-1923:26Christian Romneydoes anyone know if there’s a clj-refactor / refactor-nrepl WIP to work with nrepl 0.6.0?#2019-02-1923:37smwC:\dev\example>lein repl
Retrieving cider/piggieback/0.3.10/piggieback-0.3.10.pom from clojars
Retrieving cider/piggieback/0.3.10/piggieback-0.3.10.jar from clojars
Error loading cider.piggieback: Syntax error compiling at (cider/piggieback.clj:190:3).
Exception in thread "main" Syntax error compiling var at (C:\Users\smw\AppData\Local\Temp\form-init2045160268932467125.clj:1:2987).
anyone know offhand what this might be about?#2019-02-2000:06dpsuttonwhat's your version of lein? i believe lein 2.9.0 must use cider/piggieback "0.4.0" (if this is your problem)#2019-02-2002:27oskarkvAfter cider-jack-in and "connection established", my Emacs freezes. Any ideas of what might be wrong, or how I can find out what's wrong?#2019-02-2210:17soulflyerI was seeing something similar. I can get moving by sending emacs a kill -USR2 to drop emacs into the debugger. There are messages in the nrepl buffer (don't remember exactly what). Got round it by starting a command line repl with lein repl and doing a cider-connect-clj#2019-02-2002:31dpsuttonyou can do m-x profiler-start, do some action to make it freeze up, let it freeze for a while and then run m-x profiler-report#2019-02-2002:31dpsuttonyou may need some C-g in there beforehand to try to break the freeze (if possible)#2019-02-2002:32oskarkvok will try, thanks#2019-02-2002:32dpsuttoni'm heading out now but happy to help later#2019-02-2006:48Macrozhmm I seem to remember that in a stacktrace in a buffer (i.e. REPL) I used to be able to RET to go to the line of code but now only clicking with mouse seems to work#2019-02-2010:01robert-stuttafordwhat do i need to do to restore this behaviour?
before: prns (to the default *out*) show in *cider-result* in the order that they occur, and then the evaluated result prints at the end.
now: all *out* shows in the repl buffer, and only the evaluated results print in the *cider-result* buffer.
Cider 21. i want the ‘before’ behaviour.#2019-02-2011:05Michael GriffithsWe are tracking this here: https://github.com/clojure-emacs/cider/issues/2580#2019-02-2010:18robert-stuttaford… and now that i typed all of that out, i’m seeing prns in cider-result!#2019-02-2011:01manuel@christian.a.romney what problems are you experiencing? I am on latest CIDER and clj-refactor, and clj-refactor seems to be working fine (at least the features I use...)#2019-02-2012:15Christian Romneycurious do you have :pedantic? :abort set?#2019-02-2012:15manuelnope#2019-02-2012:24Christian Romneythat could be it. because refactor-nrepl depends on nrepl 0.4.4 and cider depends on 0.6.0#2019-02-2012:24Christian Romneylet me amend that. it’s definitely why you’re not seeing the issue and I am. 🙂#2019-02-2012:25manuel🙂 oh great#2019-02-2012:26Christian RomneyI can exclude nrepl for now and see what works#2019-02-2012:26manueltrue, but let's hope clj-refactor will be updated soon.#2019-02-2012:26Christian Romneywas just curious if anyone knew ^ right 🙂#2019-02-2015:20jsa-aerialAny idea why setting cider-overlays-use-font-lock to either t or nil has no effect on the overlay look?#2019-02-2015:42mgrbyteAnyone else getting errors with cider 0.21? I'm getting:
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context
I've got [cider/cider-nrepl "0.21.0"] in my :repl plugins section of my lein project.clj, and cider-version CIDER 0.21.0 (New York)#2019-02-2023:25arohnerI’m also seeing this behavior#2019-02-2023:29arohnerIf cider-nrepl “0.21.0” or 21.1 are in my lein profile, the repl refuses to load:
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
Exception in thread "main" Syntax error compiling var at (/private/var/folders/0l/v505ws2x7x3c3nnc6yzvy0s80000gn/T/form-init5244230070535178914.clj:1:8568).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 35 more
#2019-02-2102:02Michael GriffithsDefinitely [nrepl "0.6.0"] in your deps tree as well? Does anything else depend on nrepl or cider-nrepl?#2019-02-2314:26arohnerHrm. I depend on [cider-nrepl 0.6.0] in my ~/.lein/profiles.clj, but [nrepl "0.5.3"] is in :deps :tree, and I’m not sure why. It looks like a top-level dependency in the tree, but it’s not in profiles.clj or project.clj#2019-02-2416:58Michael GriffithsIt appears at the top level because it’s bundled by lein I think, but you should be able to force [nrepl "0.6.0"] by adding it to the :user or :dev profile (or upgrade to lein 2.9.0)#2019-02-2511:52arohnerthat was it! thanks#2019-02-2015:45dpsuttontry 0.21.1 nrepl?#2019-02-2015:46mgrbyteurg#2019-02-2015:46mgrbytehomer moment, sorry#2019-02-2015:47mgrbytehelps to actually type the correct version dunit.#2019-02-2015:49mgrbyteWell, actually, still get the same error with clj pkg [cider/cider-nrepl "0.21.1"], emacs cider-version says 0.21.0#2019-02-2015:51mgrbyteremoving cider/cider-nrepl from my :repl deps in project.clj and using cider-jack-in instead works. from the deps printed by the lein command jack-in invokes, am using same versions.#2019-02-2018:32stathissiderishello, I have a buffer which is a clj file which is not in the classpath of the project but it contains clojure code which is valid in the contect of the project. It seems that CIDER can’t really eval statements from this file (C-c C-k is not even bound). Is there any way to “associate” such a file with a REPL?#2019-02-2018:39justinbarclayI don’t know too much about it, I’ve never had to deal with that myself but you might want to look at CIDER + Sesman
http://docs.cider.mx/en/latest/managing_connections/#2019-02-2018:40stathissideristhanks I’ll look into it!#2019-02-2018:54Christian Romneyis there some setting to get cider to start in :init-ns? this has a history of being added and removed, so I’m not sure what the current state is. I saw a closed issue where this was resolved and wasn’t sure if it’s a regression or I’m simply unaware of the right defvar to customize. TIA#2019-02-2019:28ChaseI noticed since it went back to user ns as default the repl doesn't come with clojure.repl capability by default either anymore. is there anyway I can just always have clojure.repl doc capability? I would love that as a universal default.#2019-02-2020:24Michael GriffithsJust pushed a fix for the :init-ns issue, sorry for the regression there. This should fix the initial namespace for Boot users also#2019-02-2216:30Christian RomneyThank you so very much for this quick turnaround!!! Next question: I pin to melpa-stable. Will this make it into a point release e.g. 0.21.1 anytime soon?#2019-02-2020:25Michael Griffiths@chase-lambert We should still require those by default – see the default value of cider-repl-init-code#2019-02-2021:12Chasecool. thanks! I don't get it when starting the repl and it's in the user ns. But if I do C-c M-n M-n to change it to the core ns (which I think you were just saying you are going back to as default) I get doc functionality by default.#2019-02-2021:23Michael GriffithsIn that case it should be fixed by the latest push 😄#2019-02-2023:25arohnerI’m also seeing this behavior#2019-02-2210:17soulflyerI was seeing something similar. I can get moving by sending emacs a kill -USR2 to drop emacs into the debugger. There are messages in the nrepl buffer (don't remember exactly what). Got round it by starting a command line repl with lein repl and doing a cider-connect-clj#2019-02-2101:30yuhanAnyone else here using CIDER with lispy?#2019-02-2101:39yuhanI recently noticed a few bugs with using lispy-eval, curious to know if other people are experiencing the same issues: https://github.com/abo-abo/lispy/issues/478#2019-02-2103:28aisamunot seeing this here with
;; CIDER 0.21.0snapshot (package: 20190125.1339), nREPL 0.6.0
#2019-02-2103:49yuhanAre you also on the latest version of lispy? And none of the above 4 issues are present on your end?#2019-02-2107:15danierouxI've updated the issue @UCPS050BV, I see the same issues.#2019-02-2107:20danierouxThis is what REBL tracks. The first one is cider-eval-last-sexp, and the second one is special-lispy-eval#2019-02-2108:42aisamuIs that something I could query to get lispy's version? The elpa folder is lispy-20190206.1632, and inspecting the source I found ;; Version: 0.26.0. This is being fetched by lispyville, but the use-package contains no version info, so I assume it's pointing to the latest.#2019-02-2109:28yuhan@U9E8C7QRJ Thanks for the confirmation! I was afraid it was something in my configuration.
Using REBL to track the values is an interesting idea, I tried briefly to hunt down the source of the errors using Edebug but there doesn't seem to be an easy way to set breakpoints or inspect values once the string is passed over to the lispy-clojure.clj side of things.#2019-02-2109:30yuhan@U1UQEM078 That looks like the latest version, are you sure that you are using M-x lispy-eval or "e" in a special position to execute the forms as opposed to the cider-eval-* commands?#2019-02-2109:35aisamuYup, checked that! (And just retried)#2019-02-2109:37aisamuAlso tried calling lispy-eval directly, same. (Unless it's being monkey-patched with something else? I use lispyville)#2019-02-2109:43yuhanhmm.. I use lispyville too, as far as I know there's nothing overriding or advising the lispy-eval functions#2019-02-2110:12yuhanI'm testing this on clojure 1.10 , Mac OS 10.14, Emacs 26.1 with a empty deps.edn project, in case that's relevant#2019-02-2110:13yuhanalso tried with a lein project and clojure 1.90, 1.70 - same results#2019-02-2112:51aisamuThe REPL is running on Linux, Clojure 1.9.0 with Shadow-cljs (2.7.xx). Emacs is 25.3.1 on OSX 10.10.5 (I know, I know)#2019-02-2113:15dpsuttonif you want to watch the CIDER wire try m-x nrepl-toggle-message-logging and then you'll find a *messages-[connection-name]-* buffer with the messages to and from nrepl#2019-02-2109:22kommenI also see similar errors sometimes:#2019-02-2109:22kommenCaused by: java.lang.RuntimeException: No such var: stacktrace/analyze-causes
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler.resolveIn(Compiler.java:7387)
at clojure.lang.Compiler.resolve(Compiler.java:7357)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7318)
at clojure.lang.Compiler.analyze(Compiler.java:6768)
... 104 more
#2019-02-2109:22kommenthey go away when I just start the clojure process again#2019-02-2109:23kommenthis is cider 0.21.1 with piggyback 0.4 and nrepl 0.6#2019-02-2109:26kommen#2019-02-2203:27hoppy@bozhidar, do you have a good clearing house for people to find ways to contribute to cider/orchard? I'd love to help, just need some guidance#2019-02-2206:48kommen@hoppy for cider, a bunch of issues are tagged with “good first issue”: https://github.com/clojure-emacs/cider/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22#2019-02-2209:14oskarkvI tried to debug the following function but got "Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 2327 2328)"
(defn step345 [sets row]
(->> (for [[s v] sets n s]
{(disj s n) (+ v (row n))})
(apply merge-with max)))
Anyone know why or how I can fix it?#2019-02-2209:16oskarkvShould I create an issue?#2019-02-2210:34oskarkvBtw, that was my mistake. I didn't remember that I was using an old local copy of CIDER instead of downloading it fresh.#2019-02-2303:49soulflyer@oskarv Do you mean the emacs freeze on jack-in? I'm still seeing it and I just updated cider.#2019-02-2410:22oskarkvYes.#2019-02-2410:22oskarkvWorks for me now. 😛#2019-02-2410:23oskarkv@U0E3H1J5Q#2019-02-2214:10ghadidoes Clojure mode's indentation use indent-sexp under the hood?#2019-02-2214:13ghadiand does CIDER extend that or use something else?#2019-02-2214:13dpsuttonit looks like it bottoms out into emacs with indent-region#2019-02-2214:13dpsuttonCIDER does have an option to change the notion of top level defun to be (comment (form) (form)) aware#2019-02-2214:15dpsuttonin this file: ;;; indent.el --- indentation commands for Emacs -*- lexical-binding:t -*- but i don't see an indent-sexp in there at all#2019-02-2215:59Michael GriffithsNot sure if it uses indent-sexp specifically but it builds on top of the built-in lisp-mode indentation#2019-02-2223:23yuhanNot sure if this is generally known, but the #1 killer feature with Lispy's clojure integration is being able to evaluate intermediate forms in a threading macro:#2019-02-2515:09eval-on-pointIf you don't mind, what is the keybind/function for this?#2019-02-2701:11yuhanM-x lispy-eval or e at a special position (directly before opening paren / after closing paren)#2019-02-2703:09eval-on-pointThanks I appreciate it#2019-02-2223:24yuhan#2019-02-2223:31yuhanIt would be really great if this could be implemented natively in CIDER!#2019-02-2223:57Chasewhoa, that is a cool feature! how interesting that it comes from this Lispy thing. I thought it was just an alternative to paredit and such.#2019-02-2303:49soulflyer@oskarv Do you mean the emacs freeze on jack-in? I'm still seeing it and I just updated cider.#2019-02-2300:04Michael GriffithsCIDER then extends that if you have cider-dynamic-indentation set to logical true (then it will use :indent or :style/indent metadata from the Clojure environment if possible)#2019-02-2300:04Michael Griffiths(followup to the message about indent-sexp above which didn’t send earlier for some reason)#2019-02-2302:02ChaseI wonder if this is the relevant code for that lispy funcationality: https://github.com/abo-abo/lispy/blob/20ba81d4309c594eb6e2332ff3b2a385ca408b08/le-clojure.el#L382#2019-02-2305:45yuhanIt looks like this is it: https://github.com/abo-abo/lispy/blob/master/lispy-clojure.clj#L458#2019-02-2305:48yuhanlooking at that implementation, there seems to be yet another bug with using (position) to determine context, which can't differentiate between two identical forms in the same macro#2019-02-2313:22Chasewhoa. interesting stuff. Yeah these functions are quite a bit beyond me at this point. That programmer is on a whole other level! He garners a lot of respect in the emacs world for his projects.#2019-02-2316:20richiardiandreaSo I tried the build.sh script in cider-nrepl to try and install a local version in .m2 ... It does MrAnderson stuff but does not really install, am I missing some step?#2019-02-2316:40dpsuttonjust do make install#2019-02-2316:41dpsuttonno idea what that's there for#2019-02-2316:42dpsuttonbut it was last touched in 2015 whereas the makefile is quite recently updated#2019-02-2317:24richiardiandreaOk thank you very much, will try that#2019-02-2317:09vemvHow can I change the version of https://github.com/alexander-yakushev/compliment that CIDER uses?
I might want to try a fork for a while#2019-02-2317:11vemvsilly me 🙂 https://github.com/clojure-emacs/cider-nrepl/blob/master/project.clj
I was searching in cider.el before#2019-02-2317:25richiardiandreaI am doing that exactly :))) it seems like make install should do the right thing in cider-nrepl simple_smile #2019-02-2319:57Joshua SuskaloHey, I just opened an old project for the first time in a while, and I'm getting an exception on repl startup with CIDER where one of the injected middlewares (namely pprint) won't compile, which causes the repl to fail to load.
error in process sentinel: Could not start nREPL server: clojure.lang.Compiler$CompilerException: Syntax error compiling var at (cider/nrepl/middleware/pprint.clj:73:3).
#:clojure.error{:phase :compile-syntax-check, :line 73, :column 3, :source "cider/nrepl/middleware/pprint.clj", :symbol var}
Those are the two lines at the top of the stack trace. I figured this would be an easy fix, I'd just disable the pprint middleware, but I can't find the documentation which would tell me how to do this, and the variables I'm inspecting in emacs don't seem to actually give me the list of middlewares used.#2019-02-2320:24Joshua SuskaloI've tried some more recent projects and it's broken there as well.#2019-02-2320:33dpsuttonWhat version of cider and lein do you have?#2019-02-2320:34Joshua Suskalolein version 2.9.0, cider is 0.18.0snapshot#2019-02-2320:35Joshua Suskalojust using the default cider which is currently in spacemacs develop, and the version of lein in the arch repos#2019-02-2320:38dpsuttonOk. So cider 21 requires lein 2.9.0 and cider 19 and below require lein 2.8.3#2019-02-2320:39dpsuttonSo you'll need to correct one or the other#2019-02-2320:45Joshua SuskaloAlright, thanks. I'll see about updating cider then.#2019-02-2320:48dpsutton👍#2019-02-2323:19dpsuttondoes anyone cider-connect to images running on a docker host? I'm working on a patch to make this a bit easier and wondering what problems you run into. I'm seeing navigation issues because its using the path inside the container rather than the local path. anything else anyone sees?#2019-02-2409:20michalbefore I start digging deeper, anyone here noticed this weird behavior? after jacking-in or connecting to already running nrepl a blank screen shows up (with no usual cider help banner, whatsoever). but seems like it's just incorrectly scrolled, when I press C-l to re-position the buffer everything immediately gets visible - repl prompt, banner, etc.#2019-02-2510:25Michael GriffithsThere were some changes to recentering in the REPL recently – do you have any related config/customisations? Could you share your values for cider-repl-pop-to-buffer-on-connect and scroll-conservatively? (and any other config/customisations related to scrolling if possible?)#2019-02-2510:25Michael GriffithsPossibly this will fix it once merged: https://github.com/clojure-emacs/cider/pull/2599/files#2019-02-2510:49michal@U052B0PT3 sure, here are the values: cider-repl-pop-to-buffer-on-connect is a variable defined in ‘cider-repl.el’.
Its value is t
scroll-conservatively is a variable defined in ‘C source code’.
Its value is 1001
#2019-02-2511:19michalI also applied the patch locally but seems like it doesn't help neither for cider-repl-pop-to-buffer-on-connect t nor for display-only values. initial banner is still scrolled up, out of the screen. I will try to dig deeper.#2019-02-2511:38Michael GriffithsThe cause is definitely https://github.com/clojure-emacs/cider/commit/dc80d871eeacdb1c37434c4b17f9af77968d4c22#2019-02-2511:39Michael GriffithsBut I’m wondering what’s causing the scrolling not to happen on your env (you have the same config as me)#2019-02-2511:39Michael GriffithsThis has been reported now as well: https://github.com/clojure-emacs/cider/issues/2600#2019-02-2511:46michalactually, what works for me is, instead of the patch you pointed to, replace it with what recenter function does. that solves my problem (with help banner on and off): (recenter (- -1 (max 0 scroll-margin)))#2019-02-2514:52Michael GriffithsThat might be the best solution. I removed all the recentering because it was impacting performance (and was mostly redundant because of scroll-conservatively), but doing it once at init isn’t a problem at all#2019-02-2512:31dominicmthe clojurescript.md docs suggest https://github.com/clojure-emacs/cider/blob/62134b4ffa109ddfd143303db929af4760182470/doc/clojurescript.md#L102-L109 but those aren't vars marked as safe, so doing this presents the user with a warning when they open files in the directory.
Is it worth changing them to be marked as safe? I don't think they're actually unsafe, as they don't affect anything until you jack-in, which is inherently an unsafe operation, as I can run arbitrary code on your machine at that point.#2019-02-2512:32dominicmI would assume unsafe is for things like "opening this file could run rm -rf /"#2019-02-2512:34dpsuttonI brought this up a bit ago and I think @bozhidar agreed. And yeah it's super annoying#2019-02-2512:35dominicmthis is about to become the default in edge (https://github.com/juxt/edge/issues/62)#2019-02-2512:35dominicmin the past I have made PRs for this, but I don't use emacs, so I don't run the code or anything before doing so.#2019-02-2512:55dominicmcontroversial question: I want to include something like: (define-key clojure-mode-map (kbd "M-r") (cider-interactive-eval "(dev-extras/reset)")) in the emacs guide, so, what is a good key, and how do I do this properly?#2019-02-2513:35Michael Griffithswell IMO the current keybinds situation is a bit of an untenable mess and there aren’t any good ones left… maybe it would fit in cider-ns-map if it’s conceptually similar to cider-ns-refresh#2019-02-2513:35Michael Griffithscider-ns-map is prefixed C-c M-n by default#2019-02-2513:36Michael GriffithsYou could also recommend customising cider-ns-refresh-before-fn or cider-ns-refresh-after-fn if it makes sense to run reset before/after a tools.namespace reload#2019-02-2513:37dpsuttoni wonder if we could do a pass where we remove lots of keybindings and open up something for users to have a place to assign stuff. I know that I only use like 10 or so keybindings.#2019-02-2514:07dominicm@cichli thanks for the tip, I'm going to add that as a default to the .dir-locals in edge 🙂#2019-02-2514:08dominicmcontroversial: I don't think there should be a keybinding for cider-jack-in-clj&cljs. You do it once a day at most 😛#2019-02-2514:14Michael GriffithsOr a single keybinding for something like cider-jack-in-command, which could be configurable to use either CLJ, CLJS, or both#2019-02-2514:19dominicmyeah, that's a good point#2019-02-2514:19dominicmthere's no reason edge users should have to think about which#2019-02-2514:19dominicmI would like to see a common .dev.edn though, as I have the same problem when launching clj and rebel and vim, etc.#2019-02-2514:20dominicmmaybe something for orchard to discuss#2019-02-2516:05Michael GriffithsIt’s an interesting idea, and we can parse edn in emacs lisp now (not sure about vim though)#2019-02-2516:08Michael GriffithsI had a look at your Edge PR: one other option you could mention or include a default for is cider-repl-init-code. This is a list of strings of code to execute at REPL init – for example you could do:
(add-to-list 'cider-repl-init-code "(dev)")
#2019-02-2516:10Michael GriffithsOr just set it to '("(dev)")#2019-02-2516:24dominicmA default is good. Will do that.#2019-02-2516:25dominicmHow does init code play with cljs jack in?#2019-02-2517:01Michael GriffithsShould run in the Clojure session before the CLJS REPL is started#2019-02-2521:45dominicmI can't seem to do add-to-list in .dir-locals.el#2019-02-2521:46dominicmwell, I could do it with eval, but that will never be marked safe 🙂#2019-02-2521:53dominicmthe repl-init-code isn't working for me 😕#2019-02-2522:13Michael GriffithsAh, there’s a bug, in-ns has no effect in cider-repl-init-code! We ignore ns in the response when we eval it#2019-02-2522:13Michael Griffithsand yeah, I think eval is the only way to do that 😕#2019-02-2522:15dominicmAre you on the bug or shall I report it? :)#2019-02-2522:15Michael GriffithsAt least if you mark it as safe, it only marks the exact form as safe, not eval generally#2019-02-2522:15Michael GriffithsI’m taking a look, thanks though 🙂#2019-02-2522:16dominicmOkay great :)#2019-02-2522:16dominicmMy colleague has been bothering me about this forever, so it will be nice to resolve it#2019-02-2522:57Michael GriffithsPushed [a fix](https://github.com/clojure-emacs/cider/commit/0dea44b460aaa56feedda1ecebeef3b45e49cdf3)#2019-02-2522:58Michael GriffithsYou can parse that markdown manually 😛#2019-02-2606:53dominicmhere's the interesting thing: the cljs repl runs the init code too 🙂 I put the emacs cljs repl function in user, that's okay though 🙂#2019-02-2606:54dominicmthe fix is working though, thanks! 🙂 making that part of edge now#2019-02-2610:03Michael GriffithsProbably best to fully qualify the cljs repl function anyway#2019-02-2610:03Michael GriffithsSince there’s also :init-ns in Leiningen’s :repl-options#2019-02-2610:04Michael GriffithsSo we can’t be sure the initial namespace is user generally#2019-02-2610:05dominicmhmm, I'm noticing a bit of a race condition between cider-repl-init-code and cider-cljs-repl-types I think.#2019-02-2610:05dominicmprobably because both repls are running (require 'dev) simultaneously.#2019-02-2610:08dominicm(locking o (require 'dev))#2019-02-2610:13Michael GriffithsThere is a fn in core for that in 1.10#2019-02-2610:13Michael GriffithsActually it was made private https://github.com/clojure/clojure/commit/ee3553362de9bc3bfd18d4b0b3381e3483c2a34c#2019-02-2610:14Michael GriffithsI’ll see if we can make sure that waits for init to be done first#2019-02-2610:28dominicmI think it's actually that init is called in the clj and pending-cljs repl simultaneously.#2019-02-2610:28dominicmyeah, they made it private. For our needs though having our own locking is fine.#2019-02-2610:54Michael GriffithsYeah you’ll need the locking either way, because of the two simultaneous REPLs#2019-02-2610:54Michael GriffithsBut I’m testing a change that lets the evaluation of cider-repl-init-code finish before proceeding with the rest of connection init#2019-02-2610:55dominicmThat's cool, thanks 🙂#2019-02-2514:08dominicmor even cider-quit.#2019-02-2514:09dpsuttoni think cider-quit is a bit too strong and can sometimes take other existing connections out of cider-mode#2019-02-2514:16Michael GriffithsI haven’t really looked at how clj/cljs sessions are managed since it was moved into a separate library. It’s not an easy problem#2019-02-2518:12richiardiandreais there a way to output all the messages in nrepl if I start it from the terminal? I have seen that there is a PR for verbose logging but I wonder if we have something already in there I am missing#2019-02-2518:20Michael GriffithsMessages as in nrepl requests/responses? In CIDER you can set nrepl-log-messages, but there’s nothing in nrepl itself for that atm#2019-02-2519:09richiardiandrea@cichli ok thanks!#2019-02-2606:32anishHi Everyone, I am using cider with figwheel , to start cider i use cider-jack-in-clj&cljs and choose figwheel#2019-02-2606:32anish#2019-02-2606:35anishIts starts clj cider and then cljs but I see pending-cljs message as it can't connect to cljs cider#2019-02-2606:35anishmy cider-version , 0.21#2019-02-2606:35anish[figwheel-sidecar "0.5.16"]#2019-02-2606:35anish[cider/piggieback "0.4.0"]#2019-02-2606:36anishAm i missing something?#2019-02-2610:09Michael GriffithsIs anything relevant logged in the *nrepl-server ...* buffer? What happens if you try to evaluate something in the CLJS REPL marked pending?#2019-02-2613:01anish@cichli sorry i missed your reply, nREPL server started on port 43689 on host localhost - #2019-02-2613:01anishI dont see any errors#2019-02-2613:07Michael GriffithsAh, I just noticed the Stdin: in the minibuffer. That’s not right#2019-02-2613:07Michael GriffithsCan you try with [figwheel-sidecar "0.5.18"]?#2019-02-2613:08anishtrying#2019-02-2613:16anishthanks @cichli awesome also i had to add :repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}#2019-02-2613:17Michael GriffithsCider should add that automatically if you use cider-jack-in I think. You can check the command it uses in *Messages*#2019-02-2613:17Michael GriffithsGlad it’s working now though 😄#2019-02-2613:18anishcool thanks again 🙂#2019-02-2606:37kommen@anish.developer do you have the cljs app open in a browser?#2019-02-2606:38anish@kommen yeah its open , when app gets connected i get User prompt in cljs#2019-02-2606:40kommenok, sorry, then I don’t know what is wrong here#2019-02-2606:41anishthanks @kommen, its confusing may be I'm missing something#2019-02-2609:06stathissiderisfor deps.edn projects, is there an interactive way to select the aliases before launching a REPL? for now I’m using a .dir-locals file to start my project with the :dev alias but I’d like to be able to add more aliases in some cases#2019-02-2610:06Michael Griffiths@stathissideris try prefixing the jack-in command with C-u#2019-02-2610:06Michael GriffithsI’m planning on merging this soon which makes the UX a bit better https://github.com/clojure-emacs/cider/pull/2586#2019-02-2610:06stathissideris@cichli great, thank you, I’ll try#2019-02-2610:56andrea.crottiI remember that adding a project dependency with cljr-refactor would make that dependency available immediately#2019-02-2610:56andrea.crottiI've tried many times recently and it adds the dependency but it's not available in the existing repl anymore#2019-02-2610:57andrea.crottisomething missing in my set up or it never worked that way maybe and I just dreamed it?#2019-02-2610:58Michael GriffithsPossibly you updated to a newer JDK? I think it doesn’t work on JDK9+ yet#2019-02-2611:00andrea.crottimm ;; Clojure 1.10.0, Java 1.8.0_144#2019-02-2611:00andrea.crottiso no still java 1.8#2019-02-2611:03Michael Griffithshttps://github.com/clojure-emacs/refactor-nrepl/commit/f75441e2bb9f8f47aed221f592a1ac583df4cf1b#2019-02-2611:03Michael GriffithsSeems it’s disabled completely#2019-02-2611:06andrea.crottiah right that's a shame#2019-02-2611:08andrea.crottiit's using alembic though, so maybe I can just do it myself#2019-02-2611:08andrea.crottieven though `Alembic doesn't work anymore and other better solutions are coming down
the line, so this is disabled for now..`#2019-02-2611:08andrea.crottiso I should maybe look at these better solutions 😄#2019-02-2617:11Patrick Winter#2019-02-2617:43Michael GriffithsI assume tcp/start-server is a function, so it only ever sees the value of handler it’s provided, and if -main only runs once, then it will only be provided the value at initial load-time. Reevaluating handler won’t rerun -main#2019-02-2617:44Michael GriffithsYou could instead pass a function that resolves 'socketserver.core/handler and invokes it each time it’s called#2019-02-2617:44Michael GriffithsOr look into https://github.com/clojure/tools.namespace (and the cider-ns-refresh command)#2019-02-2715:50ennI'm struggling to understand this behavior (`cider-repl-use-pretty-printing` is true):#2019-02-2715:50ennclojure.pprint/pprint prints those values very differently. I understand CIDER is using a different pretty-printer now (not sure which one?). But it seems very strange for any pretty printer to print maps and strings indistinguishably.#2019-02-2715:55dpsuttoni can't reproduce#2019-02-2715:56dpsuttoncan you verify that this doesn't happen for you if you (setq cider-repl-use-pretty-printing nil)#2019-02-2716:02dpsuttonalso do (type *1) and make sure it actually is a string?#2019-02-2717:04enn@dpsutton I can confirm it's a string#2019-02-2717:04enn#2019-02-2717:04enntesting w/nil pretty printing now#2019-02-2717:05ennw/nil pretty printing it works as expected:#2019-02-2717:05dpsuttondid you set a specific pretty printer?#2019-02-2717:05dpsuttoni'm using the default and not seeing it. also which cider version?#2019-02-2717:07ennCider 0.19.0. I believe I am using the default. cider-pprint-fn is pprint.#2019-02-2719:41richiardiandreahello! trying to debug an error in my tests in cider-nrepl#2019-02-2719:41richiardiandreathe message I receive is significant, but unfortunately I do not see the stacktace#2019-02-2719:42richiardiandreait is of course wrapped in an nrepl message so I wonder if there is a way to attach the stacktrace of errors as well?#2019-02-2719:42richiardiandreaI see
Message: {:id 2, :msg "clojure.lang.Symbol cannot be cast to clojure.lang.Namespace", :session "fa2fd41b-7660-472e-874c-a7c6eebf6254", :status ["notification"], :type "error"}
#2019-02-2719:42richiardiandrea(new to nrepl debugging 😄)#2019-02-2719:52richiardiandreaok I might have found a hack
(catch Exception e
(let [stack-str (clojure.string/join "\n" (.getStackTrace e))]
(notify-client @debugger-message stack-str #_ (.getMessage e) :error))
false)
my problem specifically is in cider.nrepl.middleware.debug#2019-02-2807:32PiotrGuys just curious, when working with emacs (cider-jack-in) how do you reload the file without restarting the whole nrepl?#2019-02-2807:57mccraigmccraig@piotr.kurnik C-c C-k does it for me#2019-02-2808:03Piotr@mccraigmccraig fantastic this is exactly what I was looking for, thanks!#2019-02-2821:42piotr.owsiakhi guys I have a problem with cider-jack-in it freezes, it worked until very recently#2019-02-2821:42piotr.owsiakthe buffer for the repl contains this error:#2019-02-2821:42piotr.owsiak#2019-02-2821:43piotr.owsiakI suspect this might be related to recent packages update on my Ubuntu 16 but I'm not sure#2019-02-2821:43piotr.owsiakcan anyone help me solve this issue please?#2019-02-2822:07piotr.owsiakok, nevermind, I tried a few things and seems that deleting my .emacs.d/elpa helped#2019-02-2822:08justinbarclaythats great, just out of curiosity did your version of Emacs change at all?#2019-02-2822:08piotr.owsiakno, I'm on 26.1 from some AppImage I found somewhere on the net#2019-02-2822:09piotr.owsiakrecently started learning Clojure with the "Brave" book and it worked and sudden stopped 😕#2019-02-2822:09justinbarclayOk, then thats a little strange for me then, if your version of Emacs changes i know that you need to recompile the packages from elpa#2019-02-2822:10piotr.owsiakthis error "#:clojure.error{:phase :compile-syntax-check, :line 73, :column 3, :source "cider/nrepl/middleware/pprint.clj", :symbol var}" made me think that maybe some file is broken#2019-02-2822:10piotr.owsiakI hope my disk is not dying#2019-02-2822:24Michael GriffithsI think the problem was you were using an older version of CIDER incompatible with the version of Leiningen you have installed. After removing the elpa directory you then redownloaded the newest version#2019-02-2822:25piotr.owsiakbtw. what is the recommended version of Java to run Clojure?#2019-02-2822:45Michael Griffiths8 or 11#2019-03-0105:35markwquick question - when jumping to definition M-. is there a way to avoid being prompted for a symbol? Even when there is a matching definition, I still get a prompt for a symbol where the default is set to the symbol at point, requiring me to press enter every time I try to jump to a definition.#2019-03-0105:41manuelcould it be related to this https://github.com/clojure-emacs/cider/issues/2534 ?#2019-03-0105:50markwI know it’s trivial - but having to prss enter to confirm the default every single time is annoying#2019-03-0105:50markwpossible - but the behavior I get is that the minibuffer displays Symbol: (default "symbolatpoint")#2019-03-0105:50markwso all i have to do is press enter - in the example above it looks like they were getting no default#2019-03-0105:51markwconnection dropped so those sentences are out of order - first one should be last#2019-03-0105:52markwI would expect that M-. would just take you to the symbol at point if there is one, and ask if not. Instead, it asks every time (but pre-fills with the symbol at point as default so I only have to press enter immediately after M-.)#2019-03-0106:10markwFound a similar discussion:
https://github.com/clojure-emacs/cider/issues/1014#2019-03-0106:11markwlooks like C-u M-. does what I want…#2019-03-0107:28dominicmThat's more keys! 😀#2019-03-0109:07Michael GriffithsYou can (setq cider-prompt-for-symbol nil)#2019-03-0109:07Michael GriffithsThen the C-u behaviour is reversed#2019-03-0115:05Per WeijnitzIs there a Cider function to interrupt a long running eval and have it start the debugger at the currently running point in the program where the interrupt occured? cider-interrupt alone does not seem to have this function.#2019-03-0116:31Robert NikanderI see that you can write a macro with {:style/ident ...} metadata to control indentation. But how do you association an indentation spec with a macro that wasn't written with one originally? For example, clojure.algo.monads/domonad.#2019-03-0116:34dpsuttonadd-custom-clojure-indents in clojure-mode#2019-03-0116:45Robert NikanderI looks like it doesn't understand namespaces, but it's better than nothing.#2019-03-0217:50hoppyhi, having some grief jacking in a node repl on raspi. I took what cider tried to do and did it on the comand line, with similar results. Any ideas?#2019-03-0218:15dpsuttonCan you just start up the project without cider? It's saying you've got a bad file some where's#2019-03-0218:31hoppyyes#2019-03-0218:47dpsuttonwhich version of lein are you using?#2019-03-0218:51hoppy#2019-03-0218:51hoppyI'm not sure about "just starting it up", I can build it with cljsbuild if that's what you mean#2019-03-0219:24hoppyalso trying to get there launching lein repl manually and connecting#2019-03-0219:24hoppygetting this: WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!#2019-03-0221:22hoppyI got past this by putting openjdk 11 - something about the arm java from oracle is upset#2019-03-2617:55bozhidar@bfay I’ve just committed to master a fix for that classpath problem. Now it should work properly even without the extra middleware.#2019-03-2617:57bfaywow, that was fast!#2019-03-2618:39bozhidarWell, I had promised a fix for this same problem to @pesterhazy a week ago, so not that fast really. 😄#2019-03-2708:49romainMore related to emacs in general but is there a function to highlight function call? (ex (println "hello"))#2019-03-2708:56bozhidarHighlight how?#2019-03-2709:00romainCurrently the face is the same as arguments. For my usage, I think I'd like to colorize it or might be make it italic#2019-03-2709:01romain@bozhidar btw, thanks for all your amazing work and talks you give 🙂#2019-03-2709:14bozhidar:man-bowing:#2019-03-2709:15bozhidarThe face of function names should become different when CIDER is running and you’ve enabled dynamic font-locking.#2019-03-2709:16bozhidarWithout a running REPL it’s hard to tell wether something is a function name or something else, but once CIDER is running it uses different colours for macros, special forms, core functions and other functions.#2019-03-2709:16bozhidarThe colours themselves can be tweaked, of course.#2019-03-2709:18bozhidar(we are just using the standard faces for functions, built-ins and so on)#2019-03-2709:18bozhidarDoes this make sense?#2019-03-2709:21romainthat's perfect! Indeed defined function and defined var weren't activated#2019-03-2709:25bozhidarYou’re welcome!#2019-03-2709:26bozhidarFor everyone else - you can try (setq cider-font-lock-dynamically t) and see if you like it. (that turns on everything possible)#2019-03-2709:31romainHm it doesn't change anything, I guess I did something wrong.
Edit: oh, it needed some kind of refreshing 😉#2019-03-2711:10pesterhazy@bozhidar will try the fix asap, thanks for this!#2019-03-2717:56NickIs there a way to get cider to stop inserting [clojure.set :as set] in my file? I have a large number of om transactions with the unfortunate prefix of set/ and these keep breaking when clojure.set is required as set#2019-03-2717:56Nickin my file I already have clojure.set required as s#2019-03-2717:58dpsuttonsounds like a clj-refactor issue#2019-03-2717:59dpsuttoni think there's a notion of common imports and you can hopefully prevent it from using that one#2019-03-2718:04dpsuttonhttps://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L74#2019-03-2718:04dpsuttonso that's my guess 🙂#2019-03-2718:04dpsutton@nick.matthews#2019-03-2718:05Nickawesome, thanks, i’ll give that a try.#2019-03-2718:06Nickperfect, that looks exactly like what i’m looking for. Thanks!#2019-03-2721:29stathissiderisis there any way to do something like cider-pprint-eval-last-sexp-to-repl but printing the result in the REPL instead of adding it as input in the REPL?#2019-03-2814:40Ian FernandezHow can I use midje on Cider?#2019-03-2814:48bozhidarhttps://github.com/nubank/emidje#2019-03-2814:57Ian Fernandez=33#2019-03-2814:57Ian Fernandezthanks!#2019-03-2816:44skrathow do I jack-in into deps.edn project such that my test/ source path is loaded? I don't have it in source-paths, however I have it in extra-paths under test alias, as recommended by the official guide#2019-03-2816:44skratthe docs don't say a word on this#2019-03-2816:44dpsuttonuse a prefix argument and you can add in the alias by editing the command. there's also something you can set in your dir locals if its the same every time#2019-03-2816:45dpsuttoncider-clojure-cli-global-options i think#2019-03-2816:46skrat@dpsutton thanks, right, the dir locals sounds interesting, what is it?#2019-03-2816:47dpsuttondir locals allow you to override variables when in buffers in directories. (dir locals name tries to imply this)#2019-03-2816:47dpsuttonthe syntax is a little confusing but check the emacs manual or google it#2019-03-2816:48dpsuttonbut it looks like this
((nil
(cider-docker-translations . (("/root/" . "/Users/dan/") ("/src/" . "/Users/dan/projects/")))))
#2019-03-2816:52skrat@dpsutton cool, anyways, even if I did that, added the test alias with :extra-paths ["test"], set cider-clojure-cli-global-options to -C:test (it indeed changed the command), my test namespace is still not loaded when I hit cider-test-run-ns-tests#2019-03-2816:52dpsuttonwhat is -C ?#2019-03-2816:53skratit's classpath alias https://clojure.org/reference/deps_and_cli#_aliases#2019-03-2816:53dpsuttoncheck in the *Messages* buffer to ensure that your updates were reflected#2019-03-2816:53dpsuttonyou can also (hack-local-variables) to try to get emacs to recognize the new dir locals#2019-03-2816:54dpsutton*Messages* will have a copy of the actual command CIDER used to start up the proejct#2019-03-2816:54skratyeah they were, the jack-in correctly added that -C:test, so that's all right, it's just that it doesn't load the test namespace initially#2019-03-2816:54skratand most likely doesn't reload#2019-03-2816:55skratI'm not sure what I'm doing#2019-03-2816:55skratwhat's the workflow supposed to be? 🙂#2019-03-2816:55dpsuttonwelcome to the club 🙂#2019-03-2816:55dpsuttonwhat are you trying to accomplish? running your tests with CIDER?#2019-03-2816:56dpsuttonmaybe try one thing? delete the cpcache or whatever clj makes. i've heard we might have some issues with that#2019-03-2816:56skratyeah#2019-03-2818:13bozhidarI can only say that if the jack-in command looks right to you than the classpath should be properly set, as this comes straight from clj/lein/boot/whatever someone is using.#2019-03-2818:14bozhidarDo you see the relevant directories in the classpath browser?#2019-03-2819:47stathissideris@bozhidar hello! many thanks for cider! is there any way to do something like cider-pprint-eval-last-sexp-to-repl but printing the result in the REPL instead of adding it as input in the REPL?#2019-03-2819:56bfayUpdated my cider package and just tried the remote nrepl thing I was having trouble with yesterday (with the classpath op thing).
It's seems to be working perfectly now, thanks for the change! 🔥🔥💯🔥🔥#2019-03-2907:01bozhidar@bfay Happy to hear this!#2019-03-2907:03bozhidar> @bozhidar hello! many thanks for cider! is there any way to do something like cider-pprint-eval-last-sexp-to-repl but printing the result in the REPL instead of adding it as input in the REPL?#2019-03-2907:04bozhidar@stathissideris Do you want just the result printed there? Or you want the form added and the result printed?#2019-03-2907:05stathissideris@bozhidar just the result please #2019-03-2907:18bozhidarThose two come to mind:#2019-03-2907:18bozhidar["Eval last sexp to REPL" cider-eval-last-sexp-to-repl]
["Eval last sexp and pretty-print to REPL" cider-pprint-eval-last-sexp-to-repl]
#2019-03-2909:55stathissideris@bozhidar cider-pprint-eval-last-sexp-to-repl inserts the result as an expression in the prompt, not above it (or below it)#2019-03-2909:56stathissiderisso I mean it’s printed as input, not as output#2019-03-2910:13bozhidarI don’t think we have something to just display eval results in the REPL, but that’s certainly doable. Why do you need something like this? Won’t it be a bit hard to follow as results would have appeared out of nowhere?#2019-03-2910:16conanHi lovely people, do any of you have a .dir-locals.el file that you use for a combined clj/cljs tools.deps project that you'd be prepared to share with me? i'm not an Emacs user (shoo! shoo!) but I'm trying to set up a build that will work happily with cider jack-in for my colleagues, so i'd really appreciate the help. Thanks!#2019-03-2910:19dominicmThe edge one is pretty advanced at this point, that's the one I'd recommend#2019-03-2910:21conanoh cool, i didn't realise there was one in there#2019-03-2910:23conando you have a link by any chance? i'm basically trying to learn the syntax#2019-03-2910:25dominicmhttps://github.com/juxt/edge/blob/master/lib/edge-app-template/resources/clj/new/app.template/dir-locals.el this is the pre-generated one, you'll have to resolve the mustache manually 🙂#2019-03-2910:29conanyeah, that's fine =D
i saw this, but i guess it's not exactly what i'm after, as it contains (what i understand to be) only a single, global configuration section, whereas i'm after an example with separate clojure-mode and clojurescript-mode sections - or to find i'm barking up the wrong tree?#2019-03-2910:31conanthe long-term thing i'd like to learn is how to set up a clj/cljs project that works for all ides without any custom configuration for each, which means now i need to understand what the custom configuration actually does.#2019-03-2910:32dominicmI think you're barking up the wrong tree#2019-03-2911:34conanhaha, ok thanks, that's good to know!#2019-03-2911:46dominicmI don't understand what you're looking for with clojure-mode and clojurescript-mode sections, there's nothing to really put in a .dir-locals.el related to them afaik. The bulk of what a cider user is looking for is making jack-in work, after that they want cljs-jack-in to work.#2019-03-2916:33conantrying to apply a different profile when kicking off jack-in for clojure and clojurescript#2019-03-2916:34conani'll fully admit i don't really know what jack-in is exactly#2019-03-2917:42dominicmjack-in is done to create a single JVM, so the settings have to be shared between them#2019-03-2917:43dominicmJack-in is about starting a JVM with the right dependencies loaded.#2019-03-2910:26stathissideris@bozhidar The workflow I’d like to try is type long multi-line expressions in a .clj file and eval+pretty-print their results in the REPL where the results accumulate. I saw that something similar would be possible with getting the results in a popup buffer, but I prefer to see a “log” of results. If the inputs are also shown (as you said it may be a bit hard to follow otherwise) I think it would be even more usable, but I’d be happy with just the outputs#2019-03-2910:54plexusHow do I tell CIDER again not to take over *out* and *err*? My google fu is failing me...#2019-03-2910:56plexusI'm starting my nREPL outside of Emacs, and I want all output to go to that terminal, instead of to the *cider-repl* buffer#2019-03-2911:00plexusfound it I think, cider-redirect-server-output-to-repl#2019-03-2911:00plexusthere's no substitute for grepping the source 🙂#2019-03-2911:50bozhidar@plexus Yep, that’s the magic option.#2019-03-2911:53bozhidar@stathissideris Got it. It makes sense to me, so I’d suggest filing a ticket about this so I won’t forget to look into it.#2019-03-2911:53bozhidar> I saw that something similar would be possible with getting the results in a popup buffer,#2019-03-2911:54bozhidarYeah, I’m thinking we can probably add another option for the result destinations. I’d be wary of adding dedicated commands for something like this.#2019-03-2912:43orestisI would love the workflow that @stathissideris is talking about. If you are tweaking data, it’s very helpful to have a history that you can just scroll back and see.#2019-03-2913:23stathissideris@bozhidar @orestis https://github.com/clojure-emacs/cider/issues/2617#2019-03-2913:27dpsuttoncan you get this with the insert commands?
> if the eval'ed expression is also added as if it was typed in the prompt of the REPL
check out the map under C-c C-j for the insert commands#2019-03-2913:29dpsutton(setq cider-switch-to-repl-on-insert nil)
(setq cider-invert-insert-eval-p t)
#2019-03-2913:31dpsuttonthese 1) prevent jumping to the repl buffer on insert and 2) eval it rather than wait for more input#2019-03-2913:34stathissiderishaven’t seen these before, reading docs…#2019-03-2913:37stathissideris@dpsutton that would actually cover my use case exactly! but I don’t seem to have cider-switch-to-repl-on-insert#2019-03-2913:37dpsuttoni think that's new#2019-03-2913:37stathissiderisI’m on CIDER 0.21.0 (New York)#2019-03-2913:38dpsuttonthe current one is cider-switch-to-repl-after-insert#2019-03-2913:41stathissiderisworks! with a slight problem: it seems that if cider-switch-to-repl-after-insert-p is true, the REPL scrolls to the end of the result, if it’s nil it doesn’t 🙂#2019-03-2913:43stathissideristhanks @dpsutton, I’ll see if I can script it to scroll somehow (didn’t know about the insert commands)#2019-03-2913:56bozhidarEven I had forgotten about those two options. 😄#2019-03-2914:15dpsuttoni remember working on something like this#2019-03-2914:16dpsuttonhttps://github.com/clojure-emacs/cider/pull/2590#2019-03-2914:19dpsuttonthere were subleties of buffer focused, visible, etc#2019-03-3101:25bherrmannblarg! cider-jack-in (latest cider, jdk1.8, latest clojure)
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate nrepl/middleware/pr_values__init.class or nrepl/middleware/pr_values.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(cider/nrepl.clj:1:1)
#2019-03-3101:32dpsuttonWhich version of lein?#2019-03-3101:39yuhanI'm getting the same error too in a deps.edn project since upgrading to latest version of cider#2019-03-3101:40yuhanproblem seems to be the change in cider-latest-middleware-version#2019-03-3101:41yuhanbumping it back down to "0.21.2-SNAPSHOT" solved the error#2019-03-3101:42bherrmannits a deps.edn project..#2019-03-3101:43bherrmannWhen I run the command that emacs/cider says it is running, aka
$ /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2019-03-3101:43bherrmannI get the same error,#2019-03-3101:44bherrmannException in thread "main" Syntax error compiling at (cider/nrepl.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7647)
at clojure.lang.RT.loadResourceScript(RT.java:381)
....
Caused by: java.io.FileNotFoundException: Could not locate nrepl/middleware/pr_values__init.class, nrepl/middleware/pr_values.clj or nrepl/middleware/pr_values.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
#2019-03-3109:30bozhidarHmm, I did push a new snapshot on cider-nrepl a day ago, but there were no changes there that seem related to this problem.#2019-03-3109:31bozhidarIn particular pr_values was already removed for a couple of months already.#2019-03-3109:36bozhidarI wonder if something’s wrong with the build in general. It’s the first one using the new MrAnderson 0.5, but on the other hand you’re getting the error for something that’s not even inlined.#2019-03-3110:23benedekseen the issue @bozhidar will have a look later today#2019-03-3119:57benedekthe cider.nrepl ns in that snapshot jar looks very outdated. no idea how could that happen. was this a manual build or CI produced?#2019-03-3120:05bozhidar@benedek - Manual build, done with make deploy.#2019-03-3120:07benedeksorry for asking the obvious. are you sure you run that from the right dir?#2019-03-3120:07benedeknot some old backup or something?#2019-03-3120:07bozhidarmake deploy master
lein inline-deps
Retrieving thomasa/mranderson/0.5.1-SNAPSHOT/mranderson-0.5.1-20190329.105340-3.pom from clojars
Retrieving thomasa/mranderson/0.5.1-SNAPSHOT/mranderson-0.5.1-20190329.105340-3.jar from clojars
project prefix: cider.nrepl.inlined-deps
retrieve dependencies and munge clojure source files
in RESOLVED-TREE mode, working on a resolved dependency tree
[cljs-tooling "0.3.1" :exclusions [[org.clojure/clojure]]]
[compliment "0.3.8" :exclusions [[org.clojure/clojure]]]
[cider/orchard "0.5.0-20190329.191815-1" :exclusions [[org.clojure/clojure]]]
[org.clojure/java.classpath "0.3.0" :exclusions [[org.clojure/clojure]]]
[org.tcrawley/dynapath "0.2.5" :exclusions [[org.clojure/clojure]]]
[fipp "0.6.15" :exclusions [[org.clojure/clojure]]]
[org.clojure/core.rrb-vector "0.0.13"]
[org.clojure/tools.trace "0.7.10" :exclusions [[org.clojure/clojure]]]
[cljfmt "0.6.4" :exclusions [[org.clojure/clojure] [org.clojure/clojurescript]]]
[com.googlecode.java-diff-utils/diffutils "1.3.0"]
[org.clojure/tools.cli "0.3.7"]
[rewrite-clj "0.6.0"]
[rewrite-cljs "0.4.4"]
[mvxcvi/puget "1.1.0" :exclusions [[org.clojure/clojure]]]
[mvxcvi/arrangement "1.1.1"]
[org.clojure/tools.namespace "0.3.0-alpha4" :exclusions [[org.clojure/clojure]]]
[thunknyc/profile "0.5.2" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.reader "1.2.2" :exclusions [[org.clojure/clojure]]]
#2019-03-3120:07bozhidarPretty sure about this. 🙂#2019-03-3120:08bozhidarThe deps here match those in HEAD.#2019-03-3120:11benedekrun make clean && make install jar has to OK looking cider.nrepl in it#2019-03-3120:11benedekno reference to pr-values#2019-03-3120:12benedekan other weird thing i noticed with the snapshot in question: it has a src dir in it#2019-03-3120:13benedekwhich maybe has the right version of stuff in it?! looks weird… something went wrong when this was built. what about just trying to deploy a new one maybe?#2019-03-3120:15bozhidarThat’s what I just did.#2019-03-3120:15bozhidarDid make clean and make deploy again and it seems that this time it’s ok.#2019-03-3120:16bozhidarPerhaps the previous one got messed up because I didn’t do clean after updating MrAnderson. I don’t know what exactly went wrong, but it seems we’re back in business now.#2019-03-3120:17benedekgood, i’ve also seen you already upgraded to 0.5.1-snapshot of MrAnderson. brave move 😉#2019-03-3120:17dpsuttoni just ran make install and i seem to have a src file in the built jar#2019-03-3120:17benedek?!#2019-03-3120:17dpsutton...
drwxrwxrwx 0 31-Mar-2019 15:08:48 src/
drwxrwxrwx 0 31-Mar-2019 15:08:48 src/cider_nrepl/
-rw-rw-rw- 2136 31-Mar-2019 15:08:48 src/cider_nrepl/main.clj
-rw-rw-rw- 4377 31-Mar-2019 15:08:48 src/cider_nrepl/plugin.clj
drwxrwxrwx 0 31-Mar-2019 15:08:48 src/cider/
drwxrwxrwx 0 31-Mar-2019 15:08:48 src/cider/nrepl/
-rw-rw-rw- 1035 31-Mar-2019 15:08:48 src/cider/nrepl/version.clj
-rw-rw-rw- 2777 31-Mar-2019 15:08:48 src/cider/nrepl/print_method.clj
#2019-03-3120:17dpsuttonthis is just a bit of it#2019-03-3120:19benedekso what is the difference between me running it and you running it is the big Q#2019-03-3120:20benedeksame if you run make clean before? — should not have an effect either tho…#2019-03-3120:20dpsuttoni have two copies it seems. everything at cider/nrepl/ and src/cider/nrepl/#2019-03-3120:20dpsuttoni did not do a clean before but i'll do it now and rebuild#2019-03-3120:20benedekthat is what i am seeing in the broken snapshot jar too#2019-03-3120:23dpsuttonlein 2.9.1 on fedora 29.#2019-03-3120:25dpsuttoninterestingly (frustratingly?) a lein clean and rebuilding seems to have fixed it#2019-03-3120:25benedekalso i run make install without clean this time. result seems to be ok#2019-03-3120:27dpsuttonso seems like the first build is busted and subsequent ones are fine?#2019-03-3120:28dpsuttonstrange. there's a top level project.clj in the jar with (defproject mvxcvi/arrangement "1.1.1"#2019-03-3120:28benedekthat is just MrAnderson weirdness. should not cause any probs#2019-03-3120:28benedeki mean the project.clj#2019-03-3120:31dpsuttoni can successfully jack in with my installed cider-nrepl#2019-03-3120:31bherrmannThis seems spooky... I tried changing nrepl {:mvn/version "0.6.0"} to *nrepl {:mvn/version "0.6.0-SNAPSHOT"} and it started up fine, now the spooky bit#2019-03-3120:31dpsuttondid you update cider?#2019-03-3120:32bherrmannwhen I change it back to "0.6.0" it starts up fine. (without the -SNAPSHOT)#2019-03-3120:32dpsuttonit starts up or doesn't start up?#2019-03-3120:32dpsutton@bozhidar pushed a change to make CIDER use the 21.2 snapshot. perhaps you have that change?#2019-03-3120:32bherrmannI was using outside of cider, $ /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
#2019-03-3120:33dpsuttonah#2019-03-3120:34dpsuttonoh. i think he also deployed again so it should be fixed#2019-03-3120:35bherrmannHuh... $ mv ~/.m2 ~/m2.huh
$ /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
Error: Could not find or load main class clojure.main
$ clojure
Downloading: org/clojure/clojure/1.10.0/clojure-1.10.0.pom from
Downloading: org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.pom from
Downloading: org/clojure/pom.contrib/0.2.2/pom.contrib-0.2.2.pom from
Downloading: org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.pom from
Downloading: org/clojure/clojure/1.10.0/clojure-1.10.0.jar from
Downloading: org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar from
Downloading: org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar from
Clojure 1.10.0
user=> ^D
$ /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
Exception in thread "main" java.io.FileNotFoundException: Could not locate nrepl/cmdline__init.class, nrepl/cmdline.clj or nrepl/cmdline.cljc on classpath.
#2019-03-3120:37bherrmannOdd, that it didnt download the packages that it needs#2019-03-3120:39benedekin other news will very likely release MrAnderson 0.5.1 tmrw first thing#2019-03-3120:39bherrmannIn that vein, if I remove "-SNAPSHOT" from the cider-nrepl,
$ /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
Downloading: nrepl/nrepl/0.6.0/nrepl-0.6.0.pom from
Downloading: nrepl/nrepl/0.6.0/nrepl-0.6.0.jar from
Error building classpath. Could not find artifact cider:cider-nrepl:jar:0.22.0 in central ()
#2019-03-3120:40bherrmannoh, I see MrAnderson is supposed to bundle stuff, so this resolution isnt needed.#2019-03-3120:40dpsuttonyes there is no 0.22.0. it is in development there has been no release#2019-03-3120:40bherrmannhuh, so it is an oversight that cider runs with that on the command?#2019-03-3120:41dpsuttoni don't follow. CIDER should never reference 0.22.0 non-snapshot#2019-03-3120:42dpsuttondoes it currently?#2019-03-3120:45bherrmannHumm... Seems I mistakingly installed "CIDER 0.22.0snapshot (package: 20190329.1924)"#2019-03-3120:45bherrmannI presume I do not want a snapshot version.#2019-03-3120:47bherrmanncider is an installed package.
Status: Installed in ‘cider-20190329.1924/’ (unsigned). Delete
Version: 20190329.1924
Summary: Clojure Interactive Development Environment that Rocks
Requires: emacs-25, clojure-mode-5.9, pkg-info-0.4, queue-0.2, spinner-1.7, seq-2.16, sesman-0.3.2
Homepage:
Keywords: languages clojure cider
Other versions: 20190302.114 (installed), 20190329.1924 (melpa).
#2019-03-3120:48dpsuttonup to you. the snapshot version has the chance for breakages (as seen today) but if no one uses it then the melpa-stable version just shifts the risk to everyone rather than volunteers who run the melpa (snapshot) version#2019-03-3120:49dpsuttonie, if no one beta tests, then everyone beta tests#2019-03-3120:51bherrmannok, then I guess I'm wondering then, why does cider have a snapshot mvn dependency#2019-03-3120:52bherrmannoh, I didnt show that.#2019-03-3120:52dpsuttonpresumably you are running the melpa (not melpa-stable) version so you are in the snapshot version#2019-03-3120:53dpsuttoni wish the names were inverted. ie, melpa and melpa-beta or something but it is what it is#2019-03-3120:56bherrmannJust to be clear, when I execute from emacs, "cider-jack-in", emacs puts this in Messages
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.io.FileNotFoundException: Could not locate cider/nrepl__init.class, cider/nrepl.clj or cider/nrepl.cljc on classpath.
So you can see then that the "melpa" (snapshot) version of CIDER is asking for a "0.22.0-SNAPSHOT" -#2019-03-3120:56bherrmannis that legit? or a bug?#2019-03-3120:59dpsuttonseems legit#2019-03-3120:59bherrmannoh I see ( I read up on SNAPSHOT and maven), snapshot in maven speak means always fetch the latest.#2019-03-3120:59bherrmannbut you also said 0.22.0 has never been released#2019-03-3120:59dpsuttondue to this: https://github.com/clojure-emacs/cider/blob/master/cider.el#L405#2019-03-3121:00dpsuttonthe way its released is while you are creating 0.22.0 you release 0.22.0-SNAPSHOT and then once you are happy with it you release the 0.22.0 artifact#2019-03-3121:00dpsuttonso there can be versions of 0.22.0-snapshot while you work on it and it changes and then a single 0.22.0 release#2019-03-3121:01dpsuttonreplace snapshot with "beta" "preview" or "test" in your head and it should make sense.#2019-03-3121:26bherrmannok, I dropped back to melpa-stable - for today anyway. And all is right with the cider-jack-in#2019-03-3121:26bherrmannThanks @dpsutton!!!!! 🙂#2019-04-0107:21bozhidarI think we’re back in business with 0.22.0-SNAPSHOT of cider-nrepl. Hopefully this first build with the new MrAnderson was some isolated incident.#2019-04-0108:07bozhidar> i wish the names were inverted. ie, melpa and melpa-beta or something but it is what it is#2019-04-0108:08bozhidarHistorical reasons - originally there was only MELPA and it was for snapshots. MELPA Stable was born much later after some users asked for it. I don’t think it was something the original creator of MELPA ever envisioned. Afterwards you’re bound by backwards compatibility. 🙂#2019-04-0109:33benedek@bozhidar shall i close the my PR then or you still want the other project file changes apart from the version upgrade?#2019-04-0109:34bozhidar@benedek Just rebase it and I’ll merge it. I had changed just the version number.#2019-04-0109:35benedekok, good. will do#2019-04-0109:57tianshuwith recent cider updates, sometimes when launched, cider will prompt for Lisp expression:, and close cider will raise an error error in process sentinel: Wrong type argument: stringp, nil. is there anyone run into the same issue?#2019-04-0110:01bozhidar@doglooksgood Make sure you’re using the latest cider-nrepl snapshot. There was one bad build that made it to clojars over the weekend.#2019-04-0110:03tianshucan I refresh the snapshot by remove the one in .m2?#2019-04-0110:08tianshulooks like it works! thanks! @bozhidar#2019-04-0110:08bozhidarYou’re welcome!#2019-04-0110:32tianshucider 0.22.0 use cider-nrepl 0.21.1, this is not a snapshot version.#2019-04-0110:40yuhanhow do I prevent the cider debugger from trying to fully realize lazy sequences?#2019-04-0110:40yuhan(let [n 5]
#dbg
(take (inc n) (repeat n)))
#2019-04-0110:41yuhanthis hangs indefinitely trying to evaluate (repeat n)#2019-04-0110:42yuhanwhereas eg. cider-eval on an infinite sequence doesn't have that issue#2019-04-0112:28alexyakushevHave anyone experienced problems with running tests in latest CIDER?#2019-04-0112:28alexyakushevThe test runner sometimes just hangs#2019-04-0112:28alexyakushevjstack shows this. Can it be related?#2019-04-0112:29alexyakushev"nRepl-session-6d174f6f-fb70-42ca-be1b-8742ba9f97ec" #1394 daemon prio=5 os_prio=31 tid=0x00007fea4a089800 nid=0x2445b waiting for monitor entry [0x0000700008eef000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.io.PrintWriter.println(PrintWriter.java:738)
- waiting to lock <0x000000064f731640> (a java.io.BufferedWriter)
at com.sun.tools.javac.util.Log.printRawLines(Log.java:528)
at com.sun.tools.javac.util.Log.writeDiagnostic(Log.java:622)
at com.sun.tools.javac.util.Log$DefaultDiagnosticHandler.report(Log.java:600)
at com.sun.tools.javac.util.Log.report(Log.java:562)
at com.sun.tools.javac.comp.Resolve.logResolveError(Resolve.java:3514)
at com.sun.tools.javac.comp.Resolve.accessInternal(Resolve.java:2219)
at com.sun.tools.javac.comp.Resolve.accessBase(Resolve.java:2262)
at com.sun.tools.javac.comp.Resolve.accessBase(Resolve.java:2272)
at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:2383)
at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3170)
at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:576)
at com.sun.tools.javac.comp.Attr.attribType(Attr.java:638)
at com.sun.tools.javac.comp.Attr.attribType(Attr.java:631)
at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:649)
at com.sun.tools.javadoc.JavadocMemberEnter.visitVarDef(JavadocMemberEnter.java:103)
at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:437)
at com.sun.tools.javac.comp.MemberEnter.signature(MemberEnter.java:385)
at com.sun.tools.javac.comp.MemberEnter.visitMethodDef(MemberEnter.java:581)
at com.sun.tools.javadoc.JavadocMemberEnter.visitMethodDef(JavadocMemberEnter.java:75)
at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:778)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:437)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:449)
at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:459)
at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1404)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1199)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:493)
at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
at com.sun.tools.javadoc.JavadocEnter.main(JavadocEnter.java:78)
at cider.nrepl.inlined_deps.orchard.v0v5v0_20190329v191815_1.orchard.java.parser$parse_java.invokeStatic(parser.clj:81)
#2019-04-0112:35bozhidar@alexyakushev I haven’t seen any problems myself yet, but I don’t think there were any changes related to tests between the previous middleware snapshot and the current one.#2019-04-0112:36bozhidarLooking at the commits almost nothing has changed https://github.com/clojure-emacs/cider-nrepl/commits/master#2019-04-0112:37alexyakushevThanks. It might be because I launched C-c C-t C-t once, then it seemingly hanged (put perhaps were working too slow) so I C-c C-b to cancel it and then launched again.#2019-04-0112:37bozhidarI’m actually surprised to see anything related to Javadoc in your stacktrace. Pretty weird.#2019-04-0112:37alexyakushevI guess the first test run didn't complete but was blocking some shared resource.#2019-04-0112:37bozhidarHmm, that use case you described should be fine (at least in theory).#2019-04-0112:39alexyakushevAlright, I'll try to make something reproducible if it happens again.#2019-04-0114:05soulflyerI'm having trouble with connecting to nrepl in a docker version of our project. Usually I use cider-jack-in and that works fine, but with the docker version I have to do a cider-connect so nrepl isn't getting injected automatically. I put [nrepl "0.6.0"] in the project file (and my profiles.clj!) but when I connect I'm getting
WARNING: CIDER requires nREPL 0.4.4 (or newer) to work properly
More information.WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!
More information.
Then lots of messages like this in the minibuffer
error in process filter: user-error: ‘nil’ requires the nREPL op "classpath" (provided by cider-nrepl)
cider-describe-connection tells me I'm running nrepl 0.2.12 even after deleting nrepl from .m2 and doing a lein deps to pull down 0.6.0. ! I have no idea where it's getting that version from. Any idea what I must do to get it to use 0.6.0?
(cider version is 20190331, just updated and tried again..)#2019-04-0114:14bozhidar@soulflyer What’s your lein there?#2019-04-0114:14bozhidarI’d venture a guess it’s older than 2.8.3.#2019-04-0115:01soulflyer2.9.0#2019-04-0115:03dpsuttonare you sure that's the version of lein inside docker?#2019-04-0115:13soulflyerfacepalm No, that's the version in my home environment.....#2019-04-0115:17dpsutton👍#2019-04-0116:19Nick Staresif I run cider-jack-in-clj with a deps.edn in the root directory it can't find the project and asks to continue without one. What am I missing?#2019-04-0116:37dpsuttoncouple things to check. you can walk through cider-project-type to see what's going on. make sure clojure-project-dir reports the correct project directory. there's a cache that can get busted so restart emacs and make sure clojure-cached-project-dir is nil in the buffers.#2019-04-0116:41Nick StaresI can't find cider-project-type or clojure-project-dir with M-x describe-variable. Where can I find these?#2019-04-0116:41dpsuttonthose are functions#2019-04-0116:42dpsuttonfrom CIDER and clojure-mode respectively#2019-04-0116:46Nick Stares😅 Didn't see them as interactives so I assumed they were variables#2019-04-0116:48Nick StaresYeah, cider-project-type is clojure-cli but clojure-project-dir is nil. How should it be set?#2019-04-0116:57dpsuttoncan you step through clojure-project-dir? it ends up in clojure-project-root-path looking up the directory tree for one of the project files#2019-04-0117:06Nick StaresOk, first time using step through in emacs debugger, but it gets to a point where while running locate-dominating-file it runs * mapcar(#f(compiled-function (fname) #<bytecode 0x443ce435>) ("project.clj" "build.boot" "build.gradle")) .. conspicuously no deps.edn#2019-04-0117:08dpsuttonnice! those come from clojure-build-tool-files var which makes me think you need to update your clojure-mode#2019-04-0117:09dpsutton(defcustom clojure-build-tool-files
'("project.clj" ; Leiningen
"build.boot" ; Boot
"build.gradle" ; Gradle
"build.gradle.kts" ; Gradle
"deps.edn" ; Clojure CLI (a.k.a. tools.deps)
"shadow-cljs.edn" ; shadow-cljs
)
is my version. what does yours look like?#2019-04-0117:10Nick Stares(defcustom clojure-build-tool-files '("project.clj" "build.boot" "build.gradle")
"A list of files, which identify a Clojure project's root.
Out-of-the box `clojure-mode' understands lein, boot and gradle."
:type '(repeat string)
:package-version '(clojure-mode . "5.0.0")
:safe (lambda (value)
(and (listp value)
(cl-every 'stringp value))))
#2019-04-0117:10Nick Staresclojure-mode-display-version gives version 5.7.0-snapshot)#2019-04-0117:11dpsuttonlooks like i'm on 5.10. but just update that so its nows about the new project file type adn you should be good#2019-04-0117:13Nick StaresAwesome, that worked! Glad I didn't get the 'just update your version' response and that I learned a bit more about clojure-mode and emacs debugger 🙂#2019-04-0117:14dpsuttonwell... had i known that was the problem i wuld have said that lol#2019-04-0117:15dpsuttonbut its good to know how to step through stuff. because i didn't know where that stuff was but i have to tools to figure out where it is. and now you do too 🙂#2019-04-0117:59dpsutton@soulflyer i see your message on mobile but not on teh desktop. i recently fixed a bug in cider-nrepl. does the project stipulate a clojure version below 1.8 and uses a supported clojure version above 1.8 in a profile?#2019-04-0118:00dpsuttonthe cider plugin can erroneously decide not to inject the ~guts~ middleware#2019-04-0118:11soulflyerNot sure what you mean there. project.clj specifies clojure 1.9 in the dependencies and that's what cider-describe-connection shows. As far as I know there is nothing in the profiles specifying any other version of clojure. Certainly not in project.clj or my own .lein/profiles.clj.#2019-04-0118:12dpsuttonok. its not related then. but my example was like nippy, where the dep is 1.5 or so in the dependencies and in the dev profile clojure 1.9 is specified#2019-04-0118:12dpsuttonbut i would still start up the project where you can observe the output and see if cider-nrepl is logging anything#2019-04-0118:21soulflyerI guess that means modifying the docker setup as that is where the nrepl server gets started. Not sure how to go about doing that.#2019-04-0118:29soulflyerwill try tomorrow. Thanks for your help @dpsutton#2019-04-0201:33soulflyerJust a thought, is it possible to "inject the middleware" by hand, after connecting to the repl?#2019-04-0201:53dpsuttonWithout docker you can try just cranking up cider with the same command cider jack in would use. I think you'll see some output if you do this from the command line#2019-04-0202:46soulflyerAh-ha! cider-jack-in is adding cider/nrepl to the plugins. Not sure why, I don't have it in the project file, only nrepl/nrepl in dependancies. But... changing the startup command from lein repl :headless to lein update-in :plugins conj \[cider/cider-nrepl\ \"0.21.2-SNAPSHOT\"\] -- repl :headless lets it start ok. Now I get the clj-refactor warning but I can live with that. 😁#2019-04-0202:57dpsuttonHa. That was the error it was giving you#2019-04-0202:57dpsuttonCider requires cider nrepl for the good bits#2019-04-0203:09soulflyerI think I have been getting confused between cider/nrepl and cider-nrepl. The first is deprecated, but we still need the second, yes?#2019-04-0203:35dpsuttonThere's tools.nrepl which is deprecated and nrepl/nrepl 0.6.0 which replaces it. Cider/cider-nrepl are the nrepl middleware for cider which allows it to do all of it's fancy bits#2019-04-0209:49Arthurhello guys!
I have just switched from linux to macos and have noticed that cider debug is incredibly slow comparing to ubuntus…does someone has the same problem? is it possible to fix it somehow?
Thank you!!#2019-04-0213:14tianshuafter a long time use, when I close the cider connection, still get the error
[nREPL] Connection closed
error in process sentinel: nrepl-send-sync-request: Wrong type argument: stringp, nil
error in process sentinel: Wrong type argument: stringp, nil
at this moment, the nrepl process will not be quit, If I kill the buffer with C-x k, will get the error
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server:
error in process sentinel: Could not start nREPL server:
If I start cider again, it will prompt for Lisp expression:#2019-04-0214:30bozhidar@doglooksgood Errors in the process sentinel are not very descriptive. Without a more specific stack trace I have no idea what went wrong for you.#2019-04-0214:43dpsuttonyou can see if there are any messages in *Messages* or can try to start from the command line using the same command cider uses and see if there are any obvious errors#2019-04-0216:13ghadihow do I prevent cider from slurping URLs?#2019-04-0216:17dpsutton(setq cider-repl-use-content-types nil) i think#2019-04-0216:21dpsuttonalthough the knob may have been removed now that i'm looking through it#2019-04-0216:22ghadiseems to have done the trick#2019-04-0216:22dpsutton👍#2019-04-0216:22ghadithanks!#2019-04-0217:19bozhidarIt’s not removed, although at some point we’ll have to actually fix the underlying problem. 🙂#2019-04-0217:26dpsuttonwe should probably make it opt-in rather than opt-out#2019-04-0217:26dpsuttonwhile we think about a fix#2019-04-0217:31ghadiit can be a security problem to automatically deref URLs#2019-04-0217:46dpsuttonYeah. Images are fine. Arbitrary urls not good#2019-04-0223:37cheppreyquestion on cljs + shadow-cljs + cider-nrepl tooling setup...#2019-04-0223:38cheppreyI've previously gotten Emacs + Cider + regular Clojure (not cljs) all up and running for my 1st ever Clojure project. I went with Emacs since I had some experience with it 25 years ago. Anyhow, I got the jist of REPL development.#2019-04-0223:38cheppreyNow I'm trying Clojurescript, to implement the client-side of my little learning project. FWIW I'm trying the "Learn Reagent Free" course at https://www.jacekschae.com (free plug). WELL...#2019-04-0223:39cheppreyI'm having trouble getting the REPL going in this setup. The online course supplies the basic config files, so most of what I have was provided.#2019-04-0223:39cheppreyI modified shadow-cljs.edn and added the cider-nrepl dependency.#2019-04-0223:40cheppreyUsing the npm run dev command, it spins up shadow-cljs and starts up nREPL on port 3333.#2019-04-0223:40cheppreyI run cider-connect and give localhost / 3333, and emacs/Cider connects to the REPL. GREAT. The problem (or my confusion) starts here:#2019-04-0223:40cheppreydoing any sort of "eval" of any forms, buffers, or anything in Emacs seems to just... do... nothing.#2019-04-0223:40cheppreyI can enter expresions in the REPL buffer (+ 3 4) yields 7, so the REPL is there. But it doesn't seem "connected" to any of my .cljs files or anything.#2019-04-0223:41cheppreySo i'm just kinda lost.#2019-04-0223:41cheppreyAnother point: when I was just doing Clojure, I used cider-jack-in to start the REPL. With this shadow-cljs it seemed I had to use cider-connect; perhaps this line of thinking is wrong & is the problem?#2019-04-0223:41cheppreyWhen I try to do cider-jack-in, Emacs gives the error The npx shadow-cljs executable isn't on your 'exec-path'#2019-04-0306:23bozhidarI think the approach with cider-connect is the simplest one. You just need to select cider-connect-cljs, and upgrade the new REPL to a shadow-cljs REPL. I started playing with this tutorial myself and that’s what I did.#2019-04-0310:57manuelFWIW this is how I do it: https://manuel-uberti.github.io/programming/2018/11/14/deps-shadow-cljs/#2019-04-0701:50cheppreyHUZZAH thank you @U051BLM8F and @U4TE22XR8 very much, got a repl going.#2019-04-0702:22cheppreyThe hint (and my mistake) was the "upgrade it to a shadow-cljs REPL". After cider-connect-cljs, I was skipping the important step of specifying "shadow" as the type. Then after that it wanted to know which shadow "build" to use, then it informed me that the browser wasn't up and running (a browser Reload cured that), then after that it all seemed to connect up. Thank you very much. My journey unto Cljs SPAs begins at last!#2019-04-0805:54manuelglad it worked 🙂#2019-04-0310:54tianshu@bozhidar I'll open debug on error, when met the error again, I can give the trace.#2019-04-0311:01alexyakushevWeird behavior that I've been seeing for a while and it continues: if I'm connected to multiple projects, and then I disconnect from one, the buffers that are still connected to other project lose cider-mode. I have to re-enable it in every buffer manually. Does anyone know a remedy?#2019-04-0407:17yuhanI thought this was an isolated thing on my end too!
Dug a little into this by putting a trace on the cider-mode function: this seems to originate from the call to (delete-process) inside (cider--close-connection), which somehow disables cider-mode for all buffers. Not sure why/how that would happen though.#2019-04-0515:08yuhanFound the culprit: cider-disable-on-existing-clojure-buffers and cider-enable-on-existing-clojure-buffers which are run during the repl's connected and disconnect handlers#2019-04-0515:09yuhancommenting those function calls out solves the issue, I wonder why they were there in the first place?#2019-04-0311:03manuelhappens to me too#2019-04-0311:26orestisOh, happens to me too. I always shrugged it thought I did something wrong.#2019-04-0312:07bozhidarThat definitely sounds like a bug to me. Probably some hook triggers disabling cider-mode in all Clojure buffers.#2019-04-0314:44liammccombesHi - I’m having some trouble with cider-connect. My workflow is that I start my app from the command line, using lein-ring, by invoking lein ring server-headless, then use cider-connect to connect to the process. This worked in the past, but now when I run cider-connect, I get the error message
15:40:42.549 ERROR: Unhandled REPL handler exception processing message {:op describe, :session c5b63de3-8573-422a-9fc0-6c4ad08923fe, :id 3} {}
java.lang.ClassCastException: clojure.lang.Var cannot be cast to java.lang.String
along with a stacktrace. any hints on how I can go about debugging what’s wrong?#2019-04-0316:13bozhidarWhat’s the stacktrace?#2019-04-0408:50liammccombeshttps://pastebin.com/eZKfZ2FL#2019-04-0320:06Robert NikanderAnyone use speedbar? I add symbols to a clojure file and they are not showing up in the speedbar, even when I re-eval the file.#2019-04-0321:03frozenlockHello! Is there something to do to enable pprint in a cljs repl?#2019-04-0321:12bozhidarIt’s enabled by default in CIDER 0.20+.#2019-04-0321:12bozhidarIt doesn’t matter what type of REPL are you using.#2019-04-0321:12frozenlockHmmm.. I must have messed up something 😕#2019-04-0321:13frozenlockbrb, I'll restart emacs just to be sure#2019-04-0321:13bozhidarhttp://www.cider.mx/en/latest/pretty_printing/#2019-04-0321:19frozenlockStill printing everything on one line :thinking_face:#2019-04-0321:22richiardiandrea@frozenlock just a note that I haven't seen pretty printing working in shadow-cljs#2019-04-0321:23frozenlockI'm in figwheel-main#2019-04-0321:23frozenlockSo maybe it's cljs related#2019-04-0407:17yuhanI thought this was an isolated thing on my end too!
Dug a little into this by putting a trace on the cider-mode function: this seems to originate from the call to (delete-process) inside (cider--close-connection), which somehow disables cider-mode for all buffers. Not sure why/how that would happen though.#2019-04-0402:18yuhanbumping my previous question here about Cider debugger:#2019-04-0402:18yuhanhow do I prevent the cider debugger from trying to fully realize lazy sequences?
(let [n 5]
#dbg
(take (inc n) (repeat n)))
this hangs indefinitely trying to evaluate (repeat n)
whereas eg. cider-eval on an infinite sequence doesn't have that issue#2019-04-0405:48bozhidar@qythium I’ll have to take a look at the code to be sure, but I assume the debugger might be doing a sync eval would be stuck forever once the result starts coming.#2019-04-0407:10yuhanThanks, I thought it might be something obvious I was missing, but it sounds more like a bug - will file an issue on the Cider repo sometime later 🙂#2019-04-0405:49bozhidar@malabarba would know better if he’s around.#2019-04-0405:49bozhidar> @frozenlock just a note that I haven’t seen pretty printing working in shadow-cljs#2019-04-0405:50bozhidar@richiardiandrea But the printing logic is independent from ClojureScript, so I can’t imagine how this won’t be working. We get the value from ClojureScript, but we pretty-print it in Clojure.#2019-04-0405:50bozhidarIf there’s really some problem with this someone should file a ticket.#2019-04-0415:03richiardiandreaOk i quali try to take the time and do it#2019-04-0405:51bozhidarBtw, a few random updates from me https://metaredux.com/posts/2019/04/03/meta-reduce-volume-2019-0.html#2019-04-0409:41alexyakushevcider-nrepl's stacktrace op has became freakishly slow.#2019-04-0409:41alexyakushevSome stacktraces take as long as 5-10 seconds to render.#2019-04-0409:42alexyakushevI profiled it to discover that most cost is paid for resolving each frame to a Java class/method.#2019-04-0409:42alexyakushevIs this all really necessary, or is it possible to cut down some of that?#2019-04-0409:51bozhidar@alexyakushev I don’t remember to be honest. We have barely touched it since it’s initial version. And I don’t recall any recent changes that’s why I’m puzzled by your observation that it has suddenly become very slow.#2019-04-0409:52alexyakushevDigging deeper, looks like it is connected to the fact this is a Java/Clojure project, and orchard has some special rules to when not to cache internal Java classes.#2019-04-0409:53alexyakushevI have many internal classes on the stacktrace, and they are being parsed over and over.#2019-04-0409:53alexyakushevI'll try to do something about this case#2019-04-0409:58bozhidarI was just about to cut a new Orchard release, so now is a good time to tackle this.#2019-04-0409:58bozhidarI have no memory of why we decided to handle the internal classes differently.#2019-04-0410:12alexyakushevBy the way, that could be the reason why my tests were hanging the other day.#2019-04-0410:13alexyakushevThe tests were failing with exceptions and there were ~100 of them, so CIDER was probably busy rendering the stacktraces.#2019-04-0410:20alexyakushevhttps://github.com/clojure-emacs/orchard/pull/47#2019-04-0410:46bozhidar@alexyakushev Check out the new cider-nrepl snapshot.#2019-04-0421:11alexyakushevYes, thanks, seems to be working.#2019-04-0421:11alexyakushevI finally had to restart the REPL 🙂#2019-04-0507:48bozhidarIt happens from to time even to the best of us. 😉#2019-04-0508:25Dmytro BuninIs there a way to overwrite a function from clojure core in cider-repl? Like I am using a (:refer-clojure :exclude [throw]) but when I call throw later it is still being called as the clojure.core/throw#2019-04-0512:04oskarkvI'm getting
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval1836$fn__1837 to method java.net.URLClassLoader.addURL(java.net.URL)
when jacking-in. Does anyone know what this is about?#2019-04-0512:43okhow to kill all background threads created with core.async running in REPL? now status bar shows 4 = slithering...#2019-04-0512:47okC-c many times worked...#2019-04-0523:03hoppywaking up to this: Caused by: java.lang.RuntimeException: Unable to resolve var: cider.piggieback/wrap-cljs-repl in this context#2019-04-0523:03hoppyany ideas?#2019-04-0523:05hoppy#2019-04-0806:22bozhidar@hoppy Hard to say without the full stacktrace.#2019-04-0808:02yuhandealing with serious Java interop for the first time.. is there any way to get info about class constructors etc.?#2019-04-0808:06jumarreflect may be useful; see https://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure
I sometimes use something like this:
(->> (clojure.reflect/reflect "") :members (sort-by :name) (clojure.pprint/print-table [:name :flags :parameter-types :return-type]))
#2019-04-0808:06jumarWhere you replace "" with your object.#2019-04-0808:07yuhanhmm, so there's nothing built into Cider's tooling that helps with this?#2019-04-0808:20yuhaneg. when cursor is in
(java.awt.Dimension. )
I'd like the minibuffer to show something like
java.awt.Dimension.: ([] [^int width ^int height] [^java.awt.Dimension d])
#2019-04-0808:21yuhancurrently having to switch back and forth between the online documentation, I'm surprised this doesn't exist in some way#2019-04-0808:03yuhaneldoc just says [args*] and cider-doc doesn't show anything useful#2019-04-0808:20yuhaneg. when cursor is in
(java.awt.Dimension. )
I'd like the minibuffer to show something like
java.awt.Dimension.: ([] [^int width ^int height] [^java.awt.Dimension d])
#2019-04-0810:40alexyakushev@qythium You can also inspect the class, it will list the constructors and methods#2019-04-0810:45alexyakushev@bozhidar @cichli I become progressively more annoyed with how the recent changes to printing/recentering in the REPL buffer behave. My scroll-conservatively is set to 101 by the way. Are you sure this feature is properly baked? I would rather opt out of this, to be honest.#2019-04-0810:55alexyakushevLook how after the pause the cursor will not to scroll the new output. This happens if the first output moves the previous prompt precisely to the beginning of the screen.#2019-04-0811:39yuhanYeah I realise I can inspect everything via reflection, the question was more about the editor integration#2019-04-0811:41yuhaneg. Cider already shows variadic class method arglists using Eldoc, so extending that to constructors shouldn't be that much of a stretch?#2019-04-0816:07bozhidar@alexyakushev I haven’t tested the fallback to the old behaviour to be honest, so I can’t really say. For me the new default always worked reasonably well.#2019-04-0816:07bozhidarI’d suggest filing a ticket for this, as I’m pretty busy this week, so I won’t be able to debug this soon.#2019-04-0816:07bozhidar> eg. Cider already shows variadic class method arglists using Eldoc, so extending that to constructors shouldn’t be that much of a stretch?#2019-04-0816:08bozhidarI thought we had already done this. If not - it shouldn’t be hard.#2019-04-0816:09alexyakushev> I’d suggest filing a ticket for this, as I’m pretty busy this week, so I won’t be able to debug this soon.
It just seems to me that problems like this one, and the one I had before, are ducttape-patched, so they will keep on showing.#2019-04-0901:55TreyIs there a function that can take a region selection and wrap it in a let that provides values for the free references?#2019-04-0901:55Trey(str x y z) -> (let [x nil y nil z nil] (str x y z))#2019-04-0901:56Trey(in emacs/cider)#2019-04-0902:26dpsuttonI made one for when you are debugging#2019-04-0902:26dpsuttonBut not in general. It uses the debugger state and not a one off lexical analysis#2019-04-0902:44dpsutton(defun cider-debug-create-local-let (start end)
"During debugging, grab the locally bound vars and create a let
binding. Place this let binding in the kill ring for future use."
(interactive "r")
(if cider--debug-mode-response
(nrepl-dbind-response cider--debug-mode-response (locals)
(let* ((code (buffer-substring-no-properties start end))
(bindings (apply #'append locals))
(formatted-bindings (mapconcat 'identity bindings " ")))
(kill-new (format "(let [%s]\n %s)" formatted-bindings code))
(message "copied let form to kill ring")))
(message "No debugging information found.")))
#2019-04-0908:41benedekthere is also introduce let in clojure mode as a refactoring feature. does not do exactly what you asking for tho#2019-04-0909:43manuelA weird thing has been happening lately with a deps.edn/shadow-cljs project I am working on. This is what I do:
- shadow-cljs watch my-project from the command line
- C-c C-x j j to bring up a Clojure REPL
- M-x cider-connect-sibling-cljs
All I get is: user-error: ClojureScript is not available. See for details#2019-04-0909:44manuelClojureScript is available though, because I can compile and watch the project via shadow-cljs with no problem.#2019-04-0909:56manuelNote also that I can bring up the CLJS REPL without a problem if connect to shadow-cljs nREPL via M-x cider-connect and don't do a Clojure jack-in.#2019-04-0910:48manuelAnd another note: if I connect to shadow first and then I Clojure jack-in, I get 2 working REPLs (CLJ+CLJS).#2019-04-0912:01bozhidar> ClojureScript is available though, because I can compile and watch the project via shadow-cljs with no problem.#2019-04-0912:01bozhidarThere’s a simple classpath check for this. Depending on your setup it might have failed resulting in this message.#2019-04-0912:05manuelI see, although I don't understand while connecting to shadow-cljs before jacking-in with Clojure works fine.#2019-04-0912:08bozhidarNot sure how the classpath looks exactly in your case. CIDER simply does a check for clojurescript-something.jar being there.#2019-04-0912:09bozhidarI’ve added this in the past as some people were trying to run ClojureScript REPLs without having clojurescript as a dependency and were getting weird errors then.#2019-04-0912:09manuelok, thanks. I'll check the classpath and see if something's wrong there.#2019-04-0912:18bozhidarThere’s a similar discussion here - https://github.com/clojure-emacs/cider/issues/2308#2019-04-0913:11dominicmThe check should attempt a require really#2019-04-0913:23bozhidarThat was my original plan, but for some reason I thought the classpath check would be simpler and faster to do (because it didn’t require code evaluation). Obviously I was wrong. 🙂#2019-04-0913:24bozhidarI also wanted to check the version of some libs and there was no generic way to do this via evaluation. But I definitely agree that’s a better course of action.#2019-04-0914:16dominicmReliability matters more than speed#2019-04-0918:22keymonehi, somebody help me understand evaluation mechanics in cider#2019-04-0918:22keymonei have a clj buffer opened and am jacked-in-to a regular clj nrepl#2019-04-0918:23keymonewhen i cider-eval-last-sexp of a (def something …) it works (i see the output in the buffer)#2019-04-0918:23keymonebut when i then try to access it - i get an error that symbol is undefined#2019-04-0918:23dpsuttonwhat does "access" it?#2019-04-0918:24keymonelike, i type \something\ in the next line and try to cider-eval-last-sexp it#2019-04-0918:24dpsuttonin a source buffer?#2019-04-0918:24keymoneyes#2019-04-0918:24dpsuttonor the repl#2019-04-0918:25keymonei think i also don’t understand disconnect between evaling things in source buffer and in the repl#2019-04-0918:25keymonebut the error i get in source buffer#2019-04-0918:26dpsutton#2019-04-0918:26dpsuttoni did this. eval'd the (def x 3) and then eval'd x#2019-04-0918:27keymoneah#2019-04-0918:27keymonei get it#2019-04-0918:27keymonei’m in evil mode#2019-04-0918:27keymoneso the caret is on the last ) not after it and it evaluates stuff inside (def …) not the def itself#2019-04-0918:28keymonefacepalm#2019-04-0918:28dpsuttonyes you need to evaluate the def, not the expression you will use as teh def#2019-04-0918:28keymoneyeah#2019-04-0918:28keymonethere must be some trick people use in evil mode#2019-04-1020:50bfay@U0FU2H117 I'm not sure what other folks do for this, but personally I have semicolon bound to cider-eval-sexp-at-point.
I actually put the cursor on the beginning of the thing I want to eval, rather than at the end.
I'm pretty convinced that this is the best thing ever and everybody should do it but nobody else seems very impressed when I show them.#2019-04-1020:51bfayIf you happen to be using spacemacs and you want to try it out, I defined it putting these two lines in my .spacemacs file, inside dotspacemacs/user-config
(evil-define-key 'normal clojurescript-mode-map ";" 'cider-eval-sexp-at-point)
(evil-define-key 'normal clojure-mode-map ";" 'cider-eval-sexp-at-point)
#2019-04-0918:29dpsutton¯\(ツ)/¯#2019-04-0918:29yuhanyou might want to set evil-move-beyond-eol to t#2019-04-0918:29keymonei’ll head to noobs channel 🙂#2019-04-0918:30keymonethanks! that worked#2019-04-0918:31yuhanyep, personally I never got used to eval-ing at the "end" of a sexp#2019-04-0918:32dpsuttonthere's eval top level defun#2019-04-0918:32yuhanI have my own wrapper function that lets me eval from the beginning of one#2019-04-0918:33keymonewhat if top level is not defun? :^)#2019-04-0918:33dpsuttonthat doesn't matter. its just the terminology. it should be "top level form"#2019-04-0918:33keymoneah ok#2019-04-0918:33keymonemy top level form is (comment) 🙂#2019-04-0918:33dpsuttonah#2019-04-0918:33dpsuttongot you covered#2019-04-0918:34dpsutton(setq clojure-toplevel-inside-comment-form t)#2019-04-0918:34keymoneoh wow#2019-04-0918:34keymonethere’s a variable for everything#2019-04-0918:35keymonethanks!#2019-04-0918:35keymonethis channel is the most helpful so far#2019-04-0918:37yuhancheck this out too:
(define-clojure-indent
(comment (lambda (&rest r) 0))
#2019-04-0918:38yuhankinda non-standard but you get to comment forms out without worrying about changing the indentation and producing huge diffs#2019-04-0918:48keymonesweet#2019-04-1003:28zlrthhow do i look into speeding up cider-debugger? stepping through operations that have to do with data structures with thousands of items is taking seconds and seconds#2019-04-1009:01alexyakushevI'm not sure, but that slowness could be from the debugger trying to print the structure, not from the evaluation being slower#2019-04-1009:02alexyakushevYou could try to work around that by manually placing #dbg tags that don't target those big structures instead of compiling the whole function in debug mode.#2019-04-1009:03alexyakushevOr you can go past them with h, however that is not always reliable from my experience.#2019-04-1010:10bozhidarYou can always limit the print length in the configuration and that will probably speed up things. Using the inspector from the debugger might be another option that can help.#2019-04-1010:45yuhanWhich configuration option would that be? I opened an issue about a similar thing a few days ago, the debugger trying to fully realize intermediate sequences#2019-04-1011:35zlrththanks alexyakushev--i forgot about #dbg! that will help.
bozhidar: i wonder if i'm experiencing something related to what yuhan is. just now i set my print-length to 1, and debugging is just as slow.
yuhan: thanks. i thumbs-upped your issue; i can reproduce it. https://github.com/clojure-emacs/cider/issues/2621#2019-04-1015:42Robert NikanderM-x fill-paragraph in a function docstring seems to ignore the fill-column variable. Anyone know how to choose the width of your comment text?#2019-04-1100:33mikerod@rob704 fill-paragraph works for me. #2019-04-1107:12Robert Nikander@mikerod Are you setting a buffer-local fill-column to something different from the default? And is it using that value? I have it at 100, but it's using the original value of 70.#2019-04-1113:45mikerodYes. I have it set to 100 as well#2019-04-1109:52bozhidar@qythium See https://metaredux.com/posts/2019/04/01/new-york-new-york.html#2019-04-1111:32yuhanhmm, I read that post and tried playing around with the variables, however the cider debugger doesn't seem to take any of it into account#2019-04-1111:34yuhan(setq cider-repl-init-code "(set! *print-length* 10)")
(setq cider-print-quota 10) ;; bytes
#2019-04-1111:35yuhanand evaluating normal forms does indeed cut off at 10 elements / 10 bytes#2019-04-1111:35yuhan(let [n 100]
#dbg
(range n))
but the debugger still prints out the full 100 elements#2019-04-1114:58zlrthsame for me #2019-04-1111:40yuhan(setq cider-print-options '(("length" 10))) and changing the print-fn to fipp didn't change anything either#2019-04-1114:56bozhidarGuess we messed something up then. File a ticket, please.#2019-04-1116:16yuhandoesn't this fall under the same issue I previously filed?
https://github.com/clojure-emacs/cider/issues/2621#2019-04-1206:54bozhidarAh, I forgot about this. Unfortunately I had no time at all for CIDER in the past couple of weeks, so I haven’t really looked into any of the recent tickets.#2019-04-1207:48RisettoI have trouble getting cider to work in a certain project I'm working in. I made a stackoverflow post about it, but maybe a github issue would be better suited#2019-04-1207:48Risettohttps://stackoverflow.com/questions/55645756/cider-connect-to-already-running-repl-with-figwheel#2019-04-1313:08weavejesterI’m trying to start a custom Clojurescript REPL in CIDER, but it doesn’t appear to do anything. My guess is that it’s hanging in some way. I’ve tried running the same command in cider-cljs-repl-types in a Leiningen REPL, and it starts up and hooks into the browser correctly. Are there any logs or ways of debugging this? There’s nothing in *messages*.#2019-04-1313:13weavejester(Incidentally, thanks for adding in documentation for how to override cide-cljs-repl-types with .dir-locals.el)#2019-04-1315:02weavejesterOh, interesting. When I use cider-connect-cljs on an existing REPL, I get a “pending” cljs REPL, though it’s one that actually works. So I need to tell CIDER somehow that the REPL is ready.#2019-04-1315:05weavejesterAh, that was solved just by adding in dependencies to cider-nrepl.#2019-04-1315:06weavejesterSo this is odd: when I copy the Leiningen startup line directly from *messages*, run it in a terminal, then connect with cider-connect-cljs, everything works.#2019-04-1315:06weavejesterBut if I use cider-jack-in-cljs it just hangs.#2019-04-1316:26weavejesterAh, it has to do with whether Emacs already has a nREPL process running. If they’re siblings, it seems to have a problem.#2019-04-1316:40weavejesterMight be a known issue. Okay, looks like I’ll need to use cider-connect instead, as cider-jack-in doesn’t seem to like two processes for the same project.#2019-04-1321:24weavejesterIs there a way of forcing a command to happen in the Clojure REPL? If I’m editing a cljs file, is there a way of telling cider-ns-refresh to refresh the clj parts of my project?#2019-04-1321:25weavejesterAh, maybe with-current-buffer…#2019-04-1321:32weavejester(with-current-buffer (cider-current-repl 'clj)
(cider-ns-refresh))
#2019-04-1321:32weavejesterPerfect 👍#2019-04-1321:36genmeblogmy turn 🙂 when I eval (println "something\nanything") result is properly printed in the REPL buffer. Is there any way to print to comment in the clj buffer instead?#2019-04-1321:39genmeblog"something\nanything"
;; => "something\nanything"
(with-out-str (println "something\nanything"))
;; => "something\nanything\n"
;;
;; I need:
;; something
;; anything
#2019-04-1411:03agile_geek@tsulej I think you need cider-pprint-eval-last-sexp-to-comment (bound by default to, take a deep breath, C-c C-v C-f C-c C-e... phew!)#2019-04-1411:04genmeblogit prints result of the evaluation not *out*#2019-04-1411:05agile_geek(with-out-str (print "something\nanything"))
;; => something
;; anything
#2019-04-1411:05agile_geekyou can't avoid the mapping out to string#2019-04-1411:05genmeblogwell... I believe I tried it yesterday...#2019-04-1411:05agile_geekotherwise it just evals to nil#2019-04-1411:06genmebloglet me check 🙂#2019-04-1411:06agile_geekYou may have tried cider-eval-defn-to-comment#2019-04-1411:07agile_geekwhich maintains the \n characters but again the pprint needs to be eval'ed to a string for this to work#2019-04-1411:08agile_geekThere's no way I know of to get the results of out to a comment without wrapping out to convert it to a string using with-out-str#2019-04-1411:10genmeblogI have no problem with wrapping but unfortunately I'm getting the following:#2019-04-1411:10genmeblog(with-out-str (print "something\nanything"))
;; => "something\nanything"
#2019-04-1411:11genmeblogmaybe I have some parameters set up. Cider used: [cider/cider-nrepl "0.21.2-SNAPSHOT"]#2019-04-1411:12genmeblogCIDER 0.22.0snapshot (package: 20190331.2014)#2019-04-1411:12agile_geekOdd I get the result above#2019-04-1411:12genmeblogYour result gives me a hope 🙂#2019-04-1411:13agile_geekWhat version of cider areu on#2019-04-1411:13genmeblog^ above#2019-04-1411:13genmeblogwhat is yours?#2019-04-1411:15genmeblogI'm sure it worked month ago, so maybe latest version of cider broke the thing#2019-04-1411:18agile_geekmines 0.18.0 still#2019-04-1411:19genmeblogok, I'll issue a ticket then#2019-04-1411:20genmeblogor investigate changes: https://cider.readthedocs.io/en/latest/pretty_printing/#2019-04-1411:38genmeblogok, achieved it by making this:
(set! nrepl.middleware.print/*print-fn* (fn [v o]
(binding [*print-readably* nil]
(print-method v o))))
#2019-04-1411:38genmeblogany easier way to do this? maybe @bozhidar#2019-04-1511:30benedekmorning, i have this faint memory (maybe was just dreaming about it?!) that there was some talk/plans already to integrate kaocha with cider? can anyone point me to a blog post, github issue or the like? (posted this in #kaocha too)#2019-04-1515:57bozhidarWe might have discussed this, but certainly no work has been done in this direction.#2019-04-1515:58bozhidarUnfortunately the list of our ideas greatly outpaces our ability to deliver upon them. 😄#2019-04-1516:28benedekindeed. that said would love some feedback on https://github.com/clojure-emacs/refactor-nrepl/issues/195#issuecomment-482895570#2019-04-1516:29benedeknot sure if this is worthy to work on anymore… or if this is the right direction even.. anyways… may just give this a proper a go to see where it leads…#2019-04-1516:35bozhidar@benedek Looking at clj-kondo, I’ve been thinking it’d be much easier (and way more portable) to just use rewrite-clj to generate the AST.#2019-04-1516:36bozhidarIt won’t be as precise as using tools.jvm, but it’s so much simpler and doesn’t involve evaluating the code.#2019-04-1516:36bozhidarI think something like this should be the direction for us, as everything else is too complicated IMO.#2019-04-1516:37bozhidarBtw, on the client-side now we also have the option to use the native elisp parseclj library.#2019-04-1516:56benedekyeah i might end up writing an analyzer but does feel like an easy option ;)#2019-04-1516:58benedeki use rewrite-clj in mranderson now but still a long way from there to an analyzer which can give is global and local vara#2019-04-1516:58benedekvars#2019-04-1517:11benedekseen borkdude's tweets and announcements about clj-kondo will check it out more in depth#2019-04-1517:14bozhidarI’ve yet to check the exact AST format, but I assume we can figure out most locals and globals with simple heuristics. I’d rather have a simple runtime-independent solution that works well most of the time, than a very complex solution that works all of the time.#2019-04-1517:17benedekwe agree on that one#2019-04-1517:18benedekbit like joker i suppose in the sense that you explicitly need to teach it your custom macros if they add defs#2019-04-1517:18benedekif i understand right#2019-04-1517:20bozhidarYeah, but I think that’s perfectly fine.#2019-04-1517:20bozhidarIt’s the only way to avoid having to expand the macros anyways.#2019-04-1517:21bozhidar(or you can annotate macros with some metadata, which would be my preferred approach)#2019-04-1517:21dpsuttonCoworker of mine made an lsp server#2019-04-1517:21bozhidarWhat did he use for the static analysis?#2019-04-1517:22dpsuttonNot sure. Let me dig it up#2019-04-1517:24dpsuttonClj-rewrite it seems from looking at the reps#2019-04-1517:28benedekok so there may be quite a bit of proof out there proving that it can be done#2019-04-1517:33benedekis this public repo @dpsutton?#2019-04-1517:34dpsuttonYes. On mobile but GitHub user is snoe #2019-04-1517:34dpsuttonClosure lsp #2019-04-1517:34benedekcheers#2019-04-1519:06benedekthis is really interesting @dpsutton thanks for mentioning it.#2019-04-1519:07dpsuttonI use it at work. It’s been very nice. Refactoring, reference navigation, etc#2019-04-1519:14benedekit says it has find usages etc on tin.#2019-04-1519:15benedekreally impressed so far#2019-04-1519:15benedeki will deffo try it#2019-04-1519:15benedekyou don’t really need cider as a fronted for such a thing, right?#2019-04-1519:17dpsuttonNope#2019-04-1519:17dpsuttonIts lacking eldoc which I rely on a lot but otherwise pretty good#2019-04-1519:17benedeki mean lsp-mode is the frontend i assume#2019-04-1519:17dpsuttonYes#2019-04-1519:17dpsuttonThere are some config info for emacs in the reader#2019-04-1519:18dpsuttonRead me#2019-04-1519:18benedekyup seen that#2019-04-1519:20benedekthis is really exciting actually. this is a direct competitor of cider — if such a thing exists in open source terms 😉#2019-04-1519:26dpsuttonIt needs a good layer to wrap up the refactoring commands#2019-04-1519:26dpsuttonIt has some threading rewriting stuff#2019-04-1520:55bozhidarLSP is likely going to be become a big deal for every language in the years to come.#2019-04-1520:56bozhidarFor Lisps is a bit weird to running tooling outside the REPL (at least for me it’s weird), but LSP makes a lot of sense in general.#2019-04-1520:56dpsuttonyes. and also might drastically lower the barrier for newcomers. CIDER is fantastic but if someone just grabs an lsp-aware editor and is up and running that is a good thing for sure#2019-04-1520:56bozhidarYeah, although I guess this would mean less people on Emacs as well. 🙂#2019-04-1520:56ghadisnoe/lsp can benefit from being dynamic instead of driven by file analysis#2019-04-1520:57richiardiandreaagree with the Ghadi lsp is just a protocol after all#2019-04-1520:57richiardiandrealike nRepl#2019-04-1520:58bozhidarWell, it you can implement it in terms of a running REPL, that’s true.#2019-04-1520:58richiardiandreaI guess that if it even makes sense, there could be a REPL-driven mode with static analysis backup#2019-04-1520:59richiardiandreawell...I don't know what could happen if the two clash though 😄#2019-04-1521:00dominicmI disagree that tooling should be "good enough". I want tooling that is reliable so I don't have to swear every time I cut a finger on a sharp edge.
"Great, now my completion doesn't work because I'm using a macro".#2019-04-1521:00ghadithe LSP server should be embedded within the repl application#2019-04-1521:00ghadinot separate. Other langs need the separation, but we don't#2019-04-1521:01dpsuttonthe author, case, is my coworker and is more than happy to have contributors#2019-04-1521:01ghadicool! @dpsutton thank him for me#2019-04-1521:02dpsuttoni will pass that along. do you use it?#2019-04-1521:02bozhidarWell, at some point I suggested an LSP server which simply proxies to an nREPL server (or whatever). That’s how I would have done it, but in general for me LSP doesn’t really add much value to our existing setup.#2019-04-1521:02ghadino, but we looked at it in relation to REBL#2019-04-1521:02richiardiandrea@bozhidar yes that's the way to go imho#2019-04-1521:03dpsuttoni think he will be quite pleased to hear that#2019-04-1521:03bozhidarThere are 0 technical limitations to doing the static analysis directly from a REPL-powered tool, I just never liked tools analyzer and the need to evaluate the source files to build the AST.#2019-04-1521:04ghadiyou can override the need to evaluate in tools.analyzer#2019-04-1521:06ghadiwhat do we need to analyze, btw? get position context for better autocompletion?#2019-04-1521:07bozhidar@ghadi No, we need some AST for things like find usages, replace var, etc.#2019-04-1521:08bozhidarIt’s also useful for linting purposes - e.g. getting arity warnings without the need to run a separate lint tool, etc.#2019-04-1521:09bozhidarGenerally find & replace are the most important usages as far as I’m concerned. Unfortunately they can’t be reliably implemented without analyzing the entire project.#2019-04-1521:09ghadiah, cool#2019-04-1521:15bozhidarAnyways, I really hope we’ll do more on the static analysis front one way or another soon.#2019-04-1521:16bozhidarAs for LSP - that’s not something I’m particularly interested myself (at least with respect to Clojure), but I’m happy to see progress on that front and I hope someone will do an nREPL backed LSP server implementation at some point.#2019-04-1522:32Ian Fernandezbci#2019-04-1605:53benedekthis kinda boils down to eval or not eval#2019-04-1605:55benedekand i tend to agree that not eval is the way with the caveat that a not evaling backend needs to do a lot to be complete, reliable (in @dominicm terms)#2019-04-1605:56benedeki was possibly not clear when comparing this to cider. the real edge here is the not evaling analyzer#2019-04-1606:20benedeki might give this rewrite-clj based analyzer a go#2019-04-1606:21benedeksee you guys in 3 months :)))#2019-04-1610:11yuhanIs there some sort of configuration to control the (pretty) printed representation of records? In particular I'd like to abbreviate the full namespace name as it tends to take up a lot of horizontal space#2019-04-1610:13yuhaneg. (ns some.arbitrary.deeply.nested.namespace)
(defrecord Foo [bar1 bar2])
(defrecord Bar [bar])
(->Foo
(->Bar [1 2 3])
(->Bar [4 5 6]))
;; => #some.arbitrary.deeply.nested.namespace.Foo{:bar1 #some.arbitrary.deeply.nested.namespace.Bar{:bar [1
;; 2
;; 3]},
;; :bar2 #some.arbitrary.deeply.nested.namespace.Bar{:bar [4
;; 5
;; 6]}}
#2019-04-1610:14yuhanit makes the actual content of the maps very hard to make out#2019-04-1610:36benedekplayed with clojure-lsp a bit. seems to be working fine together with cider actually. eg. without jacking in it gives you go to definition, find usages, rename and joker like linting. pretty nice#2019-04-1610:37benedekhttps://github.com/snoe/clojure-lsp/issues/27 is annoying tho, and should be a small fix really#2019-04-1610:37benedekbasically means that you can’t jump into dependencies which i do all the time#2019-04-1610:47benedeknot quite sure how to run the refactorings, this executecommand thing is a bit cryptic#2019-04-1610:51benedekthat jar thing maybe was fixed yesterday by https://github.com/snoe/clojure-lsp/commit/24ebfa6f591e1f8bb80aac191c6adb635497bf77 i am not sure…#2019-04-1613:58cddrI've recently started seeing "No linked cider session" when I try to inspect the stacktrace of an error.
emacs version: GNU Emacs 26.0.90 (build 1, x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911)) of 2017-10-11
cider-version: CIDER 0.22.0snapshot (package: 20190302.114)#2019-04-1614:01bozhidar> Is there some sort of configuration to control the (pretty) printed representation of records? In particular I’d like to abbreviate the full namespace name as it tends to take up a lot of horizontal space (edited)#2019-04-1614:02bozhidar@qythium Don’t think so. I doubt any pretty-printer does something special with those namespaces and CIDER certainly doesn’t do anything with them as well.#2019-04-1615:00bozhidar> I’ve recently started seeing “No linked cider session” when I try to inspect the stacktrace of an error.#2019-04-1615:00bozhidar@cddr How recently? I don’t recall any changes related to this for quite a while.#2019-04-1615:02cddrJust started seeing it today but this is probably just the first time I've tried to use the feature since upgrading to the versions above.#2019-04-1615:03cddrIf I do sesman-info in a clojure buffer, I see the expected (only current) connection, but in the test-report-buffer, if I do the same, I don't see any connections#2019-04-1615:05cddrSeems I can manaully link it using sesman-link-with-buffer#2019-04-1808:12Ahmed HassanI'm working in Fulcro on Cider mode. How can I keep indentation two spaces deep? (which I think is ideal for Clojure??) It is too much indentation as you can see.#2019-04-1808:14manuelprobably leveraging define-clojure-indent? I have this:
(define-clojure-indent
(for-all 1)
(defroutes 'defun)
(GET 2)
(POST 2)
(PUT 2)
(DELETE 2)
(HEAD 2)
(ANY 2)
(context 2)
(reporting 1))
Maybe adding defsc there can fix your problem.#2019-04-1808:18Ahmed HassanDid this, it doesn't work.#2019-04-1808:18bozhidarThere’s also a global config for this, but it will force 2-space indentation everywhere.#2019-04-1808:19Ahmed HassanSo 2-space is not ideal globally?#2019-04-1808:31bozhidarDepends on your perspective. 🙂 It’s not aligned with classic Lisp traditions, but many Clojure devs like it. That’s why the option exists.#2019-04-1808:31bozhidar(but it’s not the default)#2019-04-1808:19bozhidar(setq clojure-indent-style 'always-indent)#2019-04-1808:22Ahmed HassanIt's not working in this case too.#2019-04-1808:30bozhidarWhat’s your clojure-mode version? I’m 100% that this works.#2019-04-1808:38Ahmed HassanVersion: 20190413.909#2019-04-1808:50bozhidarSo, you evaluated this and nothing changed in clojure-mode? I can’t imagine how this can happen.#2019-04-1809:00Ahmed HassanI added this to init.el file.#2019-04-1809:21benedek@dpsutton any idea how to make add-libspec or the refactoring work in clojure-lsp? when i try to run them i get
lsp--send-request-async: No workspace could handle workspace/executeCommand [2 times]#2019-04-1812:41dpsuttonbeen looking into this over coffee. it looks like you have to register all of the actions at startup#2019-04-1812:41dpsuttonhttps://github.com/emacs-lsp/lsp-mode/blob/master/lsp-css.el#L174#2019-04-1812:41dpsuttonso need to make the hashmap have all of these
(def refactorings
{"cycle-coll" #'refactor/cycle-coll
"thread-first" #'refactor/thread-first
"thread-first-all" #'refactor/thread-first-all
"thread-last" #'refactor/thread-last
"thread-last-all" #'refactor/thread-last-all
"move-to-let" #'refactor/move-to-let
"introduce-let" #'refactor/introduce-let
"expand-let" #'refactor/expand-let
"clean-ns" #'refactor/clean-ns
"add-missing-libspec" #'refactor/add-missing-libspec})
#2019-04-1812:52benedekoi, thx. i am bit slow tho… or just the def confusing me… so i need to put those pairs into :action-handlers#2019-04-1812:52benedekright?#2019-04-1812:53dpsuttonyeah. but i'm not sure exactly what the values of the hash table are, but the keys are the refactoring commands here#2019-04-1812:57dpsuttoninterestingly, lsp-code-actions-at-point can look these up dynamically and returns a hash table suitable for us i think#2019-04-1813:00benedekhm…#2019-04-1813:00benedekthe params need to be templated in somehow i suppose…#2019-04-1813:15benedekso you can get the args with (gethash "arguments" action)#2019-04-1814:57benedekhm… no joy so far. as far as i see action-handlers are good when you want to handle the whole call yourself. eg. it is a hook *before* the request is sent to the server#2019-04-1810:08dominicm@snoe is the person to bother about clojure-lsp I think 🙂#2019-04-1810:09bozhidarIndeed. I think he works with @dpsutton, therefore the assumption he’s also quite familiar with the project.#2019-04-1810:51benedekthey are both probably in a timezone where it is still pretty early maybe..#2019-04-1811:26dpsuttonI just woke up. Unfortunately I’m not sure and it just works in neocon#2019-04-1811:32dpsuttonNeovim #2019-04-1811:38benedekgood morning and thx :)#2019-04-1814:07frozenlockMy understanding is that CIDER launches with the :dev profile. Is there a way to specify another one?#2019-04-1814:10dpsuttoncider launches lein which defaults to the dev profile. you can do a one-off by jacking-in with a prefix arg to edit the command#2019-04-1814:10dpsuttoni'm looking up the var you can set to always use an arg#2019-04-1814:11dpsuttoni think you want to edit cider-lein-global-options (usually in dir-locals#2019-04-1814:12frozenlockI'll take a look, thank you very much!#2019-04-1818:43frozenlockIs there a way to get a hold of project-dir once inside a CIDER buffer?#2019-04-1818:47ghadihow hard would it be to make the buffer readonly when you jumped to a source within ~/.gitlibs ?#2019-04-1818:48ghadiaccidentally editing/saving something in there would be catastrophic#2019-04-1818:59dpsuttonDo You need to distinguish when in the buffer normally versus when there from navigation or is it always read only#2019-04-1819:00bozhidar@ghadi Not hard at all. You can simply add a find-file-hook that checks the directory of the file you’re visiting and makes its buffer read-only.#2019-04-1819:01bozhidarThat’s something you can add to your global Emacs config, as it’s not really tied to CIDER in any way.#2019-04-1819:02ghadi😎. Learned something new. Thanks!#2019-04-1819:08dominicmIt might be worth tools.gitlibs making that directory read only#2019-04-1819:11ghadithere's no such thing#2019-04-1819:12ghadireadonly directory means you cannot add or remove to it#2019-04-1819:12ghadimodifying an existing file is still fair play#2019-04-1819:31timvisherIs there a way to get println statements to go to stdout in the terminal running the main process?#2019-04-1819:31timvisherI'm running nrepl via an embedded server.#2019-04-1819:32timvisher(defn nrepl-handler
[]
(require 'cider.nrepl)
(ns-resolve 'cider.nrepl 'cider-nrepl-handler))
(defonce the-nrepl-server (nrepl-server/start-server :bind "0.0.0.0"
:handler (nrepl-handler)))
#2019-04-1819:33timvisher:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/data.json "0.2.6"]
[org.clojure/tools.nrepl "0.2.13"]
[cider/cider-nrepl "0.17.0"]]
#2019-04-1819:35bozhidar> 😎. Learned something new. Thanks!#2019-04-1819:35bozhidarYou’re welcome! Btw, another thing you can do is to just put .dir-locals.el there making everything in the directory read-only. Might be even simpler.#2019-04-1819:36bozhidarI’ve got a cool little commit that I’d like to share with all of you - https://github.com/clojure-emacs/cider/commit/fc4362a745df1ef959af579679408582167be898#2019-04-1819:36dpsuttonbig fan#2019-04-1819:37bozhidarNow definition and documentation lookup should work even without cider-nrepl being present. That’s part of the initiative to make more of the core functionality work without middleware.#2019-04-1819:37dpsuttonwon't work for cljs though 😞#2019-04-1819:37ghadicool#2019-04-1819:37ghadi!#2019-04-1819:38bozhidar@dpsutton Yeah, we’ll need a different code path there, but it’s perfectly doable IMO.#2019-04-1819:38dpsuttonsame thing for repl utils. been meaning to raise a ticket#2019-04-1819:38dpsuttoni like the notion of fallbacks like how inf-clojure would do it#2019-04-1819:40dpsuttonreally digging what parseedn will let us do#2019-04-1819:40bozhidarThe only problem with the fallbacks is that you have to inline them in the Elisp code, which is kind of annoying. When we implement the client-side nREPL code injection the clients would be able to just load a few Clojure files themselves which would be more elegant.#2019-04-1819:40bozhidarStill, we’re making progress.#2019-04-1819:41bozhidarYep, parseedn opens a lot of possibilities - before this dealing with native Clojure data was so much pain… I had to convert everything to a list of strings. 😄#2019-04-1819:50timvisherBump. 🙂 https://clojurians.slack.com/archives/C0617A8PQ/p1555615891131500#2019-04-1819:51bozhidar@timvisher Did you try this?#2019-04-1819:51bozhidar(defcustom cider-redirect-server-output-to-repl t
"Controls whether nREPL server output would be redirected to the REPL.
When non-nil the output would end up in both the nrepl-server buffer (when
available) and the matching REPL buffer."
:type 'boolean
:group 'cider
:safe #'booleanp
:package-version '(cider . "0.17.0"))
#2019-04-1819:52timvisherHmm… No I didn't. Correct me if I'm wrong but if I'm cider-connecting to a running nrepl server there shouldn't be an nrepl-server buffer in play?#2019-04-1819:55timvisherLooks like this might be closeish… (require '[ :as io])
(with-open [out (io/writer System/out)]
(binding [*out* out]
(println (json/write-str {:type "SCHEMA"}))))
#2019-04-1822:42timvisherActually I think I was wrong. That was not closesish. 🙂#2019-04-1822:54timvisherHuh. I'm stumped. 🙂#2019-04-1906:23bozhidar> Hmm… No I didn’t. Correct me if I’m wrong but if I’m cider-connecting to a running nrepl server there shouldn’t be an nrepl-server buffer in play?#2019-04-1906:24bozhidarYeah, there shouldn’t be such a buffer. But output redirected from the server’s own terminal (whatever it might be) to CIDER’s REPL is still a concern even then.#2019-04-1909:49yuhanI think the latest round of commits to Cider broke something, now cider-doc no longer works on symbol at point#2019-04-1909:59yuhanoh okay, looks like the change to cider-var-info#2019-04-1910:25bozhidar@qythium What’s broken exactly? Those changes shouldn’t change anything in the presence of cider-nrepl.#2019-04-1910:25yuhanI just submitted a PR for it#2019-04-1910:26bozhidarOps, my bad! Sorry about this!#2019-04-1912:03erwinrooijakkersHi all#2019-04-1912:03erwinrooijakkersI want to upgrade cider-nrepl#2019-04-1912:03erwinrooijakkers[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.3.10\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0\"\] -- repl :headless :host localhost...
I need cider-nrepl 0.21.1, but cannot see where to put that
Versions in profiles.clj and in ~/.lein/profiles.clj do not change anything.#2019-04-1912:03erwinrooijakkersI remember changing something in cider in the past to use an older version…#2019-04-1912:04erwinrooijakkersBut don’t remember what, something with recompiling manually#2019-04-1912:04erwinrooijakkersMaybe just redownload everything#2019-04-1912:05erwinrooijakkersNew emacs.d#2019-04-1912:10bozhidarWhat’s your CIDER version?#2019-04-1912:10bozhidarIs it 0.18?#2019-04-1912:19erwinrooijakkersI redownloaded Spacemacs#2019-04-1912:19erwinrooijakkersNow it gives the correct version#2019-04-1912:21erwinrooijakkersNew error:
Caused by: java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context
#2019-04-1912:25erwinrooijakkersAh related to https://github.com/clojure-emacs/cider/issues/2284#2019-04-1912:27bozhidarSo, did you sort this out?#2019-04-1912:39erwinrooijakkersWell now it starts with latest version of lein#2019-04-1912:39erwinrooijakkersBut then Spacemacs crashes#2019-04-1912:39erwinrooijakkersIt freezes#2019-04-1912:40erwinrooijakkersAfter cider-jack-in-clj and cider-jack-in-cljs#2019-04-1912:40erwinrooijakkersI now try cider-jack-in-clj&cljs#2019-04-1912:41erwinrooijakkersYes also freezes Spacemacs#2019-04-1912:42erwinrooijakkersOh no it does unfreeze#2019-04-1912:43erwinrooijakkerserror in process filter: user-error: Figwheel-main is not available. Please check
error in process filter: Figwheel-main is not available. Please check
#2019-04-1912:45erwinrooijakkers:dependencies [[org.clojure/tools.nrepl "0.2.13"]
[com.bhauman/figwheel-main "0.2.0"]
[com.bhauman/rebel-readline-cljs "0.1.4"]
[vvvvalvalval/scope-capture "0.3.2"]
[cider/piggieback "0.4.0"]
[figwheel-sidecar "0.5.16"]]
#2019-04-1912:48dpsutton@benedek i've been reading why the clojure-lsp doesn't let you execute commands. Need to include it on the client. Been reading this example for the java version. https://github.com/emacs-lsp/lsp-java/blob/master/lsp-java.el#L905#2019-04-1913:02bozhidar> [org.clojure/tools.nrepl “0.2.13”]#2019-04-1913:02bozhidarYou don’t need this.#2019-04-1913:03bozhidar@erwinrooijakkers What exactly is your CIDER version now?#2019-04-1913:03erwinrooijakkersHow to check?#2019-04-1913:03erwinrooijakkersCIDER 0.22.0snapshot (package: 20190419.1025)#2019-04-1913:04erwinrooijakkersOkay and I removed tools.nrepl#2019-04-1913:04bozhidarHmm, that’s weird. I wonder why the checks are failing for you.#2019-04-1913:04erwinrooijakkerserror in process filter: Figwheel-main is not available. Please check
#2019-04-1913:04bozhidarTry adding (setq cider-check-cljs-repl-requirements nil) to your requirements.#2019-04-1913:05bozhidarMaybe the new approach I implemented yesterday is not working properly.#2019-04-1913:05erwinrooijakkersOkay#2019-04-1913:05erwinrooijakkersIt is bit annoying that Spacemacs takes SNAPSHOT version of Cider#2019-04-1913:05erwinrooijakkersBit me once half a year ago too#2019-04-1913:05erwinrooijakkersBut I do discover bugs 😉#2019-04-1913:06erwinrooijakkersLet’s see how it works with the (setq cider-check-cljs-repl-requirements nil)#2019-04-1913:08erwinrooijakkersAh now I see the same error as after lein fig#2019-04-1913:08erwinrooijakkers#2019-04-1913:34timvisherRE https://clojurians.slack.com/archives/C0617A8PQ/p1555655010143700
Cool. I'll try a few iterations of that. Currently I worked around it by just moving the pipe into the program and launching a new process each time.#2019-04-1913:39erwinrooijakkers$ lein -v
Warning: implicit hook found: lein-environ.plugin/hooks
Hooks are deprecated and will be removed in a future version.
Leiningen 2.9.1 on Java 1.8.0_192 Java HotSpot(TM) 64-Bit Server VM
$ clj
Clojure 1.10.0
#2019-04-1913:54bozhidar> Warning: implicit hook found: lein-environ.plugin/hooks#2019-04-1913:54bozhidarYou have to remove this plugin I guess.#2019-04-1918:24benedekthanks @dpsutton i was looking at this on Thursday too and also jumping into dep jars. latest version of the server can now return a jar url. but it seems that this is not handled properly in the elisp client#2019-04-1918:24benedekthis is a real missing piece for me#2019-04-1920:22bozhidarThat should be trivial thing to fix.#2019-04-2012:24Ahmed HassanI ran npx shadow-cljs server command in shell. Then in Emacs I ran cider-connect. REPL started but showing following:#2019-04-2012:30Ahmed HassanWhen I run cider-jack-in-cljs command in Emacs, it gives following prompt:
cider-jack-in-cljs requires nREPL op classpath (provided by cide-nrepl)#2019-04-2020:35yuhanwhen using the Cider debugger to step through a function, how can I inspect the current value?#2019-04-2020:36yuhani.e open the cider-inspector on the form being currently highlighted whose result is being displayed in the overlay#2019-04-2020:40dpsuttonl opens and shows the locals, right?#2019-04-2020:41dpsutton#2019-04-2021:11yuhanthe highlighted form might not be a named local#2019-04-2021:24yuhaneg. how do I inspect the value being shown in the overlay here#2019-04-2806:53yuhanDoes anyone have a clue how to do this? Seems like a pretty basic operation but I haven't been able to figure it out#2019-04-2806:53yuhanDoes anyone have a clue how to do this? Seems like a pretty basic operation but I haven't been able to figure it out#2019-04-2107:17bozhidar@ahmed1hsn Have you added cider-nrepl to the dependencies of your project? CIDER can’t auto-inject it for a shadow project.#2019-04-2109:41bozhidarhttps://metaredux.com/posts/2019/04/21/meta-reduce-volume-2019-1.html#2019-04-2210:54benedek@dpsutton i kinda managed to hack together something to handle jar urls with cljoure-lsp it is really nice. jump to source works for all deps now incl clojure core#2019-04-2210:54benedekit is quite hacky tho at the moment, based on mainly cider-find-file from cider-common.el#2019-04-2218:00solfAny idea why #light doesn't work? Using M-x cider-enlightment-mode does#2019-04-2218:01solf#2019-04-2310:44bozhidar@dromar56 Seems you’ve hit some bug, but it’s hard to tell from the partial stacktrace. @malabarba might have a better intuition about this. Feel free to file a ticket upstream.#2019-04-2314:23hlolliwhere do jvm stacktraces go to, I'm having jvm crashes, when I run in temrinal I get log files spitted out, but cider just closes the nrepl connection buffer and says *** Closed on Tue Apr 23 16:21:10 2019 *** in the repl buffer#2019-04-2316:14malabarbaNo idea either, though I'll admit I forgot that feature even existed 😁#2019-04-2316:15malabarba(That was a reply to @dromar56)#2019-04-2318:24didibusI see there's now a way to hotload dependencies?#2019-04-2318:24didibusI was wondering if there was a way to refresh the class path from a project.clj without restarting the repl?#2019-04-2318:25didibusIt be nice to be able to change dependencies in the project.clj. and somehow just have the repl sync itself with it#2019-04-2318:25didibusWithout needing to restart the repl#2019-04-2318:25dominicmYou would need a library that can do that#2019-04-2318:26dominicmThen it will work with nrepl/cider#2019-04-2320:41benedekthere is an issue for this in cljr. essentially the code quoted in the cider docs needs to be wrapped and all the other parts of the feature (retrieve, cache candidates, versions; modify deps in proj files etc) adapted#2019-04-2320:42benedekPRs welcome ofc. i may put this on my todo list too but no promises ;)#2019-04-2408:49RisettoHey guys. Are any of you aware of how to solve this error message: "user-error: ‘autopair-newline’ requires the nREPL op "classpath" (provided by cider-nrepl)#2019-04-2408:49RisettoI think it's related to the message I get in my repl: WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it#2019-04-2408:50RisettoCurrently using this setup:
[nrepl "0.6.0"]
[figwheel-sidecar "0.5.18"]
[cider/piggieback "0.4.0"]
[cider/cider-nrepl "0.21.0"]
[lein-figwheel "0.5.18"]
#2019-04-2409:33plexus@olle142 how are you starting nREPL? if you're not using cider-jack-in then you have to make sure yourself that the cider-nrepl middleware is present#2019-04-2409:34plexusif you're using leiningen then add [cider/cider-nrepl "0.21.1"] to the the :plugins section#2019-04-2413:13jpmonettashello everybody! is there a way of starting two clojurescript repls to the same project but with different builds? I'm working with a browser cljs app and a nodejs cljs server, both sources in the same project. Starting two clojure repls to the same project would also work.#2019-04-2413:27dmaiocchihi all, i have a noob question: i'm using cider + emacs. Sofar i have compiled the buffer with C-x C-k but in the cider-jack-in REPL, i get unable to resolve symbol: .. plus some java errors.. the code itself it is fine, but it seems to me that cider cannot load my project namespace, because it prompts user instead of the namespace.#2019-04-2413:29dmaiocchii have tried different projects, but i get always the same error msg, def symbol not defined, etc. anyone has a clue how i could debug it further? tia 🚀#2019-04-2413:30arbschtcould you give some more info like the full error you are seeing, and the input code? (also might help to know versions of emacs and cider you are on, just in case)#2019-04-2413:32dmaiocchiuser> (-main)
Syntax error compiling at (clojure-noob:localhost:33929(clj)*:43:7).
Unable to resolve symbol: -main in this context
#2019-04-2413:33dmaiocchiemacs version: GNU Emacs 25.3.1 cider 21, running on linux opensuse leap15, with leininigen Leiningen 2.9.0 on Java 10.0.2 OpenJDK 64-Bit Server VM
`#2019-04-2413:34dmaiocchiand i have latest stable clojure,#2019-04-2413:34arbschtso what does the code in the buffer look like?#2019-04-2413:35arbscht(the one you are sending to cider with C-c C-k)#2019-04-2413:35dmaiocchi(ns clojure-noob.core
(:gen-class))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(println "Hello, World!"))
😁#2019-04-2413:35arbschtso that looks fine#2019-04-2413:35dmaiocchii'm using a pretty basic, for debugging..#2019-04-2413:36dmaiocchiyep, should work in theory#2019-04-2413:36arbschtwhen you do C-c C-k it sends code to cider, but you shouldn't expect the repl to switch ns#2019-04-2413:36arbschtyou have to refer to your clojure-noob.core/-main explicitly#2019-04-2413:36arbschtor manually switch to that ns with in-ns#2019-04-2413:36dmaiocchiok, i was reading this doc#2019-04-2413:37dmaiocchi(https://www.braveclojure.com/basic-emacs/#Anchor)#2019-04-2413:37arbschtI haven't seen that, let me check it out#2019-04-2413:37dmaiocchiif you see the basic example there, it seems that it assumes that cider switch implicetely to namespace#2019-04-2413:38dmaiocchiallthough the doc is deprecated in a sense that it uses old cider, now i dunno if it is up2date..#2019-04-2413:39dmaiocchiok indeed it works nice if i reference it with the namespace#2019-04-2413:39arbschtI see, yes I suspect it may be the case that the default behavior changed#2019-04-2413:40dmaiocchiyeah, thx.. i was trusting it blinding since i learned emacs like 2 days ago 😁#2019-04-2413:40dmaiocchiis there a way to load the namespace automatically?#2019-04-2413:40arbschtwow, enjoy the ride!#2019-04-2413:40dmaiocchiwell is kind full-mind-blowing experience emacs, i love it#2019-04-2413:41dmaiocchii have tried vim, and all other editos but comparing to emacs, emacs is way better 😁#2019-04-2413:47arbschtso there's a cider fn called cider-repl-set-ns bound to C-c M-n n#2019-04-2413:48arbschtthat's not automatic but if you can handle that key chord, it could be useful#2019-04-2413:56dmaiocchithx @UHBQQMPGR for allhelp was really usefull#2019-04-2413:56dmaiocchianother thing i didn't saw#2019-04-2413:56dmaiocchii was thinking it was due to my gnu-emacs on linux, namely is that when i run the :cider-mode#2019-04-2413:56dmaiocchii don't have the GUI Bar showed as documented..#2019-04-2413:57dmaiocchibut i'm pretty ok without it atm , i will dive more on it when i have time.. 😁#2019-04-2413:57arbschtgui bar = file/save/etc toolbar?#2019-04-2413:58dmaiocchino, the cider-interaction bar#2019-04-2413:58dmaiocchihttps://docs.cider.mx/en/latest/interactive_programming/#2019-04-2413:59dmaiocchibut honestly i dunno if it is because my emacs configuration is preventing it. I see save/etc buttons#2019-04-2414:00dmaiocchifor the moment, i'm pretty fine without it..#2019-04-2414:00dmaiocchii wil dive into when i'm more expirmented 😁#2019-04-2414:00arbschttry M-x tool-bar-mode#2019-04-2414:00arbschtoops, I mean M-x menu-bar-mode#2019-04-2414:01dmaiocchiwow#2019-04-2414:01arbschtjust guessing it might be toggled off by default in your distro#2019-04-2414:01dmaiocchiawesome thx worked#2019-04-2414:01arbschtnice#2019-04-2414:01dmaiocchi💌#2019-04-2414:01dmaiocchicider#2019-04-2414:01dmaiocchithx !!, i think is my emacs conf that is disabling by default#2019-04-2414:02arbschtI learned something too, I've never used that menu bar before#2019-04-2413:39Risetto@plexus I'm starting my repl with: lein trampoline with-profile more-figwheel figwheel app test and then I try to connect to it with cider-connect-cljs#2019-04-2611:06plexuslike I said start by adding the cider-nrepl plugin to your project.clj. You can also try cider-jack-in-clj and then look at your *Messages* buffer, it will show you the command CIDER uses to start leiningen, which adds the necessary plugins#2019-04-2413:51fmnoisehi everyone, I've just found that locals are not autocompleted when I work with CLJS
so the same issue as covered here https://github.com/alexander-yakushev/compliment/issues/12 but seems that doesn't work in cljs
any ideas?#2019-04-2414:02fmnoiseah, as I see, compliment has opened PR for cljs support 😞 but maybe anyone has another ideas/tools on that#2019-04-2414:59richiardiandreaAt the moment it is just not possible I guess, nobody has put enough work in it to make it happen. Btw the code that you see in the PR is just a port from another library which does not currently support locals either unfortunately#2019-04-2415:02fmnoisehm, which problem does it solve then?#2019-04-2415:02fmnoiseI mean I have completion for CLJS, so just locals are problem atm#2019-04-2415:03fmnoiseI didn't get into details which part of cider provides that completion, but probably not compliment as I see#2019-04-2415:06fmnoisethanks for your work anyway, just trying to understand if that can solve my problems#2019-04-2415:08richiardiandreaDo you mean what problem the PR solve?#2019-04-2415:09fmnoiseyep#2019-04-2415:11richiardiandreaHistorically cljs-tooling contained all the Cljs code but nobody was maintaining it and it was neglected. Also the api that cider-nrepl would see was not consistent.
So I thought I could port the "info" part to orchard and the completion part to compliment#2019-04-2415:12richiardiandreaI have unified the api for the info and compliment will finally be the de facto completion Clojure library#2019-04-2415:12fmnoiseah I see, so it's basically a port of code to more proper place#2019-04-2415:12fmnoiseand some refactoring#2019-04-2415:12fmnoiseno new functionality yet#2019-04-2415:13richiardiandreaYes not yet, but folks like you now see it there and can hack away - visibility is also a goal#2019-04-2415:13fmnoiseyep, true#2019-04-2415:14richiardiandreaThe first enhancement is the context for the locals. Second fuzzy matching. The sky is the limit 😃#2019-04-2415:14fmnoisesounds good :thumbsup::skin-tone-2:#2019-04-2508:48benedekcc @dpsutton https://github.com/emacs-lsp/lsp-mode/pull/791#2019-04-2614:14frozenlockI'm working on a project with files symlinked from another directory. When I work on those files, Cider (or clojure-mode?) acts as if it was a totally unrelated file from the running REPL (`cider-find-var` doesn't work, etc...)#2019-04-2614:17frozenlockIs there a way to configure it to consider files that aren't directly downstream of the project root project.clj?#2019-04-2615:15yuhancheck out the sesman-link-* commands#2019-04-2616:19frozenlock@qythium I'll take a look, thanks!#2019-04-2704:40deep-symmetryDoes anyone know why Cider no longer honors the :init-ns setting in the :dev profiles of my Leiningen projects when I jack in? This used to work, and if I open a repl in Leiningen directly, with no Cider involvement, it puts me in the namespaces I expect. But Cider now is only putting me in the user namespace, which means none of the convenience functions (like doc, etc.) are available, because Leiningen put them in the project’s configured initial namespace.
;; Connected to nREPL server -
;; CIDER 0.21.0 (New York), nREPL 0.6.0
;; Clojure 1.10.0, Java 1.8.0_181
#2019-04-2704:40deep-symmetryAnd my Leiningen version is 2.9.1.#2019-04-2714:57dpsutton@deep-symmetry can you help me reproduce the happy path?
i've made a lein project fizzbuzz with fizzbuzz.core and in project.clj i put :init-ns fizzbuzz.core. Presumably if I do lein repl i end up in user with not CIDER involvement. I've tried lein versions 2.9.1, 2.8.1 and 2.7.1#2019-04-2717:04deep-symmetryThe easiest way would probably be to point you at one of my Clojure repositories. Dysentery has the fewest external dependencies and exhibits the problem: https://github.com/Deep-Symmetry/dysentery#2019-04-2717:05deep-symmetryIf I clone that repo, then run lein repl within it, I am placed in the dysentery.core namespace as expected. But if I use CIDER to jack in to the project, I am placed in a stunted user namespace instead.#2019-04-2717:16dpsuttonWhich version of Leon?#2019-04-2717:16dpsuttonLein #2019-04-2717:17dpsuttonAh it’s under repl options. Thanks. I’ll look after lunch#2019-04-2717:17dpsuttonI was doing it top level #2019-04-2718:54dpsutton@deep-symmetry annoyingly, it works for me with lein 2.9.1 and using CIDER from master which is 0.22.0-snapshot. Can you try something for me? Change the welcome function in the project.clj file to
:welcome (do (println "dysentery loaded.")
(println (.name *ns*))
(System/exit 0))
and then run lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-SNAPSHOT\"\] -- repl that for prints out its in the correct ns with CIDER loaded. I'm guessing it will be the same for you#2019-04-2718:58dpsuttonif this tests pass, i'm thinking something other than main CIDER is doing this. do you have refactor in the mix? any other packages?#2019-04-2720:00deep-symmetryYou are correct, that did print the correct namespace (and then the transport socket closed because of the System/exit invocation). Ok, I do have clj-refactor in the mix, and this would not be the first time it has caused me grief.#2019-04-2720:04deep-symmetryBut I just uninstalled clj-refactor and I am still ending up in user when jacking in.#2019-04-2720:11deep-symmetryOK, I just un-pinned CIDER from melpa-stable, and I can confirm that the version from master has fixed this problem. Now I just have to decide if I want to risk staying on the bleeding edge, or wait until this gets a stable release.#2019-04-2720:14deep-symmetryAnd it still works with clj-refactor enabled. I guess I will try living on master for a while.#2019-04-2720:15deep-symmetryThanks for the suggestions and help experimenting!#2019-04-2905:04bozhidarI think there was a command to inspect the last value.#2019-04-2908:19yuhancider-inspect-last-result? Unfortunately that doesn't seem to work during a debugging session, it just freezes for a while and throws a "Sync nREPL request timed out"#2019-04-2912:46bozhidarAh, yeah. I didn’t actually see the screenshot until now.#2019-04-2912:46bozhidarI don’t have the functionality you’re after exists (yet).#2019-04-2920:36jumar@qythium I'm not sure what you're asking for - as you step through the debugger the values are shown.
If you want to show a previous value then, I think, your only option is inspect and then copy the expression into the minibuffer#2019-04-2920:45Perry FraserHow can I debug a function that takes args? If I do cider-debug-defun-at-point on
#dbg (verb-stem-to-table "porto" "porta")
I just get the normal (no breakpoints run) return value.#2019-04-2920:46Perry FraserAnd obviously I can’t run debug-defun-at-point in the func as the function itself (that takes args ofc) is what I’m debugging#2019-04-2920:49Perry FraserThe only way I can seem to get it to work is with
(defn tmp [] #dbg (verb-stem-to-table "porto" "porta"))
(tmp) ;; Run debug-... with point here
#2019-04-2920:52Perry FraserOh, I’ve figured it out. You run debug on verb-stem-to-table then just normally eval (verb-stem-to-table "porto" "porta"). Sorry y’all.#2019-04-3010:29yuhan@jumar yeah, just wanted to make sure I wasn't missing anything obvious. I think it's quite a fundamental operation a user would try to do - "inspect this intermediate data structure in front of me that won't fit on the screen" and having to navigate around the buffer and yank things is a lot of unnecessary friction#2019-04-3010:30yuhanmaybe I'll look into it on the weekend and see how to add that functionality#2019-04-3010:31yuhanideally without having to re-evaluate the form, which may be side-effecting / expensive#2019-04-3010:32bozhidarI’m not arguing about the usefulness of something like this and contributions would be appreciated. Unfortunately lately we’ve had little time for work on the debugger.#2019-04-3018:17gfredericksdoes cider print arrays as vectors by default? mine is doing this and I can't remember if I've configured anything weird; I'd like to get it to stop doing that#2019-04-3018:25solfBy default cider uses clojure.pprint/pprint (you can check the variable cider-print-fn to see if you've changed it), which prints vectors as [1 2 3] and arrays as [1, 2, 3]#2019-04-3018:31gfredericks@dromar56 thanks, that seems to explain it#2019-04-3018:31gfredericksI probably used to override it and somehow stopped#2019-04-3018:32gfredericksI definitely didn't know that pprint printed arrays like that#2019-04-3018:32solfAnd I didn't knew the difference between arrays and vectors in clojure until 5 minutes ago 😛#2019-04-3018:34gfredericks🙂#2019-04-3018:34gfredericksthey're pretty different#2019-04-3018:36solfYes it was pretty interesting to read about them. Since I have 0 java background I haven't looked into java interop yet, and hadn't met them#2019-04-3018:40gfredericksbyte arrays are probably the most common to encounter, especially if you're dealing with anything big; they'll be at least eight times (or more??) more memory efficient than a naive "sequence of numbers" clojure approach#2019-05-0119:05gfredericksis it normal for paredit to be semibroken when editing code w/o a cider connection?#2019-05-0119:11dpsuttonno. are you seeing "op: info" stuff is not supported?#2019-05-0119:15gfredericksI've seen that in other situations#2019-05-0119:15gfredericksI need to just nuke my five years old cider customizations :face_with_rolling_eyes:#2019-05-0119:16gfredericksthey're probably screwing something up#2019-05-0120:17solfHelp, I forgot the exit condition in a recur loop#2019-05-0120:18solfand I eval'ed it using C-x C-e, how do I stop it?#2019-05-0120:18tannersC-c C-c should stop any running repl evaluation#2019-05-0120:18tannersiirc#2019-05-0120:19solfah yeah thanks, I had to switch to the repl but it did kill it#2019-05-0120:19solfit's bound to cider-interrupt#2019-05-0120:19tannersInterrupting Evaluations
If you accidentally try to evaluate something that's going to take a lot of time (if it finishes at all), you can interrupt the rouge evaluation operation by pressing C-c C-c.
Tip
Note that this is different from the keybinding for interrupting evaluations in source buffers, namely C-c C-b.#2019-05-0120:19tannersLooks like C-c C-b works outside the repl#2019-05-0120:19tannersneat#2019-05-0120:20solfyeah, thanks, you saved my repl session 😛#2019-05-0120:21tanners🎉#2019-05-0208:45RisettoIs it possible to somehow in my emacs config make sure a specific version of nrepl is used?#2019-05-0208:45RisettoNot just when jacking in, also on cider-connect#2019-05-0208:53lispycloudsyou can put it in your ~/.lein/profiles.clj?#2019-05-0208:53lispycloudsAssuming you're using leiningen#2019-05-0212:17dpsuttonNrepl creates an nrepl server so it needs a hard dependency on nrepl. This means your choice of lein version dictates what version of nrepl you will get#2019-05-0212:35bozhidarNot really. If you put a different (newer) version in your project deps or profiles.clj it will override the built-in lein version.#2019-05-0212:53dpsuttonoh. its just unable to use a lower version? I am mistaken sorry 🙂#2019-05-0213:27bozhidarI think you can’t have lower than the base version, but you can certainly override it with a newer version.#2019-05-0218:24mhcatthis happens when I start a repl from my project.clj with cider, and also when I run this in my shell, in the project root: lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-SNAPSHOT\"\] -- repl
BUT not if I run that same line to start a repl outside a project. Any ideas? Or should I make a gh issue?#2019-05-0218:25mhcatalso hi 🙂#2019-05-0219:23bozhidar@j0ni See https://github.com/clojure-emacs/orchard/issues/50#2019-05-0219:23bozhidarI assume you’re on JDK 8 and you’re missing src.zip or tools.jar.#2019-05-0219:35mhcatah interesting - that could be it. I just switched computers and I'm not having the same problem on this one so I will test that solution later. Thanks for the pointer @bozhidar!#2019-05-0223:28tianshuwhat could be the cause of error Caused by: java.lang.Exception: namespace 'cider.nrepl.inlined-deps.orchard.v0v5v0-beta2.orchard.java' not found when I launch a repl for a shadow-cljs project.#2019-05-0223:29tianshuI'm sure using the lastest cider-nrepl and latest shadow-cljs.#2019-05-0223:29thhellera bad .cljc file that emits invalid CLJS code#2019-05-0223:31tianshuEmmm. @thheller this is happened in a initial project which have only one cljs file with content (println "hello").#2019-05-0223:32thhelleroh right nvm thats not a compiler warning. 😛#2019-05-0223:32tianshumaybe this is the cause? Caused by: java.lang.ClassNotFoundException: com.sun.javadoc.ClassDoc#2019-05-0223:32tianshualso found this error#2019-05-0223:34tianshufound this issue https://github.com/clojure-emacs/cider/issues/2287#2019-05-0223:45tianshuissue disappear when using oracle jdk-11.🙃 looks like com.sun.javadoc.ClassDoc not exists in openjdk-8. not sure about other java versions.#2019-05-0300:04tianshualso works on openjdk-11#2019-05-0306:27bozhidar@doglooksgood Do you have tools.jar in your JDK 8?#2019-05-0306:45bozhidarAlso, please take a look at https://github.com/clojure-emacs/orchard/issues/50, as we’re trying to gather more info about this.#2019-05-0309:33tianshu@bozhidar I have tools.jar in my openjdk 8#2019-05-0309:41bozhidar@doglooksgood And is this file present there? It’s supposed to be part of tools.jar. Perhaps tools.jar is not on the classpath or something?#2019-05-0309:46tianshuI run clojure -Rcider -Spath, it is not in the classpath. not sure if it is the correct way to check.#2019-05-0318:04ennIs there something special required to get autocompletion to work for Javascript libraries in a shadow-cljs REPL?#2019-05-0318:08ennI get no matches for js/<M-tab>, for example#2019-05-0318:23diego.videcoHey folk, what are the best ways to print and explore complex data structures on cider?#2019-05-0319:39dominicmCider-inspect#2019-05-0320:45Nickany way to find out why my cider repl seems to have 8 full blank lines in between every line of output, and shifts the beginning of every line three quarters of the width of emacs? clear-output sadly does not restore my repl.#2019-05-0320:45Nickah, clear did#2019-05-0321:24dadairIs there a way to change the formatter alignment of a macro I don’t define? e.g., by default the body of prop/for-all aligns with the binding vector, while I’d like the whole form to align more like a standard let form#2019-05-0321:48gfredericksI have this in my emacs cfg, I assume it's still doing what it looks like but I can't keep track anymore
(dolist (macro '(fresh conde run run* for-all for-map go go-loop
for> doseq> fn> defn> defprotocol> gen-for fnk
macrolet bg letfn> domonad checking))
(put-clojure-indent macro 'defun))
#2019-05-0321:48gfredericks@dadair ⇑#2019-05-0321:57dadairawesome thanks I’ll give that a try!#2019-05-0414:51bartukahi ppl, I can't find a way to use cider-jack-in using with-profile dev#2019-05-0414:52bartukaI found this function around the web
(defun start-cider-repl-with-profile ()
(interactive)
(letrec ((profile (read-string "Enter profile name: "))
(lein-parms (concat "with-profile +" profile " repl :headless")))
(message "lein-params set to: %s" lein-parms)
(set-variable 'cider-lein-parameters lein-parms)
(cider-jack-in)))
#2019-05-0414:52bartukabut I think it's outdated. I get an error message about Wrong number of arguments#2019-05-0416:52bozhidar@iagwanderson Simply prefix the jack-in command with C-u.#2019-05-0419:14bartukathanks!!#2019-05-0416:52bozhidarE.g. C-u M-x cider-jack-in.#2019-05-0416:59bozhidarThis might be of interested to some of you https://metaredux.com/posts/2019/05/04/discovering-runtime-function-references-in-clojure.html#2019-05-0417:00dpsuttonAlso I believe the dev profile is present by default with lein?#2019-05-0422:11pabloreHow do I tell cider to use JDK 8 instead of 9?#2019-05-0422:12pabloreI normally use jenv to manage my java versions, but emacs is not picking it up#2019-05-0501:14lread@pablore , if you are on macos or linux you might try sdkman to manage and switch jdks https://sdkman.io/#2019-05-0609:21rickmoynihanany ideas why including the cider.nrepl/wrap-debug middleware would break focusing on swing windows is macos?#2019-05-0609:24rickmoynihanSteps to reproduce compare:
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/wrap-debug]" -i
nREPL server started on port 58662 on host localhost -
nREPL 0.6.0
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_191-b12
Interrupt: Control+C
Exit: Control+D or (exit) or (quit)
user=> (require 'clojure.inspector)
nil
user=> (clojure.inspector/inspect {:a :b})
#object[javax.swing.JFrame 0x17a01b0c "javax.swing.JFrame[frame0,0,23,400x400,invalid,layout=java.awt.BorderLayout,title=Clojure Inspector,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,22,400x378,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777675,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]"]
To:
$ clj
Clojure 1.10.0
user=> (require 'clojure.inspector)
user=> (clojure.inspector/inspect {:a :b})
#object[javax.swing.JFrame 0x17a01b0c "javax.swing.JFrame[frame0,0,23,400x400,invalid,layout=java.awt.BorderLayout,title=Clojure Inspector,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,22,400x378,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777675,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]"]
#2019-05-0609:26rickmoynihanwith respect to the window focus / java menu bar behaviour#2019-05-0609:28rickmoynihanThe above is a minimal example — the real problem I get is running nrebl and REBL with cider wrap-debug as a middleware#2019-05-0610:18bozhidar@rickmoynihan That’s pretty weird. That’s nothing GUI-related in all of cider-nrepl.#2019-05-0610:18rickmoynihanyeah I tried searching for gui stuff in the project and couldn’t see any either#2019-05-0610:19rickmoynihancould there be some transitive dependency?#2019-05-0610:19rickmoynihanalso I think cider.nrepl/wrap-enlighten and cider.nrepl/wrap-tracker might be effected too#2019-05-0610:25rickmoynihan@bozhidar: ok an even more minimal case is#2019-05-0610:25rickmoynihanclj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"}}}'
Clojure 1.10.0
user=> (require 'cider.nrepl.middleware.debug) ;; causes window problem
user=> (require 'clojure.inspector)
nil
user=> (clojure.inspector/inspect {:a :b})
#2019-05-0610:27rickmoynihanso there’s some side effect occurring when loading that ns#2019-05-0610:29bozhidarAnd this doesn’t happen if you try some other middleware?#2019-05-0610:30bozhidarPlease, file a ticket about this on cider-nrepl issue tracker.#2019-05-0610:30rickmoynihannope#2019-05-0610:30rickmoynihanyeah I’ll definitely file a ticket#2019-05-0610:31rickmoynihanam just trying to narrow down which ns is doing it#2019-05-0610:33rickmoynihanI think something is transitively requiring clojure.inspector from that wrap-debug#2019-05-0610:33rickmoynihanas it looks like it’s already loaded when you require the debug ns#2019-05-0610:43rickmoynihanok looks like it’s orchard.java#2019-05-0610:44rickmoynihanthat somehow appears to load clojure.inspector — not sure if that causes the issue#2019-05-0610:45rickmoynihanlooks like that ns does some funky side-effects to the classpath etc#2019-05-0610:47jakobHi I get this error when evaluating something in the Cider repl:
ERROR: Unhandled REPL handler exception processing message {:ns order.core, :file *cider-repl telia/order:localhost:42383(clj)*, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print cider.nrepl.pprint/pr, :op eval, :column 13, :line 43, :id 11, :code (println "hello"), :nrepl.middleware.print/stream? [], :session 9cbf4680-5cd0-45bd-86ba-1c5af7119f20}
Any ideas how to proceed debugging this?#2019-05-0612:19bozhidar@karl.jakob.lind What’s your CIDER version?#2019-05-0612:21bozhidarThe exception stacktrace would be useful as well.#2019-05-0612:35jakobversion 20190419.1025#2019-05-0612:36jakob#2019-05-0613:29slipsetHei @karl.jakob.lind It looks like your java installation is a bit wierd?#2019-05-0709:55jakobIn what way is it wierd and do you know how I can fix it? 🙂#2019-05-0712:42jakobI just reinstalled Java and now it works 😄 thanks for your input it helped!#2019-05-0615:18bozhidar@karl.jakob.lind Your issue seems similar to https://github.com/clojure-emacs/orchard/issues/50 I’d suggest posting a comment with your exception there.#2019-05-0621:17macrobartfastwhen trying to cider-jack-in-clojurescript I'm getting
error in process filter: Sync nREPL request timed out (op clone id 1)
thoughts?#2019-05-0621:18macrobartfastI searched on this error and have found a number of references stretching back years and am trying various solutions to no avail.#2019-05-0621:19tannersCan you run the repl outside of emacs?#2019-05-0621:23macrobartfastyes#2019-05-0621:23macrobartfastlein repl works#2019-05-0621:24tannersWhat version of cider/cider-nrepl are you running?#2019-05-0621:25macrobartfast0.21.0 for cider...#2019-05-0621:25macrobartfasthow do I determine my nrepl version?#2019-05-0621:27tannersby default it injects the version when you run cider-jack-in-clojurescript, it should say the version when you run that command#2019-05-0621:27tannersif you run it then check the output in the messages buffer#2019-05-0621:27tanners[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.2-SNAPSHOT\"\] -- repl :headless :host localhost...
Mine looks something like this for instance#2019-05-0621:27macrobartfast[nREPL] Starting server via /Users/spaceman/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl :h\
eadless :host localhost...
#2019-05-0621:30tannersHm, versions look like they line up. Are you able to use jack-in with a fresh clojurescript project or do you get the same error everywhere?#2019-05-0621:30macrobartfaststand by#2019-05-0621:32dpsuttonwhat happens when you run lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl?#2019-05-0621:32macrobartfastcider-jack-in worked on a app generated by lein new app foobar#2019-05-0621:32macrobartfast@dpsutton stand by...#2019-05-0621:34macrobartfast@dpsutton when running your command I get a prompt in the cli.#2019-05-0621:34dpsuttonvery strange. that's exactly what you ran#2019-05-0621:35macrobartfastsooo... I'm using the flyingmachinestudios .emacs/init.el which I'll paste, hang on.#2019-05-0621:38macrobartfastwell, here it is:#2019-05-0621:38macrobartfasthttps://github.com/flyingmachine/emacs-for-clojure/blob/master/init.el#2019-05-0621:38macrobartfastI blew away my .emacs.d in the course of troubleshooting this, as well as reinstalled leiningen.#2019-05-0621:39macrobartfastso, yeah, pretty stumped.#2019-05-0621:39tannersCan you also post your project.clj?#2019-05-0621:39macrobartfastyes, stand by.#2019-05-0621:39tannersSince it works for a basic project its likely something setup there#2019-05-0621:41Ian Fernandezhey guys, there's some way to check type hinting on java types using emacs ?#2019-05-0621:41Ian Fernandezand there is some way to enter in the interop java code using emacs?#2019-05-0621:44tannersNot that I know of, but I could be wrong#2019-05-0621:45tannersI've heard Intellij with cursive has good support for jumping to actual java classes#2019-05-0621:46tannersWas about to mention that lol#2019-05-0621:46tannersInteresting that a tool for pasting code would have that issue :thinking_face:#2019-05-0621:47macrobartfastok here is a better version: https://paste.ofcode.org/UBH8RcKpjyJ6LwQCK3C5Gi#2019-05-0621:57macrobartfast@dpsutton ok, pasting in your cli version
lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl
into the root of
generates
scratch/understanding-re-frame 002 $ lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl
Compiling ClojureScript...
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: medley.core, being replaced by: #'medley.core/boolean?
2019-05-06 17:54:10.465:INFO::main: Logging initialized @2686ms
[WARNING] No nREPL middleware descriptor in metadata of #'cemerick.piggieback/wrap-cljs-repl, see nrepl.middleware/set-descriptor!
nREPL server started on port 50571 on host 127.0.0.1 -
ERROR: Unhandled REPL handler exception processing message {:id dadaa1c9-dea8-4244-b3e7-c62d26e43018, :op clone}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cemerick.piggieback$wrap_cljs_repl$fn__2251.invoke(piggieback.clj:289)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1847.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1115.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
which is the error I get in emacs.#2019-05-0621:57dpsuttonok. i see a cemerick.piggieback in there. that needs to change to cider/piggieback#2019-05-0621:58dpsuttonchas created it but is no longer active in the community and cider took it over#2019-05-0621:58dpsuttonso that's an outdated version#2019-05-0621:59macrobartfastok, changed that... gettting
scratch/understanding-re-frame 002 $ lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl
Compiling ClojureScript...
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: medley.core, being replaced by: #'medley.core/boolean?
2019-05-06 17:58:46.081:INFO::main: Logging initialized @3138ms
Error loading cemerick: Could not locate cemerick__init.class, cemerick.clj or cemerick.cljc on classpath.
Exception in thread "main" Syntax error compiling var at (/private/var/folders/kd/kchlcnk11qxdnhbxb6s1mxr80000gn/T/form-init851643206016320226.clj:1:9279).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cemerick/piggieback/wrap-cljs-repl in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 36 more
REPL server launch timed out.#2019-05-0621:59macrobartfastam I supposed to paste errors like that in here? I don't know the protocol here.#2019-05-0622:01macrobartfastby the way, happy to completely reinstall emacs/cider/leiningen etc... I'm trying to get my setup current, anyway.#2019-05-0622:02macrobartfastI've always been pretty confused about the 'ideal' setup if there is anything like that.#2019-05-0622:02macrobartfastI like to develop interactively from within vanilla terminal emacs.#2019-05-0622:03dpsuttonfor some reason its looking for cemerick.clj#2019-05-0622:03macrobartfasthmmm#2019-05-0622:04dpsuttoncan you look for cemerick/piggieback or any combination and make sure the coordinates are for cider/piggieback?#2019-05-0622:04macrobartfastok... uh... where do I do that?#2019-05-0622:05dpsuttonin your project.clj file#2019-05-0622:05macrobartfastah ok#2019-05-0622:05dpsuttonno worries 🙂#2019-05-0622:05macrobartfasthttps://github.com/lispcast/understanding-re-frame/blob/002/project.clj ...#2019-05-0622:06macrobartfast[com.cemerick/piggieback "0.2.2"]#2019-05-0622:06macrobartfastand :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}#2019-05-0622:06dpsuttonright#2019-05-0622:07dpsuttonthat should get you going.#2019-05-0622:07macrobartfasthmm#2019-05-0622:07macrobartfastI'm going to reclone the project and run it.#2019-05-0622:09macrobartfastsame error.#2019-05-0622:10macrobartfastafter replacing my .emacs files and leiningen I thought I'd get this solved.#2019-05-0622:11macrobartfastI guess I should try without the flyingmachinestudios .emacs stuff next.#2019-05-0622:11macrobartfastit may have something to do with that.#2019-05-0622:11dpsuttonyou've updated the references to cider/piggieback yes?#2019-05-0622:11dpsuttonwhat error are you getting now. it cannot be the same as before#2019-05-0622:15macrobartfastoh, good lord... doh.#2019-05-0622:15macrobartfastI forgot to fix that when I recloned it.#2019-05-0622:16macrobartfastcratch/understanding-re-frame-2 master $ lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl
Compiling ClojureScript...
Compiling "resources/public/js/compiled/app.js" from ["src/cljs"]...
WARNING: uri? already refers to: cljs.core/uri? being replaced by: cognitect.transit/uri? at line 332 /Users/patrick/Documents/projects/scratch/understanding-re-frame-2/target/cljsbuild-compiler-1/cognitect/transit.cljs
Successfully compiled "resources/public/js/compiled/app.js" in 19.295 seconds.
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: medley.core, being replaced by: #'medley.core/boolean?
2019-05-06 18:15:56.324:INFO::main: Logging initialized @2579ms
Error loading cemerick: Could not locate cemerick__init.class, cemerick.clj or cemerick.cljc on classpath.
Exception in thread "main" Syntax error compiling var at (/private/var/folders/kd/kchlcnk11qxdnhbxb6s1mxr80000gn/T/form-init5173703016794437444.clj:1:9280).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cemerick/piggieback/wrap-cljs-repl in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 36 more#2019-05-0622:16macrobartfast(defproject understanding-re-frame "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.7.0"]
[re-frame "0.10.2"]
[secretary "1.2.3"]
[compojure "1.5.0"]
[yogthos/config "0.8"]
[ring "1.4.0"]
[day8.re-frame/http-fx "0.1.4"]
[cljsjs/react-input-autosize "2.0.0-1"]]
:plugins [[lein-cljsbuild "1.1.5"]]
:min-lein-version "2.5.3"
:source-paths ["src/clj"]
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"
"test/js"]
:figwheel {:css-dirs ["resources/public/css"]
:ring-handler understanding-re-frame.handler/dev-handler}
:repl-options {:nrepl-middleware [cemerick/piggieback/wrap-cljs-repl]}
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.4"]
[cljsjs/d3 "4.3.0-5"]
[day8.re-frame/trace "0.1.7"]
[figwheel-sidecar "0.5.18"]
[com.cemerick/piggieback "0.2.2"]
[re-frisk "0.5.0"]]
:plugins [[lein-figwheel "0.5.18"]
[lein-doo "0.1.8"]]}}
:cljsbuild
{:builds
[{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:on-jsload "understanding-re-frame.core/mount-root"}
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload
day8.re-frame.trace.preload
re-frisk.preload
]
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:external-config {:devtools/config {:features-to-install :all}}
}}
{:id "min"
:source-paths ["src/cljs"]
:jar true
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:pretty-print false}}
{:id "test"
:source-paths ["src/cljs" "test/cljs"]
:compiler {:main understanding-re-frame.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none}}
]}
:main understanding-re-frame.server
:aot [understanding-re-frame.server]
:uberjar-name "understanding-re-frame.jar"
:prep-tasks [["cljsbuild" "once" "min"] "compile"]
)
#2019-05-0622:17dpsuttoncemerick/piggieback/wrap-cljs-repl#2019-05-0622:17dpsuttonCaused by: java.lang.RuntimeException: Unable to resolve var: cemerick/piggieback/wrap-cljs-repl in this context#2019-05-0622:17dpsuttoncider.piggieback/wrap-cljs-repl#2019-05-0622:18dpsuttoncemerick/piggieback/wrap-cljs-repl -> cider.piggieback/wrap-cljs-repl#2019-05-0622:20macrobartfastok, after that, lol...#2019-05-0622:20macrobartfastscratch/understanding-re-frame-2 master $ lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl
Compiling ClojureScript...
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: medley.core, being replaced by: #'medley.core/boolean?
2019-05-06 18:19:20.723:INFO::main: Logging initialized @2589ms
Error loading cider: Could not locate cider__init.class, cider.clj or cider.cljc on classpath.
Exception in thread "main" Syntax error compiling var at (/private/var/folders/kd/kchlcnk11qxdnhbxb6s1mxr80000gn/T/form-init8491191050944837256.clj:1:9274).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cider/piggieback/wrap-cljs-repl in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 36 more#2019-05-0622:21macrobartfastproject.clj is now:
(defproject understanding-re-frame "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.7.0"]
[re-frame "0.10.2"]
[secretary "1.2.3"]
[compojure "1.5.0"]
[yogthos/config "0.8"]
[ring "1.4.0"]
[day8.re-frame/http-fx "0.1.4"]
[cljsjs/react-input-autosize "2.0.0-1"]]
:plugins [[lein-cljsbuild "1.1.5"]]
:min-lein-version "2.5.3"
:source-paths ["src/clj"]
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"
"test/js"]
:figwheel {:css-dirs ["resources/public/css"]
:ring-handler understanding-re-frame.handler/dev-handler}
:repl-options {:nrepl-middleware [cider/piggieback/wrap-cljs-repl]}
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.4"]
[cljsjs/d3 "4.3.0-5"]
[day8.re-frame/trace "0.1.7"]
[figwheel-sidecar "0.5.18"]
[com.cemerick/piggieback "0.2.2"]
[re-frisk "0.5.0"]]
:plugins [[lein-figwheel "0.5.18"]
[lein-doo "0.1.8"]]}}
:cljsbuild
{:builds
[{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:on-jsload "understanding-re-frame.core/mount-root"}
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload
day8.re-frame.trace.preload
re-frisk.preload
]
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:external-config {:devtools/config {:features-to-install :all}}
}}
{:id "min"
:source-paths ["src/cljs"]
:jar true
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:pretty-print false}}
{:id "test"
:source-paths ["src/cljs" "test/cljs"]
:compiler {:main understanding-re-frame.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none}}
]}
:main understanding-re-frame.server
:aot [understanding-re-frame.server]
:uberjar-name "understanding-re-frame.jar"
:prep-tasks [["cljsbuild" "once" "min"] "compile"]
)
#2019-05-0622:21dpsuttoncider.piggieback/wrap-cljs-repl not cider-slash-piggieback but cider-dot-piggieback#2019-05-0622:21macrobartfastomg, ok, sorry.#2019-05-0622:21dpsuttonand you still have com.cemerick/piggieback "0.2.2" in there#2019-05-0622:21dpsuttonremove that. you want cider/piggieback "0.4.0"#2019-05-0622:25macrobartfastok... new project.clj is (defproject understanding-re-frame "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.0"]
[org.clojure/clojurescript "1.10.439"]
[reagent "0.7.0"]
[re-frame "0.10.2"]
[secretary "1.2.3"]
[compojure "1.5.0"]
[yogthos/config "0.8"]
[ring "1.4.0"]
[day8.re-frame/http-fx "0.1.4"]
[cljsjs/react-input-autosize "2.0.0-1"]]
:plugins [[lein-cljsbuild "1.1.5"]]
:min-lein-version "2.5.3"
:source-paths ["src/clj"]
:clean-targets ^{:protect false} ["resources/public/js/compiled" "target"
"test/js"]
:figwheel {:css-dirs ["resources/public/css"]
:ring-handler understanding-re-frame.handler/dev-handler}
:repl-options {:nrepl-middleware [cider/piggieback/wrap-cljs-repl]}
:profiles
{:dev
{:dependencies [[binaryage/devtools "0.9.4"]
[cljsjs/d3 "4.3.0-5"]
[day8.re-frame/trace "0.1.7"]
[figwheel-sidecar "0.5.18"]
[cider/piggieback "0.4.0"]
[re-frisk "0.5.0"]]
:plugins [[lein-figwheel "0.5.18"]
[lein-doo "0.1.8"]]}}
:cljsbuild
{:builds
[{:id "dev"
:source-paths ["src/cljs"]
:figwheel {:on-jsload "understanding-re-frame.core/mount-root"}
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload
day8.re-frame.trace.preload
re-frisk.preload
]
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:external-config {:devtools/config {:features-to-install :all}}
}}
{:id "min"
:source-paths ["src/cljs"]
:jar true
:compiler {:main understanding-re-frame.core
:output-to "resources/public/js/compiled/app.js"
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:pretty-print false}}
{:id "test"
:source-paths ["src/cljs" "test/cljs"]
:compiler {:main understanding-re-frame.runner
:output-to "resources/public/js/compiled/test.js"
:output-dir "resources/public/js/compiled/test/out"
:optimizations :none}}
]}
:main understanding-re-frame.server
:aot [understanding-re-frame.server]
:uberjar-name "understanding-re-frame.jar"
:prep-tasks [["cljsbuild" "once" "min"] "compile"]
)
`#2019-05-0622:26dpsuttonplease please. [cider/piggieback/wrap-cljs-repl]} must be cider dot piggieback#2019-05-0622:26dpsuttoncider.piggieback/wrap-cljs-repl its http://name.space/function#2019-05-0622:28macrobartfastYAAAAAAAAAAAAAAAAAAAAAAAAAYYYYY!!!#2019-05-0622:29macrobartfastit finally works.#2019-05-0622:30macrobartfastfrom the cli with your command; now trying in emacs.#2019-05-0622:33macrobartfastaha, this is something I've been wanting to understand... now getting:
Select ClojureScript REPL type: {nashorn | figwheel | figwheel-main | node | weasel | boot | shadow | shadow-select | custom}
which should I use?#2019-05-0622:34macrobartfastthe figwheel option works.#2019-05-0622:35macrobartfastunbelievable (my denseness)... thank you so much for your patience here, and that of all the eyes that may scan this.#2019-05-0622:35macrobartfastI'm back in business.#2019-05-0622:35dpsuttonof course!#2019-05-0622:35dpsuttonhappy hacking!#2019-05-0622:35macrobartfast😀#2019-05-0713:24pataprogrammingIn the process of trying to get a weirdly configured old project updated and running, I've managed to bork CIDER completely, and am no longer able to either cider-jack-in or cider-connect.
- Emacs 26.2
- Getting the problem for both lein and boot projects
- Nothing CIDER or nrepl-refactor related in lein profile.clj
- cider 20190419.1025
- clj-refactor 20190425.1002
- clojure-mode 20190413.909
- But am getting the problem both with CIDER 0.21.0 and CIDER 0.22.0-SNAPSHOT#2019-05-0713:25pataprogramming[nREPL] Starting server via /home/pls/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-SNAPSHOT\"\] -- repl :headless :host localhost...
[nREPL] server started on 42613
[nREPL] Establishing direct connection to localhost:42613 ...
[nREPL] Direct connection to localhost:42613 established
map-apply: Wrong type argument: sequencep, #s(hash-table size 2 test equal rehash-size 1.5 rehash-threshold 0.8125 data ("right-margin" 70 "length" 50))
#2019-05-0713:36pataprogrammingHere's a backtrace with .lein/profiles.clj disabled on a fresh lein project:#2019-05-0713:47pataprogramminghttps://pastebin.com/4ZkN4qcj#2019-05-0713:48pataprogrammingAny assistance would be appreciated, as I've got a interactive presentation later today.#2019-05-0713:50pataprogrammingI spent a couple of hours last night slogging through the elisp trying to figure out what's going on...`map-pairs` definitely doesn't like hash table. I tried turning it into a list with a manually written function, but that just pushed the problems further down the line.#2019-05-0715:38pataprogrammingBasically, what I tried was replacing map-pairs with (defun hash-to-list (hash)
(let (result)
(maphash
(lambda (k v)
(push (list k v) result))
hash)
result))
This gives what looks like a sane output to cider--repl-request-map, but resulted in another failure in the function calling it.#2019-05-0715:39pataprogrammingSince this problem doesn't seem to have been reported at the issue, and it might be peculiar to my emacs config, I was hoping somebody here might have some guesses.#2019-05-0715:40bozhidarIs your cider-print-options set to nil?#2019-05-0715:41bozhidarI assume it’s not and that the options there are not in the expected format.#2019-05-0715:53pataprogrammingHide cider-print-options: nil
State : STANDARD. (mismatch)#2019-05-0715:54pataprogrammingThat mismatch is weird.#2019-05-0716:22pataprogrammingcider-print-options is a variable defined in ‘cider-client.el’.
Its value is nil
Documentation:
A map of options that will be passed to ‘cider-print-fn’.
Here’s an example for ‘pprint’:
’(("length" 50) ("right-margin" 70))
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 0.21.0 of the cider package.#2019-05-0716:24pataprogrammingAnd jumping to the definition confirms it should be a list. So why would customize report a mismatch?#2019-05-0716:40pataprogrammingLooking at the definition of cider--nrepl-print-request-map, there's this bit:
(let* ((width-option (cider--print-option "right-margin" cider-print-fn))
(print-options (thread-last
(map-merge 'hash-table
`((,width-option ,right-margin))
cider-print-options)
(map-pairs)
(seq-mapcat #'identity)
(apply #'nrepl-dict))))
[...]#2019-05-0716:41pataprogrammingCutting it down to (thread-last
(map-merge 'hash-table
`(("width" 50) ("right-margin" 70))
nil)
(map-pairs)
(seq-mapcat #'identity)
(apply #'nrepl-dict))
the wrong-type-argument error pops up#2019-05-0716:42pataprogrammingIt's like the right definition isn't available for map-pairs on the hash table, and I'm not certain how this could work at all, since I'm guessing cons doesn't work on hash tables?
(cl-defgeneric map-pairs (map)
"Return the elements of MAP as key/value association lists.
The default implementation delegates to `map-apply'."
(map-apply #'cons map))
#2019-05-0716:43pataprogrammingDebugger entered--Lisp error: (wrong-type-argument sequencep #<hash-table equal 0/1 0x2b8fbf5>)
mapcar((lambda (l) (apply func l)) #<hash-table equal 0/1 0x2b8fbf5>)
map-apply(cons #<hash-table equal 0/1 0x2b8fbf5>)
map-pairs(#<hash-table equal 0/1 0x2b8fbf5>)
(seq-mapcat (function identity) (map-pairs (map-merge (quote hash-table) cider-print-options)))
#2019-05-0717:46pataprogrammingSo it apparently delegates to map-apply in map.el, which should theoretically be able to figure out that a hash table is being passed in.#2019-05-0717:47pataprogrammingI'm kind of stumped as to why and how this went awry.#2019-05-0717:48pataprogrammingpackages cl-lib 1.0, map 2.0, seq 2.20 are installed#2019-05-0716:55fedregHi all, I updated to latest cider and looks like C-c C-p now prints only stdout stuff to the new *cider-result* buffer, whereas it used to print everything... Before I make my own hack, is anyone aware of any other cider func which prints everything to *cider-result*? didn't see one. Thx!#2019-05-0720:51bozhidarDefine everything. 🙂#2019-05-0804:39bartukaI'm using flycheck-clojure and I got the following error message when I visit a clojure buffer:
Error while checking syntax automatically: (void-function cider-default-connection)#2019-05-0804:39bartukahow can I investigate more about the source of error? I saw on the web that it has something to do with cider version#2019-05-0804:40bartukabut I am not sure for what version should I downgrade my cider without any major loss to fix this bug.#2019-05-0804:41dpsuttonthat hasn't been kept up to date with CIDER. The connection system is quite different now so you can't really fix it unless you want to take the task of rewriting a good bit#2019-05-0804:41dpsuttonyou could use https://github.com/candid82/flycheck-joker which uses static analysis and does a quite nice job#2019-05-0804:42dpsuttonalso a member @borkdude has made a new checker called https://github.com/borkdude/clj-kondo#2019-05-0804:44dpsuttoni'm not actually sure how clj-konda differs from joker. but from his readme it appears he wants to focus on features not supported by joker so the two will complement each other#2019-05-0806:19bozhidar@dpsutton For one - clj-kondo is a regular Clojure project. I think that’s the biggest difference.#2019-05-0806:19bozhidar> that hasn’t been kept up to date with CIDER. The connection system is quite different now so you can’t really fix it unless you want to take the task of rewriting a good bit#2019-05-0806:20bozhidarI don’t think the changes are that big from a user’s perspective - probably just aliasing the cider-default-connection to cider-current-connection (or something along those lines) would work. I think flycheck-clojure shouldn’t need big changes.#2019-05-0806:24bozhidarBtw, I don’t even see cider-default-connection used here https://github.com/clojure-emacs/squiggly-clojure/blob/master/elisp/flycheck-clojure/flycheck-clojure.el#2019-05-0806:24bozhidar(note that flycheck-clojure is a very simple 200-lines of code type of project)#2019-05-0808:44borkdudeclj-kondo originated from things I missed from joker. there is some overlap. some things joker does better, but clj-kondo can find stuff joker can’t. so they work best together#2019-05-0809:46benedekare you aware of clojure-lsp @borkdude? somewhat parallel project too#2019-05-0809:46benedekit is not a linter tho but an other rewrite-clj based parser/analyzer of sorts#2019-05-0809:57borkdudeI’ll check it out, thanks #2019-05-0816:11martinklepschI noticed that c-c c-k doesn't work if the file is not part of the classpath (cli tools setup). In contrast evaluating forms one by one works fine, so Cider is clearly able to link the buffer to an nrepl session. Should this be considered a bug or are things working as intended?#2019-05-0816:38bozhidarDefine “can’t eval”. 🙂#2019-05-0816:42martinklepschI hit C-c C-k, the minibuffer prints "Loading xyz...", in the REPL buffer none of the things from that namespace are available. No error is printed. Hope this makes more sense 😄#2019-05-0817:14bozhidarHmm, that’s interesting. Frankly, I’m not quite certain what should happen in this case - doesn’t the compiler itself expect for the file to be on the classpath?#2019-05-0817:30dpsuttoncider's github is killing my inbox today 😆#2019-05-0817:32bozhidarhehe#2019-05-0817:32bozhidarSorry about that!#2019-05-0817:32dpsutton(but i'm glad for it)#2019-05-0817:32dpsuttoneasy to archive them. i'll be glad to have a more active list of issues#2019-05-0817:33bozhidarI decided to try to clean up the backlog using a bot, so let’s see how things are going to work out.#2019-05-0817:33bozhidarI’m hoping that the end result is going to be a small list of really important tickets (and hopefully more people willing to tackle those).#2019-05-0817:34dpsuttoni think its a great idea. good thinking#2019-05-0908:46fmnoisehi everyone, I'm getting
Caused by java.lang.RuntimeException
Unable to resolve symbol: STATE__ in this context
while trying to eval defn with #light tag#2019-05-0908:46fmnoisecider trace
Util.java: 221 clojure.lang.Util/runtimeException
Compiler.java: 7414 clojure.lang.Compiler/resolveIn
Compiler.java: 7358 clojure.lang.Compiler/resolve
Compiler.java: 7319 clojure.lang.Compiler/analyzeSymbol
Compiler.java: 6768 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3881 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3888 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 3888 clojure.lang.Compiler$InvokeExpr/parse
Compiler.java: 7109 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 6118 clojure.lang.Compiler$BodyExpr$Parser/parse
Compiler.java: 7107 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 6120 clojure.lang.Compiler$BodyExpr$Parser/parse
Compiler.java: 5467 clojure.lang.Compiler$FnMethod/parse
Compiler.java: 4029 clojure.lang.Compiler$FnExpr/parse
Compiler.java: 7105 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 38 clojure.lang.Compiler/access$300
Compiler.java: 596 clojure.lang.Compiler$DefExpr$Parser/parse
Compiler.java: 7107 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6789 clojure.lang.Compiler/analyze
Compiler.java: 6745 clojure.lang.Compiler/analyze
Compiler.java: 7181 clojure.lang.Compiler/eval
Compiler.java: 7132 clojure.lang.Compiler/eval
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
debug.clj: 584 cider.nrepl.middleware.debug/instrument-and-eval
debug.clj: 579 cider.nrepl.middleware.debug/instrument-and-eval
Var.java: 384 clojure.lang.Var/invoke
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 660 clojure.core/apply
regrow.clj: 18 refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 79 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 142 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 170 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 745 java.lang.Thread/run
#2019-05-0908:52bozhidar@fmnoise Seems like you’ve encountered a bug. File a report with CIDER or cider-nrepl.#2019-05-0908:52fmnoiseok, thanks#2019-05-0912:25borkdudeNot sure where to discuss this, but since @bozhidar is around here:
I think this style guide rule is a bit ambiguous.
https://github.com/bbatsov/clojure-style-guide#else-keyword-in-cond
Should I read that as: always use :else in cond, or only when you intend the last clause as a catch-call?#2019-05-0912:26borkdudeso:
(cond (< x 5) .. (< x 10) ..)
returns nil for (=> x 11), that doesn’t require an :else?#2019-05-0912:37bozhidar@borkdude Yeah, I see what you mean. You should use :else when you need a catch all. Depending on the conditions that’s not always necessary.#2019-05-0912:38bozhidarI think we discussed something similar with you and @alexmiller recently on Twitter.#2019-05-0912:38borkdudeyeah, that was a slightly different one though, about case#2019-05-0913:07bozhidarI remember now.#2019-05-0913:07bozhidarFor cond having an :else in definitely necessary in some scenarios as if you don’t have any matches it returns nil, which is not exactly great.#2019-05-0913:08bozhidarI use it almost all the time, but it really depends on the nature of the clauses.#2019-05-0913:09borkdudesome people are relying on nil so I wasn’t sure about this.
right now clj-kondo complains every time you have no :else. I haven’t had any complaints from users so far.
but after this conversation I made this issue: https://github.com/borkdude/clj-kondo/issues/147#2019-05-0917:00dominicmI rely on this in lots of projects#2019-05-0917:01dominicmI think the rule should be looking for other truthy values which should instead be :else#2019-05-0917:01borkdudethat’s indeed what this conversation is about and since I’ve heard both opinions, it’s probably going to be configurable#2019-05-0917:02dominicmI'd like the linter to fail when someone does 1 or something though, I don't think the default should encourage the including of :else nil#2019-05-0917:04borkdudeyes. if you’re using a constant, it should be :else.#2019-05-0917:05borkdudeI’m inclined to make that the default, since it leads to less false positives without any config#2019-05-0913:10borkdudemaybe it’s already fine as it is.#2019-05-0913:16bozhidarWell, some times nil might be ok, but I definitely think that some explicit return value would be better most of the time.#2019-05-0913:17bozhidarI guess you can make this configurable and keep the current behaviour as the default.#2019-05-0913:18borkdudegood idea#2019-05-0913:19dpsuttonnow the classic: where do you configure? Source comment. project file, global settings, etc#2019-05-0913:19borkdudeI don’t like changing the source code because of a linter, so I’m inclined in a project .clj-kondo/config.edn file#2019-05-0913:20bozhidarThat’s usually the best approach.#2019-05-0913:20bozhidarThat’s how I do it in RuboCop (https://github.com/rubocop-hq/rubocop) and it has worked out really well.#2019-05-0913:21bozhidarMost linters support some default file in the home folder and per project configuration.#2019-05-0913:21borkdudeyeah, that’s totally possible#2019-05-0913:23bozhidarSome ideas https://nrepl.org/nrepl/0.6.0/usage/server.html#_server_configuration 🙂#2019-05-0913:26borkdudeHere's an example global configuration file:
nrepl/nrepl.edn
that should read .nrepl/nrepl.edn yes?#2019-05-0913:51bozhidarYep. Thanks for spotting that typo!#2019-05-0913:51bozhidarBasically I just get if there’s global config map and merge it with a project config map if present. Works out really well in practice.#2019-05-0914:22borkdudeyeah. what I’m having right now is that you have a project config in .clj-kondo/config.edn and you can override it with a CLI argument --config which accepts either a file path or a literal EDN expression#2019-05-0914:22borkdudebut a more global config in the home dir is a good addition probably#2019-05-0914:22borkdude(override = merge)#2019-05-0914:25borkdudemaybe I should also name the config.edn clj-kondo.edn, but that would be a breaking change…#2019-05-0914:38borkdudeon an unrelated, but more on topic note. I’ve been using Java 11 for a while. when I start my project I see this:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by mranderson048.orchard.v0v3v0.dynapath.v0v2v5.dynapath.defaults$eval2845$fn__2846 to method java.net.URLClassLoader.addURL(java.net.URL)
#2019-05-0915:02bozhidarThe warning is harmless. We’ve addressed this in the upcoming Orchard 0.5.#2019-05-0915:05borkdudethanks#2019-05-0920:26madstapOn a fresh install of ubuntu and emacs prelude I'm getting user-error: The clojure executable isn’t on your ‘exec-path’ and user-error: The lein executable isn’t on your ‘exec-path’ when I try to cider-jack-in. I do have both installed. How do I debug this?
$ which lein
/usr/bin/lein
$ which clojure
/usr/local/bin/clojure
(describe-variable 'exec-path)
=>
Its value is
("/app/bin/" "/usr/bin/" "/app/libexec/emacs/26.2/x86_64-pc-linux-gnu/" "/usr/local/bin/")
Original value was
("/app/bin" "/usr/bin" "/app/libexec/emacs/26.2/x86_64-pc-linux-gnu")
#2019-05-0920:27dpsuttonemacs starts up without the path of your shell#2019-05-0920:27madstapI'm using emacs installed via flatpak, if that makes a difference#2019-05-0920:29madstapok, that makes sense#2019-05-0920:31dpsuttoni think there's a package that loads your shells path. but not sure#2019-05-0921:02madstapThanks! Now that I know what the problem is I'll look for that package (and install from source if I can't find and use it easily ¯\(ツ)/¯).#2019-05-0922:45richiardiandreaHas anybody ever looked into this for Clojure/ClojureScript? https://github.com/emacs-lsp/dap-mode#2019-05-1007:24hkjelsI tried setting it up a while back, but got frustrated and killed it before actually getting anywhere#2019-05-1006:04benedeknot this one but clojure-lsp may support this?!#2019-05-1006:05benedekclojure-lsp is a clojure lsp server that works with lsp-mode in emacs (hosted by the same github group)#2019-05-1007:26bozhidar@richiardiandrea Someone from dap-mode reached out to me once, but I don’t remember the details.#2019-05-1007:28bozhidarhttps://github.com/clojure-emacs/cider/issues/2423#2019-05-1007:53bozhidarSeems it won’t be hard to provide a good integration between it and CIDER.#2019-05-1015:08richiardiandreaIt definitely seems cool and straightforward, maybe for Cljs and Clojure the protocol could be the same#2019-05-1014:33rickmoynihanDid I read somewhere that there was a cider command for evaluating expressions inside a thread first / thread last?#2019-05-1014:35dpsuttoni think @richiardiandrea added a command to close as many parens as needed and eval?#2019-05-1014:35rickmoynihanyeah that’s the one#2019-05-1014:36rickmoynihanI glossed over some chat about it a while back#2019-05-2515:41benedek?!#2019-05-2515:43borkdudewell, no ns-reload does what require does when you do :reload I think#2019-05-2515:44borkdudeor maybe there is: https://github.com/clojure-emacs/cider/blob/master/doc/miscellaneous_features.md#reloading-code
I have to read this carefully, but now I’m afk for cooking dinner 🙂#2019-05-2515:45borkdudecider-ns-refresh throws an exception in my emacs, not sure what this is#2019-05-2515:55borkdudeit tries to (re)load namespaces that are in my test directory, that need deps I haven’t loaded in my REPL, so it crashes 😕#2019-05-2515:57borkdudewhat I would need is a more fine-grained behavior than “try to reload all namespaces you can find”, just the current one#2019-05-2517:12yuhansame here, I tend to have lots of scratch files in a dev folder acting like a persistent REPL history / ad hoc tests#2019-05-2517:14yuhanwhich cider-ns-refresh ends up trying to reload indiscriminately and throwing an error on random broken snippets#2019-05-2601:42yuhanDoes anyone know why cider-read-symbol-name and cider-try-symbol-at-point coerce keywords to symbols?#2019-05-2601:44yuhanI was trying to write an extension to cider-doc which would dispatch to cider-browse-spec when called on a keyword, which is what I mean to do most of the time#2019-05-2601:45yuhanAnd I can't think of a use-case where reading :foo/bar as foo/bar would be useful#2019-05-2616:20bozhidar@qythium Likely it’s just how thing-at-point works, which seems reasonable to me. Keep in mind that symbols and keywords are different syntactic entities.#2019-05-2616:22bozhidarI’m pretty certain I never made special efforts to coerce keywords to symbols. I just assumed that the users will run symbol specific commands on symbols. 🙂#2019-05-2702:26yuhan@bozhidar nope, there's an explicit call to cider--kw-to-symbol in both those functions which does the coercion, thing-at-point recognizes them as different entities.#2019-05-2702:27yuhanhttps://github.com/clojure-emacs/cider/blob/2586df7dc69c168ebd904128a17f90419868d80a/cider-common.el#L119#2019-05-2704:52bozhidarWell, I guess we had some reason do so then. 😄#2019-05-2704:54bozhidarYou’ll have to go through the history to see what triggered the addition of this conversion.#2019-05-2715:08yuhanI traced it back to this issue from 2015: https://github.com/clojure-emacs/cider/issues/1220#2019-05-2715:10yuhanDidn't realise that there were libraries out there that used keywords to refer to similarly named vars/functions - I wonder how common of a practice this is (as mentioned in the issue discussion too)#2019-05-2708:04vigilancetechwhen I'm working in a cljs project, say I want to view a value (created from a def), why does it give me WARNING: Use of undeclared Var but then it prints the value to the REPL and how do I make the warning go away?#2019-05-2714:50felipebarrosIs there a special reason why the README specifically mentions lein and boot but not the CLI tools or is it just missing a PR?#2019-05-2716:52bozhidar@anantpaatra Just an oversight.#2019-05-2716:52bozhidarThe README was written before the CLI tools existed. 🙂#2019-05-2716:52bozhidarThey are properly documented in the manual, though. See https://cider.mx/cider/basics/up_and_running.html#2019-05-2723:35lvhCIDER appears to be mostly working fine but is no longer automatically creating ns forms when I create a new source file. I can't tell because they're in an unusual directory structure (`server/test/project/xyz.clj` and server/src/project/abc.clj) -- how do I start debugging that?#2019-05-2723:41dpsuttonThat was a clj refactor feature I think. Although clojuremode has an insert-namespace-form I think#2019-05-2723:47dpsutton@lvh https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L1095#2019-05-2800:08lvhThanks! I thought I remembered that but couldn’t find the cljr feature, so I think spacemacs updates might have broke this#2019-05-2805:49benedekthere is a config to switch this off/on maybe this changed in the spacemacs layer?!#2019-05-2807:29bozhidar@benedek I think clj-refactor.el was disabled by default, as it was often out of sync with CIDER and the upgrades were causing a lot of breakages.#2019-05-2807:30bozhidarGenerally a simpler setup is better for beginners and advanced users generally can enable everything they want/need.#2019-05-2807:31benedekah did not realise#2019-05-2807:31benedekthx for the info#2019-05-2807:35bozhidarYeah, I remembered this correctly https://github.com/syl20bnr/spacemacs/tree/develop/layers/+lang/clojure#enabling-sayid-or-clj-refactor#2019-05-2807:36bozhidarMaybe we should mention it in the project READMEs (sayid and clj-refactor) at some point.#2019-05-2814:29rickmoynihanIs it just me or is https://cider.mx/ down?#2019-05-2814:30rickmoynihanno bother I can use https://github.com/clojure-emacs/cider/tree/master/doc/modules/ROOT/pages — just weird#2019-05-2814:33manuelit is down for me too#2019-05-2814:35mgrbyteyou want: https://docs.cider.mx I think (that's what's linked from the top-level README in the cider repo)#2019-05-2814:35manuelyep, that works#2019-05-2814:37mgrbytealthough I note cider-view-manual does not resolve correctly (goes to "https://docs.cider.mx/en/latest/" which 404s)#2019-05-2814:59rickmoynihanthanks#2019-05-2815:00rickmoynihanfor some reason my brower history has …#2019-05-2815:22bozhidar@rickmoynihan I’ve reworked the manual a couple of days ago. The new one is https://docs.cider.mx/. I’ll still wondering what to put at the apex domain (http://cider.mx). I’d love to create one nice overview page for the project in the style of http://antora.org, but my design skills are too limited. 😄#2019-05-2815:22bozhidar@mgrbyte I haven’t updated the links in CIDER itself, but I’ll do this soon.#2019-05-2815:23rickmoynihan@bozhidar: that’s really neat :thumbsup:#2019-05-2815:23rickmoynihanI’d noticed your new drop down, very cool#2019-05-2815:23bozhidarFYI the legacy docs are still available at https://cider.readthedocs.io/en/latest/ (with a deprecation notice)#2019-05-2815:26bozhidar@rickmoynihan The new manual is powered by Antora and AsciiDoc, which are infinitely better than Markdown, MkDocs and ReadTheDocs. There are some open items (e.g. auto-deployment, search), but I’m pretty happy with the results so far.#2019-05-2815:27rickmoynihanis antora an oss project itself, or a service?#2019-05-2815:27rickmoynihanahh cool it’s a cli tool#2019-05-2815:29dominicmIt's my fault, I'll take responsibility#2019-05-2815:29rickmoynihanit’s just a shame asciidoc isn’t org-mode 🙂 - ho ho ho#2019-05-2815:29dominicmThat's also my fault#2019-05-2815:29rickmoynihangrrr 😉#2019-05-2815:30dominicmI guess it makes less sense in the context of cider, but JUXT standardized asciidoc because I couldn't edit the org files#2019-05-2815:30rickmoynihanyes other people are org-modes only problem 🙂#2019-05-2815:31dominicmMakes sense for the cider-nrepl stuff though#2019-05-2815:31dominicmOrg mode has breaking changes and is hard to parse. Very hard for complete tools to emerge. The vim org stuff is only partially complete.#2019-05-2815:33rickmoynihanyeah I know… it’s incredibly tightly coupled to Emacs. It’s just a shame that it’s simultaneously often the best tool for the job; but also the worst for almost everyone else.#2019-05-2815:34rickmoynihanI’ve liked the look of asciidoc for a long time though, as a half decent alternative#2019-05-2815:51bozhidar> It’s my fault, I’ll take responsibility#2019-05-2815:52bozhidar@dominicm True that. I’m not sure how I feel about Antora per se, but I definitely love AsciiDoc.#2019-05-2815:52bozhidarI’ve long avoided org-mode (believe it or not), as it’s too Emacs-specific.#2019-05-2815:52dominicmWe are strongly considering building our own antora#2019-05-2815:53dominicmI just can't quite figure out lucene 😁#2019-05-2815:54bozhidarBut I do plan to put one documentation module in cider-nrepl and pull it in the main cider docs site. Maybe more down the road.#2019-05-2815:54bozhidarIf there’s one thing I love about Antora, it’s the ability to pull doc modules from multiple repos.#2019-05-2815:55dominicmThat's awesome. I think I could reproduce it with tools.gitlibs#2019-05-2901:50vigilancetechwhen I'm working in a cljs project, say I want to view a value (created from a def), why does it give me WARNING: Use of undeclared Var but then it prints the value to the REPL and how do I make the warning go away?#2019-05-2909:43bozhidar@rickmoynihan FYI - https://cider.mx/ works again.#2019-05-2909:52mgrbyteLooks great @U051BLM8F :thumbsup: Some quick feedback, think your missing href bookmark links to the various sections for the header items (Overview, Features, Testimontials)#2019-05-2909:53bozhidarI know. 😄#2019-05-2909:54mgrbyteI missed the "need some works" bit, sorry! 😜#2019-05-2909:54bozhidarI consider the current landing page a very rough draft, but I decided to push something anyways, as it beats the 404. I haven’t written any front-end code in a very long time and I had to take a crash course in Bootstrap to come up even with this. 😄#2019-05-2910:30dominicmvery nice#2019-05-2910:41manuellooks great to me!#2019-05-2912:11rickmoynihanlooks amazing!!!#2019-05-2912:55practicalli-john@U051BLM8F I am not an expert, but have did create a couple of nice landing pages for ClojureBridge and Practicalli. Happy to help out with the CIDER landing page if interested, especially if you want to do it in ClojureScript 🙂
https://practicalli.github.io/
https://clojurebridgelondon.github.io/#2019-05-2912:55practicalli-johnI use http://Bulma.io rather than Bootstrap as it feels a bit more intuitive to use#2019-05-2913:06bozhidarThanks! Any help on that front would be most welcome! I opted for Bootstrap, as it was something I used in the past and I don’t really follow front-end trends much. The landing page is completely static right now, but if you find a reason to sneak in some ClojureScript there - be my guest. 🙂#2019-05-2913:24practicalli-johnThere is always a reason (obsession) to sneak in some ClojureScript 🙂 I'll take a look and come up with some ideas in a forked repo (it will be good practice for me at least)#2019-05-2913:58dominicm@U05254DQM what kind of reasons you aiming at? Edge could use a landing page, so I'm watching you both closely ;)#2019-05-2914:01practicalli-johnI am enjoying building up my visual skills and seeing how far I can get. ClojureScript has helped a lot. Also it's a nice visual way to get new people into Clojure#2019-05-2914:08dominicmIf you're just doing static stuff, there's loads of live reload tools for static sites :)
Do you have ideas for dynamic regions?#2019-05-2914:25practicalli-johnSimple dynamic stuff I just put as data in a reagent atom and trigger updates to content or style based on changes to the atom. Try to use CSS as much as possible for browser compatibility.#2019-05-2914:27practicalli-johnI tend to use reagent and figwheel as I know it but am always interested in other tools. Getting into figwheel-main and Clojure CLI tools#2019-05-2909:43bozhidarI forced myself to write HTML and CSS for the first time in a very long time and I came up with this. 😄#2019-05-2909:43bozhidarIt needs some works, but it’s better than a 404. 😄 😄 😄 (I hope)#2019-05-2912:15rickmoynihaninfinitely better than a 404 🙂#2019-05-2920:26arohnerI’m running cider using M-x cider-connect and everything is fine. Then after several reboots of my clojure processes, one of my emacs buffers says cider[not connected], and C-c C-z doesn’t work in that buffer, but if I switch to my repl buffer, I can send forms as usual#2019-05-2920:26arohnerwhat’s going on, and how do I fix that?#2019-05-2920:26arohnerrunning 0.21.0#2019-05-2920:27arohnerkilling the .clj buffer and reloading the file doesn’t help#2019-05-2920:34arohnerkilling the (mostly-working) repl connection and reconnecting did fix it#2019-05-3005:42carkhdocumentation typo:
https://docs.cider.mx/cider/additional_packages.html
the link to clj-refactor displays clr-refactor which of course doesn't make sense =)#2019-05-3006:14bozhidar@carkh Thanks for spotting this!#2019-05-3006:15carkhhah i'd rather thank you for your awesome work#2019-05-3006:52bozhidarcider#2019-05-3021:01pyrnice work on http://cider.mx everyone!#2019-05-3021:01pyr(or at least, everyone involved :-))#2019-05-3106:19bozhidarThanks!#2019-05-3111:38rickmoynihanGiven that tools.deps doesn’t support :injections like lein, would it make sense for nrepl to offer such a feature?#2019-05-3115:20dominicmIt does :)#2019-05-3115:20dominicmVia the -m option?#2019-05-3115:20dominicmUnless I'm misunderstanding?#2019-05-3115:22rickmoynihando you mean clojure cli’s -main or nrepl’s -middleware options?
AFAIK neither of those are the same as :injections… though a middleware could certainly provide a similar capability.#2019-05-3115:23dominicmWhat is injections?#2019-05-3115:23dominicmI must not know what it is#2019-05-3115:23rickmoynihanforms that get wrapped over every repl interaction#2019-05-3115:24dominicmOh, how did lein provide that?!#2019-05-3115:24dominicm@U051BLM8F guessing you might have a guess? I can only assume it's a form of middleware#2019-05-3115:26rickmoynihanactually scratch that — I don’t understand injections… they’re not quite what I thought#2019-05-3115:27rickmoynihanI think they get executed when evaluating of project.clj#2019-05-3113:10bozhidar@rickmoynihan See https://github.com/nrepl/nrepl/pull/109#2019-05-3113:17rickmoynihanInteresting… Isn’t that about letting the nrepl server access resources from the client?
I’m not sure I see the connection…#2019-05-3113:18rickmoynihanthough such a powerful feature could surely enable a lot of things#2019-05-3113:11bozhidarWe have to wrap this up at some point, as it’s an extremely important feature.#2019-05-3113:11dpsuttonit appears reid has taken down http://conj.io/grimoire#2019-05-3113:11rickmoynihan👀#2019-05-3113:11bozhidar> it appears reid has taken down http://conj.io/grimoire#2019-05-3113:11dpsuttonhoping we can get it transferred to some entity still active in clojure and keep it going.#2019-05-3113:11bozhidarI’ll ask him about this. I think he abandoned it a while ago and probably decided to pull the plug on it.#2019-05-3113:12dpsuttonyes this morning. daniel compton and i have emailed him about taking over it. I sent a follow up this morning as its been a while. feel free to ping him as well#2019-05-3113:14bozhidarBtw, this might also be a good thing, as it means more cohesion on docs front.#2019-05-3113:14bozhidarI don’t know. I liked http://conj.io, but https://clojuredocs.org/ was always way more popular.#2019-05-3113:14bozhidarSometimes it’s better to focus more efforts on fewer things.#2019-05-3114:02orestisWhen I first arrived in Clojure, it was a little bit overwhelming with many different community-based efforts on docs. Clojure Docs was the best for me, if only because of the comments.#2019-05-3114:02orestisIt’d be nice if old links were still around though…#2019-05-3114:22bozhidarNo argument from me. 🙂#2019-05-3114:24bozhidarI just know Reid put a lot of efforts in http://conj.io and unfortunately they didn’t pay off. If i recall the story correctly he started the project at the time when https://clojuredocs.org/ was dormant, but then it was revived and this killed the interest in Grimoire.#2019-05-3114:43bozhidar@dpsutton He confirmed he was done with http://conj.io. He had written about this on Twitter, but I hadn’t seen this. Anyways, the ball is yours now.#2019-05-3114:56dpsutton👍#2019-05-3115:18Nick StaresNot sure if this is the right place to ask this question, but cljr-find-usages does not work for me in clj-refactor 2.4.0 (package: 20190516.1254), refactor-nrepl 2.4.0-SNAPSHOT#2019-05-3115:19Nick StaresShould it work immediately after evaluating a buffer?#2019-05-3115:27bozhidar@dpsutton http://conj.io is back. 🙂 Reid just fixed it.#2019-05-3115:28dpsuttoni don't know what the celebrate emoji is 😞#2019-05-3115:28tanners🎉#2019-05-3115:31dpsuttonhaha thanks!#2019-05-3115:33dpsuttoni was looking for :huzzah:#2019-05-3117:39mikerodwhen using cider-jack-in-clj&cljs with figwheel, it doesn’t seem that it respects project.clj config of the form:
:figwheel {:init user/restart
:destroy user/shutdown
:css-dirs ["resources/public/css"]}
which is figwheel server side startup config. Is this true?#2019-05-3117:39mikerodI know jack-in is doing this
"(do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))"
#2019-05-3117:39mikerodnow I’m wondering if perhaps figwheel-sidecar.repl-api/start-figwheel! doesn’t automatically look at this config#2019-05-3117:45mikerodI think it doesn’t#2019-05-3117:45mikerodSo that may solve that#2019-05-3119:52mpdairydoes anybody know how to truncate long spec explain messages in cider?#2019-05-3119:52ghadito be clear, it's not the message, but the ex-data#2019-05-3119:53mpdairyoh yeah, the ex-data is way too long sometimes#2019-05-3120:41ccanndoes anyone know how to add annotations to the company completions? the docs suggest they should be on by default, but I just get the following:#2019-05-3120:42ccann#2019-05-3120:43ccanncider-annotate-completion-candidates is t and cider-completion-annotations-alist has a bunch of kv pairs in the alist#2019-05-3121:12bozhidar@ccann Are you using company-mode for completions?#2019-05-3121:12ccannyeah#2019-05-3121:12ccannvia (global-company-mode)#2019-05-3121:13bozhidarHmm, then they should be there. Super weird.#2019-06-0314:01ccannturns out this was to do with the lispy package. It overrides the CIDER behavior. Not quite sure how to resolve that unfortunately.#2019-06-0501:30eval-on-pointI think this is a pretty big issue with lispy. As far as I know, there is no way to just get the "text editing" features without the "IDE-like feactures". It seems to cause a lot of subtle issues like this#2019-06-0518:40ccannagreed, this isn’t the first issue I’ve had#2019-05-3121:13bozhidar@mpdairy Can you post some screenshot?#2019-05-3121:14ccannthis is my config here
https://github.com/ccann/emacs/blob/master/init.el#L198
https://github.com/ccann/emacs/blob/master/init.el#L609#2019-05-3121:15ccannI tried toggling cider-annotate-completion-candidates to off and it has the same behavior as when it’s on#2019-06-0111:58Kari MarttilaI have used Emacs every now and then but I'm not an Emacs guru. I was wondering if there is an easy way to remap the typical key bindings in cider (evaluating expressions in code, loading file to repl, slurp, barf in code...). The reason for this is that I'd like those bindings to be the same I use with Cursive so that the same bindings are in my finger muscle memory.#2019-06-0112:11Kari MarttilaActually I just now realized that there is above by @ccann an example of this. I'll use that as an example.#2019-06-0114:35dmaiocchiHi, a short question, I'm using cider in jack-in-mode but when I create like a foo variable in the xx.core namespace, I get no such var .. error. But restarting cider it see the var#2019-06-0114:35dmaiocchiIf I restart with C-x C-s r#2019-06-0114:35dmaiocchiI'm doing something wrong ? :thinking_face:#2019-06-0114:35dmaiocchithx#2019-06-0114:54dmaiocchiah yep, so I have forgot to compile with C-C C-k facepalm 😭 😁 ok#2019-06-0114:54dmaiocchiI was remembering wrong that it auto-evaluated after I saved.. but it has been a while I didn't use it 😁#2019-06-0214:38vladexHi all. I’ve got couple of projects on tools.deps which are forming a dependency - very similar to monorepo. I have an issue that cider (20190528.801) wouldn’t evaluate code from transitive dependencies specified with :local/root. I can invoke fns from the ns of the dependency in the repl, is just if I change the code and try to evaluate the ns or a fn nothing happens. Any suggestions what I am doing wrong?#2019-06-0216:04dominicm@vladex I think you're looking for the sesman commands. sesman-link-buffer, etc.#2019-06-0216:04dominicmI think the cider docs have a section on it#2019-06-0220:56bozhidar^^ https://docs.cider.mx/cider/usage/managing_connections.html#2019-06-0308:20vladexthx a lot, will check the docs 📖#2019-06-0407:55lispycloudsHello @bozhidar, I'm having trouble jacking in with boot 2.8.3, Clojure 1.10. Seeing this error pop up after Emacs freezes for a couple of seconds#2019-06-0407:55lispyclouds#2019-06-0407:56lispycloudsalso things like jump to definitions are not working#2019-06-0407:56lispycloudsI assume its something to do with https://github.com/clojure-emacs/cider/pull/2643 ?#2019-06-0407:57lispycloudsjack in works fine with leiningen though#2019-06-0408:51bozhidar@rahul080327 Hmm, maybe there was difference between the custom boot task and the default one that we forgot about. Can you file a ticket for this?#2019-06-0409:25lispyclouds@bozhidar raised it here: https://github.com/clojure-emacs/cider/issues/2644#2019-06-0410:13bozhidarGreat!#2019-06-0418:13arohnerI’m still seeing an intermitting problem with my cider repl connections. I can M-x cider-connect, and then some of my buffers work. Others say not connected#2019-06-0418:14arohnerIf I kill the repl buffer and reconnect, things again work, for a different set of buffers#2019-06-0418:26arohnerrunning 0.21.0 from melpa#2019-06-0418:37arohnerit appears the problem is related to files being in a separate lein project that is a dependency of my main project#2019-06-0418:38arohnerweirdly, if I cider-jack-in to the main project, and then visit the a dependency’s source file and cider-connect, I get two different repl buffers on the same nrepl connection#2019-06-0418:38arohnerbut they share a clojure env so it kinda-sorta works ¯\(ツ)/¯#2019-06-0506:28bozhidar@arohner I guess your problem stems from how CIDER tried to map every connection to some file context (usually the root of a project), so when you’re working with multiple projects it would know where to dispatch the evaluation ops. This doesn’t work well on non-conventional projects currently and some manual work is usually needed https://docs.cider.mx/cider/usage/managing_connections.html#2019-06-0512:10arohnerThanks. In CIDER friendly sessions are defined by the project dependencies.
So I connect to project A, and project B is a dependency, but buffers containing B’s source files currently say ‘not connected’. Is that intended?#2019-06-0518:02Ian Fernandezhey#2019-06-0518:02Ian Fernandezguys, how I can debug cider on emacs?#2019-06-0518:02Ian Fernandezthese days Cider is very sow with me#2019-06-0518:03Ian Fernandezslow*#2019-06-0518:14bozhidar@d.ian.b I’d start here https://docs.cider.mx/cider/troubleshooting.html#_debugging_cider_commands#2019-06-0518:16Ian Fernandez#2019-06-0518:16Ian FernandezI'm having this with profiler#2019-06-0518:17Ian Fernandezevery time I start cider emacs became very slow#2019-06-0518:23Ian Fernandezit could be this??
(let ((normal-gc-cons-threshold (* 20 1024 1024))
(init-gc-cons-threshold (* 128 1024 1024)))
(setq gc-cons-threshold init-gc-cons-threshold)
(add-hook 'emacs-startup-hook
(lambda () (setq gc-cons-threshold normal-gc-cons-threshold))))
#2019-06-0518:27bozhidarDoubtful. Here you’re just setting a high GC threshold during Emacs’s startup. That shouldn’t be causing general slowdowns.#2019-06-0518:27bozhidarAs for the profiler you need to expand the data in the reports to see which are the real functions where the time is going into.#2019-06-0609:04minikomiIs there something I can set to prevent focusing switching to the result of cider-pprint-eval-last-sexp ?#2019-06-0609:48bozhidar@minikomi Currently not. Its easy to make this customisable, though.#2019-06-0609:48bozhidarAs a simple work-around - pressing q in the result buffer will make it disappear.#2019-06-0714:46borkdudeI consider this the channel also for the Clojure style guide (because of a lack of one and because @bozhidar is here :))
So I’m going to link this here: https://github.com/borkdude/clj-kondo/issues/241
There have been discussions in several issues in different projects. I think the style guide should maybe take a stance on this#2019-06-0715:17bozhidar@borkdude I prefer option 2. I totally agree we should document this in the style guide. I’ve many times deleted a namespace like this, because joker told me it was unused. 🙂#2019-06-1010:52rickmoynihanWhat about this as an option?
https://github.com/borkdude/clj-kondo/issues/241#issuecomment-500374252#2019-06-0715:18lreadjoker was just joking about that I guess simple_smile#2019-06-0715:20borkdude@bozhidar I like that idea, except that it breaks alignment#2019-06-0715:21borkdude[^:keep foo] would also be possible, but some tools might not see the metadata because you can’t actually add metadata onto a symbol 😉#2019-06-0715:23bozhidarGood points.#2019-06-0715:24bozhidarWell, I guess option is the most balanced then, but I assume some linters might consider an obsolete refer. 😄#2019-06-0715:24bozhidarTricky situation…#2019-06-0715:24borkdudeclojure-mode could be adapted to align vectors vertically in namespace declarations#2019-06-0715:32borkdudeabout vertical alignment, it seems clojure-sort-ns already respects metadata, kind of:
(ns foo
(:require
^:keep [bar.specs]
^:keep [foo.specs]
[another.namespace.a]
[another.namespace.b]))
#2019-06-0715:32borkdudeso maybe this wouldn’t be a problem, since ‘kept’ libspecs go on top anyways#2019-06-0715:40borkdudeanother idea:
(ns foo (:require (foo.specs)))
#2019-06-0715:41dpsuttoni like that idea#2019-06-0715:41borkdudeme too#2019-06-0716:11bozhidar@borkdude Please, file a ticket on the style guide repo, so others can see/join the conversation and we’ll decide on the approach to adopt in the next few days.#2019-06-0716:12borkdudeIs it ok to redirect the conversation from there to the issue already open, since it already has a few comments?#2019-06-0716:14bozhidarYeah, that’s fine. I just want everyone watching the repo to see we’re discussing a new rule.#2019-06-0716:14borkdude👍#2019-06-0716:17borkdudeI’ll make an issue at joker and maybe cursive as well#2019-06-0723:05julio-slacknoticing a weird behavior in cider cljs repls: the content of the cider-classpatch doesn't match the lein deps: tree, specifically the cider-classpath reports older version of artifacts (transitive dependency), which is causing compilation errors. any ideas?#2019-06-0723:07julio-slackSpecifically: according to lein: [metosin/reitit "0.3.7"]
[metosin/reitit-core "0.3.7"]
[meta-merge "1.0.0"]
according to cider-class path:#2019-06-0723:07julio-slack.m2/repository/meta-merge/meta-merge/0.1.1/meta-merge-0.1.1.jar#2019-06-0801:19julio-slackhmm never mind, my bad! I had an old tweaked refactor-nrepl installed in my local cache. Removing this, cleared the issues#2019-06-0904:03naomarikI used to be able to connect a cljs and a clj repl and have them work flawlessly, now I get an error like this user-error: No clj REPLs in current session "Sites/booma:localhost:5056" it will work as soon as I bring the clj repl buffer into focus, but then the cljs repl will give me the same error.
sesman info gives me this:
1 Sites/booma:localhost:5056 [*cider-repl %s(cljs)*] linked-to proj(~/Sites/booma/)
2 Sites/booma:localhost:5056#2 [*cider-repl %s(clj)*] linked-to proj(~/Sites/booma/)
#2019-06-0904:04naomarikso both repls work, but i have to manually open the repl buffer that corresponds to cljs or clj depending on what i’m trying to evaluate#2019-06-0904:07naomarikthis is my cider version CIDER 0.22.0snapshot (package: 20190607.2013), nREPL 0.6.0#2019-06-0906:53bozhidar@naomarik When did you start experiencing your problems? There haven’t really been any related updates in CIDER for a while now.#2019-06-0906:54bozhidarWhen exactly do you get the errors?#2019-06-0907:24naomarik@bozhidar i usually backup my emacs.d directory before updating everything, so it looks like version 0.17.0-snapshot of cider is what i was using before this latest version. The error displays when I use the function cider-switch-to-repl-buffer If the last repl buffer was a clj repl, and I try to use cider-switch-to-repl-buffer from a cljs file, I get this error and evaling anything does not work. As soon as I focus the cljs repl buffer, everything is good for cljs, then doing clj stuff breaks until I focus the clj buffer. I have the two repls running at the same time for backend/frontend shown from the sesman info output.#2019-06-0907:29naomarikIf you’re connected to a cljs and clj repl at same time in the same project, you’re able to evaluate both of them without having to focus the repl buffer of the type you want?#2019-06-0908:31bozhidarAh, so you’ve updated from a pretty old version. I get it.#2019-06-0908:32bozhidarWell, your session data looks correct assuming you’re trying to evaluate code that is in this booma folder.#2019-06-0908:33bozhidarHave you seen https://docs.cider.mx/cider/usage/managing_connections.html?#2019-06-0911:21naomarikdidn’t see that, but https://docs.cider.mx/cider/usage/managing_connections.html#_current_repl doesn’t seem to be working for me anymore, does my sesman info look correct? Maybe it’s my setup, I’ll try a new skeleton project later on and see if I get same behavior…#2019-06-0911:23naomarikfor context i’m launching a boot repl with my boot dev command and using cider-connect on it. Then for the cljs one I’m using (figwheel-sidecar.repl-api/cljs-repl "dash") in one repl to connect to cljs.#2019-06-0922:19lvhI'm starting to experiment with clj/deps.edn and I'm hitting a problem with CIDER where C-c C-k only works in the buffer where I jack in, it doesn't work when I open sibling files to that file (in the same directory) -- for some reason the repl doesn't attach there. Any idea how I debug that?#2019-06-0922:19lvhpreviously I noticed that behavior with a test directory, but I assumed that was because CIDER wasn't applying the test alias by default, so the file wasn't in the classpath#2019-06-0922:19lvhthis file definitely is#2019-06-0922:20lvh(I know because I can (require 'my.ns) in the repl)#2019-06-0922:22lvhwhen I manually run cider-connect-sibling-clj, the buffer works as expected#2019-06-1010:57orestisAre you on the latest cider and supporting libs? nRepl, cider-middleware etc. I think I remember similar mysterious issues that went away after an update. #2019-06-1010:58orestisIf you are, I’d look into the various cider / sessman functions to try and see what cider thinks about your buffers. I always found the session management of cider to be a little confusing, probably because I don’t know much about emacs/sessman. #2019-06-1011:03bozhidarYeah, yeah. The documentation definitely needs some improvement. 🙂#2019-06-1011:05bozhidarVery simply put on jack-in REPLs are mapped to the project that created them, so you can switch easily between REPLs for different projects and you won’t evaluate code from one project in the REPL for another project by accident.#2019-06-1011:05bozhidarEverything on the subject (which is admittedly not much) lives here https://docs.cider.mx/cider/usage/managing_connections.html#2019-06-1011:06bozhidarGenerally the common problem people encounter is that they try to evaluate code in files that CIDER doesn’t consider part of the project owning the REPL. Turned out we didn’t initially consider all the setups people could possibly have. 🙂#2019-06-1016:42TravisMight be a dumb question but I am new to using deps.edn but is there anything special that you need to do so CIDER sees deps that exist in a Test alias ? After jacking in it cannot find deps that exist in that alias for my test source.#2019-06-1016:45dpsuttonyou need that alias. run the jack in with a prefix argument. (C-u C-c M-j) and it will let you edit the startup command. you can stick the alias on there#2019-06-1016:56Travisthanks!#2019-06-1215:10lvhthanks for helping me debug that sesman problem the other day; turns out it's really a spacemacs bug: https://github.com/syl20bnr/spacemacs/issues/12429#2019-06-1215:11lvhjust in case someone else comes in with the same problem, I assume I'm not the only spacemacs hybrid-mode user#2019-06-1216:59bozhidar@lvh Good to know! Thanks for following up!#2019-06-1219:45frozenlockI noticed some discrepancies between the normal REPL representation and the printed one :
(sql/call :some-call :some-arg)
-> {:name :some-call, :args (:some-arg)}
(print (sql/call :some-call :some-arg))
-> #sql/call [:some-call :some-arg]nil
Is this caused by CIDER, or is there a missing definition in HoneySQL? https://github.com/jkk/honeysql/blob/354b3502c81c45e4fe5de11dd2139a803e2aa760/src/honeysql/types.cljc#L75#2019-06-1219:48dpsuttoncan you compare it to running with just lein repl?#2019-06-1219:48dpsuttonremove CIDER from the equation altogether#2019-06-1219:56frozenlockIt prints as expected with lein repl#2019-06-1219:56frozenlock(sql/call :test :arg)
-> #sql/call [:test :arg]
#2019-06-1306:33bozhidar@frozenlock CIDER’s REPL uses fipp for printing the results by default. I assume the difference is coming from there.#2019-06-1311:08borkdudegentle reminder, feel free to vote on a convention for refactor-nrepl and other tooling: https://github.com/borkdude/clj-kondo/issues/241#issuecomment-500805941#2019-06-1311:43practicalli-johnI never came across this style of adding requires until you asked, so thanks for that.
Is it really used that much? Or is it a recent thing with the advent of spec?
If its not used in the majority of code bases, then perhaps it should just be a tooling option you can switch off / on as required.#2019-06-1311:44borkdudestyle of adding requires?#2019-06-1311:45tatutnot only spec, defmethod is side-affecting also#2019-06-1311:46borkdudeyes, also loading foreign libs with cljsjs. e.g. (:require [cljsjs.foobar])#2019-06-1314:33practicalli-johnInteresting. I really had not come across that at all...
I have always used either :refer [] or :as with the :require.
Something to look out for in future. Thanks for the examples.#2019-06-1404:31frozenlock@bozhidar Thanks, I'll take a look!#2019-06-1407:30felipebarrosI'm trying to cider-jack-in-cljs into https://github.com/lispcast/understanding-re-frame/tree/001 but keep getting the error in process filter: Sync nREPL request timed out (op clone id 1) error. I'm using Emacs 26.1 and CIDER 0.22.0snapshot (package: 20190607.2013). No luck so far.
It doesn't even matter if I evaluate the code in the README or not:
(setq cider-cljs-lein-repl
"(do (require 'figwheel-sidecar.repl-api)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl))")
#2019-06-1408:56bozhidar@anantpaatra This configuration format was changed a while ago. See https://docs.cider.mx/cider/basics/clojurescript.html for details.#2019-06-1408:58bozhidar(there’s no cider-cljs-lein-repl now and the replacement option doesn’t take a form)#2019-06-1416:15eval-on-point@anantpaatra see my post (http://discuss.purelyfunctional.tv/t/figwheel-repl-timeouts-in-understanding-re-frame-course/1215) on the lispcast discussion group. As of right now the current version of Cider (not sure which it is at the moment) in Melpa Stable is compliant with the Understanding Re-frame course. As things move forward, Eric will probably have to update the project.clj himself.#2019-06-1416:16felipebarrosThank you!#2019-06-1416:21eval-on-pointNo problem, @U3SG7RX7A is the real mvp!#2019-06-1417:56felipebarrosI have solved it using @bozhidar link. Just modified the piggieback dependency to [cider/piggieback "0.4.1]" and changed the namespace in the :repl-options to cider.piggieback/wrap-cljs-repl. 🙂 No need to migrate to melpa stable.#2019-06-1517:05bozhidarGlad to hear this!#2019-06-1419:12ericnormandthanks @mitchell_clojure#2019-06-1419:12ericnormandI'll make this clear in the readme#2019-06-1419:18eval-on-pointThank you @ericnormand! You're service has really helped me bridge the gap between knowing the language and being able to effectively operate in the Clojure ecosystem. It's awesome work.#2019-06-1421:00ericnormandAwesome! I'm glad I could be of service.#2019-06-1422:50dottedmagHow do I debug CIDER thinking that the file's namespace is ...Downloads.jemod.src.mg.dt.jemod.spec?#2019-06-1422:51dottedmag(should be mg.dt.jemod.spec)#2019-06-1422:53dottedmagWeird, restarting Emacs helped (killing CIDER REPL and starting it afresh didn't, neither closing/opening buffers)#2019-06-1504:00Eric IhliBrand new lein new my-proj, I open project.clj and type cljr-add-project-dependency and I get the error below. Anyone have any troubleshooting ideas?
Retrieving list of available libraries...
cljr--get-error-value: Error in nrepl-refactor: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: trident/1.1
#2019-06-1504:02Eric IhliWhelp. Never mind. I moved to duckduckgo recently and I forgot that Google can sometimes give much better results. Found what I was looking for there. https://github.com/syl20bnr/spacemacs/issues/12385#2019-06-1509:36pez@bozhidar, I saw that ´good-first-issue` on the repo about repl tools for cljs. I figured I wanted to give it a shot, but didn’t find any info on how to hack on cider in that readme. I can google it, of course, but is there a reason there isn’t a link in the README?#2019-06-1511:36dumratHi guys, cider jack in today gives this error:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.4.5\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init7254150147707415858.clj:4223:33)
Any idea why this happens? Used to be fine till yesterday so I'm guessing some update somewhere?#2019-06-1513:44bozhidar@pez I just assumed most people would go to the docs site, instead of to the README. There’s a whole section there.#2019-06-1513:45bozhidarI also think it’s linked from the contribution templates, etc. No harm in adding it to the README as well.#2019-06-1513:45bozhidar@dumrat I see you’re using a very old version of CIDER. I’d recommend updating to the current version (0.21) or the current dev version (0.22-snapshot).#2019-06-1513:46bozhidarAlso make sure you’re running Lein 2.9.1+.#2019-06-1514:18pez@bozhidar, I would have googled it, never occurred to me to check the docs site. 😃#2019-06-1516:03benedek@ericihli yup, this got fixed tho. you just need to use a snaphsot version, see the related refactor-nrepl version issue (from the spacemacs issue)#2019-06-1516:44bozhidar@pez No one ever reads the docs. 😄#2019-06-1517:12dumratUpdated lein, reinstalled everything. I still get this error:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta4\"\] -- repl :headless :host localhost...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init8632471219806107511.clj:4223:33)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:1009)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3834)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6269)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.eval(Compiler.java:6924)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler.resolveIn(Compiler.java:7164)
at clojure.lang.Compiler.resolve(Compiler.java:7108)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7069)
at clojure.lang.Compiler.analyze(Compiler.java:6648)
... 50 more
Subprocess failed
#2019-06-1517:17dpsuttonWhich clojure version are you using. And can you get a running repl with just “lein repl”?#2019-06-1517:36dumrat@dpsutton: Turns out, I can't.
Dumindas-MacBook-Pro:~ duminda$ lein --version
Leiningen 2.9.1 on Java 1.8.0_181 Java HotSpot(TM) 64-Bit Server VM
Dumindas-MacBook-Pro:~ duminda$ lein repl
[WARNING] No nREPL middleware descriptor in metadata of #'clojure.tools.nrepl.middleware.render-values/render-values, see nrepl.middleware/set-descriptor!
nREPL server started on port 54673 on host 127.0.0.1 -
ERROR: Unhandled REPL handler exception processing message {:id ca4db4fe-4051-4a1c-95b1-6394eac16366, :op clone}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__3935
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
at nrepl.transport$fn__9103$G__9098__9110.invoke(transport.clj:16)
at nrepl.middleware.print$send_nonstreamed.invokeStatic(print.clj:157)
at nrepl.middleware.print$send_nonstreamed.invoke(print.clj:138)
at nrepl.middleware.print$printing_transport$reify__9539.send(print.clj:174)
at nrepl.middleware.caught$caught_transport$reify__9570.send(caught.clj:58)
at nrepl.middleware.session$register_session.invokeStatic(session.clj:205)
at nrepl.middleware.session$register_session.invoke(session.clj:197)
at nrepl.middleware.session$session$fn__9743.invoke(session.clj:267)
at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
at nrepl.middleware.load_file$wrap_load_file$fn__9657.invoke(load_file.clj:81)
at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__9579.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__9550.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__9350.invoke(middleware.clj:16)
at clojure.tools.nrepl.middleware.render_values$render_values$fn__3943.invoke(render_values.clj:42)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1100.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__9774.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)#2019-06-1517:37dpsuttonthe project you are using depends on clojure.tools.nrepl. lein depends on the new nrepl/nrepl. Can you bump that dep?#2019-06-1517:41dumrat@dpsutton Sorry, prev was outside project dir. Here's what happens when I run lein repl inside project dir.
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init1899146372180899917.clj:4223:33)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve symbol: create in this context, compiling:(/private/var/folders/g_/ldc4hkys4r73yffyf77pcn1c0000gn/T/form-init1899146372180899917.clj:4223:33)
at clojure.lang.Compiler.analyze(Compiler.java:6688)
...
#2019-06-1517:42dpsuttonwell its not a CIDER issue then. Are there any usages of create in your project?#2019-06-1517:53dumrat@dpsutton: Ok, I had edited a namespace name in a source file and that was the reason for the create error.
However, after fixing the namespace name, I face the previous error with lein repl.
"the project you are using depends on clojure.tools.nrepl. lein depends on the new nrepl/nrepl. Can you bump that dep?"
My project file has no dependencies except clojure-1.8.0. So it's unclear to me what to do here.#2019-06-1517:53dpsuttonis it public?#2019-06-1517:54dpsuttoncan you place the error you're seeing now? I'm not sure i'm clear on what you are seeing now that the "create" bug is resolved#2019-06-1518:00dumratI get this error now:
[WARNING] No nREPL middleware descriptor in metadata of #'clojure.tools.nrepl.middleware.render-values/render-values, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
nREPL server started on port 54796 on host localhost -
ERROR: Unhandled REPL handler exception processing message {:op clone, :id 1}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.render_values$wrap_renderer$reify__2021
at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:568)
at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:560)
at nrepl.transport$eval402$fn__403$G__393__410.invoke(transport.clj:16)
at nrepl.middleware.session$register_session.invokeStatic(session.clj:205)
at nrepl.middleware.session$register_session.invoke(session.clj:197)
at nrepl.middleware.session$session$fn__1105.invoke(session.clj:267)
at nrepl.middleware$wrap_conj_descriptor$fn__668.invoke(middleware.clj:16)
at refactor_nrepl.middleware$wrap_refactor$fn__6497.invoke(middleware.clj:214)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1850.invoke(middleware.clj:22)
at clojure.tools.nrepl.middleware.render_values$render_values$fn__2027.invoke(render_values.clj:42)
at clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__1850.invoke(middleware.clj:22)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1142.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__4676.invoke(core.clj:1938)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
proj file:
https://github.com/nakiya/paint/blob/master/project.clj#2019-06-1518:01dpsuttondo you have a file at ~/.lein/profiles.clj?#2019-06-1518:01dpsuttonfrom your stacktrace #'clojure.tools.nrepl.middleware.render-values means that somehow clojure.tools.nrepl is involved. And since you have lein 2.9.1 it must be nrepl/nrepl#2019-06-1518:02dumrat~/.lein/profiles.clj:
{:user {:plugins [[venantius/ultra "0.5.2"]]}
:dependencies [[org.clojure/tools.trace "0.7.10"]]}
}#2019-06-1518:02dumratIs it due to org.clojure/tools.trace?#2019-06-1518:04dpsuttoni'm guessing venatius#2019-06-1518:05dpsuttonbut just try it with one commented out and then the other.#2019-06-1518:05dpsuttonBut venatius is made for a good lein-repl experience and you'r eusing CIDER so i don't see the value of it for you#2019-06-1518:05dpsuttonBut fundamentally these global things are always pains and you should get rid of them#2019-06-1518:09dumratAfter removing ~/.lein/profiles.clj everything is fine. Thank you @dpsutton for your help.#2019-06-1518:09dpsuttonglad i could help. happy coding 🙂#2019-06-1520:24pezHaha, @bozhidar , I am one to read the docs. But just a mention in the readme about checking the docs for how to hack on CIDER, would be good. #2019-06-1604:08theeternalpulseDo most people here run a repl separately and just connect to it? Is there a way for new projects to have their dependencies loaded into it?#2019-06-1606:42theeternalpulseI actually found the cljr hotload function but it seems not to work with later versions of java due to the way they changed loading files during runtime 😞#2019-06-1606:42theeternalpulseyou'd have to downgrade to jvm 8#2019-06-1606:45theeternalpulseit would be cool if the cider jack in actually spawned the process outside of emacs so if it crashed you can connect back to it. Unless this is a feature already#2019-06-1609:20practicalli-john@theeternalpulse the developers I know all use Jack-in so they do not need to manually manage the dependencies and versions. Any version of cider from 0.11 does this. Your question seems to suggest you are using cider 0.10 or earlier (if I have understood the question)
I haven’t had Cider crash Emacs, certainly not since Emacs 25.x.x. I usually have Cider running for days and weeks without issue. The worse that has happened is I burn up all the heap with some reckless code, but even then I can do cider-interrupt.#2019-06-1614:49theeternalpulseRigh, jack-in works fine, because the starting point is the current project so it loads the deps.edn file properly. If I start a repl with this clojure alias :cider-nrepl {:extra-deps {cider/cider-nrepl {:mvn/version "0.21.1"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"]}
and connect, the starting point wasn't my project so it doesn't include the dependencies. i'm using cider 0.20 (oslo).
Also my reference to crashing wasn't necessarily cider, but in general, closing emacs kills the repl process#2019-06-1609:45danieroux@jr0cket I like to start up a separate REPL, and have the deps, port and middleware be consistent and explicit for everyone on the team.#2019-06-1609:50practicalli-johnSo do you manage a shared .lein/ profiles.clj file in shared version control system, or do you add tool dependencies in your projects?#2019-06-1609:52practicalli-johnCan you elaborate why the REPL port needs to be the same? And how do you keep it the same, I thought it was random#2019-06-1610:30aisamuData point: I use fixed ports for convenience because they are tunneled#2019-06-1611:18danierouxI add tool deps in my project.
:nrepl
{:extra-deps {nrepl {:mvn/version "0.6.0"}
cider/piggieback {:mvn/version "0.4.0"}
cider/cider-nrepl {:mvn/version "0.21.1"}}
:extra-paths ["dev"]
:main-opts ["--main" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--port 9000"]}
#2019-06-1611:21danierouxAnd the ports are fixed, because the Cursive Run configuration is also version controlled. This way, a new person on the team can checkout the code; make repl; and connect via Cider or Cursive, consistently.#2019-06-1609:46danierouxAlso, sometimes I muck up my Emacs with some new thing I want to try out, and then killing and restarting is quick#2019-06-1614:52theeternalpulseSo what you suggested above, you start a repl separately, then do cider-jack-in or connect?#2019-06-1614:55theeternalpulseOh I see now. You have the alias for nrepl in your project and just kick it off there from a script, so you get the deps for your project but it's not tied to emacs#2019-06-1614:55theeternalpulseI think my problem is I'm kicking it off from my user deps.edn so it has no dependency information, this makes more sense#2019-06-1615:23danierouxI start nrepl with the above in the project deps.edn yes, and clojure -A:nrepl - then cider-connect-clj to it.#2019-06-1615:24danierouxI like the stability and the explicit version numbers#2019-06-1615:28theeternalpulseright, I got you, that make sense. My perfect use case would be to have one "Central" repl that I can just connect any application into and dynamically add deps to the classpath upon connect, so then I will never have to worry about opening a new connection or if I'm working on new projects,I can start it up from my profile.clj on startup#2019-06-1615:29theeternalpulsebut seems java gets in the way of that#2019-06-1615:48danierouxI want my repl’s to be project specific simple_smile#2019-06-1615:49danierouxTo complete the picture, I also have this:
(cider-register-cljs-repl-type 'user-custom "(start-cljs-repl)")
(setq cider-default-cljs-repl 'user-custom)
And all my ClojureScript user.clj’s have that function defined, and piggieback and it’s middleware is also explicitly defined#2019-06-1615:57theeternalpulsehmm, I'd have to look into that, I am on and off cljs and use shadow, but mostly on clj so not sure what that is doing#2019-06-1616:00danierouxSwapped from shadow to figwheel last week, and my Emacs remained unchanged - it just connects to whatever that function does.#2019-06-1616:02danierouxNow:
(defn start-cljs-repl []
(let [build-id "common"]
(do
(try
(figwheel.main.api/start build-id)
(catch RuntimeException e
(figwheel.main.api/cljs-repl build-id))))))
#2019-06-1616:03danierouxThen:
(defn start-cljs-repl []
(shadow/watch :local)
(println "Open to connect and start an evaluation environment.")
(shadow/repl :local))
#2019-06-1616:03danierouxSame workflow, from the REPL perspective#2019-06-1616:34theeternalpulseis there an easy way from emacs to run the aliased command in your project on the host rather than using cider jack in?#2019-06-1616:34theeternalpulseI'm thinking I can just make a function in elisp for it#2019-06-1616:42theeternalpulsecider doesn't seem to accept my alies in my project deps.edn#2019-06-1616:43theeternalpulsedoing clj -A:nrepl doesn't seem to find it#2019-06-1616:48theeternalpulsenever mind, got it working#2019-06-1618:13richiardiandrea@bozhidar is orchard going for 0.5.0 for the new info stuff? asking for a friend that needs to add :added to some code 😸#2019-06-1708:22bozhidar@richiardiandrea Yep. 🙂#2019-06-1718:08Cas ShunHello, I'm trying wrap cider evals with some clojure code to use REBL. So I need to eval some code, then send the code and result to rebl. How do I get the result of something that's been eval'd through cider? Perhaps I'm thinking about this the wrong way?#2019-06-1718:20carkhmhh a REBL mode for emacs, now that would be grand#2019-06-1719:40bozhidarMost CIDER users just use the CIDER inspector, which is a somewhat similar concept, although REBL is definitely more polished.#2019-06-1719:41bozhidarThere’s also https://github.com/RickMoynihan/nrebl.middleware#2019-06-1719:42dpsuttoni know there's https://github.com/RickMoynihan/nrebl.middleware. i've never used it but its a good place to start#2019-06-1720:12carkhthese days i'm mostly living in clojurescript land, and i moslty can't make the inspector work. or pretty printing. Looks like cider views the data as a string rather than clojure data structures#2019-06-1720:18carkhthat's not always the case, i didn't investigate more on that#2019-06-1720:21carkhand of course i can't reproduce the trouble with inspect right now =)#2019-06-1720:21carkhstill pretty printing never worked for me in clojurescript#2019-06-1720:13carkhthe inspector is half way there, but the datafy/nav protocols are really what makes REBL interesting#2019-06-1720:14carkhi guess the configurable views is a plus but more icing on the cake rather than fundamental#2019-06-1720:26carkhhttps://github.com/denisidoro/floki has a nice simple UI for browsing inspected values#2019-06-1809:17bozhidar> the inspector is half way there, but the datafy/nav protocols are really what makes REBL interesting#2019-06-1809:17bozhidarYep, we do plan to leverage it at some point, but there’s never enough time for everything. I think this won’t be hard. //cc @alexyakushev.#2019-06-1809:18bozhidar> still pretty printing never worked for me in clojurescript#2019-06-1809:19bozhidar@carkh I can’t imagine why it wouldn’t work, as it’s not tied to ClojureScript in any way. What exactly happens for you?#2019-06-1809:20carkh@bozhidar it just prints with syntax highlight and all, but no pretty printing#2019-06-1809:20bozhidarCan I see the nREPL message exchange for you?#2019-06-1809:21bozhidarAs this is baked straight into nREPL it should be impossible for it not to work unless the request doesn’t contain a printing function.#2019-06-1809:22carkhBuffer *cider-nrepl ...* doesn-t have much data where can i find those messages?#2019-06-1809:26carkh*nrepl-server ....* is only command line stuff, that's what you want ?#2019-06-1809:27carkh#2019-06-1809:36carkh#2019-06-1809:37carkhin this last example i eval a long edn data in clojurescript (in cider repl), it is not pretty printed, then i exit clojurescript, and evaluate the same edn in clojure, it is now pretty printed#2019-06-1809:39carkhi'm using cider-jack-in-cljs "C-c M-J" with shadow-cljs (had the same trouble with figwheel)#2019-06-1809:41carkhthe one thing that's special about my setup is that i'm on windows#2019-06-1813:55bozhidar@carkh See https://docs.cider.mx/cider/config/basic_config.html#_log_nrepl_communications and https://docs.cider.mx/cider/troubleshooting.html#2019-06-1813:55bozhidarI guess I should have explained first what the message log is. 🙂#2019-06-1813:56carkhi'm right on it#2019-06-1813:59carkh#2019-06-1813:59carkh@bozhidar there you go#2019-06-1814:00carkhthat's the same example edn than before#2019-06-1814:33bozhidar@carkh What’s your CIDER and nREPL versions?#2019-06-1814:33bozhidarAlso - what’s your piggieback version?#2019-06-1814:34bozhidarI recall there was some nasty bug in 0.4.0 that was related to the printing.#2019-06-1814:34carkh;; CIDER 0.22.0snapshot (package: 20190419.1025), nREPL 0.6.0#2019-06-1814:34carkhshould be fairly recent#2019-06-1814:35bozhidarYeah, that’s pretty recent.#2019-06-1814:35bozhidarWhat about piggieback?#2019-06-1814:35carkhmhh let me find out#2019-06-1814:36carkhthat isn't bundled with cider ?#2019-06-1814:36carkhmaybe with shadow-cljs ?#2019-06-1814:36bozhidarAh, actually shadow-cljs doesn’t use piggieback.#2019-06-1814:36bozhidarAnd I think we solved the mystery. 🙂#2019-06-1814:37bozhidarProbably shadow doesn’t play nice with the printing changes in nREPL 0.6.#2019-06-1814:37carkhhum i had those problems with figwheel, but that's a good while back so i guess it might be fixed in this case#2019-06-1814:38carkhi'll have to check that out =)#2019-06-1814:38bozhidarI’m reasonably certain that if you start some cljs REPL using say figwheel or something simpler like nashorn the printing might actually work.#2019-06-1814:38carkhi'll check that and keep you updated#2019-06-1814:40bozhidarGreat!#2019-06-1814:41bozhidarYou might also open some GitHub issue for @thheller pointing him to https://github.com/nrepl/piggieback/commit/8e0ff8911a1a7ad012dba19d3be6d7c0515d418d and subsequent commits. Changes that had to be done for Piggieback to play well with nREPL 0.6.#2019-06-1814:41carkhi'll do that as soon as i see problems were fixed for regular clojurescript#2019-06-1814:42carkh@bozhidar ah indeed that works now with figwheel#2019-06-1814:42carkhthanks for your help#2019-06-1814:45bozhidarYou’re welcome!#2019-06-1817:09Drew Verleeis there a functional equivalent to cider-quit -> cider-jack-in. Not that two strokes is a big deal. i have given up on trying to dynamically adding libs to my project, it seems to break or at least its giving me anxiety 🙂.#2019-06-1817:10dpsuttonhit , in the repl and you can "restart"#2019-06-1817:11dpsuttoncider-restart bound for me at C-c M-r#2019-06-1817:14SchmohoI had this issue with CIDER lately - when I use lein on jack-in I don't start
in the main namespace of the lein project and the user-ns has no
clojure.repl-ns preloaded. I was told this should not be so, but I
wanted to be sure, so could someone tell me whether this is indeed
unexpected behaviour?#2019-06-1817:23ghadiis there a way for command history to persist across restarts @dpsutton?#2019-06-1817:23dpsuttoncommand history = repl history?#2019-06-1817:23dpsuttonor the command used to invoke clj/lein/boot/etc ?#2019-06-1817:24ghadirepl history#2019-06-1819:59dpsutton@U050ECB92 did you get it solved?#2019-06-1819:59ghadihaven't tried yet, but tysm for responding#2019-06-1819:59dpsutton👍 always happy to help#2019-06-1817:24dpsuttonah, i think repl history should be preserved with a simple boolean. let me check#2019-06-1817:26dpsuttoncider-repl-history-file seems like it needs a filename. if you set that presumably it will write stuff there?#2019-06-1817:30dpsuttonwe have multiple projects at the same root including a cljs version. seems repl history does not discriminate there. not sure if that will be a pain point for you#2019-06-1817:33kingcodeI just upgraded to Cider 0.21 - from 0.15, now my environment seems trashed, both for clj and cljs. I am getting the following in my mini-buffer:
‘cider-jack-in-cljs’ requires the nREPL op “classpath” (provided by-cider-nrepl)
Any idea how to fix this? Thx..#2019-06-1817:34dpsuttonwhat's your lein version?#2019-06-1817:34dpsuttondo you have cider-nrepl version injected by CIDER or do you have it in project.clj or in your lein profiles?#2019-06-1817:37dpsutton@d.eltzner what version of lein/CIDER are you using?#2019-06-1817:38dpsuttonhttps://github.com/clojure-emacs/cider/issues/2593#2019-06-1817:39dpsuttonthat diff is terrifying lol#2019-06-1817:41Schmoho@dpsutton i just skimmed over the emacs cider-customizations, there does not seem to be any particular opt that would control what you last asked - how would one configure what nrepl-version cider uses?
as to my question, lein 2.9.0, cider nrepl is 0.21.1#2019-06-1817:41dpsuttonunless you specify something it will inject what it needs#2019-06-1817:42dpsuttonlooks like that fix is already applied buy not released yet. if you get from melpa (22.0snapshot) you'll have it though#2019-06-1817:44SchmohoI know really little about elisp, so what exactly did you mean it's terrifying? is this diff something that should/could have been obvious to me, or is it that it actually takes string "nil"?#2019-06-1817:44dpsuttonits very "spooky". (nrepl--eval-request "nil") vs (nrepl--eval-request "")#2019-06-1817:45dpsuttonthe code is very readable. the intent and implications of it is what's scary#2019-06-1817:45Schmohoyeah i think i kind of see that.#2019-06-1817:48kingcode@dpsutton I am using lein 2.8.1, and just saw from lein --version, that ‘cider-nrepl’ requires 2.8.3+.
I will try that and see what happens….thx#2019-06-1817:48dpsuttonthis happens because CIDER switched from tools.nrepl -> nrepl/nrepl. Check your deps for that and you may need to bump. They are poisonous to each other#2019-06-1817:49kingcode@dpsutton yeah indeed, I tried first removing nrepl decls from my profiles.clj, to no avail…#2019-06-1817:59kingcodeFunny…emacs is frozen when I try jack-in-clj, with “Direct connection to localhost:xxx established”, but when I started jack-in-clj/cljs, the cljs console comes up fine, and an error with clj-refactor middleware came up#2019-06-1818:00kingcodeHave to kill my emacs process and restart..#2019-06-1818:01dpsuttonone thing to try: check *Messages* buffer for the startup invocation lein .... copy and paste that into a terminal and see what it says#2019-06-1818:08kingcode@dpsutton The relevant line in Messages buffer:
[nREPL] Starting server via /Users/kingcode/bin/lein update-in :dependencies conj \[nrepl\ \“0.6.0\“\] -- update-in :dependencies conj \[cider/piggieback\ \“0.4.0\“\] -- update-in :plugins conj \[refactor-nrepl\ \“2.4.0\“\] -- update-in :plugins conj \[cider/cider-nrepl\ \“0.21.1\“\] -- repl :headless :host localhost...
[WARNING] No nREPL middleware descriptor in metadata of #’refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
nREPL server started on port 54819 on host localhost - <nrepl://localhost:54819>#2019-06-1818:10Schmohoit is more of an emacs question, but i really fail trying to do that upgrade. first i cant find out which melpa snapshot i am referring with neither http://melpa.org and emacs, then upgrading in package-list-packages did nothing and downloading and replacing cider 20190216.2255 by hand broke cider badly, so was probably a stupid idea - and replacing it back with the old version left packages-list-packages saying it was deleted although cider at least works fine now. soooo ... how does emacs work?#2019-06-1818:11Schmohowoops, replaced with 20190618.1025#2019-06-1819:07dpsutton@kingcode make sure you have the latest nrepl-refactor. Probably remove it while you get everything working again#2019-06-1819:08kingcodeThe issue had to do with figwheel-sidecar using an old tools.nrepl dep - I used an other version which fixed the issue.#2019-06-1819:08dpsuttonah. 0.5.18 should be the ticket then#2019-06-1819:09kingcode@dpsutton I have to manually jack-in clj now, but it is working together with the cljs. It seems the key bindings all changed - jack-in, + refactor bidings don’t work anymore…#2019-06-1819:10dpsuttonwhat do you mean manually jack in?#2019-06-1819:10kingcodecider-jackin-clj and -cljs, they used to both start with C-c M-J. No longer works that way…#2019-06-1819:11kingcodeC-c M-n no longer works (used to swith to ns),#2019-06-1819:12dpsuttonthat brings up the cider-ns-map with several options now#2019-06-1819:12kingcodeSo to resume, when I C-c M-J, only the cljs repl client comes up. So, I start C-c M-j separately, instantiate my server, and reload the web page and it now works as before - but what a headache…EDIT: duh! somehow I was out of clj-refactor mode, everything is good now. Actually I prefer starting the clj repl manually, which I do first - in the old version C-c M-J always produces the figwheel repl first and a js error due to server not being up. Thanks!#2019-06-1819:13kingcodeOK thx. Your help is very appreciated! Will check up on all this and see if I can smooth things up 🙂#2019-06-1819:13dpsutton#2019-06-1819:13dpsuttoni defined a bunch of connections like that. you could make your own startup function#2019-06-1819:14kingcodeSounds good, will look into that. Thank you!#2019-06-1819:57mhcatDoes this ring any bells for anyone? cljr--get-error-value: Error in nrepl-refactor: java.lang.AssertionError: Assert failed: (instance? java.io.PushbackReader rdr)
#2019-06-1819:59mhcatFull trace#2019-06-1820:00benedekwhat is your version @j0ni?#2019-06-1820:01mhcatof everything? I just updated everything that needed an update from melpa#2019-06-1820:01benedekM-x cljr-version#2019-06-1820:01mhcatclj-refactor 2.5.0-SNAPSHOT (package: 20190618.716), refactor-nrepl 2.5.0-SNAPSHOT#2019-06-1820:02benedekthat is the new snapshot @bozhidar just released#2019-06-1820:02benedekmaybe the release went wrong?!#2019-06-1820:02benedektry to downgrade to stable#2019-06-1820:02benedekas a workaround#2019-06-1820:03benedekan issue on github would be appreciated#2019-06-1820:03mhcatsure, will do - thanks!#2019-06-1820:03benedekcheers#2019-06-1820:11zlrthcider-jack-in is getting an "old" version of my $path. cider-jack-in's output doesn't have /Library/Java...
my path is constructed in my .profile. this behavior survives reboot.#2019-06-1820:14zlrthand i have set my JAVA_CMD="/Library/.....java", which a terminal picks up, but same behavior for cider-jack-in.
and lein repl from the terminal works.#2019-06-1820:15dpsuttoncheck out https://github.com/purcell/exec-path-from-shell @mfm#2019-06-1820:17dpsuttonyou don't need to use the package but this is your issue (i think). Emacs path != shell path#2019-06-1820:17dpsuttonyou can test by starting emacs from a terminal and seeing it work#2019-06-1820:17zlrththanks. i had no idea#2019-06-1820:19zlrththis is a new problem for me, since my work is on java 8, but there's a cool project that uses java 12. by the time i switched back to java 8 to build prod, oracle no longer has jdk8 publicly. so i went to openjdk. and now here i am. anyway thanks let me take a look#2019-06-1820:20mhcat@benedek https://github.com/clojure-emacs/refactor-nrepl/issues/258#2019-06-1820:21mhcatoops#2019-06-1820:21zlrthindeed (getenv "PATH") is missing /library/java/etc! thanks dpsutton!#2019-06-1820:21zlrthi never thought to check that!#2019-06-1821:46Ian Fernandezguys, I'm having this problem with cider:
ERROR: Unhandled REPL handler exception processing message {:op midje-test-stacktrace, :ns user.query-test, :index 0, :print-fn clojure.lang/println, :session 972a0590-f8b7-4349-ae22-b541d7c381a1, :id 24}#2019-06-1905:45bozhidar@d.ian.b Looks like you hit some bug in emidje or whatever middleware is providing this op.#2019-06-1905:46bozhidar@benedek Seems like some regression in the recent commits (I’m thinking it is probably https://github.com/clojure-emacs/refactor-nrepl/commit/916b55445d2a700c85bb57efb73b6fd98a2d653a)#2019-06-1905:47bozhidarWe had forgotten to bump the version of clj-refactor.el to snapshot and when I did this I had to also push a new snapshot of the middleware to match it, which revealed the problem.#2019-06-1905:48bozhidar@kingcode I’m sorry to hear about your painful upgrade experience. 0.15 -> 0.21 represents a couple of years of development, plus the big switch to the new nREPL. Generally it’s a good idea to always stick to the latest CIDER and avoid such big upgrades. I also plan to address this to some extent by adding some upgrade notes for the different releases.#2019-06-1906:12benedekthanks @bozhidar for looking into it#2019-06-1906:40bozhidarActually, now I think that probably this bulk dep update broke something https://github.com/clojure-emacs/refactor-nrepl/commit/2bae83eeacd209823d9075efb2c41856de400655#2019-06-1907:11benedekyeah could have. wonder how the tests passed tho?!#2019-06-1907:22bozhidarMe too. Maybe they didn’t cover the part the blew up?#2019-06-1907:39benedekyeah plausible explanation ;)#2019-06-1913:04kingcode@bozhidar Oh no apologies needed! I love your work and everything Cider :) Actually it took only about an hour to recover from the upgrade, and I only need to set up a few key bindings...Looking forward to discovering the new version! Thank you!#2019-06-1913:06bozhidarYou’re welcome! I guess a good starting point would be https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md#2019-06-1913:06kingcodeAs said above, my own troubles had to do with dependencies relying on the old tools.nrepl - this will get easier in the future#2019-06-1913:06bozhidarYep, this was a one time thing and it’s not going to happen again.#2019-06-1913:12Ian Fernandezhow can I make cider jack-in ask for a profile before jack-in?#2019-06-1913:13kingcodeThank you Bozhidar, I will make sure to read this up, sorry for not doing that first (in a bit of a crunch) - thanks for your fantastic work!#2019-06-1913:14bozhidar@d.ian.b Just use C-u before the jack-in command.#2019-06-1913:50Ian FernandezI'm using this, but I want some command to detect if lein, if deps, if boot, ask for profile#2019-06-1913:51Ian Fernandezin the jack-in#2019-06-1913:51Ian Fernandez😃#2019-06-1913:51Ian Fernandezmaybe I'll make this haha#2019-06-1913:51Ian FernandezI'm learning some of elisp#2019-06-1913:57bozhidarWe had this in the early version of CIDER, but it was removed in favour of a more generic way to customize the jack-in command.#2019-06-1913:58bozhidarOtherwise it was a slippery slope if we started to add different prefixes or commands for everything someone might want to alter.#2019-06-1913:59bozhidarAnd I see to recall that not every tool had the notion of a profile, which also made it problematic to support such thing out of the box.#2019-06-1913:59bozhidarAdding a small local wrapper should be trivial.#2019-06-1917:12Ian Fernandezaw, understood, thanks#2019-06-1917:12Ian Fernandez😃#2019-06-2008:15dotemacsSince there are a lot of repeating issues in regards to support for CIDER, I figured that adding a section to https://cider.readthedocs.io/en/stable/about/support/ might be an idea.
Such as:
- what was your previous/current version of Emacs, OS, deps/lein/boot, CIDER, nREPL, piggieback, figwheel, clj-refactor…
with examples on how to obtain those version numbers, that should be provided when asking a question.
That way it speeds up the whole troubleshooting process.
But while looking at that page, there is talk of a mailing list on Google Groups.
When I try to access that URL: https://groups.google.com/forum/#!forum/cider-emacs I get:
This group either doesn't exist, or you don't have permission to access it. If you're sure this group exists, contact the Owner of the group and ask them to give you access.
1. I can create the PR for the information that should be provided, if you think that it’s a good idea, but is the intro to the Support section the right place for this information to be placed the correct place to add it?
2. Does the Google Group exist or is it just a relic of a bygone era? (If it doesn’t exist and the idea is for it to exist, can we create it at some more liberal minded solution, like https://www.freelists.org/? )
Thanks#2019-06-2008:23bozhidar> Since there are a lot of repeating issues in regards to support for CIDER, I figured that adding a section to https://cider.readthedocs.io/en/stable/about/support/ might be an idea.#2019-06-2008:23bozhidarFYI - this page was moved to https://docs.cider.mx/cider/about/support.html#2019-06-2008:23bozhidar> When I try to access that URL: https://groups.google.com/forum/#!forum/cider-emacs I get:#2019-06-2008:24bozhidarThe link works for me. That’s weird.#2019-06-2008:24bozhidar> 1. I can create the PR for the information that should be provided, if you think that it’s a good idea, but is the intro to the Support section the right place for this information to be placed the correct place to add it?#2019-06-2008:25bozhidarI’m always open to improving the docs. The support docs are basic indeed and I wanted to extend them to encourage more people to provide support for others. I was also thinking of adding Zulip and Clojureverse there.#2019-06-2008:25bozhidarGenerally I don’t really pay attention to anything except Slack and GitHub, but I also can’t support everyone, so I’m hoping to get to a point where more people are answering the questions of others (as most support requests are about trivial things).#2019-06-2008:26bozhidar> 2. Does the Google Group exist or is it just a relic of a bygone era? (If it doesn’t exist and the idea is for it to exist, can we create it at some more liberal minded solution, like https://www.freelists.org/? )#2019-06-2008:27bozhidarIt never gained much traction, and I’m open to killing it. Google Groups are super lame anyways. Clojure was using Google Groups a lot back in the day, so at the time this made sense. Now - not so much.#2019-06-2008:28bozhidarExtending https://docs.cider.mx/cider/troubleshooting.html and https://docs.cider.mx/cider/faq.html#2019-06-2008:33dotemacsThanks#2019-06-2008:38dotemacsThis is what I get for the Google group.
I tried changing my profiles, but that gives me back the same result. I’m definitely logged into my Google profiles…#2019-06-2008:38dotemacsReloading does not change anything.#2019-06-2009:35bozhidarWorks for me. A mystery. 🙂#2019-06-2010:30manuelI get the same message as @dotemacs when I try to open the Google Groups link. Mystery indeed.#2019-06-2010:32dotemacs🙂#2019-06-2014:27practicalli-johnI am not able to access the google group either. Perhaps its best to delete the google group#2019-06-2014:28bozhidarThat’d be fine by me.#2019-06-2014:36dotemacsBut some important, historical data could be lost. So maybe make sure that it really is world readable and just make it read only, rather than deleting it. After all, it is on Google’s servers…#2019-06-2014:38bozhidarI don’t see any setting implying that the group is private. There’s not much in the mailing list - on average it got 10 threads per year.#2019-06-2023:53skratis anyone getting this:#2019-06-2023:54skrat#2019-06-2023:54skrat#2019-06-2023:55skratcider-version = 0.22.0-snapshot#2019-06-2023:58skratGNU Emacs 27.0.50 (recent build)#2019-06-2100:10skratnever mind, it went away after upgrading cider#2019-06-2307:48theeternalpulseWhen running some of the test functions, i notice it doesn't eval beforehand, is there a setting to have cider save/eval before, or do I just have to bind to a custom fn that does that?#2019-06-2308:59yuhanOn my local branch of cider I simply edited cider-test-run-test to do (cider-eval-defun-at-point) before executing the test in a clojure-mode buffer, there doesn't seem to be an existing setting for it.#2019-06-2309:02yuhanI think it should be a default behaviour, it doesn't make sense to edit a test and then run the outdated version#2019-06-2309:02bozhidarYeah, that’s reasonable. Probably we can also do this for namespaces as well.#2019-06-2309:03bozhidarI think we avoided it initially simply because we didn’t want to trigger unwanted side-effects from the code under test.#2019-06-2309:07yuhanFWIW, Spacemacs does a more extreme version of this by default, binding <leader>t t to a custom fn that re-evals the entire buffer before running the test:#2019-06-2309:08yuhan(defun spacemacs/cider-test-run-focused-test ()
"Run test around point."
(interactive)
(cider-load-buffer)
(cider-test-run-test))
#2019-06-2309:23bozhidarWell, that’s an easy change and I’d be fine with adding customizations to auto-eval the test at point or the entire buffer.#2019-06-2309:23bozhidarThere’s also a cider-auto-test mode which does a similar thing when it’s enabled and you’re changing code.#2019-06-2311:47carkh@bozhidar it had been a good long while since i've been doing clojure stuff (rather than clojurescript). Now i'm hitting a problem with cider specific to windows and deps.edn project. When i try to jack-in and select "clojure-cli", i get "the clojure executable isn't on your 'exec-path'"...
This is completely normal as there is no clojure command to execute, it lives in powershell, there is no file to execute.
While doing shadow-cljs work, i worked around this by having a clojure.cmd file in the root of my project directory, which, i guess, shadow-cljs was calling. This in turn was executing poweshell and the clojrue command within it.
Looking at the source code in cider.el I think I already see one problem : you're looking for .bat files and not .cmd, both should be looked up.
I cannot put this clojure.cmd (or .bat) file in the path, because then powershell will recurse calling it, rather than using its internally added clojure command. So i'll rename my cmd file to a bat file, but how can i make cider call it in the root of my project ?#2019-06-2311:49carkhwould adding . to the exec-path emacs variable do it ?#2019-06-2311:55carkhok that works, but i'm back with the different interacting escape of quotes issues#2019-06-2312:18carkhi think in this regard, calling clojure with double quotes outside the -Sdeps parameter rather than single quotes, and \" inside that string is the most compatible way to do it#2019-06-2312:19carkhworks for unix, works (somewhat better) for windows#2019-06-2312:41lreadThis might provide some related relevant info https://clojure.atlassian.net/browse/TDEPS-133#2019-06-2312:43carkhindeed#2019-06-2312:44carkhok i went ahead and installed https://github.com/frericksm/clj-windows#2019-06-2312:44carkhthen changed cider.el to use the double quote parameters with escaped double quotes inside those#2019-06-2312:45carkhand it works#2019-06-2312:45carkhbut i need to test this in a unix before maybe submitting a pr ?#2019-06-2314:41oskarkvI'm using figwheel-main, doing a cider-jack-in-cljs, and almost everything works, I get a [Figwheel] Successfully compiled, it opens my browser on the dev page, but my clj repl doesn't turn into a cljs repl, and the repl doesn't seem to work. I don't get any error message and I don't know what's wrong. It worked yesterday but I can't figure out what is different today. 😕#2019-06-2314:43oskarkvIf I try to use the repl it gets stuck with that loading animation going on -> [=== ]#2019-06-2314:45oskarkvAnybody know what's wrong, or how I can find out what's wrong?#2019-06-2314:47dpsuttondoes your deps.edn file have any main or main args (i forget what its called). Tutorials for figwheel-main tell you to set some main args. If you put these, CIDER cranks up unhappy. If you omit them, it works just fine. Is this perhaps your issue?#2019-06-2314:48oskarkvHm I found this in my project directory lrwxrwxrwx 1 oskar oskar 28 Jun 23 16:34 .#core.cljs -> and removed it, and now it works. What was that? 😛#2019-06-2315:10dpsuttonlooks like a temp file#2019-06-2400:09didibusIs there an easy way to get the full tools.deps command to use to start a similar as cider-jack-in nRepl manually?#2019-06-2400:12didibusIt seems it uses cider-jack-in-dependencies and cider-jack-in-lein-plugins for the deps.edn content. And then it calls -m nrepl.cmdline with the options from cider-jack-in-nrepl-middlewares#2019-06-2400:31dpsuttonlook in *Messages*#2019-06-2400:32didibusYa, I was confused by the ... at the end, but it doesn't seem like it is truncated even though it shows ...#2019-06-2400:33dpsuttoni think we've all be confused by that#2019-06-2400:33dpsuttoni think its meant to show progress but it always indicates that more is there to me#2019-06-2400:34didibushaha#2019-06-2400:34didibusya, I think you're right, it means, please wait#2019-06-2400:37dpsutton(defun cider-copy-jack-in-command ()
(interactive)
(let ((cider-jack-in-dependencies (append cider-jack-in-dependencies cider-jack-in-cljs-dependencies))
(cider-jack-in-lein-plugins (append cider-jack-in-lein-plugins cider-jack-in-cljs-lein-plugins))
;;(cider-jack-in-nrepl-middlewares (append cider-jack-in-nrepl-middlewares cider-jack-in-cljs-nrepl-middlewares))
(orig-buffer (current-buffer)))
(kill-new (plist-get (cider--update-jack-in-cmd (cider--update-project-dir '()))
:jack-in-cmd))))
i made this a while back. should copy your jack in command. I don't think its cljs aware yet though#2019-06-2400:37dpsuttonha, yeah. its just commented out lol#2019-06-2409:38pyrHi there! Do any of you have workflows to work with taps in emacs + cider?#2019-06-2409:39pyrHad a look at https://www.youtube.com/watch?v=UFY2rd05W2g&feature=youtu.be and it made it seem like a tap receiving buffer would be awesome 🙂#2019-06-2409:50pyrHappy to look into how to do that, it's a bit unclear what belongs where (orchard/cider-nrepl/cider) to me right now. Naively a middleware that runs tap< and produces messages over the repl that can be interpreted by a cider extension would sound like the approach#2019-06-2409:50pyrLooking at it, it seems the nrepl side of things is having a def-wrapper of the sort: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl.clj#L390-L398#2019-06-2412:33mgrbyte(Apologies in advance, am sure this one's getting very old)
On: emacs 26.2.90, cider 0.22.0snapshot, getting this:
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
Tried following the suggestions in the docs, but can't get rid of it (I've put (setq-default cljr-inject-dependencies-at-jack-in nil) in my emacs setup).
I'm guessing using cider 0.22.0 would fix, but can't convince package-el to install it. (pinning to stable gives me 0.21.0)
Anyone know what I should/could do?#2019-06-2413:29dpsuttonGot a bunch of PRs up. Was hoping we could
1) merge Orchard PR and create release
2) bump orchard version in cider-nrepl
3) merge cider-nrepl PRs and make a release
4) merge CIDER PR and bump the cider-nrepl version it requests#2019-06-2413:59dpsuttonalso http://conj.io is down 😞#2019-06-2414:53bozhidar@dpsutton Thanks for the fixes!#2019-06-2414:53bozhidarI’ll try to find some time to review and merge those and I’ll issue the new alphas. There are also a couple of small tweaks by @richiardiandrea that I want to squeeze in the next build.#2019-06-2414:53dpsuttondefinitely! Want to improve documentation viewing after seeing Cursive. I pinged reid on twitter about http://conj.io but no response. I hope the site doesn't become more of a chore as his interest seems thin 😕#2019-06-2414:54richiardiandreaWill try to address the PR feedback this week#2019-06-2414:54bozhidar:thumbsup: Once we’re ready with this and we figure out the boot breakage I might even cut a new CIDER release.#2019-06-2414:55bozhidarIt has been a while…#2019-06-2414:55bozhidar> definitely! Want to improve documentation viewing after seeing Cursive.#2019-06-2414:55bozhidar@dpsutton For a while I wanted us to do more with overlays for inline docs and so on, but I never got to doing so.#2019-06-2414:55bozhidarShouldn’t be hard, though.#2019-06-2414:55dpsuttonthe apropos viewer is nice! not sure who made it but i like it. it included all the inline deps so its way to chatty to be useful right now though#2019-06-2414:57bozhidar@dpsutton We just borrowed the interface from Emacs’s own apropos for Emacs Lisp. I definitely like the UI.#2019-06-2414:57bozhidarBut I was referring to something like https://emacs.stackexchange.com/questions/30031/how-to-display-overlay-like-this-screencast/30038 for some things.#2019-06-2414:58bozhidarI also wanted us to support inline macroexpansion and tracing.#2019-06-2414:58dpsuttonyeah i've accidentally done emacs-lisp apropos on a few things instead of cider apropos 🙂
and yeah i followed. Cursive does clojuredocs inline in a popup with syntax highlighted examples and it is quite useful (and quick!)#2019-06-2414:59dpsuttoni think lispy mode does this for documentation?#2019-06-2414:59bozhidarMaybe. There are a few generic Emacs packages that provide this, I just never had the time to play with them.#2019-06-2415:00dpsutton#2019-06-2415:00dpsuttonthe yellow doc is displayed inline and then goes away#2019-06-2415:00dpsuttonbut i think there's a better true "popup" solution?#2019-06-2417:41bozhidarMaybe. I don’t I’ve seen many real popups in Emacs, though (probably because Emacs UIs have to work in a terminal as well). Overlays are still a reasonable option, though.#2019-06-2506:19soulflyerI have a problem with the newest refactor-nrepl 2.5.0-SNAPSHOT included when I do a cider-jack-in. I can get working again by specifying 2.4.0 and starting the repl with lein and doing a cider-connect but then I get a version mismatch with clj-refactor. Anyone else seeing this?
error in process sentinel: Could not start nREPL server: clojure.lang.Compiler$CompilerException: Syntax error compiling at (refactor_nrepl/core.clj:101:29).
#:clojure.error{:phase :compile-syntax-check, :line 101, :column 29, :source "refactor_nrepl/core.clj"}
at clojure.lang.Compiler.analyze (Compiler.java:6808)
clojure.lang.Compiler.analyze (Compiler.java:6745)
...
...
clojure.main.main (main.java:37)
Caused by: java.lang.RuntimeException: No such var: fs/hidden?
at clojure.lang.Util.runtimeException (Util.java:221)
clojure.lang.Compiler.resolveIn (Compiler.java:7387)
...
...
lein ancient and paradox-list-packages tell me I'm up to date, and the problem is appearing on multiple projects including one that I know worked a few days ago.#2019-06-2513:10borkdudeIs there a difference in licensing when you commit inlined deps to your repro (like eastwood does) or only distribute those in your .jar on clojars (like cider-nrepl does)? Eastwood mentions the libs explicitly with their licenses, but CIDER-nrepl doesn't#2019-06-2513:12bozhidar@soulflyer I think that some deps upgrade broke clj-refactor’s master. There’s a ticket about this in refactor-nrepl’s repo, but it seems no one had the time to investigate the problem.#2019-06-2513:14bozhidar@borkdude I guess it depends on the licenses of the libraries. Frankly, I didn’t really think about this much. I don’t think this changes anything the way cider-nrepl (mranderson) does it, as you end up distributing the code in pretty much the same way as it normally would be. Only the namespaces get changed.#2019-06-2513:15borkduderight#2019-06-2513:15borkdudeI'm also inlining some deps for a library, that's why I wondered. I'll probably do it like eastwood#2019-06-2513:38bozhidarMrAnderson came after Eastwood and I’d suggest its approach simply because it makes it very easy deal with multiple deps and switch between versions.#2019-06-2513:39bozhidarI think that deps obfuscation should be completely transparent.#2019-06-2513:39bozhidarBtw, why do you need to inline deps? Isn’t clj-kondo typically used a pre-compiled binary?#2019-06-2513:41borkdude@bozhidar two reasons: 1) clj-kondo can also be used as a JVM library. 2) I want to maintain a fork of rewrite-clj with different namespace prefixes to patch some things or maybe optimize a thing or two#2019-06-2513:43borkdudeSome people are using clj-kondo in CI using the JVM.#2019-06-2513:45bozhidarWell, in this case I’d just add a direct dependency to your fork with its changed namespace.#2019-06-2513:45bozhidarIn practice this would mean no runtime conflicts anyways.#2019-06-2513:46borkdudethat's right, but right now rewrite-clj can't run with the newest tools.reader, so I'm also inlining that#2019-06-2513:46borkdudethe forked version will live in a subdirectory of the repo, it makes no sense to split it out, since it's the only place where it should be used#2019-06-2513:47bozhidarFair enough.#2019-06-2516:52bozhidar@dpsutton It’s done (the var-query exclusion problems).#2019-06-2516:53dpsuttonawesome! apropos should be much better after releases of orchard and cider-nrepl#2019-06-2516:55dpsuttonoh i see you already did that. awesome. i'll try at lunch!#2019-06-2601:31oskarkvHm, functions don't font lock dynamically correctly in cljs for me. I rememer that I worked on this like 2 years ago. I wanted to try and see if I can debug and fix it. But now my mind is blank as to how this all worked, with cider-nrepl mostly. How do I most conveniently send input to cider-nrepl and how do I see the output? I want to for example test the function cider.nrepl.middleware.track-state/ns-as-map for a cljs namespace. How would I do that?#2019-06-2601:38dpsuttonthe simplest path to some message introspection is nrepl-toggle-message-logging so you can see what CIDER sends back and forth. Anything beyond that gets a little hairy#2019-06-2601:39oskarkv@dpsutton Ok! But if I have jacked-in to the cider-nrepl project, which is clj, then how do I test it for cljs?#2019-06-2601:40dpsuttoni don't know how to answer that. I've traced some of that stuff before and its a tower :0#2019-06-2601:40oskarkvhehe, ok#2019-06-2601:40oskarkvthanks#2019-06-2602:44felipebarrosI'm getting this while trying to connect to an nrepl using cider-connect after following the instructions here (https://github.com/nrepl/piggieback#clojure-cli-aka-toolsdeps), but the link for More information is broken.
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!
More information.#2019-06-2602:49felipebarrosWhat I'm really trying to do is to connect Cider to a figwheel-main project using deps.cli using this figwheel-main template https://rigsomelight.com/figwheel-main-template/#2019-06-2602:55felipebarrosIf I follow the docs https://docs.cider.mx/cider/basics/clojurescript.html#_using_figwheel_main I get error in process filter: Figwheel-main is not available. Please check which is the place I'm coming from.#2019-06-2605:02oskarkv@anantpaatra Are you using deps.edn?#2019-06-2605:02oskarkvOh, yeah, you said#2019-06-2605:03oskarkvI had success just following these instructions https://github.com/bhauman/figwheel-main#setting-up-a-build-with-tools-cli#2019-06-2605:11felipebarrosHave you been able to connect Cider to it? This is my current struggle.#2019-06-2605:44oskarkvYes#2019-06-2605:57felipebarrosCan you tell me more or less how to connect? I don't see specific instructions on that tutorial. I've been using that exact configuration through the figwheel-main template without luck.#2019-06-2606:13oskarkvcider-jack-in-cljs, choose figwheel-main, then choose your, eh, like build name#2019-06-2606:15oskarkvIf you do jack-in, do you get a list of different tools to choose from?#2019-06-2606:18felipebarrosYes#2019-06-2607:27felipebarrosJust tried it again following that tutorial by hand, and when I cider-jack-in-cljs I still get that error in process filter: Figwheel-main is not available. Please check error. 😞#2019-06-2605:45oskarkvHm, I'm hacking on cider-nrepl, and I'm running tests. If I run all tests, I get an error that I don't get when I run only that files' test, and vice versa.
This is with make test
lein test cider.nrepl.middleware.track-state-test
lein test :only cider.nrepl.middleware.track-state-test/ns-as-map-cljs-test
FAIL in (ns-as-map-cljs-test) (track_state_test.clj:132)
expected: {sym-0 {:arglists ([]), :macro true}, sym-1 {:arglists ([])}, a-var {}, a-fn {:fn "true"}, b-fn {:fn "true"}, c-fn {:fn "true"}}
actual: ({a-fn {:fn "true"}, b-fn {}, c-fn {}, a-var {}, sym-1 {:arglists ([])}, sym-0 {:arglists ([]), :macro true}})
And this is with lein test cider.nrepl.middleware.track-state-test
lein test cider.nrepl.middleware.track-state-test
lein test :only cider.nrepl.middleware.track-state-test/update-and-send-cache-test
FAIL in (update-and-send-cache-test) (track_state_test.clj:38)
expected: (< 100 (count new-data))
actual: (not (< 100 74))
lein test :only cider.nrepl.middleware.track-state-test/update-and-send-cache-test
FAIL in (update-and-send-cache-test) (track_state_test.clj:42)
expected: (< 100 (count changed-namespaces))
actual: (not (< 100 73))
I had an error in ns-as-map-cljs-test at first, when running just that file. But then I fixed it, and I'm pretty sure it's right now. So why do I get the error when running with make test? The output I could see in actual was different, even when it was wrong in both.#2019-06-2611:19dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/issues/390
The track state bug happens because we are using the thing under test in the tests. Running all tests loads more namespaces than just running an individual file.#2019-06-2605:50oskarkvAlso, I haven't touched update-and-send-cache so it shouldn't be failing, I reckon. 😕#2019-06-2606:09oskarkvAnd when running from CIDER I get 0 errors
(run-tests *ns*)
Testing cider.nrepl.middleware.track-state-test
Ran 7 tests containing 34 assertions.
0 failures, 0 errors.
{:test 7, :pass 34, :fail 0, :error 0, :type :summary}
#2019-06-2608:33bozhidar@anantpaatra The check that’s failing for you is pretty basic:#2019-06-2608:33bozhidar(defun cider-check-figwheel-main-requirements ()
"Check whether we can start a Figwheel ClojureScript REPL."
(cider-verify-piggieback-is-present)
(unless (cider-library-present-p "figwheel.main")
(user-error "Figwheel-main is not available. Please check )))
#2019-06-2608:33bozhidarIf it’s failing that would indicate the figwheel.main ns seems to be missing.#2019-06-2608:34bozhidarYou can try suppressing the requirements check by setting cider-check-cljs-repl-requirements to nil, but if figwheel-main is truly missing that won’t help you much. 🙂#2019-06-2608:37felipebarrosAfter many hours I have just found https://github.com/clojure-emacs/cider/issues/2597 and managed to fix it by setting cider-clojure-cli-global-options to -R:fig because it was in an alias (I don't know why I thought it would pick this up magically). Now that I have understood what was wrong it seems basic but do you think its the case to document this nuance of using tools.deps with cider somewhere? Others may fall into this trap. Thanks 🙂#2019-06-2608:38felipebarrosIt's not mentioned in the README for the figwheel template (maybe I could suggest that) or in the figwheel tutorial and even the cider docs (at least I couldn't find it).#2019-06-2608:41felipebarrosThis composition of aliases is a fairly new concept that isn't contemplated in many tutorials. Sean Corfield has a new screencast that was pretty enlightening to me and I believe may even be linked somewhere in the docs.#2019-06-2608:41felipebarroshttps://www.youtube.com/watch?v=CWjUccpFvrg#2019-06-2608:47bozhidar> Now that I have understood what was wrong it seems basic but do you think its the case to document this nuance of using tools.deps with cider somewhere? Others may fall into this trap. Thanks 🙂#2019-06-2608:48bozhidar@anantpaatra yeah, I guess we should. I was under the impression most people just put figwheel.main in their main deps.#2019-06-2608:49bozhidarThere are several way to approach this, btw - we can also put the clojurescript deps in cider-jack-in-cljs. That’s not hard to do, but then people will have to know that cider might be injecting different versions of the deps overriding what they have in their projects.#2019-06-2608:50bozhidarToo much flexibility means you have to think of many details. 🙂#2019-06-2608:52felipebarrosMaybe when the user selects figwheel-main during cider-jack-in-cljs it could test to see if it is available? Hmm, maybe not. That could hide a problem in the user configuration or usage. Perhaps just updating the error message to state something like "figwheel.main wasn't found. If you're not declaring it as a main dependency, make sure you're passing it with -R:<alias>".#2019-06-2608:58bozhidar@anantpaatra The checks happens at a point where you don’t know how the REPL was started exactly, that’s why we check for the presence of the namespace only.#2019-06-2608:59bozhidarA sophisticated check is way too involved as we have to take into account many nuances for each build tool and I have think there are more important areas of improvements we can focus on. 🙂#2019-06-2609:00bozhidarI think for now just adding something in the docs about tools.deps would be helpful for most people.#2019-06-2609:00felipebarrosI understand and agree 🙂#2019-06-2609:03oskarkv@bozhidar You don't happen to know what's up with the inconsistencies with the tests I described above?#2019-06-2609:04bozhidar@oskarkv Yeah, I do.#2019-06-2609:05bozhidarlein test is not very useful with cider-nrepl as I don’t think it gets bound to meaningful profile. I think we don’t have anything in the dev profile.#2019-06-2609:06bozhidarmake test is running the tests using a build with inlined deps and finally what you would run straight from CIDER is a build using whatever is currently loaded.#2019-06-2609:07oskarkvI'm not sure I understand the difference. Which should I go by?#2019-06-2609:10bozhidarGenerally the results from make test and running tests within CIDER should be consistent unless you ended up using something that gets inlined in the tests (this would pass in CIDER and fail otherwise).#2019-06-2609:10bozhidarTo run tests with Lein you need to do something like:#2019-06-2609:11bozhidarlein with-profile +1.8,+test,+plugin.mranderson/config test#2019-06-2609:11bozhidarWell, you shouldn’t use lein test without specifying some profiles. 🙂#2019-06-2609:12bozhidarGenerally while I develop cider-nrepl are run the tests from within CIDER and I just confirm in the end with make test that everything’s ok.#2019-06-2609:13bozhidarUnfortunately inlining deps and the need to support several Clojure and ClojureScript releases makes something that’s typically simple quite complex…#2019-06-2609:21oskarkvHm, I'll have to continue tomorrow. Too tired for now. Thanks!#2019-06-2609:23oskarkvBtw, why are the tests using 1.8, and not 1.10? 😛#2019-06-2609:25oskarkvOh, no, they aren't.#2019-06-2609:50bozhidarThere are profiles for each supported Clojure version 1.8-1.10. Generally our support policy is the last 3 versions of Clojure.#2019-06-2609:50bozhidar(which admittedly is kind of random)#2019-06-2613:25dpsuttonIf anyone wants to pick up the failing tests on CIDER, there seem to be two issues
1) the linter is linting a string of clojure code. Figure out a way to not change this string but inhibit the linter? Alternatively, collapse onto a single line or just accept the weird lint suggestions to fix
2) the tests OOM on emacs-master. I can't run tests locally and now CI successfully can't run them either. No idea why this is happening but there's something there#2019-06-2613:39bozhidar> 1) the linter is linting a string of clojure code. Figure out a way to not change this string but inhibit the linter? Alternatively, collapse onto a single line or just accept the weird lint suggestions to fix#2019-06-2613:40dpsuttonah, it probably thinks its a docstring
diff -u --label /root/project/cider-client.el --label \#\<buffer\ cider-client.el\> /root/project/cider-client.el /tmp/buffer-content-2698iXy
--- /root/project/cider-client.el
+++ #<buffer cider-client.el>
@@ -401,17 +401,17 @@
(defconst cider-info-form "
(do
- (require ')
- (require 'clojure.walk)
+ (require ')
+ (require 'clojure.walk)
- (if-let [var (resolve '%s)]
- (let [info (meta var)]
- (-> info
- (update :ns str)
- (update :name str)
- (update :file (comp str ))
- (assoc :arglists-str (str (:arglists info)))
- (clojure.walk/stringify-keys)))))
+ (if-let [var (resolve '%s)]
+ (let [info (meta var)]
+ (-> info
+ (update :ns str)
+ (update :name str)
+ (update :file (comp str ))
+ (assoc :arglists-str (str (:arglists info)))
+ (clojure.walk/stringify-keys)))))
")
#2019-06-2613:40bozhidarMaybe we can load those forms from a dedicated file or suppress this type of warnings. Unfortunately the lint we’re using is pretty basic and customizations there are problematic. I remember it wasn’t respecting .dir-locals.el last time I checked.#2019-06-2613:41bozhidarAh, yeah - this is fine I guess.#2019-06-2613:41bozhidarGenerally I was hoping to find a way to just have all the forms in a Clojure file from which we load them into user (or whatever) and simply refer to their var names in the Elisp code.#2019-06-2613:42bozhidarNever had the time to pursue this idea, though. I think it won’t be hard.#2019-06-2613:42bozhidar> 2) the tests OOM on emacs-master. I can’t run tests locally and now CI successfully can’t run them either. No idea why this is happening but there’s something there#2019-06-2613:43bozhidarNo idea. It has been like this for a while. Likely some regression in Emacs 27.#2019-06-2613:43dpsuttonI'm busy tonight but i can get back to it on thursday. Really looking forward to green tests across the board 🙂#2019-06-2614:17bozhidarYou and me both! 🙂#2019-06-2614:18bozhidarI really appreciate you taking the time to work on this, as I’ve been pretty busy most of May and June and the work on CIDER stagnated a bit.#2019-06-2614:19bozhidarHopefully things are going to pick up in July and August, as I’m hoping to unveil the next CIDER release at “Heart of Clojure” or “Clojure/south”.#2019-06-2614:19bozhidar(early/late August)#2019-06-2616:13Jag GunawardanaI’m having a few issues with Emacs picking up settings from my .dir-locals.el file, from the emacs docs, I would have thought that this would set the variables globally, but they are only set in a cider repl buffer. Any one seen this before. My .dir-locals.el is:
((nil . ((cider-ns-refresh-after-fn . "dev-extras/resume")
(cider-ns-refresh-before-fn . "dev-extras/suspend")
(cider-repl-init-code . ("(dev)"))
(cider-clojure-cli-global-options . "-A:dev")))
#2019-06-2616:15Jag GunawardanaI can get things working be running a set-variable on the variables, but would be nice not to have to do this every time I ran emacs.#2019-06-2717:51Ian FernandezHey guys, I'm having a problem on connecting to a cider repl...
ERROR: Unhandled REPL handler exception processing message {:op version, :prefix-rewriting false, :debug false, :session ab137606-0faa-4ed6-86c9-104bc05b32cb, :id 8}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: nrepl.middleware.caught$caught_transport$reify__22839
#2019-06-2717:51Ian Fernandezanyone knows why this stuff happens?#2019-06-2717:52Ian FernandezI'm starting the REPL like this: /bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- update-in :plugins conj \[nubank/midje-nrepl\ \"1.2.0-SNAPSHOT\"\] -- repl
#2019-06-2717:54dpsuttonthis happens because some dep of your deps has clojure.tools.nrepl in it. Run lein deps :tree and see who is bringing in the older clojure.tools.nrepl. Then add an exclusion to your dep#2019-06-2717:58Ian Fernandez=)) it was a clojure.tools.nrepl
dependency#2019-06-2717:58Ian Fernandezthanks!!! 😃#2019-06-2718:05dpsuttonof course! happy hacking#2019-06-2718:52bozhidarI wonder how long will the spirit of tools.nrepl keep haunting us… 😄#2019-06-2723:35diego.videcoHey there, is it possible to do something like cider-eval-defun-at-point but display de result in the repl?#2019-06-2807:48jumarWhat I often use is cider-sent-last-sexp-to-repl.
There's also cider-send-function-to-repl and a bunch of similar functions.#2019-06-2819:55diego.videcoInteresting, but I can’t find them in the docs, and do not have them available as commands. Are they part of a set of extensions or something?#2019-06-2807:52myguidingstarI want to disable vertical alignment for a project, so I put this in .dir-locals.el but it doesn't seem to work. What should I do?#2019-06-2807:52myguidingstar((clojure-mode . ((clojure-align-forms-automatically . nil))))#2019-06-2816:59agMaybe try it with eval, something like this:
((nil . ((eval . (with-eval-after-load 'clojure-mode (setq clojure-align-forms-automatically nil))))))
#2019-06-2816:59agyou can also leverage clojure-mode-hook probably#2019-06-2818:29oskarkvCheck the value of the clojure-align-forms-automatically in emacs, maybe it's set to nil but there's another problem#2019-06-2901:30oskarkvI don't know if this is cider's fault, but when I have (assert false "HELLO") or (throw "HELLO") in a .cljs file, and do cider-load-buffer I don't see those messages. It's as if everything went fine.#2019-06-2901:34oskarkvIf I eval those forms with cider-eval-defun-at-point then I see the error messages.#2019-06-2901:47oskarkvI'm using figwheel-main, and I see the errors in my browser console. But I would like to see them in Emacs too. 😕#2019-06-3021:54oskarkvI started both a clj and a cljs repl with cider-jack-in-clj&cljs. I noticed that only the clj repl pretty-prints. In the cljs repl I always get a long line, which is not pretty. 😞#2019-06-3021:54oskarkvDoes anybody know what's wrong?#2019-06-3022:00oskarkvIs pretty printing supposed to work for cljs repls? 😛#2019-06-3023:22oskarkvAnother issue: If I evaluate an expression at the REPL in ClojureScript, and I get an error somewhere in it, then I don't see any output from printlns that happened before the error. Makes debugging really hard. Does anyone know what's up with that?#2019-07-0104:27carkh@oskarkv I tested pretty printing working a couple days ago with regular figwheel#2019-07-0104:28carkhthough it does not work with shadow-cljs, due to some trickery in shadow-cljs, maybe figwheel-main also replaces some of the nrepl stuff with its own ?#2019-07-0104:30carkhin any event, make sure you have a recent everything, and that you're not plugging in some old nrepl via lein#2019-07-0104:31oskarkv@carkh OK, thanks!#2019-07-0104:34carkh@oskarkv for the buffer loading, or defun evaling, I usually let figwheel/shadow-cljs do its job, and let it reload the file#2019-07-0104:35carkhi didn't notice much missing messages, granted some stuff working with regular clojrue doesn't work with clojurescript, but the experience has generally been good#2019-07-0104:36oskarkvHm, I don't understand what you mean. Do its job?#2019-07-0104:37carkhi save the file, figwheel reloads it#2019-07-0104:38oskarkvOh#2019-07-0104:38carkhevaling stuff in buffer has indeed been a bit fickle#2019-07-0104:39carkhclojurescript is a different beast, it requires a bit of workflow fine tuning#2019-07-0104:39oskarkvBut I still don't see the errors produced by assert#2019-07-0104:39oskarkvOr, messages#2019-07-0104:43carkhindeed i see the same thing as you with figwheel#2019-07-0104:44carkhevaling the assert form shows the error#2019-07-0104:44carkhbut not evaluating the buffer....now i'm curious, i've been using shadow-cljs these days#2019-07-0104:45carkhthis actually corrupted my figwheel connection it does not reload properly anymore !#2019-07-0104:46carkhhad to refresh the browser#2019-07-0104:50carkhsame problem in shadow-cljs, though this does not break the reloading there#2019-07-0104:50carkhanyways good luck =)#2019-07-0104:50carkhgotta go#2019-07-0114:44carkhI want to change cider-ns-map from C-c M-n to C-c C-n, how can i do this ? And is there a good reason not to use this combination ?#2019-07-0114:46carkhthat's not a global-set-key thing is it ?#2019-07-0114:47carkhmaybe use define-key from a hook to cider-mode ?#2019-07-0114:48carkhor local-set-key ... mhh there is a whole menagerie dedicated to this#2019-07-0114:49yuhan(define-key cider-mode-map (kbd "C-c C-n") 'cider-ns-map)#2019-07-0114:49carkhthanks !#2019-07-0114:50yuhanyou want to make sure it's only run after cider is loaded#2019-07-0114:50yuhanso in the :config section if you're using use-package#2019-07-0114:50carkhalright, i'll do just that#2019-07-0114:50yuhanor wrap it in a (with-eval-after-load 'cider#2019-07-0114:50carkhuse-package so handy, thanks again#2019-07-0114:52carkhworks like a charm#2019-07-0116:52oskarkv@dpsutton Sorry to bother you, but do you have any idea about those issues I wrote about above? Summarized here too https://www.reddit.com/r/Clojure/comments/c7l9h3/three_issues_with_cider_andor_clojurescript/#2019-07-0116:55oskarkvI don't know if they are CIDER's fault and if I should create issues on github for them.#2019-07-0117:57bozhidar> I want to change cider-ns-map from C-c M-n to C-c C-n, how can i do this ? And is there a good reason not to use this combination ?#2019-07-0117:57bozhidar@carkh Just keep in mind that this overrides the command bound to C-c C-n. I guess you don’t use it, so than this is not a big deal for you.#2019-07-0118:10bozhidar@oskarkv You could have also posted those as issues on GitHub (bigger chance that someone from our team will go over them). The pretty-printing not working really surprises me, as I can’t see a reason why it wouldn’t work with figwheel-main.#2019-07-0118:30dpsutton@oskarkv i can look this evening. Can you give the smallest possible repo that i can clone to start investigating? Can much more easily investigate the bug if I don't have to create a similar figwheel main project, make a function that println logs and then throws an error, etc.#2019-07-0118:36oskarkv@dpsutton Sure!#2019-07-0119:03oskarkv@dpsutton @bozhidar https://github.com/oskarkv/cljsissues#2019-07-0204:24dpsuttonhey oskarv, I've looked into it and I've got mixed results. The good thing is that this isn't bad behavior by CIDER because it exactly mimics what happens with cljs.main.#2019-07-0204:25dpsutton[dan@fedora cljsissues]$ clj -m cljs.main -r
ClojureScript 1.10.520
cljs.user=> (require '[cljsissues.core])
nil
cljs.user=> cljsissues.core/something
nil
cljs.user=> (cljsissues.core/test-println)
Execution error (Error) at (<cljs repl>:1).
Cannot read property 'call' of undefined
cljs.user=>
#2019-07-0204:26dpsuttonso I tried your project with figwheel, the with just a bare browser repl with figwheel, and then finally with cljs.main above. It behaved identically every time. The assertion appeared in the browser and not the repl. The defs that occur after the throw expression are not interned#2019-07-0218:13oskarkvOK#2019-07-0218:14dpsutton👍#2019-07-0218:14oskarkvWhat about the pretty printing?#2019-07-0218:14dpsuttonmaybe raise in clojurescript channel? Not sure if known limitation or bug#2019-07-0218:14dpsuttonoh forgot to investigate#2019-07-0218:15oskarkvHehe#2019-07-0218:18oskarkvI'll check out what happens with the last issue, printing first and then getting an error. And I'll open an issue on cider's github about the pretty printing#2019-07-0218:18oskarkvCheck it out with cljs.main i mean#2019-07-0218:21oskarkvcljs.user=> (cljsissues.core/test-println)
testing println
Execution error () at (<cljs repl>:1).
null
cljs.user=> *e
"ERROR IN test-println"
It prints "testing println" when trying without CIDER, hm#2019-07-0218:43oskarkvHm, but that might be figwheel's fault#2019-07-0218:50oskarkvNo, happens in nashorn too#2019-07-0218:51dpsuttoncljs.main is the reference#2019-07-0218:51dpsuttonif it happens there it happens in clojurescript#2019-07-0218:56oskarkvYeah, but it doesn't happen in cljs.main. But then the problem might be in figwheel or cider, right?#2019-07-0218:57oskarkvAnyway, I might have found a clue. If I try to print a lot, then I get the following error
org.eclipse.jetty.websocket.api.MessageTooLargeException: Text message size [131072] exceeds maximum size [65536] Do you know anything about that?#2019-07-0218:59oskarkvSeems to be from figwheel 😛#2019-07-0119:03dpsutton👍 i'll look into it tonight. thanks for the repro#2019-07-0119:04oskarkvThank you!#2019-07-0121:20theeternalpulseIs there a way when evaluating a namespace in cide rto also evaluate any required namespaces that may reside in the classpath if possible. for example if I jump into a some.namespace.core.spec file and it has a require for some.namespace.core , I first have to go in the core.clj and evaluate it first.#2019-07-0121:23dpsuttonhow are you evaluating namespaces? It should work correctly by default#2019-07-0121:23theeternalpulseI used cider-eval-ns-form#2019-07-0121:23dpsuttonif i hit cider-load-buffer (`C-c C-k`) it will do the right thing#2019-07-0121:24theeternalpulselet me try it from scratch, I think i've seen the buffer work, thought ns would do the same#2019-07-0121:24theeternalpulsebuffer didn't either#2019-07-0121:25theeternalpulseCould not locate dantheobserver/parrot_api/response__init.class,
dantheobserver/parrot_api/response.clj or
dantheobserver/parrot_api/response.cljc on classpath. Please check
that namespaces with dashes use underscores in the Clojure file
name.
#2019-07-0121:26dpsuttonthis sounds like you've got a classpath issue. maybe the file isn't where clojure thinks it should be?#2019-07-0121:26theeternalpulseyeah I had to first load the other file first#2019-07-0121:26dpsuttonwhat's the file path to reponse.clj?#2019-07-0121:27theeternalpulse/src/dantheobserver/parrot_api#2019-07-0121:28theeternalpulse/home/theedeepee/projects/clojure/parrot-api.clj/src/dantheobserver/parrot_api:
total used in directory 24 available 403486944
drwxrwxr-x 2 theedeepee theedeepee 4096 Jul 1 14:24 .
drwxrwxr-x 3 theedeepee theedeepee 4096 Jun 24 23:24 ..
-rw-rw-r-- 1 theedeepee theedeepee 1033 Jun 30 10:30 app.clj
-rw-rw-r-- 1 theedeepee theedeepee 547 Jun 28 20:30 common.clj
-rw-rw-r-- 1 theedeepee theedeepee 526 Jun 26 07:45 response.clj
-rw-rw-r-- 1 theedeepee theedeepee 378 Jul 1 14:24 response.spec.clj
#2019-07-0121:33dpsuttonnot sure. I cloned your repo. Jack in, C-c C-k from and then#2019-07-0121:33theeternalpulseAh, maybe it's because I run the nrepl alias#2019-07-0121:33dpsuttonwhat do you mean by that?#2019-07-0121:34theeternalpulseI do clojure -A:nrepl and then do cider connect#2019-07-0121:34theeternalpulsemaybe connect doesn't evaluate the project#2019-07-0121:35dpsuttoni'm not sure "evaluate the project" is well defined. When nrepl starts up things are on the classpath but it hasn't evaluated the proejct#2019-07-0121:37theeternalpulsehmm, It works with jack in, not sure why not with my deps.edn aliases#2019-07-0121:37theeternalpulseif I run the application it finds everything fine with clojure -A:server#2019-07-0121:38theeternalpulseso it's putting the right files in the classpath#2019-07-0121:39dpsuttonso the mystery deepens. Everything works correctly on your computer if you cider-jack-in but not if you CIDER connect to clojure -A:nrepl?#2019-07-0121:40theeternalpulsewell evaluating the files at least for development#2019-07-0121:41theeternalpulselet me check the classpath#2019-07-0121:41dpsuttontry something for me. cider-jack-in (not cider-connect) and try opening the namespace. and then do m-x cider-load-buffer#2019-07-0121:44theeternalpulsehmm my classpath is dev
src
/home/theedeepee/.m2/repository/com/github/haifengl/smile-interpolation/1.5.2/smile-interpolation-1.5.2.jar
/home/theedeepee/.m2/repository/org/clojure/clojure/1.10.1-beta2/clojure-1.10.1-beta2.jar
/home/theedeepee/.m2/repository/org/apache/xmlgraphics/batik-dom/1.11/batik-dom-1.11.jar
/home/theedeepee/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
/home/theedeepee/.m2/repository/generateme/fastmath/1.2.0/fastmath-1.2.0.jar
/home/theedeepee/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
...(other maven dependencies)
#2019-07-0121:45dpsuttonwhat happened when you tried the steps i put above?#2019-07-0121:45theeternalpulsetrying that#2019-07-0121:45theeternalpulseit loaded fine#2019-07-0121:45theeternalpulseI may have changes that aren't on your version#2019-07-0121:46theeternalpulseoh yikes lol#2019-07-0121:46theeternalpulsethis is all wrong, I'm leading you down the wrong path#2019-07-0121:47theeternalpulseI was in the wrong project. I was wondering why dev showed up in my classpath when I didn't call it on -A:server#2019-07-0121:47theeternalpulsefacepalm#2019-07-0121:48dpsuttonhaha that's a funny and understandable mistake 🙂 no worries#2019-07-0121:49theeternalpulseI need to step away from the machine for a bit lol#2019-07-0208:06pinkfroghi#2019-07-0208:06pinkfrogwhat’s the difference between so many cider-jack-in ?#2019-07-0208:06pinkfroghttps://imgur.com/a/ugIPF2h#2019-07-0210:26practicalli-john@i my understanding is that
cider-jack-in-clj runs a Clojure repl
cider-jack-in-cljs runs a ClojureScript repl
cider-jack-in-clj&cljs runs a Clojure repl and then runs a ClojureScript repl#2019-07-0210:29practicalli-johnI assume cider-jack-in and cider-jack-in-clojure are aliases for cider-jack-in-clj (or perhaps just from older versions of cider). Similarly, I assume cider-jack-in-clojurescript is an alias or older version of cider-jack-in-cljs#2019-07-0210:29practicalli-johnhttps://docs.cider.mx/cider/usage/managing_connections.html#2019-07-0213:51bozhidar@jr0cket You’re spot on!#2019-07-0213:53practicalli-johnGood to know... Thanks#2019-07-0213:52bozhidarWe can’t really removed cider-jack-in, as it’s mentioned in way too many places, but probably at some point we’ll remove cider-jack-in-clojure and cider-jack-in-clojurescript, as right now we have a couple of aliases too many. 🙂#2019-07-0213:53bozhidarBtw, fun fact cider is another alias for cider-jack-in-clj.#2019-07-0213:54bozhidarAt some point I wanted to bring the names more in line with SLIME’s, but it seemed people like to jack-in, so I didn’t push much on that front.#2019-07-0213:57practicalli-johnjack-in always reminded me of the cyberpunk books by William Gibson, that's why I liked the term#2019-07-0213:55bozhidarAh, my bad - actually after I dropped the idea I made M-x cider an unified entry-point for all commands.#2019-07-0216:20nwjsmith:thinking_face: I’m getting user-error: No reader for tag #function in (inst uuid) when running tests#2019-07-0216:21nwjsmithMy .nrepl.edn file looks like {:middleware [cider.nrepl/cider-middleware]}#2019-07-0216:22nwjsmithoh, looks like that’s not enough. Might have to use cider-nrepl-handler#2019-07-0217:13ghadihow are you starting those tests? and are you on 1.10.1 @nwjsmith?#2019-07-0217:14nwjsmith{:major 1, :minor 8, :incremental 0, :qualifier nil}#2019-07-0217:14nwjsmithIs there a #function tag in 1.10?#2019-07-0217:14ghadiok#2019-07-0217:14ghadino#2019-07-0217:14ghadithat's a CIDERism#2019-07-0217:21nwjsmithHere’s what I’m trying to do:
I have a Clojure application that embeds its own nREPL server. This application run inside a Docker container. I would like to have CIDER’s middleware included into the embedded nREPL server by mounting an .nrepl.edn file and a .lein/profiles.clj file.#2019-07-0217:23nwjsmithThe application is launched with lein run.#2019-07-0217:25dpsutton> • [Abbreviated printing](https://github.com/clojure-emacs/cider-nrepl/pull/268) for functions multimethods. Instead of seeing #object[clojure.core$_PLUS_ 0x4e648e99 "clojure.core$_PLUS_@4e648e99"] you'll see #function[clojure.core/+].
that one's new to me#2019-07-0217:29dpsuttondoes this help @nwjsmith
(when @env/dev?
(nrepl.server/start-server :bind "0.0.0.0" :port nrepl-port
:handler cider-nrepl-handler)
(println "[INIT] nrepl started on port" nrepl-port))
this is from our work codebase#2019-07-0217:29dpsuttoninside docker. (also there's a docker-translate-paths PR to CIDER out there you should try out as well)#2019-07-0217:29dpsuttonhttps://github.com/clojure-emacs/cider/pull/2606#2019-07-0217:51nwjsmithThat docker-translate-paths PR looks extremely useful, thanks!#2019-07-0217:53nwjsmith@dpsutton unfortunately there isn’t any “dev” environment for this application, so that won’t quite work. I’m going to do some digging to see if handler is configurable with nrepl.edn#2019-07-0218:07oskarkv@dpsutton Did you get a chance to look at those issues?#2019-07-0218:09dpsuttonI did. Commented on thread#2019-07-0218:10oskarkvHm, what thread? 😛#2019-07-0218:11dpsutton#2019-07-0218:12oskarkvOh, thanks#2019-07-0223:24diego.videcoDoes anyone experience, after clearing the repl buffer (`cider-clear-repl-buffer`), that logs will not appear until one scrolls upwards? Any idea how to fix this so that logs will still appear without having to scroll?#2019-07-0223:27oskarkvWhen you say "logs" you mean like printlns? I can see them without any scrolling.#2019-07-0223:31diego.videcoyes printlns and variations of that#2019-07-0223:37carkhyes there appears to be some "drift" over time#2019-07-0223:38carkhbut clearing fixes it for me#2019-07-0300:37diego.videcoActually I think this happens when the prompt is at the top of the buffer#2019-07-0313:55bozhidar@nwjsmith See https://github.com/clojure-emacs/cider/pull/2668 Likely the problem you experience is similar and has to do with parseedn not understanding some reader tag.#2019-07-0313:56nwjsmith@bozhidar thank you! I forgot to follow-up here yesterday, but I figured out that I was misconfiguring my nREPL server. I’ll take a look and see if I can help out on this ticket later today#2019-07-0313:58nwjsmithand thank you for all of your OSS work. CIDER, nREPL, and Rubocop especially. I know you’ve been taking a lot of shit on Rubocop lately, but it’s been tremendously useful for teams I’ve worked on in the past.#2019-07-0314:00bozhidar@nwjsmith Thanks for the kind words! 🙂 By now I’m used to the shit, but I’ve got some lapses from time to time. 😄#2019-07-0314:00bartukahi, I'm using C-u cider-jack-in and adding with-profile local but cider is ignoring it and loading the dev profile instead. I'm checking it by the content of the config file that I am using (`yogthos/config`)#2019-07-0314:01bartukaany ideas of how to proceed with further debuging?#2019-07-0314:01bozhidar@iagwanderson Check what’s the exact command CIDER generated for the jack-in. This should give you an idea what went wrong.#2019-07-0314:02bartuka[nREPL] Starting server via /home/wanderson/scripts/lein update-in :dependencies conj \[acyclic/squiggly-clojure\ \"0.1.9-SNAPSHOT\"\ \:exclusions\ \[org.clojure/tools.reader\]\] -- update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- repl :headless :host localhost with-profile local...
#2019-07-0314:02bartukathis command?#2019-07-0314:05dpsuttonyeah. I don't see any with-profile there#2019-07-0314:06bartukathe last word of the command#2019-07-0314:08bozhidarLooks correct to me. That’s weird. Maybe it should be +local.#2019-07-0314:08bozhidarWhat happens when you run this via the command line? Is the profile properly set then?#2019-07-0314:12bartukayes, when I run lein with-profile local repl and inspect the config.core/env variable, it's working fine#2019-07-0314:12bozhidar@hugod Long time, no see! Happy to see you around! 🙂#2019-07-0314:36hugodThanks, @bozhidar - I’m happy to be back working in clojure again 🙂#2019-07-0314:13bozhidar@iagwanderson Maybe the order of the args matters?#2019-07-0314:14bartukawow!#2019-07-0314:14bartukaworked#2019-07-0314:16bartukathanks 😉#2019-07-0314:37hugodI’ll look into using the profiler#2019-07-0318:35hugodlooks like my freezes are caused by cider state updates reliably triggering multiple emacs GC’s. Raising gc-cons-threshold seems to help.#2019-07-0319:41hugodchanged-namespaces sends a lot of data#2019-07-0417:28bozhidarHmmm, we’ve had this for 5 years (or something) and I don’t recall anyone reporting issues with the update messages.#2019-07-0417:29bozhidarDo you see anything weird in the nREPL message log with respect to changed-namespace?#2019-07-0412:40kardanAnyone know where I should start to debug a failing cider-connect? I’m connecting to a docker-compose env and it “suddenly” fails for me. I managed to create a never ending recursion earlier, not sure if that is related or not. Is there something that I maybe need to clear? “”helm-M-x: Sync nREPL request timed out (op eval code (seq (.split (System/getProperty “java.class.path”) “:”)) id 3 time-stamp 2019-07-04 14:37:15.403819000)” A bit rambling on my end …#2019-07-0415:09dpsuttonThat’s a strange error to see helm m-x involved#2019-07-0417:26bozhidar@dpsutton sesman needs the classpath early on, so I guess that’s what triggers the error, but generally this basic code should always work.#2019-07-0417:27bozhidarI guess there’s some unhandled exception that blocks this eval or something like this.#2019-07-0417:28dpsutton@kardan if you're around i'm happy to help debug#2019-07-0417:30kardanHey, I deleted all my containers upgraded Emacs & Prelude and all the packages. Upgrade everything with homebrew and restarted my computer. Then it worked 🙂 Felt like a computer scientist.. 😳#2019-07-0417:30kardanThanks anyway#2019-07-0417:33dpsuttonglad it went away 🙂#2019-07-0417:28dpsutton@bozhidar PR up that makes all tests pass. bug in emacs C code 🙂#2019-07-0417:29skykaninSo I was just about to work on my project, but when I ran cider-jack-in I got this stacktrace https://pastebin.com/Hm17dq0p. It's been working fine in the past, but I'm not sure what has changed.#2019-07-0417:34bozhidar@nicholas.jaunsen Not sure what exactly is wrong, but I assume that upgrading to the latest CIDER and leiningen will fix the problem for you.#2019-07-0417:35bozhidar@dpsutton Sounds like you had a lot of fun with that one! 😄#2019-07-0417:36dpsuttonup till 4 trying to find out why 🙂#2019-07-0417:42bozhidarThat’s what I call true grit! 😄#2019-07-0417:43dpsuttonit'll be nice to see that green checkmarks everywhere. Can't figure out why it only happens in cask though#2019-07-0417:43bozhidarNow the only outstanding issue with the tests is figuring out why one test fails without lein being installed (something about cider-jack-in-clj&cljs).#2019-07-0417:43dpsuttonthere's a failing test? which one?#2019-07-0417:44dpsuttonif its cider-connection-tests it was the same issue#2019-07-0417:44dpsutton(describe "cider-jack-in-clj&cljs" this one?#2019-07-0417:44bozhidarIt fails if you remove the installation of lein in the image. It wasn’t need in general, we’ve added it as a quick workaround.#2019-07-0417:44dpsuttonoh#2019-07-0417:45bozhidarNone of the tests really run lein, so this wasn’t supposed to be needed.#2019-07-0417:46bozhidarGenerally CIDER has no real “integration tests”, as those are a bit tricky in Emacs.#2019-07-0417:47dpsuttonyeah for sure. i didn't think make test called out to lein. i'll look into it#2019-07-0417:49dpsuttonah, at one point i deleted that test. it verifies (expect 'y-or-n-p :to-have-been-called-times 3) which is just nonsense to me#2019-07-0417:50dpsuttonit gives no insight into anything. I think its testing the params construction functions but it gives no particular insight. if that changed to 4 or 2 it wouldn't signal anything#2019-07-0417:50dpsuttonand removing that test removes the dependency of lein.#2019-07-0418:00dpsuttonhuzzah!#2019-07-0418:00dpsuttoni'll work on the lein stuff. annoyingly, getting weird circle test runner errors when i modify the test buffer. i think there's caching stuff going on 😕#2019-07-0418:01dpsuttonbut i'm pretty sure that test is verifying that we ask for the port...#2019-07-0515:29PBI seem to be getting lots of errors with piggieback once I've upgraded cider to above 0.18.0. Are the two incompatible?#2019-07-0515:30dpsuttonwhich version of piggieback? you probably want to make sure you are using cider/piggieback "0.4.1"#2019-07-0515:30dpsuttonif you're targeting the older cemerick coordinate that's most likely your problem#2019-07-0515:31PBI am using 0.4.0#2019-07-0515:31dpsuttonwhich version of lein?#2019-07-0515:32PB2.7.1#2019-07-0515:32dpsuttonthere's your problem. go to 2.9.1 if possible. lein upgrade 2.9.1#2019-07-0515:39PBOH man. That's unfortunate. Can't upgrade lein because our nexus repository doesn't use ssl 😕#2019-07-0515:39dpsuttonI think there’s a way to tell lein not to use it#2019-07-0515:45dpsuttonhttps://help.sonatype.com/repomanager2/maven-and-other-build-tools/leiningen https://stackoverflow.com/questions/22716492/how-to-configure-leiningen-to-use-a-corporate-repository?rq=1
i thought i remembered seeing some kind of :ssl false option to the repositories info. but its been a while#2019-07-0518:44PBThanks for this. I've decided to see if I can do this with deps.edn!#2019-07-0518:42PBCan anybody tell me how to set enable an alias when jacking in with emacs? (using clj-cli)#2019-07-0518:43dpsuttonEasy one off way is to give a prefix when jacking in and you can edit the command directly. Let me look up the Vars you can set in a second#2019-07-0518:45PBThank you!#2019-07-0518:53dpsuttoncider-lein-global-options for profiles and cider-clojure-cli-global-options for deps.edn aliases i think. https://docs.cider.mx/cider/basics/up_and_running.html#_customizing_the_jack_in_command_behaviour#2019-07-0518:54dpsuttonif you want to have it automatic. these are usually set in dirlocals.el#2019-07-0518:57PBInteresting. I don't have cider-clojure-cli-global-options#2019-07-0519:02dpsuttonare you on version 0.18? let me check out that branch and see what it was called at the time#2019-07-0519:03PBI thought I was on 0.21.1#2019-07-0519:03dpsuttoncider-clojure-cli-parameters cider-lein-global-options ?#2019-07-0519:04dpsuttonthat's nrepl i think. or did CIDER have that release. there's lots of versions 🙂#2019-07-0519:05dpsuttonin 0.21.0 i see cider-clojure-cli-global-options. in either case you can check out cider.el in your elpa directory around line 150 and see what they are called for you.#2019-07-0519:06PBHmm i see it in my cider.el file#2019-07-0519:08PBM-x cider-version says 0.22.0-snapshot#2019-07-0519:09PBpackage: 20190626.1317#2019-07-0519:10dpsuttonthen you should see cider-clojure-cli-global-options#2019-07-0519:13PBYeah, I agree. I am a little confused#2019-07-0811:52plexusSeems after upgrading I'm no longer to evaluate anything, instead I get exceptions in the *nrepl-server* buffer: No such var: info/resource-path#2019-07-0812:00plexusafter upgrading to master, no such var: u/jar-file?#2019-07-0812:00plexusIs there a way to downgrade to 0.21?#2019-07-0812:11plexusThanks, I'd still be interested to know this.#2019-07-0812:06bozhidar@plexus There was a bad build in the morning, but it should be ok now.#2019-07-0812:07bozhidar(a small mismatch between cider-nrepl and orchard that resulted in that missing info/resource-path)#2019-07-0812:07bozhidarBad cider-nrepl build to be precise.#2019-07-0812:09manuelI can confirm latest build works now.#2019-07-0812:11plexusThanks, I'd still be interested to know this.#2019-07-0812:15bozhidarYou can just delete your current installation and pin the cider package to melpa-stable.#2019-07-0812:16bozhidarSee https://docs.cider.mx/cider/basics/installation.html#_installation_via_package_el for details.#2019-07-0817:09macrobartfastusing emacs I tend to start a nrepl with lein nrepl and then cider-connect to connect to it... I get the warning 'WARNING: CIDER requires cider-nrepl to be fully functional. Many things will not work without it!'...#2019-07-0817:09macrobartfastis this indicative of my having set things up improperly?#2019-07-0817:10macrobartfasttbh I'm confused now of what I need to do with a plugin and what with deps in package.clj to get cider working.#2019-07-0817:11macrobartfastcider-doc produces 'Wrong type argument: stringp, nil' as well...#2019-07-0817:11macrobartfastwhich might be related.#2019-07-0817:18practicalli-john@macrobartfast I used to get this message when the version of cider-nrepl was different (or not included) in my .lein/profiles.clj configuration. Quick check would be to quit the lein repl repl and use cider-jack-in from Emacs instead (moving any .lein/profile.clj file out of the way first), as this will inject the right version of libraries for the CIDER version you have installed. Then just look in the messages buffer to see what to use.
For example
[nREPL] Starting server via /home/jr0cket/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- repl :headless :host localhost...
[
#2019-07-0817:20macrobartfastwow, ok...#2019-07-0817:20macrobartfastcider-jack-in allowed for docs to work.#2019-07-0817:22macrobartfastis your profiles public?#2019-07-0817:23macrobartfastor, what versions are you using of nrepl etc?#2019-07-0817:23practicalli-johnI do not use a .lein/profiles.clj it is not needed if you are using cider-jack-in, unless you are on a really old version of CIDER, circa February 2015. Move your profiles.clj out of the way first#2019-07-0817:24macrobartfastaha ok#2019-07-0817:24macrobartfastyeah, I use nrepl in a terminal and then connect to it from emacs.#2019-07-0817:24macrobartfastall good... thx!#2019-07-0817:25practicalli-johnIts okay to use a terminal to start the REPL using lein repl but you need to manage the versions of the plugins for the version of cider you have installed. So whenever you upgrade CIDER then you may need to update your .lein/profile.clj. CIDER has taken on some pretty big improvements and consolidated lots of code from other libraries, so its simpler to use cider-jack-in and let CIDER do the work for you 🙂#2019-07-0817:28macrobartfastok... and it's all working now, thanks!#2019-07-0817:33practicalli-johnThere are some excellent docs on different ways to run/connect to the REPL if cider-jack-in doesnt meet your needs https://docs.cider.mx/cider/basics/up_and_running.html.#2019-07-0817:39macrobartfastmaybe for #clojure, but what is a good way to jump to a function declaration and pop back?#2019-07-0817:40macrobartfastI'm finding cider-find-var requires everything have been already loaded somehow, which is awkward.#2019-07-0817:47practicalli-john@macrobartfast you are not the first to mention this limitation of cider-find-var. I always have the REPL running so don't notice the issue much. I use a lot of the tools in Spacemacs to navigate around.#2019-07-0818:17dpsuttonthere's lsp mode that statically can solve this#2019-07-0818:18dpsutton(use-package lsp-mode
:init
(setq lsp-clojure-server-command '("bash" "-c" "cd ~/projects/clojure/clojure-lsp && lein run"))
(setq lsp-enable-indentation nil)
(setq lsp-enable-completion-at-point nil)
;; (setq indent-region-function #'clojure-indent-function)
(add-hook 'clojure-mode-hook #'lsp)
(add-hook 'clojurec-mode-hook #'lsp)
(add-hook 'clojurescript-mode-hook #'lsp)
:config
(require 'lsp-clojure))
#2019-07-0900:56aisamuInteresting, thanks! Can CIDER and this be used simultaneously?#2019-07-0818:59carkhcould a couple unix guys test this : https://github.com/clojure-emacs/cider/pull/2657 ?#2019-07-0818:59carkhi'm not upgrading cider anymore because i need this#2019-07-0819:00carkhthat's as fast as applying the patch and jack in a project, see if it works#2019-07-0819:02carkha deps.edn project#2019-07-0819:07carkhi tested it with a few projects here on windows and WSL,#2019-07-0819:07carkhbut when will cider produce a problematic command line though ?#2019-07-0819:08carkhok i can add that last one#2019-07-0819:09carkhalright, but are you talking in the abstract or specifically for cider usage ?#2019-07-0819:10carkhthe situation is that right now, cider won't jack(in a deps.edn project on windows without the changes i proposed, and i'm not knowledgable enough to handle the unix side of things, just good enough to test it#2019-07-0819:11carkhdo you think cider can produce such a command line with $var in it ?#2019-07-0819:13carkhi'm ok with not going at it without forethought#2019-07-0819:13carkhbut it eventually needs to be fixed to work in both cases i think#2019-07-0819:15carkhallright then, so how can i escape the $var ${var} and $(something) cases#2019-07-0819:16carkhhaha well that's what's preventing it to work under windows#2019-07-0819:17carkhthat's beyond my abilities =( i only know enough elisp to be dangerous#2019-07-0819:25carkhthanks#2019-07-0819:33FiVoIs there a way to set the size of a new repl window?#2019-07-0819:41dpsuttonthat should just be a normal emacs buffer/frame configuration thing? Do you mean just constraining the size of the repl that opens up?#2019-07-0819:41dpsuttoni think i've heard of people using https://github.com/roman/golden-ratio.el#2019-07-0819:43FiVoyes just the repl that opens up#2019-07-0819:44carkhone thing i dislike is when you drill down, say from test result to exception window then to code, i end up with code in my repl window, and sizes don't go back to what they were#2019-07-0820:28felipebarrosIt's not a cider specific thing. It's one of the most annoying aspects of Emacs in general.#2019-07-0820:50carkhtrue#2019-07-0912:32practicalli-johnI have new ClojureScript project that runs via the command line and opens up the browser with the ClojureScript app, but doesn't run from Emacs using cider-jack-in-cljs.
error in process filter: Figwheel-main is not available. Please check
I created a new project with the Clojure CLI tools and the figwheel-main template (using clj-new). This is the first time with this approach, so I may have missed something.
clj -A:new figwheel-main practicalli/study-group-guide -- --reagent
When I run cider-jack-in-cljs from Emacs, it prompts me for the build tool. I select figwheel-main and then I get the error. The web page does open (assuming because figwheel is not running)
Output in message buffer
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.1"} refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.22.0-beta8"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'...
[nREPL] server started on 40737
[nREPL] Establishing direct connection to localhost:40737 ...
[nREPL] Direct connection to localhost:40737 established
error in process filter: user-error: Figwheel-main is not available.
I am using the latest version of Cider (updated 12:00 UTC today) and Clojure CLI tools and clj-new
Emacs version GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) of 2019-06-19
If there is nothing obvious I have missed, I will have a dig around. If I cant get it working, I'll raise a ticket. Thank you.#2019-07-0912:33practicalli-johnThe code is at https://github.com/practicalli/study-group-guide#2019-07-0912:38bozhidar@jr0cket see https://github.com/clojure-emacs/cider/blob/master/cider.el#L674#2019-07-0912:38bozhidarBasically this only checks if the figwheel.main ns in present.#2019-07-0912:39bozhidarPerhaps you didn’t start the right profile or something like this?#2019-07-0912:39practicalli-johnWill do. It seems to be specific to this project. Other projects that were working, are still working in Emacs / CIDER#2019-07-0912:39practicalli-johnIt doesnt prompt me for a profile. It dies before that#2019-07-0912:40practicalli-johnIts the first time I have created a project with this template, so will also compare all the configurations to the project that works.#2019-07-0912:40bozhidarI meant the deps.edn profile. It wouldn’t prompt you about this - it just runs whatever the default one is.#2019-07-0912:42practicalli-johnI get a second prompt when I run a figwheel-main project created from a Leiningen template (I am still figuring out this whole Clojure CLI tools / deps.edn stuff )#2019-07-0912:42practicalli-johnI am sure I will find something simple missing in the difference between the two project configurations.#2019-07-0913:01practicalli-johnThe only difference I can see is how Leiningen and deps.edn include figwheel-main as a dependency. Leiningen uses :profiles {:dev ,,,}
deps.edn uses
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.1.9"}}#2019-07-0913:03dpsuttonthe dev profile is used by lein by default so its always there. you'll need to ad the fig profile to the cider startup command. The easiest way is to just prefix before jacking in and adding that profile. there's also cider-clojure-cli-global-options that you can set#2019-07-0913:07practicalli-johnis there a dir-locals (or what ever its called) approach for this, so I dont forget 🙂#2019-07-0913:08practicalli-johnI can google for it if you dont have it to hand#2019-07-0913:08dpsuttonyeah you can set cider-clojure-cli-global-options i nyour dir locals. set that to "-A:fig"#2019-07-0913:08dpsuttonbut try it with the prefix to make sure this will fix your issue#2019-07-0913:09practicalli-johnYes, just trying to remember how try it with a prefix in Spacemacs 🙂#2019-07-0913:11dpsuttonha gotcha.#2019-07-0913:12practicalli-johnOops, I killed the classpath... I didnt put the fig profile in quotes#2019-07-0913:15practicalli-johnYes, it works....#2019-07-0913:17practicalli-johnSPC u C-c M-J gives me the jack-in command line prompt and when I put -A:fig in the right place straight after the /user/local/bin/clojure command, it works (I put it after -Sdeps first and things went bang 🙂 )#2019-07-0913:18practicalli-john[nREPL] Starting server via /usr/local/bin/clojure -A:fig -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.1"} refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.22.0-beta8"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'...
[nREPL] server started on 35247
[nREPL] Establishing direct connection to localhost:35247 ...
[nREPL] Direct connection to localhost:35247 established
#2019-07-0913:18practicalli-johnI learnt a lot today, thanks @dpsutton and @bozhidar#2019-07-0913:18dpsutton👍#2019-07-0913:22practicalli-johnOne question. Has clojure-jack-in-cljs command be around for a while? Like more than 6 months?
Spacemacs is still using cider-jack-in-clojurescript which as of the latest CIDER beta release seems no longer available - it tells me to use cider-jack-in-cljs instead. Just wanted to be sure I could safely update the Spacemacs Clojure layer with the new command without breaking anyones older setup 🙂#2019-07-0913:25bozhidar@jr0cket At least an year. You can safely update it.#2019-07-0913:26bozhidarA few people complained that the aliases for the jack-in commands were confusing, as they seemed like different jack-in commands, so I’ve decided to trim them all, except the legendary cider-jack-in (which for a while has been an alias for cider-jack-in-clj.#2019-07-0913:40practicalli-johnGood work. Less commands is definitely easier 🙂#2019-07-0913:56practicalli-johnThe setting in .dir-locals.el is not getting picked up by the cider jack in. Does this look correct
((clojure-mode . ((cider-clojure-cli-global-options . "-A:fig"))))
I assume if the above config is correct, then I have probably just told spacemacs not to load .dir-locals files at some point.
I can see the fig alias is missing from jack in command in the message in the status buffer.
I created the file following this guide http://endlessparentheses.com/a-quick-guide-to-directory-local-variables.html#2019-07-0914:04practicalli-johnI switched if off and on again... and it worked !!!#2019-07-0914:06practicalli-johnWell, I closed all the project files and the layout for that project I had open, then opened the figwheel-main.edn file in another layout and started cider-jack-in-cljs and the alias was picked up in the jack in command from .dir-locals.el#2019-07-0914:45bozhidar@jr0cket a buffer has to be recreated for the vars to go in effect.#2019-07-0914:45bozhidarI recall there was also some command to refresh them, but I don’t remember what was its name.#2019-07-0922:00felipebarrosrevert-buffer I believe.#2019-07-0914:46practicalli-johnThanks.#2019-07-0915:16dpsuttonhack-local-variables?#2019-07-0916:23bozhidar@dpsutton It’s a function, not a command, but yeah - I was thinking of it.#2019-07-0916:26macrobartfastI just found the awesome cider browse ns feature... thank you for that! I use evil-mode... any suggestions for overriding those bindings in vanilla terminal emacs? in particular, would like to be able to jump to definition with the 's' key which evil has reserved.#2019-07-0916:39dpsuttontry cider-apropos 🙂#2019-07-0916:41macrobartfastok... will take a look.#2019-07-0916:46macrobartfastcider-apropos looks good... however, I definitely like the straightforward list of cider-browse-ns-all... ideally I would like to just move the pointer up and down that list and see the declaration in the other window like cider-browse-ns-find-at-point, ideally without leaving the list, but that probably doesn't exist quite like that.#2019-07-0916:52macrobartfastI guess it's really just about dropping into a ns or project and being able to see what it's about on a functional level and peruse it.#2019-07-0916:52macrobartfastwhich there may be better approaches to than I'm thinking of.#2019-07-0918:33practicalli-johnI don't really navigate that much around a project namespace, as most of my namespaces are relatively small (certainly compared to my previous Java projects).
I jump around a lot using Evil mode and avvy and on larger namespaces I may use code folding. Here is a selection of what I currently do
https://practicalli.github.io/spacemacs/navigating-code/#2019-07-0918:34dpsutton"jump to first unbalanced parens" that is crazy to me 🙂#2019-07-0918:35felipebarros@jr0cket recently I stumbled upon the same block with the figwheel-main alias. Others will probably be blocked by it too since, as you stated, C-u C-c M-J borks if you insert -R:fig or -A:fig at the end, so even the solution has this little nitpick. Where would be the right place to explain this detail @bozhidar?#2019-07-0918:37dpsuttonit needs to be a well-formed clj incantation. is that really CIDER documentation required? You're editing the raw clj form#2019-07-0918:38practicalli-john@anantpaatra I'll be adding what I have learnt to my (one day I will finish it) book on Spacemacs#2019-07-0918:38felipebarrosI feel it ends up being a little counter intuitive because CIDER injects a lot of things in the string and you are given the minibuffer with point at the end of it. I for once had tried the solution but still had to ask around to actually get that it wouldn't support it.#2019-07-0918:40practicalli-johnI enjoyed breaking my classpath, but then I am not on a deadline or just starting with ClojureScript. I am happy to do a pull request to the already excellent http://docs.cider.mx#2019-07-0918:56dpsuttonit used to present a kinda custom editor. I chose to change it to the raw command so it was clear where things can go. Its just a clj or lein invocation#2019-07-0918:56dpsuttonhappy to have better docs all the time though 🙂#2019-07-0920:39Caseyhow do I move the cider repl window so it is on the right side with a horizontal split rather than the default wide-and-short vertical split on the bottom?#2019-07-0923:38practicalli-johnI only know for Spacemacs Evil normal mode, which is SPC w l or SPC w L#2019-07-1021:48theeternalpulseI think you can check out window dedication. It's been driving me crazy as of late and I am going to look into that. I get the issue where I connect to cider and it replaced my current window split, rather then move to another one.#2019-07-1101:30practicalli-john@U70QFSCG2 As mentioned, window purpose is probably what you want if you have a need to control window placement based on buffer type
https://github.com/bmag/emacs-purpose
I never use the REPL buffer myself and Spacemacs doesn't open that buffer in a window by default. Evaluating in the source code buffer is much more effective for me.#2019-07-0920:39Caseyi'm using evil, and my normal window moving commands don't seem to affect the repl window#2019-07-1010:11FiVoHow can I load a new dependency from my project.clj while keeping my current REPL session?#2019-07-1010:49bozhidar@finn.volkel See https://nrepl.org/nrepl/0.6.0/usage/misc.html#_hot_loading_dependencies#2019-07-1011:47bozhidarhttps://metaredux.com/posts/2019/07/10/hard-cider-easy-downgrading.html#2019-07-1105:03oskarkvHm, requiring specter breaks dynamic font locking for me. Look at this https://i.imgur.com/1aW4sXr.png 😕#2019-07-1105:07oskarkvHm, no, not specter maybe, but something strange is going on#2019-07-1105:17oskarkvI removed all the code from the file, just keeping one call to a function in oskarkv.utils to see if dynamic font locking works, then I tried removing a bunch of namespaces from the (:require ...) declarations. If I remove any one of re-frame, specter or clojure.pprint, dynamic font locking starts working, but not when removing the others.#2019-07-1106:32oskarkvMy best guess as to what is going on is that it just becomes too much somehow, with many required namespaces. I checked with edebug in cider-refresh-dynamic-font-lock and it doesn't seem like anything strange is happening. But of course the values of for example cider--dynamic-font-lock-keywords are so big that it's hard to check what's going on exactly. Or maybe I should check in some other function instead.#2019-07-1107:27danielgrosseHello I have a newbie question for Jackin to cljs. I checked out the flappy bird repo with figwheel main, but cannot get the connection to the CLJS REPL right. When I start the Jackin command, it asks the usual questions and I choose lein -> fighweel-main -> :dev
The log outputs the connection to localhost:63044 is established and the websites opens in the browser. But when I switch to the REPL from the core namespace, it tells me, that no cljs REPL for current session exists.
Is there a fool proof example I could test on?#2019-07-1110:29practicalli-john https://github.com/bhauman/flappy-bird-demo uses the classic figwheel
https://github.com/bhauman/flappy-bird-demo-new uses newer figwheel-main
Make sure you use the right one they can’t run each other’s project without changing the project configuration and dependencies #2019-07-1118:34felipebarrosWhen it asks for the build name, try it without the colon. dev instead of :dev.#2019-07-1107:29oskarkv@danielgrosse https://github.com/oskarkv/cljsissues there is a small project that works for me#2019-07-1107:30danielgrosseThanks I'll try it#2019-07-1107:38Yehonathan SharvitHi there#2019-07-1107:38Yehonathan SharvitTrying to install cider and I get this annoying error:
Error: Cannot open load file: No such file or directory, sesman-browser
What should I do?#2019-07-1107:40manuelHow are you installing it?#2019-07-1107:41manuelthese steps have never failed me: https://docs.cider.mx/cider/basics/installation.html 🙂#2019-07-1107:43Yehonathan SharvitI had a old version of cider#2019-07-1107:43Yehonathan Sharvitso I did#2019-07-1107:45Yehonathan SharvitM-x package-delete <RET> cider <RET>
and then
M-x package-install <RET> cider <RET>
#2019-07-1107:46manuelAre you sure package-delete worked fine? If you have some packages depending on cider (e.g., clj-refactor), I don't think package.el will let you completely remove cider.#2019-07-1107:47Yehonathan SharvitI also removed clj-refactor#2019-07-1107:47Yehonathan SharvitHow can I check that the package-delete worked fine#2019-07-1107:47Yehonathan Sharvit?#2019-07-1107:48manuelyou could inspect the .emacs.d/elpa directory and see if cider and any of the packages depending on it (see "Needed by" here: https://melpa.org/#/cider) are still there.#2019-07-1107:49Yehonathan SharvitStill there#2019-07-1107:49Yehonathan Sharvitno#2019-07-1107:49Yehonathan Sharvitit’s removed#2019-07-1107:49Yehonathan SharvitMy bad#2019-07-1107:49Yehonathan Sharvitno cider folder#2019-07-1107:50Yehonathan Sharvitand when I run M-x package-install <RET> cider <RET> I see the error
Error: Cannot open load file: No such file or directory, sesman-browser
#2019-07-1107:50manuelok, then try refreshing the package archives with M-x package-list-packages before installing cider.#2019-07-1107:52manuelsorry, M-x package-refresh-contents#2019-07-1107:52manueland then M-x package-install cider#2019-07-1107:52manuel(see: https://docs.cider.mx/cider/basics/installation.html#_installation_via_package_el)#2019-07-1107:53Yehonathan Sharvitdone#2019-07-1107:53Yehonathan SharvitBut still the same errror when installing cider#2019-07-1107:53Yehonathan SharvitAnd now I have this folder: /.emacs.d/elpa/cider-20190708.1036#2019-07-1107:54manuelthat's what I have too#2019-07-1107:54manuelbut I don't see the error on installation#2019-07-1107:54manuelcould you try opening a Clojure project and see if jacking-in works?#2019-07-1107:55Yehonathan SharvitWhen I run cider-jack-in I get the same error#2019-07-1107:56manuelI'm a bit lost here, sorry. Can you try with a clean .emacs.d? (backing up your original one, of course). The steps on the CIDER documentation always worked for me, so there is something else at play here.#2019-07-1107:57Yehonathan SharvitIt worked#2019-07-1107:58manuelOK, so there is something messy in your original configuration. 🙂#2019-07-1107:59manuelsesman-browser comes in with sesman, which is a cider dependency that gets automatically installed when you install cider from MELPA. So it has to be there after the installation, that's why I don't understand the error you get.#2019-07-1108:02Yehonathan SharvitIs there a way to store in a file the list of packages that I want to be installed?#2019-07-1110:33practicalli-johnYou could just use Spacemacs. It uses layers to define what packages are needed for a major mode, along with any configuration
http://spacemacs.org/
https://practicalli.github.io/spacemacs/#2019-07-1108:03manuelnot sure, but you could do something like this: https://github.com/magnars/.emacs.d/blob/master/init.el#L71#2019-07-1108:27Yehonathan SharvitThanks for your help @manuel#2019-07-1108:27manuelno problem#2019-07-1202:05bartukahi ppl, is it possible today to add a dependency in project.clj (even through cljr-refactor) that reloads the repl automatically?#2019-07-1204:15felipebarros@iagwanderson take a look at https://nrepl.org/nrepl/0.6.0/usage/misc.html#_hot_loading_dependencies#2019-07-1211:23jonpitherAm looking forward to https://github.com/clojure-emacs/refactor-nrepl/pull/251#2019-07-1211:24jonpitherAny intel on a release date?#2019-07-1213:21stacktracerIs it possible to get cider autocomplete working in a codebase with a Maven POM rather than a lein project.clj? (... I have cider connected to an nrepl instance that I started from the CLI, and autocomplete works in the cider repl. But no autocomplete when editing a file. The file buffer modeline says "Clojure cider[clj:<no project>@:proc:nrepl-connection]".)#2019-07-1213:23bozhidar@stacktracer See https://docs.cider.mx/cider/usage/managing_connections.html#2019-07-1213:23bozhidarYou can manually associate the entire folder of the project with the session of your REPL connection and that should work.#2019-07-1213:24bozhidarA real solution would be to teach clojure-mode (and CIDER by association) about Maven projects. And maybe even implement cider-jack-in for them.#2019-07-1214:40stacktracer@bozhidar sesman-info says my file buffer is associated with my nrepl connection (which is linked to the project dir, as you suggest) ... but still no autocomplete in the file buffer#2019-07-1214:40stacktracerMaybe I'll try putting a project.clj in there, just to see if that's really the problem#2019-07-1215:09bozhidarI’m puzzled - how can it be linked to the project is it thinks there’s no project? 🙂#2019-07-1215:10bozhidarBtw, have you evaluated the namespace with C-c C-k first?#2019-07-1215:17stacktracerVictory! I installed and turned on company-mode, and its autocomplete works. Not sure why the standard autocomplete wasn't working.#2019-07-1215:18stacktracerAlso, you correctly anticipated my next question, which was going to be why it couldn't autocomplete symbols from the file itself. Brilliant!#2019-07-1215:21stacktracerI'm starting the nrepl server with the project dir as CWD. The file I'm editing is underneath that project dir. Once I do "cider-connect," sesman seems to be smart enough to hook up the file to the nrepl connection.#2019-07-1215:23stacktracerThanks @bozhidar!#2019-07-1217:00skykaninAccording to the cljfmt readme CIDER0.9+ has cljfmt integration, but I can't find anything about formatting code in the CIDER docs.#2019-07-1217:49practicalli-johnI am unsure there is much to say. Basic formatting just happens as you type or press TAB.
With Spacemacs I use agressive indent and automatic alignment
https://practicalli.github.io/spacemacs/improving-code/formatting/#2019-07-1305:36dpsuttonif you're using leiningen this is exactly the purpose of a dev.cljs file. I've seen a few people mention they hate this and they much prefer just having traditional clojure files. Just add an extra path under an alias.
> :extra-paths is used to include source paths in addition to your standard source paths, for example to include directories of test source:
so make a dev folder, add it as extra paths and then just make a namespace that requries whatever you want#2019-07-1310:40dmaiocchiHI! I was wondering, when i use cider-jack-in by default it split my frame in 2. window This is super-hand#2019-07-1310:41dmaiocchiI was wondering if in Emacs there is a way to open my window ( the cider-repl) into a new frame#2019-07-1310:42dmaiocchiso I can have basically my REPL session to a second screen and the codebase to a 1st monitor screen#2019-07-1310:45yuhan(switch-to-buffer-other-frame (cider-current-repl)) should do it#2019-07-1310:47dmaiocchithx. I was using make-frame#2019-07-1310:51dmaiocchiI have also a curiosity question in cider. Why do we have 2 bindings for C-x C-e and C-c C-e?#2019-07-1310:52dmaiocchior also for other cmd.. we have multiples bindings. I have started recently with emacs, so I might miss some historic, fondamental emacs design knowledge#2019-07-1310:53dmaiocchiis this a CIDER design decision or it is a common way in lisp apps, and emacs ? just for curiosity.. TIA#2019-07-1421:52Joshua SuskaloI'm currently having issues with my http-kit based library. It works fine in lein's repl, but when I start it with CIDER I get an exception about the Client/Server mode not being set. This is something I've seen from people using http-kit 2.3.0 when they're using Java 11 or later. I'm currently using Java 12, so this is somewhat expected if my http-kit version is 2.3.0 or older. However, my library requires 2.4.0-alpha3, which has support for Java 11+. Is there a way for me to see what version of http-kit is included when I launch via the CIDER repl? Or does anyone know if nREPL or something requires an older version of http-kit?#2019-07-1503:05jumar@U5NCUG8NR I'd try cider-open-classpath-entry. Usually the artifacts should have a version number in their name.#2019-07-1503:10Joshua SuskaloThanks! I'll have to take a look at that next time I have a free minute.#2019-07-1507:33bozhidarLein’s repl and CIDER’s repl are the same thing (provided you’re using lein and cider-jack-in - cider just runs lein repl and connects to the resulting nREPL server. nREPL doesn’t use http-kit in any form (although drawbridge might be using). I’m not sure if Leiningen still bundles drawbridge).#2019-07-1522:05Joshua SuskaloCIDER's repl injects several dependencies, like nREPL itself though, doesn't it? At least it appears to based on the command I see run in my message history. I was wondering if one of the injected dependencies required an older version of http-kit.#2019-07-1522:05Joshua SuskaloBut yeah, I'll try to check that out and see what I can find.#2019-07-1522:08Joshua SuskaloAfter using cider-open-classpath-entry I see http-kit 2.3.0 is being loaded instad of 2.4.0-alpha3#2019-07-1522:09Joshua SuskaloI'm not sure how to determine what is requiring it, and if I don't know that I don't know how to put an exclusion in my project.#2019-07-1600:14Joshua SuskaloAh, so it turns out I can set a global exclusion in lein, and that was the final resolution to my problem.#2019-07-1607:20jumaryes, you can always use lein deps :tree to figure out where the dependency comes from. or lein deps :why http-kit#2019-07-1510:52dmaiocchiJust a question. I do have this (defn bro []
(doseq [entry ["bra" "bro"]]
(println entry) ;; C-C C-E for evaluating here
)
)
#2019-07-1510:54dmaiocchiwhen I'm using cider, I try to evaluate the expression with C-C C-E but i noticide that i get an error , allthough if I run it in REPL this work fine#2019-07-1510:55dmaiocchiUnable to resolve symbol entry` when I use C-C C-E with cider emacs. I don't figure out why It can't resolve the symbols in a doseq. anyone has idea about this why ? tix#2019-07-1510:56dmaiocchiOr in other words, it is possible to evaluate one iteration in a doseq?#2019-07-1511:11bozhidar@darioszr Normally you’d step over iterations using the debugger.#2019-07-1511:12bozhidarThere’s also eval-up-to-point which is probably what you want.#2019-07-1511:13bozhidarTry C-c C-v (C-o).#2019-07-1511:14dmaiocchithx @bozhidar cider#2019-07-1511:14dmaiocchiI will try it out, always learning new feature on cider :grinning_face_with_star_eyes:#2019-07-1600:39Joshua Suskalocider-eval-defun-at-point might get what you want.#2019-07-1600:41dpsuttonThere’s an equivalent to insert. That command will just evil#2019-07-1600:42dpsuttonLet me finish dinner and I’ll show you my tweaks#2019-07-1600:47dpsutton@deleted-user do you use use-package?#2019-07-1600:48dpsutton(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-after-insert-p nil)
(setq cider-switch-to-repl-on-insert-p nil)
#2019-07-1600:51dpsuttonso there's a a cider-insert-map under C-c C-j#2019-07-1600:51dpsuttonwhich has insert region(r), defun (d), and expression (e)#2019-07-1600:52dpsuttonbut it puts focus in the repl which is annoying which is the purpose of the 2nd (and 3rd there. there was a refactor so depending on your CIDER version one of the other is correct)#2019-07-1600:53dpsuttonoh and this: (setq clojure-toplevel-inside-comment-form t) which lets you work with top level things inside of (comment ,,,) forms#2019-07-1600:54dpsuttoncool. use that one instead#2019-07-1600:54dpsuttonyeah. someone mentioned "on" is ambiguous so now its "after"#2019-07-1601:02dpsuttonah yeah. forgot i put that in there.#2019-07-1601:02dpsuttoncan't muck with the definition of what is a top level thing without lots of user testing#2019-07-1606:08agHey guys, I’ve been playing with shadow-cljs and CIDER I don’t think it’s working as I wanted. Can someone point me to a minimal, up to date example of node-js build with CIDER instructions please. Documentation is confusing, some sources say you need to npm install source-map-support and ws, shadow-cljs manual says nothing of that sort, trying to jack-in-cljs prompts me with questions multiple times and then says something like
[:no-worker :dev]WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)shadow.user>
I basically want to cider-jack-in and see printed statements in the REPL when app starts and when I update the code i.e: (`:after-load`). I was able to run shadow-cljs watch dev in one terminal window and then node target/app.js in another, but I just want to cider-jack-in and chill.#2019-07-1606:14agHonestly, I think Clojurescript REPL driven workflow right now is such a mess. I’ve been writing Clojure for 3 years, and I still can’t figure this out easily, how newbies suppose to deal with this shit I have no idea. Like having a bunch of options wasn’t enough: lein, deps, figwheel, figwheel-main, boot, shadow in browser, shadow in node, with webpack, without it, etc. etc.#2019-07-1606:18agand somehow we’re like “yeah, Clojurescript is awesome, I wish more people used it”. Yeah, I think more people would’ve used it if it wasn’t so damn confusing.#2019-07-1606:18carkhit's hard to get started, but once it's going, i find it even better than with clojure itself (the workflow)#2019-07-1606:20carkhsave the file, see the result instantly, no need to fiddle with the repl... and test results pop a system notification while you look at the app#2019-07-1606:30agokay, I was able to finally jack-in and I see cljs.user> prompt, but when I change the code my :devtools {:after-load server/reload!} which has only one line (println "Code updated...") is nowhere to be seen. It looks like it’s recompiling, but where is it printing this stuff?#2019-07-1606:30carkhthat would depend on your setup#2019-07-1606:30carkhmaybe in the browser console ?#2019-07-1606:40agI don’t want browser console. I need simple, vanilla nodejs#2019-07-1606:41agI’m trying (:require [cljs.nodejs :as node]) and (node/enable-util-print!) and still not working#2019-07-1606:41carkhi can't help with that, no experience at all with node#2019-07-1606:41carkhbetter ask in clojurescript channel#2019-07-1608:24bozhidarAdmittedly our ClojureScript documentation is pretty basic (https://docs.cider.mx/cider/basics/clojurescript.html) and contributions to it would be most welcome.#2019-07-1612:22dpsuttonCan you toss out the refactor nrepl dep? There is no project.edn and it sounds like it’s a bit lost#2019-07-1614:49Nick Staresusing shadow-cljs, when I cider-connect to the repl process, I get
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
In the repl window, and calling cider-switch-to-repl-buffer I get no cljs REPLs in current session#2019-07-1614:53dpsuttonthe first is saying clj refactor doesn't speak shadow and it won't do anything. For the second, is the cljs repl connected?#2019-07-1614:56Nick StaresI have a working shadow-cljs repl buffer in emacs that's connected to the shadow-clj watch app repl process#2019-07-1614:57dpsuttonput the point in that buffer and then back into the source buffer. should be good after that#2019-07-1615:06Nick Stareshmm, that did the trick, but now I'm getting No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code. when I eval a sexp#2019-07-1615:09justinbarclayI get this when I am running a web app and haven’t connected my browser to the shadow-cljs server, could that be the case for you?#2019-07-1615:06Nick Staresnew error = progress#2019-07-1615:10dpsuttonhave you connected the browser to the app?#2019-07-1615:11Nick StaresAha! That was it. Didn't realize that was part of the process. First time using shadow-cljs 🙂#2019-07-1615:11Nick Staresthanks @dpsutton @emoarmy#2019-07-1707:44FiVoHey newbie here. On some projects when I start the REPL, I start in the namespace 'user and on other in 'my-project.core. Is this somehow specified in some config? How does cider decide in which namespace to start?#2019-07-1708:15jumarThis is the leiningen thing (if you use it). user is the default for Clojure repl but it should be customizable via the :main config key in the project.clj#2019-07-1710:22FiVoI have the :main set still ends up in user.#2019-07-1712:25bozhidarIt’s actually :init-ns which specifies the initial ns.#2019-07-1712:50dmaiocchiYes the latter is true#2019-07-1712:51dmaiocchiThe main is for lein run#2019-07-1713:22jumarFunny enough, when you use lein new app and have just the :main key set to core then lein repl ends up in the core namespace. If you remove the :main key it ends up in the user namespace.#2019-07-1707:46FiVoAlso is there a cider shortcut to close and go back to the previous buffer when I have opened a cider-doc or cider-error buffer? Or is this rather some emacs related setup?#2019-07-1708:13jumarLIkely just q#2019-07-1708:34FiVothanks, I was using some other mode but that let me to the appropriate function#2019-07-1717:14dmaiocchiI'm trying to activate the cider debug with cider-debug#2019-07-1717:14dmaiocchibut I don't have it/found when I use M-X .. :thinking_face:#2019-07-1718:17dpsuttonit's in the manual. but just eval the defun with a prefix. C-u C-M-x#2019-07-1719:22dmaiocchiYep I did it but I dunno how to run the débugger after that..#2019-07-1719:22dmaiocchi😁#2019-07-1719:28dpsuttonwhen the function is invoked it should do everything for you#2019-07-1719:30dmaiocchiAh OK thx I might missed something then I will retry#2019-07-1801:38theeternalpulsein cider with evil, what mode would I set the default evil state to emacs so I can use the debug commands (continue, next, etc) without having to press backslash. I tried this (evil-set-initial-state 'cider--debug-mode 'emacs) but it doesn't work.#2019-07-1801:39theeternalpulsewhen the mode is active I see this show up with C-h m
Enabled minor modes: Aggressive-Indent Async-Bytecomp-Package
Auto-Composition Auto-Compression Auto-Encryption Blink-Cursor *Cider
Cider--Debug* ...
#2019-07-1801:46theeternalpulsethis seemed to work, (add-hook 'cider--debug-mode-hook #'evil-emacs-state)#2019-08-0506:57bozhidarOf course.#2019-08-0506:59pezOh, yes, I am confusing things. s/clj-refactor/refactor-nrepl on about everything I have said here. 😃#2019-08-0507:02bozhidarDon’t worry - I always manage to figure out what something is actually referring to.#2019-08-0507:04pezAren't you a programmer geek and supposed to have diagnoses preventing you from that?#2019-08-0507:06bozhidar😄#2019-08-0507:06bozhidar> I guess we can have a simple daemon-type of service that just handles this, but it doesn’t feel like a great fit with REPL-driven development, as in essence it would completely decoupled from the REPL state.#2019-08-0507:06bozhidarAlso known as LSP. 😄#2019-08-0507:06bozhidarJust thought I should mention this here as well.#2019-08-0507:07bozhidarOr something based on ctags (for instance).#2019-08-0507:09kstehnwe started to look into lsp
but we didnt want to have to tell the user to first install something diffrent like the clojure-lsp
and with the documantion, at least for me, is it not clear how to actualy use it#2019-08-0512:12dpsuttonOpen an issue. The maintainer is quite friendly #2019-08-0507:14pez> it would completely decoupled from the REPL state
For situations when you have evaluated something that is not yet saved to disk (or even hidden inside (comment) and such)?#2019-08-0507:15pezI mean, I see that it always would be completely decoupled, but wondered when you see it matters (most).#2019-08-0507:20pez> not clear how to actualy use it
For Calva it would be something like just register it, I think, and features would just magically appear.#2019-08-0507:42benedek#trin i think is a good candidate for this -- only it is not there yet obviously. it can be easily adapted to rewrite-cljc when @lee releases it. i can only restart working on it in anger in September tho#2019-08-0508:15bozhidar> and with the documantion, at least for me, is it not clear how to actualy use it#2019-08-0508:17bozhidar@slack1038 Yeah, I understand what you mean. With clojure-lsp you need to download the binary, put it somewhere on your classpath and setup properly your editor to run it when it needed. I have no idea how LSP servers deal with multiple projects and how the editors know when to start/restart/stop those.#2019-08-0508:18kstehnokay thanks 🙂#2019-08-0508:24benedeki guess the lsp client takes care of that really#2019-08-0508:25benedeki use it in emacs in parallel with cider nowadays. it kicks in when i open a source file in a project. it creates a directory for caches and config files in the project root directory#2019-08-0508:30bozhidarIs it one server per project or one server for all the projects?#2019-08-0508:30benedekone for all#2019-08-0508:41dominicmAnd all for one#2019-08-0508:48bozhidar😄#2019-08-0508:31benedekcache per project#2019-08-0508:32benedekwhen I open a source file in a new project it does a big analysis and caches the results -- you can opt out or postpone this#2019-08-0508:33benedeksuppose this cache is then kept up-to-date but i have not looked into this particular part#2019-08-0508:35pezWhich reminds me, refactor-nrepl has an op for warming up the AST cache. Is this cache kept up-to-date? If anyone knows w/o having to do my research work for me. 😄 (When @slack1038 and I tried it, it seemed like the cache was kept updated.)#2019-08-0508:35benedekyup#2019-08-0508:37benedekI think it looks at file last modified dates but i may be lying. but it is deffo kept up-to-date#2019-08-0508:42dominicmWarm-cache is sent in the background when cider first connects so that the first refactor operation you do doesn't take forever.#2019-08-0508:47pezThat's what @slack1038 did in his Calva branch as well.#2019-08-0508:48bozhidarWe’ve agreed with @pez to form a “Task Force” to tackle this and other common problems. I’ll form some channel about this soon and invite everyone interested in the work to join in (and the calls we’re about to have). I think it’s time we started working on the Clojure tooling foundations in a more structured manner and that’s going to be the first step. 🙂#2019-08-0622:36richiardiandreaCount me in (after August)#2019-08-0508:48bozhidar@dominicm @benedek I’m volunteering both of you for the task force. 😉#2019-08-0508:48pezaw_yeah#2019-08-0508:50dominicmVoluntold#2019-08-0508:51benedek+1 here boss :)#2019-08-0509:06bozhidar😄 😄 😄#2019-08-0516:16andrea.crottiis it actually possible to send a form directly to cider and see its evaluation?#2019-08-0516:16andrea.crottiI can't find the command in the docs or checking all the cider functions#2019-08-0516:17andrea.crottibut I think I've seen someone doing it at heartofclojure#2019-08-0516:17andrea.crotti(i could probably write the function myself if it doesn't exist)#2019-08-0516:17andrea.crottiactually sending the form to the right cider repl and switching would be enough, no need to evaluate as well automatically#2019-08-0516:19dmaiocchiI use C-X C-E for evaluating things#2019-08-0516:20dmaiocchiand for sending it to repl there is a complementary cmd#2019-08-0516:20andrea.crottiah I found it now#2019-08-0516:20andrea.crottiit was cider-insert.*#2019-08-0516:20andrea.crottiand all the related functions, cool I can't believe I never used it 😄#2019-08-0516:21dmaiocchiyep I had also same thought the 1st time I have discovered it 😁#2019-08-0516:21dmaiocchiduring the conf btw, I was about to ask people why the evaluate function by function#2019-08-0516:22dmaiocchinormally you can evaluate the whole buffer with C-c C-k#2019-08-0516:22dmaiocchiso you don't have to evaluate function by function (but everyone has is own personal repl workflow) 😁#2019-08-0516:23dmaiocchianyways for me the basic workflow current documentation is pretty well written#2019-08-0516:23dmaiocchihttps://docs.cider.mx/cider/usage/cider_mode.html#_basic_workflow#2019-08-0516:23dmaiocchione can have really the basic things there covered without going through the whole doc#2019-08-0516:31dpsutton(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-after-insert-p nil)
(setq cider-switch-to-repl-on-insert-p nil)
helpful for the insert commands#2019-08-0516:33bozhidar@darioszr The basic workflow is a bit too basic right now, but my idea for this section is to teach people how to use CIDER is something like 3-5 minutes. 10-15 essential commands and off to productivity. 🙂#2019-08-0516:35dpsutton(setq clojure-toplevel-inside-comment-form t) for working inside of comment blocks#2019-08-0516:35pezinvert-insert-eval?#2019-08-0516:36dpsuttonthe default is to not eval. I prefer to eval automatically#2019-08-0516:36dpsutton"Whether to invert the behavior of evaling.
Default behavior when inserting is to NOT eval the form and only eval with
a prefix. This allows to invert this so that default behavior is to insert
and eval and the prefix is required to prevent evaluation."
#2019-08-0516:38bozhidarYeah, the original idea was that you’d be sending the whole forms only if you needed to edit them before evaluating them. Turned out some people liked keeping tracked of things they eval in the REPL.#2019-08-0516:54dmaiocchi@bozhidar imho as basic workflow looks already a good basic thing#2019-08-0516:55dmaiocchiI mean the essential stuff are already there 😁 as long one can evalute buffer and expression, imho that's the things one need as basic#2019-08-0516:55dmaiocchi😁#2019-08-0516:55dmaiocchiwe could then just call intermediate workflow and ninja workflow then..#2019-08-0516:57dmaiocchias perhaps good hint we could add the command to switch to namespace perhaps in basic? ( i use it quite a lot#2019-08-0516:58dmaiocchibut i use now like
(in-ns 'newns2) for swtiching namespaces#2019-08-0516:59dmaiocchibefore i was using cider for that, but I tend to forget all the keystroke combinations 😁 so in-ns for that was more in my brain.. 😁#2019-08-0517:08dmaiocchior form your pov what would be missing in the base workflow?#2019-08-0517:20alexeizHi. I have a problem with repl in this setup: emcs/cider/shadow-cljs. I start it with cider-jack-in-cljs, then choose shadow as the repl type, then 'select shadow-cljs build' - app, then 'visit... in browser' - n, and it drops me into cljs.user> prompt (even though I have :nrepl {:init-ns my.ns} in shadow-cljs.edn.#2019-08-0517:21alexeizis this the right way to do it? Am I missing anything?#2019-08-0517:23alexeizif I try to call anything from my.ns, like (my.ns/main!), I get error 'no application has connected to the repl server. make sure your js environment has loaded your compiled clojurescript code.'#2019-08-0517:25dpsuttondo you have a browser open and your app successfully loaded?#2019-08-0517:25alexeizmy app is :target :node-script#2019-08-0517:25alexeizit's not a browser app#2019-08-0517:26dpsuttonah#2019-08-0517:27dpsuttonis :node-script correct?#2019-08-0517:28alexeizI think so. I'm able to compile it with 'shadow-cljs compile app' and it produces target/main.js which I'm able to run with nodejs#2019-08-0517:28dpsuttonah nevermind. that's correct#2019-08-0517:28dpsuttonis it public?#2019-08-0517:30alexeizyou mean, is code public? no, but I can post shadow-cljs.edn, it's the only thing that's needed, right?#2019-08-0517:30dpsuttonyeah sure.#2019-08-0517:33dpsutton{:source-paths ["src"]
:dependencies [[reagent "0.8.1"]
[cljs-styled-components "0.1.5"]
[org.clojure/core.async "0.4.490"]]
:builds {:app {:target :browser
:output-dir "target/js"
:asset-path "js/"
:modules {:main {:init-fn asg.main/main!}}
:devtools {:http-root "target"
:http-port 8080}}}}
example of a shadow-cljs.edn for me that works. I just use cider-jack-in-cljs. CIDER manages nrepl and piggieback and all the goodies#2019-08-0517:33alexeizhere it is: https://pastebin.com/JpmhZpNg
it's pretty barebone#2019-08-0517:37dpsutton> You do not usually need to set :optimizations since the :target already sets it to an appropriate level.#2019-08-0517:37dpsuttontry it without optimizations#2019-08-0517:39alexeizI removed all :compile-options. The behavior is the same.#2019-08-0517:42dpsuttonhmm. i get the same behavior. I wonder how shadow exposes the node cljs environment. perhaps piggieback isn't seeing it?#2019-08-0517:43dpsuttonor actually, piggieback might not be involved. been a while since i've worked inside of shadow#2019-08-0517:43dpsutton@thheller might have some thoughts but i have to run to lunch#2019-08-0517:45alexeizI followed https://shadow-cljs.github.io/docs/UsersGuide.html#_launch_the_clojurescript_repl
and got to the point of [:selected :app] cljs.repl> prompt with no errors, but then I'm not able to call anything, but get 'no application has connected to the repl' error#2019-08-0517:46alexeizI feel I'm missing something simple#2019-08-0517:46pezHave you started the app?#2019-08-0517:46alexeizno, it's a node-script app, not a browser app#2019-08-0517:47dpsutton(I'm missing the same simple thing if so :)#2019-08-0517:49pezIt still needs to be started to connect to the repl, right? Can you connect to a :node-repl?#2019-08-0517:50alexeizI'm not sure how to connect to a :node-repl#2019-08-0518:09alexeizany other ideas?#2019-08-0518:33pezTry asking in #shadow-cljs , this seems like there is something special with the :node-script target that we are missing.#2019-08-0519:56thhellerfor :node-script you need to manually launch the actual node process. node-repl is a special internal "build" that has no direct configuration but handles launching the node process internally. so from the command line you just run shadow-cljs node-repl and that gives you the REPL directly. you can "select" that REPL in CLJS by running (shadow.cljs.devtools.api/repl :node-repl) or start it via (shadow.cljs.devtools.api/node-repl)#2019-08-0519:56thhellerI' unsure how cider handles the build selection parts though#2019-08-0520:35alexeiz@thheller I sort of got it working with (shadow.cljs.devtools.api/node-repl) but it's a pita. It should be easier than this#2019-08-0602:30mhcatGood morning! Is it possible to disable the asynchronous loading of namespaces so that when I start cider, it doesn't claim to have started until after the namespaces have loaded? I don't mind waiting a long time.#2019-08-0602:43mhcatI think it might be messing with the namespace dependency graph too - I get process filter errors like this: error in process filter: user-error: Some namespaces are in a bad state: error "count not supported on this type: Symbol" in backend-big-enos.lifecycle; error "count not supported on this type: Symbol" in backend-big-enos.gateway.eloqua-live-test; error "count not supported on this type: Symbol" in backend-big-enos.validations
which relate to a var which holds a memoized version of a function. The dependencies are fine when I build jar, but things blow up with cider.#2019-08-0602:43mhcatMaybe there's a way to indicate that a ns should be loaded early?#2019-08-0602:44mhcatI'd be ok switching off these optimizations though, if that's possible#2019-08-0602:48mhcatmaybe the problem is an interaction with circleci's bond lib#2019-08-0605:58bozhidar@j0ni Not sure what you’re referring to. CIDER normally doesn’t load any namespaces on startup, unless you’ve specified some initial ns. (and I think it was evaluated synchronously)#2019-08-0606:45benedekthis is clj-refactor/refactor-nrepl#2019-08-0606:51benedeklet me look up the config options affecting this#2019-08-0607:08mhcatAhhh gotcha thanks @benedek I was looking in the wrong place#2019-08-0607:12benedekgimme a sec. on it#2019-08-0607:32benedekcljr-ignore-analyzer-errors is probably the most interesting#2019-08-0607:33benedekif you set this to ’t clj-refactor will carry on with the features needing an AST (find symbol, rename symbol etc)#2019-08-0607:49pezIs this relevant for us? @UD8TU3HP0#2019-08-0607:53kstehnmhm i could be worth a try i have already somewhere added to ignore errors but i guess it is not used right now#2019-08-0607:33benedekonly will omit those nses with an error#2019-08-0607:33benedekI am guessing you have cljr-warn-on-eval set to nil#2019-08-0607:34benedekthat is why the analysis happens right after startup on your emacs#2019-08-0607:34benedekif you set it back to ’t it won’t happen at startup, but you will be asked a question when you first invoke a feature needing an AST#2019-08-0607:35benedekyou can also control this explicitly with cljr-eagerly-build-asts-on-startup #2019-08-0607:35benedekhope this makes sense#2019-08-0704:05mhcatSo now I have the following configuration: (setq cljr-warn-on-eval nil)
(setq cljr-suppress-middleware-warnings t)
(setq cljr-favor-prefix-notation nil)
(setq cljr-favor-private-functions nil)
(setq cljr-inject-dependencies-at-jack-in t)
(setq cljr-eagerly-build-asts-on-startup t)
(setq cljr-ignore-analyzer-errors t)
but I still see the error in process filter message. It's not a big deal, I can fix it by loading the ns with the memoized function var, and then the nses which caused the errors load fine#2019-08-0704:06mhcatSeems like a dependency graph issue though I don't have time right now to go into it from our project pov. I will if it starts showing up in non-dev situations.#2019-08-0704:06mhcatanyway thanks for your help#2019-08-0706:10benedekyeah the error will be still showing. may well be a dep order issue we would need a fix for that if that is the case#2019-08-0610:33mhcatThanks @benedek I'll get to this later - sorry for disappearing, I'm (a) on JST rn and (b) suddenly sick but I'll def try to get this working right tomorrow#2019-08-0610:33benedeknw @j0ni get better soon#2019-08-0610:34mhcat❤️thanks#2019-08-0614:46myguidingstaris there anyway to connect a clojure buffer to joker?#2019-08-0614:52bozhidar@myguidingstar You can do this with inf-clojure.#2019-08-0723:40danielcomptonhttps://www.clojuriststogether.org/news/q3-2019-funding-announcement/#2019-08-0802:06TravisThose are awesome projects in that list#2019-08-0821:45mhcatcongrats on the funding @bozhidar; well earned already, and an exciting/terrifying time for those of us who track master 😄#2019-08-0821:55bozhidar😄 😄 😄#2019-08-0821:55bozhidarThat’s an interesting way of putting it!#2019-08-0909:38jumarI'm wondering what's the status of JDK 9+ / 11 support.
I finally got tools.namespace/refresh working (well almost) in my project but it doesn't play well with cider: https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace?show=8379#c8379
In particular, cider seems to add JDK's src.zip to the classloader's classpath and this doesn't work with clojure.java.classpath.
Also, I can't display javadocs and jump to JDK's source when running on JDK 9 or 11 while I can do the same with JDK 8#2019-08-0913:17bozhidar@jumar Are you problems with the stable or the snapshot version? The snapshot version has many fixes for Java 9+ and ditched the use of clojure.java.classpath in favor of Orchard’s implementation of this.#2019-08-0913:20bozhidarhttps://github.com/clojure-emacs/orchard/blob/master/src/orchard/classpath.clj#2019-08-0913:21bozhidarYou can see an overview of JDK 9 related work here https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#2019-08-0913:21bozhidarAs you can see we also dropped the internal use of tools.namespace in Orchard (although CIDER uses for ns refreshes).#2019-08-0913:43jumar@bozhidar I'm using the recent cider version:
;; CIDER 0.22.0snapshot (package: 20190808.1659), nREPL 0.6.0
;; Clojure 1.10.1, Java 11.0.2
#2019-08-0913:43jumarMac OS X if that matters#2019-08-0913:49bozhidarGot it.#2019-08-0913:50bozhidarI’ll have to revisit what exactly did we fix there. It’d be nice if you filed a couple of tickets for your particular issues, so we won’t forget to investigate those.#2019-08-0916:23jumar@bozhidar I created these two guys:
- https://github.com/clojure-emacs/cider/issues/2686
- https://github.com/clojure-emacs/cider/issues/2687
I merged the "broken javadoc" and "broken jump to the JDK class source" issues to the single 2687 since they seem to be pretty much the same thing - let me know if I should split them, though.#2019-08-0916:53jumarI updated the second issue - it must be something in my profiles.clj that's causing that. When I remove profiles.clj it seems to work.
Not sure about "jump to source" yet - will file separate issue after more testing#2019-08-0914:00jumarThanks, will do it in the evening (in a couple of hours)#2019-08-0914:01bozhidar:thumbsup:#2019-08-0914:42benedekjust noticed this https://github.com/magnars/kaocha-runner.el
by magnars himself!!#2019-08-0914:43benedekdisclaimer: have not tried yet#2019-08-0919:41skratanyone able to debug deftype method? ie. https://github.com/clojure-emacs/cider/issues/2453#2019-08-0919:41skratI'm still getting that same error#2019-08-1008:55bozhidarWe haven’t had time to work on this unfortunately, so it’s still broken.#2019-08-1008:55bozhidarBtw, this seems like a cool new package - https://github.com/rksm/clj-suitable#2019-08-1008:57pezYes! I have it on my list of things to investigate. #2019-08-1009:23bozhidar@pez Looking at the code it will just work out of the box for any users of nREPL and cider-nrepl’s complete op.#2019-08-1009:23bozhidarIt chains its completions with those of the default op and applies some clever hacks to get runtime candidates.#2019-08-1009:25bozhidarThe magic is here https://github.com/rksm/clj-suitable/blob/master/src/main/suitable/middleware.clj#L112#2019-08-1013:48richiardiandreaYep stateful completions + use of private piggieback apis... I guess it works but... well... it works 😃#2019-08-1009:25bozhidar(first I assumed this just took over unconditionally the existing op, but it doesn’t)#2019-08-1009:43dominicmIt would be neat to integrate it proper into cider#2019-08-1010:40bozhidarYeah, I totally agree.#2019-08-1107:05Yehonathan SharvitI want to change the location of a namespace from model.entry to data.entry
When I update the require expression of a ns that requires valid-entries? from model.entry to data.entry, CIDER complains
valid-entries? already refers to: #'mr-hankey.model.entry/valid-entries?
I understand that the var is redefined. But this is exactly what I want.#2019-08-1107:11dominicmThis is a clojure error#2019-08-1107:12Yehonathan SharvitIs there a way in CIDER to reload a namespace from scratch?#2019-08-1107:14dmaiocchiC-c c-k#2019-08-1107:15dmaiocchiThis works if you are editing the name space file#2019-08-1107:56jumar@viebel what do you mean by reloading "from scratch"?#2019-08-1107:58Yehonathan Sharvit@jumar I mean removing all the vars and load the new ones in order to prevent the “already refers” error#2019-08-1108:03jumarI don't think there's out of the box support for that. You need to (remove-ns *ns*) and reload the buffer.
Or you can use tools.namespace/refresh (perhaps via cider-ns-refresh?)#2019-08-1108:31Yehonathan Sharvitseems to work @jumar. Thanks#2019-08-1109:23richiardiandreaThat's probably some nice and easy feature to add by the way#2019-08-1109:25bozhidarWhat feature? Rename ns and refresh it?#2019-08-1113:14dominicmI think there's an unload-ns or something#2019-08-1114:13bozhidarI don’t think so. There’s undef-var, but I don’t recall anything about ns unloading.#2019-08-1114:14bozhidarI guess we can easily extend undef var to an entire namespace, though. 🙂#2019-08-1205:22richiardiandreaYeah nice - undef-ns-vars or something 😃#2019-08-1307:27murtaza52I am using spacemacs, I am not able to navigate clojure.core.spec symbols to their definitions. Is there a way to enable that ?#2019-08-1308:36practicalli-johnAre you running a Clojure REPL?
Do you have example code you can share?
If you believe it's a Spacemacs specific issues there is also a #spacemacs channel where you can get help#2019-08-1308:41jumar@UMA62JW4W if you want to "jump" to the place where the spec (identified by a namespaced keyword) is defined, you can try cider-find-keyword.
It doesn't work on of our projects for some reason, but it works pretty well for others#2019-08-1406:15pez@U06BE1L6T : sounds like you have an old nrepl dependency in that project. #2019-08-1409:11jumar@U0ETXRFEW hmmm. I have nrepl 0.6.0.
It actually seems to not work only if I try to "find keyword" inside the file which comes from the project's dependencies.
We have project app depending on app-core. When I try to cider-find-keyword in scope of app it works but as soon as I jump to some buffer from app-core (installed as a local dependency in .m2 repositories) and invoke cider-find-keyword then cider complains "Can't find namespace 'xyz'".#2019-08-1410:04pezI think there was a question about that the other day. Was that you, maybe? Otherwise maybe you'll get some pointers just scrolling up some in the channel.#2019-08-1410:22jumarHmm, I didn't find anything related in the accessible channel's history.#2019-08-1410:23jumarOf course, I need to eval that buffer, otherwise it won't work but that's not enough in this case.#2019-08-1411:40pezOK, I recall incorrectly then.#2019-08-1418:34Daniel BaezI'm trying to use figwheel's nrepl with cider-nrepl middleware but I can't get it to work 😕
Upon start I get:
Figwheel: Starting CSS Watcher for paths ["resources/public/css"]
Figwheel: Starting nREPL server on port: 7002
WARNING: unable to load "cider.nrepl/cider-middleware" middleware
Launching ClojureScript REPL for build: app
- figwheel-sidecar and lein-figwheel are in version 0.5.18
- cider/piggieback 0.4.1
- cider-nrepl 0.21.1
- nrepl 0.6.0#2019-08-1418:36Daniel Baezthe error goes away if I remove :nrepl-port from :figwheel in my project.clj, but then, I can't connect from fireplace 😕#2019-08-1419:05jahsonAre you doing something like this? https://figwheel.org/docs/vim.html#2019-08-1419:18Daniel BaezHi @U071CG4QY this is what I have#2019-08-1419:20Daniel Baez:figwheel {:http-server-root "public"
:server-logfile "log/figwheel-logfile.log"
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:nrepl-middleware [
;; "cider/wrap-cljs-repl"
;; "refactor-nrepl.middleware/wrap-refactor"
"cider.nrepl/cider-middleware"
"cider.piggieback/wrap-cljs-repl"
] }
:profiles { :project/dev {:jvm-opts ["-Dconf=dev-config.edn"]
:dependencies [[binaryage/devtools "0.9.10"]
;; [cider/piggieback "0.3.9"]
[cider/piggieback "0.4.1"]
[doo "0.1.10"]
[devcards "0.2.6"]
[expound "0.7.1"]
[figwheel-sidecar "0.5.18"
:exclusions [org.clojure/tools.nrepl]]
[pjstadig/humane-test-output "0.8.3"]
[prone "1.6.0"]
[faker "0.2.2"]
[ring/ring-devel "1.6.3"]
[ring/ring-mock "0.3.2"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]
;; [refactor-nrepl "2.4.0"]
[cider/cider-nrepl "0.21.1"]
;; [refactor-nrepl "2.4.0"]
;; [cider/cider-nrepl "0.21.1"]
[lein-doo "0.1.10"]
[lein-figwheel "0.5.18"]] })
#2019-08-1419:20Daniel Baezand actually piggieback works#2019-08-1419:20Daniel BaezI can connect from vim-fireplace with Piggieback (figwheel-sidecar.repl-api/repl-env)#2019-08-1419:21Daniel BaezI want to install cider, to later, install refactor#2019-08-1501:33FlavaDavehey all, at some point in time (i cannot remember when or what might have caused it) my cider repl stopped being able to call functions from my source files. I can call functions that were created before this problem, but nothing new. Anyone else have this issue?#2019-08-1503:29dpsuttonCan you explain the symptoms a bit more? And can you replicate this on a simple project?#2019-08-1512:31FlavaDaveOf course! so I start a nrepl with the cider-jack-in command and expect to be able to use functions and variables that I have already defined in the project in the repl. However, i keep getting “unable to resolve symbol.”
I noticed the problem while creating a map and then calling get on it in the repl so I have been using a small map to diagnose the problem.
(def foo
{:a 1
:b 2
:c 3})
user> (get foo :a)
It works in new projects I have created with the lein new app command but it seems that (i just discovered this) it doesn’t like anything I have started with the compojure template or anything that lacks a main function. I’m a beginner so I often create projects and remove the default main function and then put code it from exercises I do and then experiment with them in the repl. lacking a main function was never an issue before but seems to be the common denominator.#2019-08-1512:46dpsuttonIs that copied from your repl?#2019-08-1512:47dpsuttonAnd do you have anything in your global lein profiles? #2019-08-1512:50FlavaDaveNot copied. And no.#2019-08-1513:03dpsuttoncan you make a new project with the following contents? (just put them in a folder)
;; deps.edn
{:paths ["."]}
;; whatever.clj
(ns whatever)
(defn foo [x] (+ x 1))
#2019-08-1513:19dominicmThat . thing is a neat trick for trying stuff out, thanks!#2019-08-1513:05dpsuttonand then run cider-jack-in#2019-08-1513:38FlavaDavedid that and it works#2019-08-1513:40FlavaDaveI also tried putting a deps.edn file with {:paths ["."]} in one of the projects im having trouble with and am still having the same issue.#2019-08-1513:45FlavaDavenvm. it does work now!#2019-08-1513:51FlavaDaveThank you for the help!#2019-08-1514:00dpsuttonI'm not sure how i helped 🙂 I don't really understand what your symptoms were but if you're good I'm good#2019-08-1519:02tianshuIf I have two repl, quit one with cider-quit or via sesman-browser will cause all clojure file buffer disable cider-mode.#2019-08-1519:02tianshuso can't jump to repl or eval code anymore, have to enable cider by cider-mode.#2019-08-1519:03tianshuis it a bug ?#2019-08-1519:03dpsuttonyes#2019-08-1519:04tianshuI mean, is it only appear on my emacs or anyone else will run into this?#2019-08-1519:04dpsuttonno that's for everyone#2019-08-1519:05pezEqual suffering. 😃#2019-08-1519:05tianshu😂#2019-08-1519:08tianshuI also met a problem, when I have two repls (clj + cljs), cider will always try to send code to the last visited repl. If that last visited repl is not the correct repl, it will failed, result in no op.#2019-08-1519:26bozhidarYeah, unfortunately there are a few known issues in sesman that have lingered for a while. I was hoping that someone would beat me to fixing them, but I might have to finally tackle them in the months to come.#2019-08-1519:27dpsuttonhave you figured out a focus for your clojurist together work?#2019-08-1519:27dpsuttondecided/figured#2019-08-1519:30bozhidarMy focus is going to be mostly cleanup/small fixes and documentation improvements. Another big theme is collaborating with other tools writers to tackle together a few common pain points. There are way too many things to be improved across almost a dozen projects. 🙂 I don’t have a concrete list of tickets I’ll be working on, but probably this will change in the next couple of weeks.#2019-08-1519:31dpsuttoncongrats and thanks#2019-08-1519:32bozhidarGenerally I really want to stabilize and document cider-nrepl and orchard, integrate the updated compliment and finish nREPL 0.7. If we managed to build some better find-usages with @pez that’d be pretty awesome as well. Too many things to do, yet too little time. I’ve got enough ideas to keep me working full-time for at least a couple of years. 😄#2019-08-1519:34bozhidarAh, yeah - just remembered that the first thing I have to finish in the transition to ClojureDocs.#2019-08-1519:34bozhidar(which is almost ready)#2019-08-1519:37pezCT should just keep funding your projects, @bozhidar. You keep them constantly delivering more value. (With a lot of help and work from others, of course, but your persistence is key here, I think.)#2019-08-1519:47bozhidarThanks for the vote of confidence! :man-bowing:#2019-08-1519:48bozhidarAnyways, in unrelated news a new cider-nrepl beta is out with support for much smarter ClojureScript code completions - see https://github.com/clojure-emacs/cider-nrepl/pull/633 and https://github.com/rksm/clj-suitable#2019-08-1519:48bozhidarThere are a couple of small things remaining to iron out in the next couple of weeks, but I hope we’ll get to a new stable release of cider-nrepl and orchard in a week or two.#2019-08-1519:55dpsuttonwhat city will you visit to release it?#2019-08-1520:03dominicmLeuven? 😄#2019-08-1521:00alexyakushevMan, the new MacOS is driving me crazy. Did anyone experience a problem when eldoc doesn't show up until you move the mouse into the echo area (or just barely move the mouse cursor)??? This happens quite often, but not every time, so it's reproducible yet not consistent. The same often happens with just evaluating things with C-x C-e, especially with a shorter output.
I feel like I'm going mad. Mojave, Emacs for Mac OS 26.2#2019-08-1605:26bozhidar@dpsutton Sao Paulo 😉#2019-08-1605:27bozhidar@alexyakushev I haven’t seen that one. For me Emacs has some general redraw glitches on Mojave, but at least it works.#2019-08-1606:49alexyakushevFor poor souls out there that suffer from this, switching message to princ in cider--display-interactive-eval-result seems to fix this, however, you lose nice font-locking. Still, better than not seeing any output.#2019-08-1606:50alexyakushevI found a thread where someone had the same issue: https://old.reddit.com/r/emacs/comments/a59iom/emacs_in_osx_mojave/. No real solution though. I've tried installing the nightly (from May 28) and it didn't help.#2019-08-1607:48bozhidarDid you also try the mac build?#2019-08-1607:56alexyakushevI didn't. What's that, Aquamacs?#2019-08-1607:59lispyclouds@alexyakushev its https://github.com/railwaycat/homebrew-emacsmacport#2019-08-1608:00lispycloudsthis is the most native OSX Emacs AFAIK#2019-08-1608:01bozhidarYeah, it’s GNU Emacs that’s using more of macOS’s core APIs. Hopefully one day this work will its way upstream, but I’m not holding my breath. 🙂 (the Emacs core team notoriously doesn’t care much about better support for non-free operating systems)#2019-08-1608:08alexyakushevThank you! I've downloaded it, and it indeed doesn't seem to have this problem.#2019-08-1608:08alexyakushevHowever, it switched Option and Super for me, and the solution to undo this doesn't seem to work:)#2019-08-1608:09alexyakushevI have Option and Command swapped on the OS-level, and this emacs seems to revert this.#2019-08-1608:13alexyakushevAh, OK, it worked.#2019-08-1608:13alexyakushevThanks! I will try using this one for a while.#2019-08-1608:14lispycloudsthis has some really sweet mac specific settings though:
(if (fboundp 'mac-auto-operator-composition-mode)
(mac-auto-operator-composition-mode))
#2019-08-1608:15lispycloudsto enable ligatures for example 😄#2019-08-1608:15lispycloudsdunno any other macOS emacs supporting this natively#2019-08-1608:16alexyakushevNice! Might try Fira then, however, I'm not a fan of ligaturing everything.#2019-08-1608:16alexyakushev> the Emacs core team notoriously doesn’t care much about better support for non-free operating systems
I wouldn't either, I'm counting days towards when I can finally throw away this piece of shit and install a normal OS.#2019-08-1608:23bozhidarAmen to that, brother!#2019-08-1608:23bozhidarI’m really close to getting a new Linux desktop for most of my work.#2019-08-1608:25dominicmZoom & Linux was patchy for me. Occasionally my name would reset to a base64 string#2019-08-1608:46richiardiandreaOh that's what it is lol! I have been kicked out of a couple of calls because of that 😅#2019-08-1608:52alexyakushevWow, that sounds like a megafeature to me. Perfect excuse to leave a long boring call.#2019-08-1609:54dominicmWell, I tried running it through a base64 decoder and it didn't work. It might be trimmed, or something else. No idea! Looks base64ish#2019-08-1609:55dominicmThe really annoying thing was that occasionally zoom would just start eating cpu and kill the call#2019-08-1609:55dominicmAnd the remote code execution wasn't great either. Give me a safe sandboxed browser!#2019-08-1608:25bozhidarMost of colleagues on Linux had some type of issues with Zoom, but overall it seems to work.#2019-08-1608:26bozhidarI hear that Slack is also eating up more memory there, but hopefully this was addressed by now.#2019-08-1608:28bozhidarFor me the only things keeping me in macOS land are proprietary apps that I have to use for work and the general Apple lock-in (the nice integration of all their devices). Unfortunately these days the Macs are their worst devices… 😄#2019-08-1608:28bozhidarToday I was once again wanted to break my shitty macbook after its left shift got stuck…#2019-08-1608:29lispycloudsTotally agree, the worst keyboards ever! My mechanical keyboard addiction kinda saves me from it#2019-08-1609:09dmaiocchiI use linux and zoom without any pb#2019-08-1609:10dmaiocchiDunno, I use linux more then 10 years now and I have not so many pb as other folks says :girn#2019-08-1609:11dmaiocchiI do work and all things with Linux OS and everything works fine. So I would definitely reccomend to switch to Linux or Unix (freebsd) but Unix like might be to hardcore 😁#2019-08-1609:13dmaiocchiI think that any major Distro in Linux works great, from arch to debian/ubuntu, opensuse or fedora/centos etc#2019-08-1610:38dominicmLargely things work for me, yeah. Zoom is particularly weird though. Because it's all hard-compiled against a version of glib as well, makes things annoying like when the update.#2019-08-1610:40pezIt's very sad with the Mac keyboards. But there is no way I would consider anything else but macos. I just plain love it. And I also hate everything else. Haha.#2019-08-1610:55dmaiocchi1 question, do we have reverse search on Cider history?#2019-08-1610:56dmaiocchilike when you do bash reverse search on your commands history#2019-08-1610:58dmaiocchiI'm just thinking if this could be possible, like kind of swiper emacs but for the cider history.#2019-08-1610:59dmaiocchicider-repl-history-occur found this#2019-08-1612:05alexyakushevI am not aware of free-form search, but I often write the prefix of the command and then M-p#2019-08-1714:00murtaza52I was updating my emacs and spacemacs, and now the installation is broken. I have installed my emacs using brew cask install emacs, and cloned the latest master of spacemacs. On emacs startup I get the following error when spacemacs tries to install cider -
--> installing package: cider@clojure... [6/59]
Package queue is unavailable. Is the package name misspelled?
Package spinner is unavailable. Is the package name misspelled?
An error occurred while installing cider (error: (error Package 'queue-0.2' is unavailable))
Any help will be appreciated.#2019-08-1714:03dpsuttonhttps://github.com/syl20bnr/spacemacs/issues/2596#2019-08-1714:03dpsuttondon't know the details but seems to be solved here#2019-08-1714:12murtaza52@dpsutton thanks. It says the issue was solved in a prev version of spacemacs, however am still facing it. Seems to be with the htttps url for the package repo.#2019-08-1714:15dpsuttonlooks like you can (setq spacemacs-insecure t) and it should work?#2019-08-1714:15dpsuttonhttps://github.com/syl20bnr/spacemacs/blob/develop/core/core-configuration-layer.el#L475#2019-08-1714:40murtaza52thanks @dpsutton that worked !#2019-08-1714:40dpsutton👍#2019-08-1714:40dpsuttonsounds like its cert issues with gnu and it should be ironed out in time#2019-08-1714:41murtaza52yup#2019-08-1715:36murtaza52this also does the same thing - dotspacemacs-elpa-https nil#2019-08-1715:42tianshuCan I tell cider to always find a repl to use by repl type instead of find the repl from some relationship?just like the old behavior cider was.#2019-08-1715:44dpsuttonthat's a limitation of sesman right now. it doesn't know anything about its connections (i believe)#2019-08-1715:46tianshuthat's really annoying#2019-08-1715:46tianshuI mean, is there some function I can tweak#2019-08-1715:48tianshuIf there's a function which is used by cider to find the repl, I can just write it by my own.
but cider is kind of complex thing, I hope someone may give a suggestion on which function I should overwrite#2019-08-1805:42bozhidar@doglooksgood The function you’re looking for is cider-current-repl.#2019-08-1805:43tianshuthanks!#2019-08-1907:52pieterbreedHello everyone; sorry to just barge in and ask a question.
I recently did a fresh upgrade to emacs 25.2, fresh installs of everything, including the latest and greatest cider. My previous workflow was like this: I'd open the clojure project.clj file, run emacs M-x -jac and all the files in the project would get access to the cider repl. IE Ctrl-c Ctrl-z would jump to repl ecc. The buffers would all be "linked" to the repl I cerated with -jac automatically.
After the fresh install, some of the files in my project are not attached to the repl anymore. (Ctrl-c Ctrl-z does NOT work for all of the files). I can't quite understand what the pattern is either. Some files attach automatically and some don't and I can't tell the difference.
I also don't know how to link the current buffer I'm visiting to the already-connected REPL. I've read the docs about sesman, and maybe I'm just to dumb, but I don't understand how to achieve the link. I've tried things like M-x sesman-browser in one of the buffers within the same project/file structure, but the error I get is No sesman-system in buffer .... I get the same error when I'm in the buffer and try to run sesman-link-with-buffer. I have no idea what's going on or how to fix it.
I can create a new REPL with a sibling-repl, but this is annoying.
What do do?#2019-08-1910:12bozhidar@pieterbreed Nothing has been changed with respect to session handling for quite a while now. Which version of CIDER where you using before you upgraded your Emacs?#2019-08-1910:14pieterbreedI can't remember, it's been a while since I updated before that. Once it was stable and I got reasonable used to it, I didn't update until I was forced to recently with a whole bunch of system updates.#2019-08-1910:14pieterbreedI suspect I'm doing something wrong, but I can't figure out what. My assumption is if I run -jac while in the project.clj buffer, all the files in the project structure should automatically attach to the new repl.#2019-08-1910:15pieterbreedAt the moment I'm in a situation where I have to create a sibling-repl for every buffer that I open#2019-08-1910:22bozhidarYes, that’s how it is supposed to work, that’s why I’m surprised by your problem.#2019-08-1910:23bozhidarAll project files get attached to the session automatically.#2019-08-1910:24pieterbreedOK, I believe you 🙂 Since that's is not what's happening (for me...) what would you suggest I do for tracking down the issue?#2019-08-1910:25bozhidarI seem to recall that were relying on the classpath to determine what’s in a project, so I’d start by checking your project’s classpath seems correct. (especially the one produced by the jack-in command)#2019-08-1910:34pieterbreedLet me just check if I'm understanding you fully; if the files I'm struggling with make their way into the classpath, then I should expect the cider session to work out?
More context; I don't have anything funny going on here. These files I refer to are directly in a clj project (ie they're not from libraries or symlinks or cljs or something else I think is funny). They're just normal files, with the src/ns/ns.clj filepath structure...
I'll double check the classpath after jack-in, but I'm not expecting to find a problem there, since it's such a vanilla project.#2019-08-1910:40bozhidarWell, I just test everything on a vanilla project and it works fine for me. That’s why I thought you might have some non-standard setup or something like that.#2019-08-1910:42pezSeems like next logical step would be for @pieterbreed to test it on that same vanilla project. 😃#2019-08-1911:04bozhidarhttps://github.com/clojure-emacs/orchard#2019-08-1911:29pieterbreedlet me try that#2019-08-1911:38pieterbreedHere's what I did:
- Opened ./projec.clj, then ran M-x cider-jack-in, wait for repl to open and verify that it's live (+ 2 3) => 5
- Verified that Ctrl-c Ctrl-z takes me to the active repl and back to project.clj. That buffer's status bar shows the connected cider session.
- Opened ./src/orchard/core.clj, noticed that the new buffer don't have the same cider mode status. Ctrl-c Ctrl-z does NOT take me to the REPL, which is in the buffer "next-door"#2019-08-1912:09pezWhen I do that, also the core.clj buffer works. As in that I can jump back and forth between the repl and the file buffer. I installed Emacs and CIDER pretty recently. Maybe two weeks ago.#2019-08-1912:10pezI am a total Emacs noob, so if you want me to check something up, I might need pretty detailed instructions. 😃#2019-08-1912:32pieterbreedThanks @pez and @bozhidar. This feels like in the old linux days. X doesn't work, so format and start from scratch. I guess today is the day to try out spacemacs#2019-08-1912:33bozhidarWell, generally adding more complexity when trying to find the core of a problem sounds risky. 😄#2019-08-1912:34pieterbreedOMG - facepalm - Literally right after I posted that it got sorted. My imported init.el referenced aggressive-indent-mode but it wasn't installed yet. Just now installed that, and cider works like it should. Sorry for wasting everyone's time.#2019-08-1912:34bozhidar😄#2019-08-1912:34pieterbreedFeels exactly like the old linux days 🙂#2019-08-1912:43pezMy old init.el made my recent Emacs (Spacemacs) install totally horrible. I first fought the Tao and tried hard to keep at least parts of my precious init code. Then I nuked it and things started to work. It's a lesson I keep needing, I'm embarrassed to admit.#2019-08-1912:50bozhidarMy init.el is quite simple and auto-installs everything needed. But then again - this days I don’t much development outside OSS and I don’t need much of the crazy things I’ve needed in the good old days. 🙂#2019-08-1913:05pezMy init.el also auto-installed stuff. But I don't think it can be described as ”quite simple”, and also it was three years old and unused when I decided i needed to try something in CIDER...#2019-08-2019:33QuestIn a really bizarre situation where giving a shadow-cljs project -Xmx4G in project.clj causes only M-x cider-jack-in-cljs to fail about half the time. Values of 1G or 2G are 100% stable, as is running via lein dev
Is there a memory ceiling cider automatically sets & causes a self-kill? Part of the Emacs max memory setting? :thinking_face:#2019-08-2019:36dpsuttonCIDER is pretty transparent in just formatting a call to your existing tooling. Check *Messages* buffer for the exact command its running#2019-08-2019:39QuestI can find
[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.21.1 server...
But in the "self-kill" scenario (REPL suddenly closes with a shutting down.. message from shadow-cljs), I can't find any exception or errors to indicate why#2019-08-2019:40thheller@dpsutton the question is whether emacs does anything else to monitor or limit the process in any way#2019-08-2019:40thhellerit is started just fine but for some reason the process is killed when reaching a certain memory limit (and that is not shadow-cljs killing itself)#2019-08-2019:41thhellerThe shutting down ... message is produced by shadow-cljs when the JVM Runtiome.addShutdownHook thread is triggered#2019-08-2019:42dpsuttonNo monitoring as far as I’m aware#2019-08-2019:43dpsuttonYou can toggle nrepl-toggle-message-logging to see all the messages going back and forth#2019-08-2019:44thheller@quest on windows this was caused by someones anti-virus before. might also be something like that#2019-08-2019:46dpsuttonits a subprocess of emacs right? Possible the os is mad at emacs and refusing to allocate memory?#2019-08-2019:46QuestI'll play around with some OSX Java options & other features to see if it affects it. *Messages* output for a autokilled run:
[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.21.1 server...
[nREPL] server started on 8777
[nREPL] Establishing direct connection to localhost:8777 ...
[nREPL] Direct connection to localhost:8777 established
Visit ‘’ in a browser? (y or n) n
[nREPL] Connection closed unexpectedly (connection broken by remote peer)
(for completeness, at the REPL)
[:app] Configuring build.
[:app] Compiling ...
shutting down ...
user>
*** Closed on Tue Aug 20 12:44:25 2019 ***
#2019-08-2019:47dpsuttonand running /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.21.1 server from a command line behaves differently?#2019-08-2019:50dpsuttonand the messages i'm talking about look like
(<--
id "96"
session "4448d1f0-b245-4a5d-81bd-4e710146a672"
time-stamp "2019-08-20 14:49:56.258862000"
docstring "Returns the sum of nums. (+) returns 0."
eldoc (nil
("x")
("x" "y")
("x" "y" "&" "more"))
name "+"
ns "cljs.core"
status ("done")
type "function"
)
(<--
id "97"
session "4448d1f0-b245-4a5d-81bd-4e710146a672"
time-stamp "2019-08-20 14:49:56.259385000"
docstring "Returns the sum of nums. (+) returns 0."
eldoc (nil
("x")
("x" "y")
("x" "y" "&" "more"))
name "+"
ns "cljs.core"
status ("done")
type "function"
)
#2019-08-2019:51Questhmm, behaves the same -- ran it, then used M-x cider-connect-cljs & specified app as per usual. same REPL output (shutting down ...), though I get a java.net.SocketException: Socket closed at the console#2019-08-2019:51Questfound the buffers with the extra messages, will paste them in a sec#2019-08-2019:52dpsuttonwell i think you've found its not CIDER related. just running from command line and viewing the app causes the shutdown?#2019-08-2019:53Questfor the M-x cider-connect-cljs command line run#2019-08-2019:56dpsuttontry running from command line and connect from browser. if it fails, remove cider/cider-nrepl and rerun. if it fails then its not CIDER's fault. not sure from your message if you've tried that or not#2019-08-2020:07QuestRunning with /usr/local/bin/npx shadow-cljs watch app still produces a kill
> /usr/local/bin/npx shadow-cljs watch app
shadow-cljs - config: /Users/quest/repos/ns/browser/shadow-cljs.edn cli version: 2.8.46 node: v12.8.0
shadow-cljs - running: lein run -m shadow.cljs.devtools.cli --npm watch app
shadow-cljs - HTTP server available at
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.8.45 running at
shadow-cljs - nREPL server started on port 8777
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (608 files, 1 compiled, 0 warnings, 4.10s)
shutting down ...
Worker shutdown.
running lein dev reliably works with 4G, and it's configured as so under :aliases
"dev" ["with-profile" "dev" "run" "-m" "shadow.cljs.devtools.cli" "watch" "app"]
still confused but leaning away from this being cider related -- thanks for the help @dpsutton#2019-08-2020:12dpsuttonah, nothing in your npx call uses the lein dev profile#2019-08-2020:12dpsuttonso you are missing any way to set the jvm options#2019-08-2020:14dpsutton> This is done by configuring :jvm-opts at the root of shadow-cljs.edn expecting a vector of strings.
can you try here?#2019-08-2020:15dpsutton@quest without lein there's no jvm setting if i'm following correctly#2019-08-2020:22QuestNo effect on setting it to values of 4G or 1G -- process still reliably shutdown on init#2019-08-2119:46alexyakushevHey, I've just accidentally clicked on the More information link in the version mismatch warning, and I got "Not found" https://docs.cider.mx/cider/troubleshooting/#cider-complains-of-the-cider-nrepl-version#2019-08-2119:47alexyakushevMaybe it's because I'm on the older version of the cider-nrepl there, but just to make sure the link is correct in the new one.#2019-08-2120:06bozhidar@alexyakushev I’ll fix this right away.#2019-08-2120:07bozhidar(that’s the right URL https://docs.cider.mx/cider/troubleshooting.html#_cider_complains_of_the_cider_nrepl_version)#2019-08-2120:14bozhidarDone.#2019-08-2123:10m0smith(ns bug-demo
(:require [datomic.ion.cast :as cast]))
(cast/initialize-redirect "/tmp/hamster")
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})#2019-08-2123:11m0smithcalling datomic ion cast/event causes a stack overflow on my setup. Has anyone else seen this?#2019-08-2200:02dpsutton@m0smith what happens when running with just lein/boot/clj? Does it succeed?#2019-08-2400:00m0smithYes it works from clj#2019-08-2615:24m0smithTurns out change :stdout to :stderr seems to fix the problem#2019-08-2615:24m0smith(ns bug-demo
(:require [datomic.ion.cast :as cast]
[http://clojure.java.io :refer [output-stream]]))
(cast/initialize-redirect :stderr) ; instead of :stdout
(cast/event {:msg "ShouldNotCauseAStackOverflowErrorInCider"})#2019-08-2200:25ghas anyone developed any kind of fuzzy find for repl input history?#2019-08-2200:36dpsuttonI just hit ,history and then use whatever text search I want in the history buffer that pops up #2019-08-2214:46arohnerI’m trying to start an embedded nRepl in my app. I’m following the instructions at https://github.com/clojure-emacs/cider-nrepl#via-embedding-nrepl-in-your-app
and I’m getting
ERROR: Unhandled REPL handler exception processing message {:ns user, :file *cider-repl griffin/banksy:localhost:4005#2(clj)*, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :op eval, :column 7, :line 45, :id 18, :code (System/getenv), :content-type true, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/options {:right-margin 70}, :session 2bd54e06-29e1-45c6-9569-a82e782ec11f}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cider.nrepl$wrap_tracker$fn__401.invoke(nrepl.clj:435)
at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__1162.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
at cider.nrepl$wrap_info$fn__327.invoke(nrepl.clj:180)
at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__1355.invoke(session.clj:272)
at nrepl.middleware$wrap_conj_descriptor$fn__962.invoke(middleware.clj:16)
at clojure.lang.Var.invoke(Var.java:384)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1386.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
#2019-08-2214:47arohnerI’m running nrepl 0.6.0 and cider-nrepl 0.21.1#2019-08-2214:55arohner(defn nrepl-handler []
(require 'cider.nrepl)
(ns-resolve 'cider.nrepl 'cider-nrepl-handler))
(nrepl/start-server :port port
:bind host
:handler (nrepl-handler))
#2019-08-2215:01Yehonathan SharvitHi there! Cider really rocks!
Is there a way to search for a function definition without specifying its namespace or even better with specifying only part of its name?#2019-08-2215:11dpsuttoncheck out cider-apropos its awesome#2019-08-2215:26arohnerMy bug appears to be AOT related. My nrepl code is in the main namespace, with a :gen-class. If I comment out the :gen-class, the nrepl starts fine#2019-08-2215:46arohnerLooks like I had this: https://github.com/clojure-emacs/cider-nrepl/issues/533#2019-08-2215:48Yehonathan Sharvit@dpsutton Indeed cider-apropos looks awesome! I am in Spacemacs. When I hit enter on a symbol on the cider apropos buffer it displays the doc of the function. How do I get to the source code of the function?#2019-08-2215:52pez@viebel, the same way as you do it in a code buffer? (I'm just guessing, but it would make sense to me 😄)#2019-08-2215:53dpsuttonlooks like that needs some feature work#2019-08-2215:59Yehonathan Sharvit@pez @dpsutton In order to get to the code of the function, I have to press TAB and then ENTER. Is there a quicker way to navigate quickly to the source code of a function without typing the fully qualified name of the function?#2019-08-2307:12jumar@viebel this looks reasonably efficient to me. You don't need to type anything imho; it should jump straight into the source code.
The other alternative (which I use) is to just press s (still assuming you're in the doc buffer where you got after pressing RET in the cider-apropos output buffer)#2019-08-2309:53Yehonathan SharvitAwesome. I didn’t know about pressing s in the cider-apropos output buffer. Where is it documented?#2019-08-2312:26dpsuttonOh I didn’t know this either. Wonder if pressing ? Brings up a menu#2019-08-2314:24Yehonathan Sharvit@dpsutton No. ? does nothing#2019-08-2314:27dpsuttonbummer#2019-08-2218:18dmaiocchiif cider-jack-in create a new session,, what is the clone function in cider?#2019-08-2218:18dmaiocchifor cloning a session created by cider-jack-in#2019-08-2219:26bozhidar@darioszr cider-jack-in creates a new CIDER (sesman) session, not a new nREPL session.#2019-08-2219:26bozhidarA CIDER session is basically a group of connections (REPLs) attached to the same server.#2019-08-2219:27bozhidarGenerally end users never need to directly manipulate nREPL sessions.#2019-08-2219:27dmaiocchiBut cider jack in start a server right#2019-08-2219:28bozhidarYeah, it does.#2019-08-2219:28dmaiocchiIf not stated already. I think I confuse some terms in my question before.. I was duck programming myself#2019-08-2219:28dmaiocchi😁#2019-08-2219:29bozhidarAnd every CIDER connections opens up two nREPL sessions - one for user commands and one for internal commands.#2019-08-2219:29bozhidarThe second one is needed so the internal commands won’t clobber things like *1, *e, etc, which are session-bound in nREPL.#2019-08-2219:30dmaiocchiA session sofar is a thread Damon on server with a state atom right?#2019-08-2219:31bozhidarYeah, I guess that’s a reasonable way of putting it.#2019-08-2219:31bozhidarSessions exist to allow us to multiplex a single connection and do different things over it.#2019-08-2219:31dmaiocchiYep. I saw the clone thing#2019-08-2219:32bozhidarEach has its own evaluation thread and a bunch of dynamic bindings.#2019-08-2219:33dmaiocchiOK thx clj 👍 cider#2019-08-2219:57Yehonathan SharvitWhat is the quickest way to navigate quickly to the source code of a function without typing the fully qualified name of the function?#2019-08-2220:00pezI don't know the name of the command, but I press alt+. #2019-08-2220:07QuestM-. -- executes cider-find-var
FYI you can find command names via the input keystroke with C-h k
(& yeah, I had to look that up to remember it. I usually try to find commands via regex via C-h a)#2019-08-2221:23Yehonathan SharvitThe problem with cider-find-var is that I have to type the whole name of the var and the var is not on the current ns it is very cumbersome#2019-08-2221:43QuestHmm, it should autofill to the symbol under the point if working correctly. M-. then hit enter, instantly goes to source#2019-08-2307:14jumarExactly, it should work that way. As long as cider recognizes the symbol under the point it shouldn't ask for anything.
@viebel btw. I use g d (jump-to-definition) in spacemacs - this even works without connected REPL (but it's obviously quite limited in that case)#2019-08-2307:18pezAnd M-, (that's a comma), for jumping back to where you were, @viebel#2019-08-2309:47Yehonathan SharvitGuys, this is not what I am asking. I am asking for a way to look for a var by typing its name partially. Let’s say I am in ns foo and I look for var bar/my-func.
I would like to be able to type “my-func” or “my-f” and let CIDER take me to a list of symbol that matches “my-f”. Something like cider-apropos that takes me to the definition of the var instead of displaying the doc of the var.#2019-08-2313:40jumar@viebel I'm saying that you can use cider-apropos - it's just one extra key press (`s`)#2019-08-2313:41Yehonathan SharvitOk.#2019-08-2317:31dpsutton@bozhidar can you cut a new release of cider-nrepl with the clj-suitable bump? Using the latest dumps 3000 lines of error messages right now 😞#2019-08-2406:54bozhidarSure. I’ll do this now.#2019-08-2406:41jimrthyI don't know whether this channel makes the most sense or not.
I just got an excuse to dive into a lot of new libraries/frameworks after just dabbling in clojure for 2-3 years. Fulcro led me to mount. Swagger led me back to Immutant (which I've really enjoyed using) and reitit.
I'm not sure how obscure this stack really is. Maybe it would be "mainstream" (for clojure) if I switched from Immutant to Jetty (I'll probably try that for grins after I post this, just to see).
When I manually run (stop), recompile my http-server ns, and then run (start), everything works the way I expect.#2019-08-2406:42jimrthyWhen I just C-c C-k to compile the ns, (stop) does not get called. So compilation fails because the port is already bound.#2019-08-2406:46jimrthyI don't know whether this is something from CIDER or mount (or, for that matter, Immutant...I haven't dug as deep as I should have).
But I'm in a "do you have any ideas?" position, and this seemed like a good place to ask.
Thank you so much!#2019-08-2407:21dominicmI think this is mount, ish#2019-08-2407:21dominicmIt's just the behaviour of mount#2019-08-2417:10jimrthyI'll ask in there. Thank you#2019-08-2606:38jimiAnybody uses spacemacs here? Getting a problem where if I use integrant.repl or com.stuartsierra.component.repl and start the given component, it just froze.#2019-08-2607:29jumarThere's #spacemacs channel too.
I didn't recall to encounter such an error but it's been a long time since I used integrant.
But perhaps it's not specific to integrant at all..#2019-08-2707:47practicalli-johnI recently used Integrant on a very small Clojure CLI tools project using Spacemacs develop branch without problems.#2019-08-2723:34jimiI'll try that. Thank you for the help!#2019-08-2809:24practicalli-johnThere is also this blog post that creates a Clojure app that uses Duct and Integrant, you could test Spacemacs with that also https://circleci.com/blog/build-a-clojure-web-app-using-duct/#2019-08-2609:15bozhidarFYI - the cider-clojuredocs command should now show something useful. 🙂 I’ll probably just ship this is a pretty basic form (no interaction with the contents of the buffer), but I do plan to improve it down the road. The magic keybinding is C-c C-d C-c (docs -> clojuredocs).#2019-08-2610:27manuelisn't it C-c C-d C-r? 🙂#2019-08-2610:38bozhidarIt used to be.#2019-08-2610:38bozhidarNow it’s not.#2019-08-2610:39bozhidar(I did th changes just an hour ago or something like this)#2019-08-2611:04manuelyou criminal 😉#2019-08-2611:38pezMulti-level chording, I'm so envious!#2019-08-2617:31agO mantenedor do CIDER, you are awesome! I already can’t wait for the improvements you have mentioned.#2019-08-2706:29manuelhi everyone. Did something change in CIDER when it comes to linking buffer with REPLs? I have been using this setup for while: https://manuel-uberti.github.io/programming/2018/11/14/deps-shadow-cljs/
However, I cannot seem to have my CLJS buffers linked with the CLJS REPL any more. The CLJS REPL works fine, meaning I can interact with the browser from it once the application is running. And everything works just fine on the Clojure side of the project. The only problem seems linking my CLJS buffers with the running REPL.#2019-08-2706:31manuelFWIW, this is the project where I am testing all of this: https://github.com/manuel-uberti/boodle#2019-08-2706:35manuelAlso, another info. The CLJS REPL doesn't seem to be "recognised" as such, because in the mode-line I see REPL[clj].#2019-08-2706:37bozhidar@manuel Nothing has been changed there in ages. The only remotely related change I can think of is https://github.com/clojure-emacs/cider/commit/bad9995772c07467c945161552a035f32de66008, but it can’t be affecting session linking.#2019-08-2706:39manueloh, I see. Could it be something on shadow-cljs side, then? Maybe @thheller has some insights on this.#2019-08-2706:40thhellercan't win with nrepl ... fix a bug for one editor and break another ...#2019-08-2706:41thhellerI changed a bit how output is handled since previously compiler warnings during require or load-file were dropped and not displayed#2019-08-2706:41thhellerresults themselves didn't change though?#2019-08-2706:45manuelno, or at least I can't see any relevant change. I can compile/watch with shadow-cljs as usual, and as I said the REPL is interacting with the browser just fine.#2019-08-2706:47manuelanother thing: even without jacking-in on the Clojure side, just running a cider-connect-cljs to connect to the nREPL started with npx shadow-cljs watch results in a REPL buffer recognised as REPL[clj].#2019-08-2707:03bozhidarIf the buffer is not correctly recognized this would breaking the session linking, causing your problem.#2019-08-2707:04bozhidarThe detection mechanism hasn’t changed on cider-nrepl’s side, so I assume something got changed in shadow.#2019-08-2707:04thhellerhow does it detect?#2019-08-2707:06bozhidar@thheller See https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#L185#2019-08-2707:06bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#L209#2019-08-2707:19thheller@manuel only guess I have is that you are still somehow depending on an older nrepl version? I removed some of the old piggieback emulation. the cider.piggieback variant is still supported though.#2019-08-2707:20manuellet me check#2019-08-2707:21thhellermaybe also bump cider-nrepl? I have no idea to be honest. thought nobody used the old cemerick.piggieback anymore#2019-08-2707:21manuelI am using 0.22.0-beta12 in shadow-cljs.edn.#2019-08-2707:22pezDoes it work with 0.21.1?#2019-08-2707:25manuelI get WARNING: CIDER 0.22.0-snapshot requires cider-nrepl 0.22.0-beta12, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality! if I switch back to 0.21.1.#2019-08-2707:25manueland I still see REPL[clj] in the REPL buffer modeline#2019-08-2707:33thhellerdo you maybe still have the old piggieback on the classpath?#2019-08-2707:33thhellerhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/cljs.clj#L41-L47#2019-08-2707:38manuelI had com.cemerick/piggieback in my .m2 directory. I removed it from there, tried again, same problem. Should I look for the old piggieback elsewhere?#2019-08-2707:41manuelBTW, I am using version 2.8.52 of shadow-cljs.#2019-08-2707:42thhellerdoesn't matter if the files are .m2. that doesn't add them to the classpath#2019-08-2707:42thhellerjust run shadow-cljs clj-repl and ( "piggieback/core.clj") or so#2019-08-2707:44manuel[1:0]~shadow.user=> ( "piggieback/core.clj")
nil
#2019-08-2707:44thhellerok good#2019-08-2708:21bozhidarBut there’s no piggieback.core ns currently. It’s cider.piggieback. 🙂 We do plan at some point to change it to piggieback.core and alias the old ns to the new one, but that’s a low prio task for the distant future.#2019-08-2708:22bozhidarAh, I see what you mean. 🙂 The code in cider-nrepl is just future proofed and checks for the potential new ns if we ever decide to go in this direction.#2019-08-2708:22bozhidar> maybe also bump cider-nrepl? I have no idea to be honest. thought nobody used the old cemerick.piggieback anymore#2019-08-2708:23bozhidarYeah, I’m pretty sure you’re right about this.#2019-08-2708:23bozhidarHaven’t seen it around in quite a while.#2019-08-2708:26pezWhy do we think it might be a cider-nrepl issue? I have not seen these problems in Calva. Not that that means it is not in cider-nrepl, I'm just wondering. Having worked for days with jack-in things I have noticed that I depend a bit too much on certain output messages and stuff and started to worry about that...#2019-08-2708:40bozhidarI see in recent release shadow did some nREPL-related cleanup and perhaps this is some accidental regression. Don’t have time now to go over all the commits.#2019-08-2708:42bozhidar@thheller In general I think it might be better to drop the piggieback emulation at some point and integrate natively with shadow’s middleware in cider-nrepl at some point, as if I recall correctly most problems we’ve encountered were due some problems with the emulation.#2019-08-2708:43bozhidarI mean, I appreciate you doing this to make it easier for client libs, but perhaps the native integration will actually turn out to be simpler and more robust.#2019-08-2709:16erwinrooijakkersHi all, is there a way to run lein sass4clj auto on cider-jack-in-cljs?#2019-08-2709:18thheller@bozhidar I thought about that but honestly the entire piggieback things seems entirely like the wrong approach to me. It jumps through so many extra hooks only to piggyback off of "eval" instead of just adding a dedicated "cljs/eval" that skips all that crap. there are also some implementation details that would make things a bit difficult given that it already reads the code and doesn't pass an actual string to let shadow-cljs read it.#2019-08-2709:38thhellerI also couldn't find any explanation why it does this https://github.com/nrepl/piggieback/blob/master/src/cider/piggieback.clj#L236 instead of just letting the cljs REPL do that since that is the first thing it does.#2019-08-2709:38thhellerI just have too many questions when reading the entire code. most of it seems still seems to work around bugs in the cljs.repl that have been fixed for years#2019-08-2710:18bozhidar@thheller Well, I’m totally open to simplifying piggieback - my main issue is that my knowledge of ClojureScript is very basic and I’ve mostly relied on contributors to patch the code now and then. I’m reasonably certain that someone who knows their way around ClojureScript can come up with something better.#2019-08-2710:18bozhidarGenerally a safe approach would be to create an alternative simpler middleware and just market it as an alternative to piggieback and auto-load it when present.#2019-08-2710:21bozhidarBut yeah - I really need some help with all the ClojureScript-related things, as for me that’s just black magic and I don’t have enough time to dive deep into it.#2019-08-2710:24thhellerI'd be happy to help but have no clue of the cider side of things. there might be reasons it is using the same nrepl ops for CLJ/CLJS instead of dedicated ops for each. seems to me like most of the trouble comes from figuring out what the op was actually supposed to do#2019-08-2710:24thhellerwould seem clearer to me to have ops for cljs/complete or cljs/eval and not make them look like CLJ with a bunch of conditional logic#2019-08-2710:34pezThat's interesting. If it makes things simpler underneath, I don't think it would be too much needed to change at the client end. At least not in Calva. (And I haven't really thought that through, but anyway.)#2019-08-2710:39thhellerwell I don't know either. don't know much about the editor side of things. might make sense to let the backend figure all that stuff out instead of the client.#2019-08-2710:43pezHow do you mean let the backend figure it out? The client API stays similar to the current one?#2019-08-2710:44thhellerbackend = nrepl server+middleware#2019-08-2710:45thhellerclient = the editor connected to the server. is it easier for it to just always send eval messages or is it aware of the differences in CLJ/CLJS and would benefit from directly telling the server that it wants to eval CLJS#2019-08-2710:45thhellerinstead of that being some kind of server state dependent on previous messages/evals and so on#2019-08-2710:46thhellerright now my understanding is that a clone is done first. the session remains CLJ. then an eval is done (eg. cider.piggieback/cljs-repl) that sets a magic binding and turning the session to CLJS#2019-08-2710:46pezYeah, that's how I see the process too. It would be reasonably simple to let Calva add the cljs or clj info to the messages.#2019-08-2710:49bozhidar> right now my understanding is that a clone is done first. the session remains CLJ. then an eval is done (eg. cider.piggieback/cljs-repl) that sets a magic binding and turning the session to CLJS#2019-08-2710:50bozhidarYeah, that’s true. All sessions start their lives as Clojure sessions and via a dynamic binding they are changed to ClojureScript sessions.#2019-08-2710:52thhellerwould it not be reasonable to have a cljs/clone or so that just starts the session as CLJS from the start?#2019-08-2710:52bozhidarI’m not sure why it was done in this manner, as it happened before I was involved with tooling/nREPL. I assume that the idea was to be able to implement more functionality transparent in terms of just sending code to eval (this was pretty popular before the cider-nrepl era).#2019-08-2710:52thhellerand you then knowing that this session is CLJS forever instead of having to figure it out all the time#2019-08-2710:53thhelleryeah a lot of the nrepl design doesn't account for CLJS at all#2019-08-2710:53bozhidarExactly - nREPl predates ClojureScript by a couple of years.#2019-08-2710:53thhellerthings are quite different and they are made to look like CLJ#2019-08-2710:54bozhidarAnd ClojureScript changed quite a lot in the past 3-4 years, while piggieback has been around since the first release of ClojureScript.#2019-08-2710:54thhelleryeah exactly#2019-08-2813:08Yehonathan SharvitIs there a way to quickly navigate to a var that is defined in the current namespace?#2019-08-2813:09Yehonathan SharvitI mean by typing partially the name of the var#2019-08-2813:12stathissiderishello, I do cider-jack-in-clj&cljs. I have several questions:
(1) I see logging output from the clj repl in the cljs repl. Is that expected?
(2) If I close the cljs REPL only, and then do cider-jack-in-cljs figwheel-main tells me that the address (the port) is already being used. I thought I closed it already!
(3) What does it mean for 2 REPLs to be “siblings”?#2019-08-2813:15dpsutton@viebel check out imenu maybe?#2019-08-2813:18Yehonathan Sharvitimenu looks awesome! Thanks @dpsutton. How does the integration with CIDER works?#2019-08-2813:21dpsuttonnot at all. but you're still in emacs!#2019-08-2813:21Yehonathan Sharvitemacs understand Clojure?#2019-08-2813:22dpsuttonimenu understands some top level forms yes#2019-08-2813:22dpsuttonjust do m-x imenu in your buffer and see what you get#2019-08-2813:22dpsuttonits built in to emacs#2019-08-2813:24Yehonathan SharvitI saw and it looks great. I was just curious to understand how it works#2019-08-2813:25dpsuttonfrom clojure-mode: (add-to-list 'imenu-generic-expression '(nil clojure-match-next-def 0))#2019-08-2813:25dpsutton(re-search-backward "^[ \t]*(\\([a-z0-9.-]+/\\)?\\(def\\sw*\\)" nil t) so its regex based#2019-08-2813:26dpsuttonlooking for def* things#2019-08-2813:26Yehonathan SharvitNice#2019-08-2813:27Yehonathan SharvitI also saw once a CIDER buffer with the symbols of the current namespace but I don’t remember how to open this buffer#2019-08-2813:27dpsuttoncider-browse-ns ?#2019-08-2813:32Yehonathan SharvitYEAH!#2019-08-2813:33Yehonathan SharvitIs there a quick way to browse the current namespace?#2019-08-2813:40dpsutton(funcall-interactively 'cider-browse-ns (cider-current-ns))#2019-08-2813:47Yehonathan SharvitHow can I add a keybinding for that?
(spacemacs/set-leader-keys-for-major-mode 'clojure-mode "hc" '(funcall-interactively 'cider-browse-ns (cider-current-ns)))
?#2019-08-2813:48Yehonathan SharvitI tried this ^ but It din’t work @dpsutton#2019-08-2813:55dpsuttonthat needs to be a function. quoting turns it into a list of symbols#2019-08-2814:08Yehonathan SharvitOK#2019-08-2814:08Yehonathan SharvitI have still an issue. I am using helm-cider-mode#2019-08-2814:09Yehonathan SharvitWhen I run (cider-browse-ns (cider-current-ns))), it opens a buffer with the list of all the namespaces#2019-08-2814:13Yehonathan SharvitI think I found the issue in the code of helm-cider-mode:
defcustom helm-cider-overrides
'((cider-apropos . helm-cider-apropos)
(cider-apropos-select . helm-cider-apropos)
(cider-apropos-documentation . helm-cider-apropos-symbol-doc)
(cider-apropos-documentation-select . helm-cider-apropos-symbol-doc)
(cider-browse-ns . helm-cider-apropos-ns)
(cider-browse-ns-all . helm-cider-apropos-ns)
(cider-browse-spec-all . helm-cider-spec))
"Alist of CIDER functions and Helm versions replacing them."
:group 'helm-cider
:type '(alist :key-type symbol :value-type symbol))
#2019-08-2814:13Yehonathan Sharvithttps://github.com/clojure-emacs/helm-cider/blob/master/helm-cider.el#L428#2019-08-2815:57mkvlr@viebel SPC j i in spacemacs helm-jump-in-buffer does what you want I think#2019-08-2904:07Yehonathan SharvitThe command you mentioned opens imenu which is string based. I prefer (cider-browse-ns (cider-current-ns))#2019-08-2816:35QuestAnyone have a recommended keybind for cider-eval-file (or cider-eval-buffer)?#2019-08-2816:57bozhidar> (3) What does it mean for 2 REPLs to be “siblings”?#2019-08-2816:58bozhidar@stathissideris It means they belong to the same CIDER session (usually different REPLs connected to the same server).#2019-08-2816:58bozhidar> (2) If I close the cljs REPL only, and then do cider-jack-in-cljs figwheel-main tells me that the address (the port) is already being used. I thought I closed it already!#2019-08-2816:58bozhidarI’m guessing that killing the nREPL connection doesn’t kill figwheel or something like this.#2019-08-2816:58bozhidar> (1) I see logging output from the clj repl in the cljs repl. Is that expected?#2019-08-2816:59bozhidarThat definitely sounds like a bug to me.#2019-08-2817:09stathissiderisThanks @bozhidar I’ll try and demonstrate (1) by setting up a minimal project#2019-08-2818:44warnsbergI’m having some issues to get cider-connect-cljs to work with shadow-cljs – the REPL connects fine, but its type is clj which means the buffer integration from cljs buffers doesn’t work#2019-08-2818:45warnsbergIf I manually change the REPL type using cider-set-repl-type to cljs it’ll work, but the type reverts back to clj after each command I send#2019-08-2818:45warnsbergI wonder if somethings wrong with my setup, does anyone recognize this behaviour?#2019-08-2818:46warnsberg(also, cider-jack-in-cljs seems to work fine, so it seems to be related to cider-connect-cljs specifically)#2019-08-2818:48dpsuttonwhat version of shadow are you on?#2019-08-2818:48dpsuttoncan you perhaps go back a version or two and see if that fixes it?#2019-08-2818:48warnsberg2.8.51#2019-08-2818:48warnsbergSure, any specific version?#2019-08-2818:49dpsuttonshot in the dark but 2.8.49?#2019-08-2818:49dpsuttonjust a "few"#2019-08-2818:49warnsbergTrying 2.8.46 – roughly two weeks old#2019-08-2818:56warnsbergGetting some RuntimeException Unable to resolve var: cemerick.piggieback/*cljs-compiler-env* in this context errors for previous versions#2019-08-2818:56warnsberg.46 and .49 both threw that error, trying .50 now#2019-08-2818:59warnsbergGlancing over the changelogs a lot of versions around .47-.50 seems related to piggieback stuff#2019-08-2819:03warnsbergOk, 2.8.46 seems to be working as expected#2019-08-2819:05warnsberg.47 works as well#2019-08-2819:07warnsberg.48 seems to be broken, so https://github.com/thheller/shadow-cljs/commit/a4fc198a2296fdc53590b28d7afaefec03909e0e could have introduced the breakage, I suppose#2019-08-2819:07dpsuttonwhat versions of piggieback are going on?#2019-08-2819:08warnsbergIf I’ve understood things correctly, shadow-cljs doesn’t use piggieback at all, but mimics it under the hood#2019-08-2819:09dpsuttonah true#2019-08-2819:09thhellertrue and I updated the emulation to remove the older stuff#2019-08-2819:10thhellercemerick.piggieback is rather old and shouldn't be used anymore? are you on an old cider version? or nrepl?#2019-08-2819:11warnsbergCIDER version is 0.22.0snapshot 20190826.11#2019-08-2819:11warnsberg(probably the latest in spacemacs develop)#2019-08-2819:12bozhidarAnd you don’t see anything related to tools.nrepl in your deps tree, right?#2019-08-2819:13warnsbergHonestly not sure how I’d go about checking my deps tree, still pretty new to the entire clj(s) ecosystem#2019-08-2819:13warnsbergI’m using deps.edn so I guess that could list all transative deps for me somehow#2019-08-2819:17thhellerclj -Stree#2019-08-2819:19warnsbergThanks!#2019-08-2819:21thhellerdon't forget to enable all the aliases and extra deps you might have though#2019-08-2819:19warnsberg@bozhidar no tools.nrepl references#2019-08-2819:20warnsberg❯ clj -Stree | grep nrepl
nrepl/nrepl 0.6.0
refactor-nrepl/refactor-nrepl 2.4.0
cider/cider-nrepl 0.22.0-beta12
#2019-08-2819:21bozhidarHmm, I’m assuming you must have something that’s depending on the old piggieback, otherwise I can’t imagine how you’d be getting such an error.#2019-08-2819:21dpsuttonwhat about clj -Stree | grep piggie#2019-08-2819:22warnsbergNope, but I got that error when I reverted the shadow-cljs version to older releases#2019-08-2819:22thheller@warnsberg you should be on the latest shadow-cljs release (2.8.52) or something before all the nrepl mess#2019-08-2819:22thhellernot inbetween 😉#2019-08-2819:23warnsbergBut I think my real issue is as I described initially, with newer releases (> 2.8.48) CIDER seems to think that my cljs repl is a clj repl#2019-08-2819:23warnsberg@thheller I am! 🙂#2019-08-2819:23warnsberg@dpsutton asked me to try older versions, so I did#2019-08-2819:23dpsuttonwhoops 🙂#2019-08-2819:23warnsbergBut I’m seeing the issue with CIDER interpreting my REPL as a CLJ repl instead of a CLJS repl, so I cant send commands from my cljs buffers#2019-08-2819:24thhellerbut the cider detection seems to be broken somehow. @manuel reported that yesterday too#2019-08-2819:24warnsbergBut things like (js/alert "foo") works just fine, so the REPL is indeed connected correctly#2019-08-2819:24thhellerso my changes must have broken it somehow. just not sure why yet.#2019-08-2819:24warnsbergIf I manually change the REPL type to cljs it will work for a single command, but then revert back to clj#2019-08-2819:25dpsuttonwe should probably add an "ignore state tracker" option to CIDER for these annoying bits that come up. This shouldn't be a showstopper beyond the one time it falsely responds#2019-08-2819:26dpsutton(defn- cljs-env-path
"Returns the path in the session map for the ClojureScript compiler
environment used by piggieback."
[]
[(if nrepl-piggieback?
(resolve 'piggieback.core/*cljs-compiler-env*)
(resolve 'cider.piggieback/*cljs-compiler-env*))])
this could probably be smarter as well.#2019-08-2819:27thhellercider.piggieback/*cljs-compiler-env* this should be bound. the other one doesn't exist#2019-08-2819:27bozhidarYeah, exactly.#2019-08-2819:31dpsuttonoh i was totally misreading this as cemerick vs cider rather than current vs future planned version#2019-08-2819:41yenda@thheller not sure if this help but since I've had the issue as well I can add than if I manually change the repl-type to cljs, then call cljr-clean-ns, the repl-type switches back to clj, and this is the stack trace that changes it back:
Debugger entered--setting cider-repl-type in buffer *cider-repl ~/my-project:localhost:33673(cljs:shadow)* to clj:
debug--implement-debug-watch(cider-repl-type clj set #<buffer *cider-repl ~/my-project:localhost:33673(cljs:shadow)*>)
cider-set-repl-type("clj")
cider-repl--state-handler((dict "changed-namespaces" (dict) "id" "18" "repl-type" "clj" "session" "df02492d-a0c7-4553-b463-c45237d0c7c1" "status" ("state")))
run-hook-with-args(cider-repl--state-handler (dict "changed-namespaces" (dict) "id" "18" "repl-type" "clj" "session" "df02492d-a0c7-4553-b463-c45237d0c7c1" "status" ("state")))
nrepl-client-filter(#<process nrepl-connection> "d2:id2:182:ns17:app.camera.screen13:printed-valuei1e7:session36:df02492d-a0c7-4553-b463-c45237d0c7c15:value17:app.camera.screened2:id2:182:ns17:app.camera.screen13:printed-valuei1e7:session36:df02492d-a0c7-4553-b463-c45237d0c7c15:value17:app.camera.screened2:id2:187:session36:df02492d-a0c7-4553-b463-c45237d0c7c16:statusl4:doneeed18:changed-namespacesde2:id2:189:repl-type3:clj7:session36:df02492d-a0c7-4553-b463-c45237d0c7c16:statusl5:stateee")
all I understand is that the repl seems to advertise itself as being of repl-type" "clj" and cider keeps changing it back to that?#2019-08-2819:42thhelleryeah the track-state middleware is responsible for that. my changes seem to have messed with that.#2019-08-2819:43yendabut additionally my colleagues on vanilla emacs don't have this issue#2019-08-2819:43yendaand I use spacemacs#2019-08-2819:44yendaok I'm gonna try reverting#2019-08-2819:47yendabecause yeah they may be running with shadow 2.8.45#2019-08-2819:50dpsuttoncan you try without refactor-nrepl? wild guess but maybe that's different?#2019-08-2819:51yendaWARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
yeah I always have this prompt in the repl btw#2019-08-2819:55yendawith 2.8.45, removing clj-refactor from deps I get a cljs repl with the right repl type#2019-08-2819:55yendastill get the clj-refactor warning though#2019-08-2819:58yenda2.8.52/no clj-refactor in shadow-cljs.edn (but still get warning about clj-refactor middleware in repl): wrong repl type#2019-08-2820:00thhellerjust stick to the older version. don't have time to figure out what exactly broke right now.#2019-08-2820:02yendaok, definitely this commit though https://github.com/thheller/shadow-cljs/commit/a4fc198a2296fdc53590b28d7afaefec03909e0e#2019-08-2820:15yendamy guess would be that it is caused by the removal of piggieback middleware which does this https://github.com/nrepl/piggieback/blob/7bcda974b6df9aaae55d889c5f44507b47201cde/src/cider/piggieback.clj#L293-L310#2019-08-2820:23yendaOk seems to be confirmed by the fact that I can run 2.8.52 with [cider/piggieback "0.4.1"] and option :nrepl {:middleware [cider.piggieback/wrap-cljs-repl]} in shadow-cljs.edn#2019-08-2820:48thhellershadow-cljs does not need or use piggieback at all. does this solve the CLJS REPL type detection issue?#2019-08-2905:23yendaYes shadow doesn't need it but apparently cider does because it sets some vars that are needed to determine the right repl type#2019-08-2820:24yendaso one of these vars is required by nrepl to determine the right repl type#2019-08-2820:34yendaSo now I am back at my clj-refactor not working, with this warning in the repl:
WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
and if I call clr-refactor-ns for instance I get Wrong type argument: stringp, nil#2019-08-2820:35yendaalso in the build:
shadow-cljs - config: /home/yenda/clash/shadow-cljs.edn cli version: 2.8.52 node: v11.15.0
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by refactor_nrepl.inlined_deps.dynapath.v0v2v5.dynapath.defaults$eval8419$fn__8420 to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of refactor_nrepl.inlined_deps.dynapath.v0v2v5.dynapath.defaults$eval8419$fn__8420
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
#2019-08-2904:40bozhidarThe build warnings are harmless, so the actually problem is elsewhere.#2019-08-2904:40bozhidarIt’d be nice if you can find out the entire stacktrace from Emacs for Wrong type argument: stringp, nil.#2019-08-2914:35tianshucider-find-var will prompt me to confirm the var, is this a change in new version? can I disable this?#2019-08-2914:56dpsutton(defcustom cider-prompt-for-symbol t
"Controls when to prompt for symbol when a command requires one.
When non-nil, always prompt, and use the symbol at point as the default
value at the prompt.
When nil, attempt to use the symbol at point for the command, and only
prompt if that throws an error."
:type '(choice (const :tag "always" t)
(const :tag "dwim" nil))
:group 'cider
:package-version '(cider . "0.9.0"))
#2019-08-2914:57dpsuttonshouldn't have changed recently that i know of#2019-08-2915:44tianshu@dpsutton thanks! I've just found this, I change it to nil. I'm re-constructing my emacs config, maybe I missed this.#2019-08-2916:49ahungryIs there any type of way to auto run tests related to a function when the function is redefined in the repl?#2019-08-2917:50dominicmWe have the parts for that now.#2019-08-2917:51dominicm@bozhidar if the var query code could query for "in use by" this would be trivial.#2019-08-2917:51dominicmYou would just find usages and filter to tests#2019-08-3002:16johanatani'm having a lot of trouble getting cider working with figwheel-main (latest versions of all involved packages).#2019-08-3002:16johanatananyone else using this setup successfully and can share the setup?#2019-08-3004:59johanatanhere are my deps:
com.bhauman/figwheel-main {:mvn/version "0.2.3"}
com.bhauman/rebel-readline {:mvn/version "0.1.4"}
com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
org.clojure/tools.nrepl {:mvn/version "0.2.13"}
nrepl/nrepl {:mvn/version "0.6.0"}
cider/cider-nrepl {:mvn/version "0.22.0"}
cider/piggieback {:mvn/version "0.4.1"}
#2019-08-3007:17bozhidarTry removing that dependency to tools.nrepl. My guess is that this should fix your problem.#2019-08-3007:36practicalli-john@johanatan I use the figwheel-main template to create new projects and that works with CIDER without issue. Details of the deps.edn file and other configuration files and workflow are here
http://jr0cket.co.uk/2019/08/development-workflow-with-clojure-cli-tools.html
There is also a video of creating a figwheel-main of project with the Clojure CLI tools here
https://youtu.be/uuxEYsX-1eg #2019-08-3016:37johanatanUnfortunately this is also my own setup. Most of it works. But connecting from CIDER/Emacs does not.#2019-08-3016:38johanatancider-jack-in-cljs does not prompt for the build tool like it is purported to.#2019-08-3007:43practicalli-johnIf you want to run a deps.edn based figwheel-main project from Emacs, then don’t forget to include the alias for cider-jack-in-cljs if that is where you include the figwheel-main dependency
http://jr0cket.co.uk/2019/07/CIDER-jack-in-to-Clojure-CLI-projects-from-Spacemacs.html#2019-08-3008:01kommen@jr0cket since you worked on find var stuff recently, do you mind having a quick look at https://github.com/syl20bnr/spacemacs/pull/12658?#2019-08-3008:04practicalli-johnYes, looks very useful, thanks. I will give it a try and leave a comment on the GitHub PR, helping the maintainers know it works for others. If anyone else here has used this hopefully they will do the same.
Thanks again.#2019-08-3008:05kommenthank you too!#2019-08-3016:37johanatanUnfortunately this is also my own setup. Most of it works. But connecting from CIDER/Emacs does not.#2019-08-3016:38johanatancider-jack-in-cljs does not prompt for the build tool like it is purported to.#2019-08-3108:54thhellercan someone that knows how to use clj-suitable tell me if it does break the *1 *2 etc bindings? from looking at the code it seems like it would?#2019-08-3112:16robertkrahnworks fine for me. What makes you think that?#2019-08-3109:22dominicm@robertkrahn#2019-09-0106:20dpsuttoni believe that cljs completions are broken on cider-nrepl 0.22.0 https://github.com/clojure-emacs/cider-nrepl/issues/643#2019-09-0114:28robertkrahnThanks for letting me know, looking into it.#2019-09-0117:23robertkrahnonce clojars is up again and I can deploy the fix it can be merged into cider via https://github.com/clojure-emacs/cider-nrepl/pull/644#2019-09-0117:24dpsutton👍#2019-09-0117:25dpsuttoni found this error in a shadow project as well. I'm not sure its node specific. I've only read your commit message not hte code yet but the message makes me think its tailored to node#2019-09-0117:29robertkrahnNo, cljs.repl/setup is run in any case. But I hadn't had problems with shadow-cljs before (added support for it two weeks ago). What were the steps you used to run it? Just jack-in?#2019-09-0117:29dpsuttonyeah. just jack in in a shadow project and i was able to see it#2019-09-0117:30robertkrahnOK, let me check again...#2019-09-0117:43robertkrahnTesting it with shadow :node-lib and :browser targets works. If you used node before it might be just that issue. If it was the browser I would think it's something else#2019-09-0117:46dpsuttoni was using browser when i first noticed it#2019-09-0117:57dpsuttonclojars issue should now be resolved#2019-09-0111:30bozhidarHmm, that looks bad. Let’s hope that @robertkrahn will be able to take a look at the problem soon.#2019-09-0116:08dpsutton@bozhidar any chance you can release cider-nrepl 0.22.1#2019-09-0116:21dominicmI think there's some clojars issues#2019-09-0116:21dominicmhttps://clojurians.slack.com/archives/C0H28NMAS/p1567336191002100#2019-09-0116:23dpsuttonah i see. thanks#2019-09-0117:23lreadHello people of cider! I am keen to try out REBL with cider and was pointed to this brief guide: https://github.com/cognitect-labs/REBL-distro/wiki/REBL-and-nREPL. Before I dig in, I thought I’d consult the ones who know best, is this the easiest path to REBL with cider?#2019-09-0118:16johanatananyone else seeing this?
[nREPL] Starting server via clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.1"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.22.1"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Downloading: com/cemerick/clojurescript.test/0.2.3-SNAPSHOT/maven-metadata.xml from
Error building classpath. Could not find artifact cider:cider-nrepl:jar:0.22.1 in central ()
error in process sentinel: Could not start nREPL server: Downloading: com/cemerick/clojurescript.test/0.2.3-SNAPSHOT/maven-metadata.xml from
Error building classpath. Could not find artifact cider:cider-nrepl:jar:0.22.1 in central ()
#2019-09-0118:20dpsuttonyes there was a clojars issue preventing the release of a new artifact. If you jack in with a prefix you can edit the cider/cider-nrepl dep to "0.21.1" or "0.22.0-beta12"#2019-09-0118:21johanatanwhat does "with a prefix" mean in this context?#2019-09-0118:22johanatani actually have cider/cider-nrepl explicitly in my deps.edn. could i just tweak the version there?#2019-09-0118:24dpsuttonsure. you can do it there#2019-09-0118:25dpsuttonbut for future reference, if you invoke something like cider-jack-in with C-c M-j, "with a prefix means C-u C-c M-j its a way to send more information to interactive functions that you invoke with m-x or key chords like that#2019-09-0118:25dpsuttona prefix when jacking-in lets you edit the command that CIDER starts up with#2019-09-0200:49johanatangot it. cool, thx for the info!#2019-09-0200:53johanatanbtw, do you know how to invoke with prefix in spacemacs?#2019-09-0201:04dpsuttoni don't i'm not a spacemacs user. but have you tried with C-u the same way as non-spacemacs? I think m-x is the same there but if that doesn't work check out #spacemacs#2019-09-0307:23practicalli-john@U0E98NQG2 SPC u is the equivalent in Spacemacs of C-u in Emacs. So if you are using Vim style, you would use SPC u , ‘ to edit the command to jack-in.
There is an example in this article http://jr0cket.co.uk/2019/07/CIDER-jack-in-to-Clojure-CLI-projects-from-Spacemacs.html#2019-09-0307:25practicalli-john#spacemacs is a channel that can also help with Spacemacs specific questions#2019-09-0120:25bozhidarI’m really sorry about the botched release. Seems I got really unlucky with the timing of it.#2019-09-0120:26bozhidarI’ll likely address this later today or early tomorrow. In the mean time I issued a small patch to require the older cider-nrepl 0.22.0 for now.#2019-09-0121:03dpsuttonenjoy brazil! its labor day weekend. the perfect day in the US for some hiccups in the release to not affect anyone's work 🙂#2019-09-0214:48bozhidarThings should be good now.#2019-09-0214:49bozhidarThere’s a bit more work to do around the release (update the docs portal, issue some release announcement), but I hope I’ll manage to do it later today.#2019-09-0214:53dpsuttonIs this one named Sao Paolo? Didn’t see a name attached#2019-09-0222:13Drew Verleewhen i run "cider jack in" emacs crashes. I would like to provide a better error message, but emacs crashes 😢#2019-09-0222:19Drew Verleei take it I need to bump the cider version of emacs to look at 0.22.1?#2019-09-0222:22Drew Verleeor .. maybe the reverse lol. i think im going to head to the pub and wait for this alll to blow over.#2019-09-0223:43sofra@drewverlee mine is doing that today. I deleted the user.clj file and it worked#2019-09-0223:56ahungryWhen using cider and needing to reload an entire session or namespace, is there a better method than killing cider buffer and jacking in again? Cider-reload doesn't seem to do it#2019-09-0223:57ahungrySay, after adding a new dependency in project.clj in a lein project#2019-09-0300:06sofraAnyone else had problems with emacs crashing when loading a user.clj file?
this is an old project other newer projects work but this one is giving me problems#2019-09-0300:37dpsuttonDo y’all have a minimal repro? Is it just the presence of a user.clj?#2019-09-0300:57sofraI don’t have a minimal repro yet, sorry. Still investigating. If I have an empty user.clj file it works, it is when I have some requires that it fails.#2019-09-0301:15sofraI have narrowed it down to a particular namespace that is being required, it is a namespace internal to the app so I am guessing it is something weird we are doing#2019-09-0301:32sofraIn my case the issue of emacs crashing when loading user.clj came down to it requiring [clojure.tools.nrepl.server :as nrepl] from [org.clojure/tools.nrepl "0.2.13"]#2019-09-0302:18dpsuttonwhat was the last version of CIDER you were on? CIDER switched to nrepl/nrepl a while back and now org.clojure/tools.nrepl is not supported#2019-09-0303:00sofrayep, switching it for nrepl/nrepl works. I am on CIDER 0.21.0snapshot#2019-09-0311:32bozhidar> Is this one named Sao Paolo? Didn’t see a name attached#2019-09-0311:32bozhidarYeah, it is.#2019-09-0315:23lepistaneis there a shortcut for cider-repl-clear-buffer ?
From what i gather online it used to be but not anymore
in docs i only found
C-c C-o which clears only last result
and i need whole repl cleaned#2019-09-0317:08jumarIf by chance you use spacemacs, there's also , s c#2019-09-0315:32dpsuttonERROR: Unhandled REPL handler exception processing message {:op complete, :ns aclaimant.dashboard-v2.controls, :symbol log/spy, :context :same, :session 85879d90-112a-4993-bde8-57d97808a0bf, :id 38}
java.lang.AssertionError: Assert failed: file:/Users/dan/projects/aclaimant/acl/resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v6/suitable/js_introspection.cljs does not provide a namespace
still having issues with clj-suitable on 22.1#2019-09-0315:32dpsuttonprints a big stack trace into the repl#2019-09-0315:56johanatandoes anybody recognize the following stack trace?:
Exception in thread "main" java.lang.IllegalArgumentException: no conversion to symbol
at clojure.core$symbol.invokeStatic(core.clj:596)
at clojure.core$symbol.invoke(core.clj:589)
at clojure.core$map$fn__5847$fn__5848.invoke(core.clj:2742)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
at clojure.core$transduce.invokeStatic(core.clj:6883)
at clojure.core$into.invokeStatic(core.clj:6899)
at clojure.core$into.invoke(core.clj:6887)
at nrepl.cmdline$__GT_mw_list.invokeStatic(cmdline.clj:217)
at nrepl.cmdline$__GT_mw_list.invoke(cmdline.clj:215)
at nrepl.cmdline$build_handler.invokeStatic(cmdline.clj:226)
at nrepl.cmdline$build_handler.invoke(cmdline.clj:219)
at nrepl.cmdline$options__GT_handler.invokeStatic(cmdline.clj:295)
at nrepl.cmdline$options__GT_handler.invoke(cmdline.clj:286)
at nrepl.cmdline$server_opts.invokeStatic(cmdline.clj:343)
at nrepl.cmdline$server_opts.invoke(cmdline.clj:331)
at nrepl.cmdline$dispatch_commands.invokeStatic(cmdline.clj:432)
at nrepl.cmdline$dispatch_commands.invoke(cmdline.clj:425)
at nrepl.cmdline$_main.invokeStatic(cmdline.clj:448)
at nrepl.cmdline$_main.doInvoke(cmdline.clj:443)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.main$main_opt.invokeStatic(main.clj:491)
at clojure.main$main_opt.invoke(main.clj:487)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
#2019-09-0315:56johanatan^^ i get this when trying to jack-in-cljs#2019-09-0315:56bozhidar@lepistane Try C-u C-c C-o.#2019-09-0315:57bozhidar@johanatan Seems you like you’re passing some bad arguments to clj when starting the nREPL server.#2019-09-0315:58johanatanhere are the arguments:
[nREPL] Starting server via clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.1"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.22.1"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'
#2019-09-0316:18dpsuttonif you run that from the command line do you see the same behavior? perhaps more information?#2019-09-0316:18dpsuttonalso, if you use a prefix while jacking in (`C-u C-c M-J` (capital J for clojurescript here) and edit the nrepl version to 21.1 do you see the same behavior?#2019-09-0316:19johanatanWill try when I return. Thx!#2019-09-0316:49johanatanIt works when I copy/paste that into a terminal on the machine.#2019-09-0316:49johanatanOne more detail is that the CIDER attempt from Spacemacs is over a TRAMP connection.#2019-09-0316:56johanatanAfter trying 21.1 i got a warning that i might want to try setting nrepl-use-ssh-fallback-for-remote-hosts. trying that now#2019-09-0316:59johanatanThat worked.#2019-09-0316:59johanatanSeems to be an issue with 22.1 and TRAMP/remote shells.#2019-09-0317:00johanatanalthough i do get this warning: "WARNING: CIDER 0.22.0 requires cider-nrepl 0.22.1, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality!"#2019-09-0317:03dpsuttonif you have that value set can you get it to work with 22.1? Is this a regression in functionality or regression in errors/info#2019-09-0317:04johanatani just tried 22.1 with that value set and i got the original "symbol not defined" error#2019-09-0317:04johanatanlooks like a regression along both axes#2019-09-0317:04dpsuttonbummer#2019-09-0317:04johanatanas 21.1 gave a more helpful error (which was that i needed to set that value)#2019-09-0317:05johanatanoh, shoot. sorry. it doesn't work with 21.1 either with cljs which is what i really need here#2019-09-0317:05johanatanthe previous attempt for 21.1 was for clojure not cljs#2019-09-0317:05dpsuttonwhat was your previous cider version?#2019-09-0317:05johanatani've never gotten it to work with this project but i just upgraded to the new cider last week#2019-09-0317:06dpsuttonah. i'm wondering if this is a regression or if this just never worked then#2019-09-0317:06johanatanoh, hmm. well i'm pretty sure i've used TRAMP + CIDER before on other projects (but those were lein. this is first attempt for tools.deps)#2019-09-0317:07johanatanbut, just to confirm, if i start nrepl in clojure mode on a cljs project and then send a buffer to it, switch to that namespace and then trying calling a function, it will fail to find the function since it was a clj repl and not a cljs one?#2019-09-0317:08dpsuttonwhat does "in clojure mode" mean? cider-jack-in-clj?#2019-09-0317:08johanatanthe one associated with , ' in spacemacs#2019-09-0317:08dpsuttoni have no clue what that means or does#2019-09-0317:08johanatancider-jack-in#2019-09-0317:09dpsuttonok. that's a clojure repl and it can't evaluate clojurescript#2019-09-0317:09johanatanah, yea, figured.#2019-09-0317:09dpsuttonif you jack in with cider-jack-in-cljs you can evaluate clojurescript#2019-09-0317:09johanatanyea, but that fails 😞#2019-09-0317:09johanatanwith the "no conversion to symbol" error#2019-09-0317:09dpsuttonis this with tramp or without. i can't follow what circumstances we're discussing now#2019-09-0317:09johanatanwith tramp#2019-09-0317:10johanatanlet me iterate the full setup: it's clj/tools.dep, clojurescript, tramp, nrepl 0.21.1 --or-- 0.22.1 .#2019-09-0317:10dpsuttonok. so 21.1 with clj works, 21.1 with cljs fails with the symbol error, 22.x fails with symbol error in both clj and cljs#2019-09-0317:10johanatancorrect#2019-09-0317:10dpsuttoncool#2019-09-0317:10dpsutton,er, not cool but i understand now 🙂#2019-09-0317:10johanatan🙂#2019-09-0317:11johanatani suppose removing tramp would be the path of least resistance forward for me#2019-09-0317:11johanatani.e., work locally.#2019-09-0317:11dpsuttonnot sure if you've ever worked with elisp and CIDER before but you're probably the most qualified to work on this bug. A work product is by far the best testing ground to diagnose these issues#2019-09-0317:12dpsuttonhow burdensome is that?#2019-09-0317:12dpsuttonbut that does sound like the best temp solution#2019-09-0317:12johanatanhehe, i will try to give it a look. otherwise, should i file an issue on the cider github?#2019-09-0317:13dpsuttonyou should file an issue regardless#2019-09-0317:13johanatanok#2019-09-0317:13dpsutton👍#2019-09-0315:57bozhidar@dpsutton There’s an updated version on master, but I hadn’t had time to cut a new release.#2019-09-0315:57bozhidarLet me do this now.#2019-09-0315:58dpsuttonah i thought that's what the release was based on. thanks#2019-09-0316:12bozhidar@dpsutton I’ve pushed a new cider-nrepl release.#2019-09-0316:17dpsutton0.22.2? i'll try it out#2019-09-0316:17dpsuttonthanks!#2019-09-0316:17lepistane@bozhidar it works! tnx#2019-09-0316:19dpsuttonnilWARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 35 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 40 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/starts-with? at line 34 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 41 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/oget at line 35 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/properties-by-prototype at line 30 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
WARNING: Use of undeclared Var cider.nrepl.inlined-deps.suitable.v0v2v13.suitable.js-introspection/property-names-and-types at line 26 resources/public/js/app.out/cider/nrepl/inlined_deps/suitable/v0v2v13/suitable/js_introspection.cljs
#2019-09-0316:32robertkrahnWhen does this happen?#2019-09-0316:33dpsuttonour work project. figwheel, cljs 1.10.439. When editing a buffer while cider-connected#2019-09-0316:36robertkrahnThanks. will look into it.#2019-09-0316:19dpsuttoni think clj-suitable isn't ready for primetime yet#2019-09-0316:30bozhidarPerhaps. That’s why I had suggested to @robertkrahn that maybe we should make it optional for now and have the users opt into it.#2019-09-0316:32pezHow would the user opt in?#2019-09-0316:34robertkrahnFeel free to disable it or suggest what kind of switch you want. What's problematic is that various cljs engines tend to act quite differently and even core features such as dynamically loading code are implemented and act differently.#2019-09-0316:36robertkrahnSo right now I have lots of special handlers for figwheel / node / shadow etc in place but it will take a while - if it happens at all - to find and code around all the different behaviors. I only have limited time and only use figwheel so this will probably take a long time.#2019-09-0316:39robertkrahnSo an opt in solution might be best but this also means that most people will never see / hear of that feature. Please suggest how you prefer to parameterize that behavior.#2019-09-0317:32bozhidar@robertkrahn I was thinking that we can just add an extra flag to the completion middleware request.#2019-09-0317:32bozhidarIn editors the value of this flag can be derived through some configuration option.#2019-09-0317:33bozhidarAlternatively we can just keep it enabled only for figwheel and node have suitable do nothing with other REPLs.#2019-09-0317:34bozhidarI think suitable is pretty cool, but I also completely understand how hard it is to reconcile the differences in all the ClojureScript REPLs.#2019-09-0317:53dpsuttonJust as a data point I was having issues on a figwheel project #2019-09-0317:56pezWith some holding hands, I can spend some time on fixing issues that creep up in suitable. Or at least try fix them.#2019-09-0318:34dominicmI think the option should be something like inhibit-suitable-during-testing, meaning that the flag will become non operational in the future.#2019-09-0318:43bozhidarI was thinking that we can just have the middleware take some optional params map where we can add some suitable flags for the time being - e.g. disable completely, disable for some REPL types, etc.#2019-09-0401:01fabraoHello all, what is the best way to change cider starting params?#2019-09-0401:02fabraochanging this "c:/ProgramData/chocolatey/bin/boot.exe" -i "(require 'cider.tasks)" -d "org.clojure/tools.nrepl:0.2.13" -d "refactor-nrepl:2.4.0" -d "cider/cider-nrepl:0.21.1" cider.tasks/add-middleware -m "refactor-nrepl.middleware/wrap-refactor" -m "cider.nrepl/cider-middleware" repl -s -H :: wait...#2019-09-0401:02fabraoor just versions?#2019-09-0401:47dpsuttonYou want to modify the command coder is starting with?#2019-09-0406:45slipsetHere’s something a bit funny. I have a 2018 mbp 13" connected to a 4k display. MacOS presents me with serveral different options for the display “Best for Display” which is kind of low-res, and then five scaled options, the one with the most space being “Looks like 3840x2160". If I run at this resolution, CIDER is snappy and all is fine. If I change to the one with the second most space, “3360x1890”, evaluating a form in CIDER takes significantly longer time, as in 10s of seconds.#2019-09-0406:47slipsetBut I can decrease the time spent evaluating a form by decreasing the emacs frame-size.#2019-09-0406:47slipsetGNU Emacs 26.1 (build 1, x86_64-apple-darwin18.0.0, Carbon Version 158 AppKit 1671) of 2018-10-01#2019-09-0406:56dominicmIs it perhaps print time?#2019-09-0407:03slipsetThe thing is I don’t know. I tried running the profiler on this, but couldn’t see anything useful 😞#2019-09-0408:08slipsetSo I guess it’s more like a “Hey, look what I found” to see if anyone else have experienced the same thing.#2019-09-0408:13rickmoynihanI upgraded cider last night, and now get this warning:
WARNING: CIDER 0.22.0 requires cider-nrepl 0.22.1, but you're currently using cider-nrepl 0.22.2. The version mismatch might break some functionality!
I don’t see any issues at the minute; and suspect the differences are almost nothing… but was wondering if there is a cider point release to match the latest cider-nrepl?#2019-09-0410:06bozhidar@rickmoynihan Despite the similar version numbers there are not released in lockstep anymore. The required version is defined by cider-required-middleware-version (or something like this).#2019-09-0410:07rickmoynihanahh ok, good to know… So is the above warning indicative of a problem in my setup or not?#2019-09-0410:08bozhidarI guess you’re doing cider-connect, right?#2019-09-0410:09bozhidarWith cider-jack-in I can’t see how this can happen.#2019-09-0410:09rickmoynihanfor this project yes#2019-09-0410:09rickmoynihanas I need to set some env vars etc#2019-09-0410:09bozhidarNo real problem. It’s actually better to be on cider-nrepl 0.22.2.#2019-09-0410:10rickmoynihanCool that’s what I thought; I saw the chat from the other day#2019-09-0410:10bozhidarI guess I can relax this version check and make it ignore the patch portion of the version.#2019-09-0410:10bozhidarProbably I should have done this a long time ago.#2019-09-0410:11rickmoynihanIt’d mean annoying people like myself would stop bugging you 🙂#2019-09-0410:12rickmoynihanAnyway thanks again for everything. As always everything you do is much appreciated! 🙂#2019-09-0410:49bozhidar:man-bowing:#2019-09-0502:19ahungrywhen using cider, is there a way to force reloading an entire ns at once? the equivalent of, say, killing the cider buffer/process and re-executing a jack-in?#2019-09-0502:47dpsuttonThere’s a cider-restart#2019-09-0504:33ahungrythanks - that doesn't reboot the repl, just redoes the connection, but it did lead me to sesman-restart, which is bound to C-c C-s r and did what I needed 🙂#2019-09-0508:58rickmoynihanIs it just me or does cider/nrepl 0.22.x take longer to display the results of form evaluation than cider 21? It certainly feels that since upgrading even evaluating simple forms sometimes takes longer… e.g. (reduce + (range 999999)) which takes a few ms in clojure, sometimes takes a few seconds to print the result in the REPL with cider spinning the ===… other times the same form is near instant.#2019-09-0509:00pez@rickmoynihan Can you try with 21 and see if that makes a difference?#2019-09-0509:01rickmoynihan@pez: perhaps later — not wanting to shave the dev env yak just now — what with a deadline looming 😬#2019-09-0509:02pez¯\(ツ)/¯#2019-09-0509:04rickmoynihanit could equally be other stuff in my environment — though I know the time spent in clojure is the miniscule amount I’d expect#2019-09-0509:05rickmoynihane.g. (time (reduce + (range 99999)) eventually prints the tiny amount of msecs clojure actually took#2019-09-0509:07rickmoynihanthe form itself doesn’t seem to matter even evaluating 1 can take seconds#2019-09-0509:14rickmoynihanInteresting it appears that switching focus out of the REPL to my code buffer with e.g. C-x o seems to force the REPL to display the result (and flush the nrepl-messages. When I eval e.g. 4 I instantly see the eval op in nrepl-messages; but none of the responses until I switch buffer#2019-09-0509:16rickmoynihan#2019-09-0509:16rickmoynihanthis took about 2 seconds… at the 2 second point I’d switched buffer with C-x o at which point the result 4 displayed in the REPL#2019-09-0509:39rickmoynihanAlso did cider 22 happen to change the binding of cider-eval-defun-at-point from C-S-M-x to C-M-x? I can’t see it mentioned in the release notes; but my muscle memory keeps hitting the former key chord… :thinking_face:#2019-09-0510:44bozhidarThis binding has never been changed since the initial version of CIDER and was always C-M-x and C-c C-c.#2019-09-0511:24rickmoynihanIn that case it’s probably that I’m just not as used to my home keyboard as I thought 🙂#2019-09-0510:46bozhidar> Is it just me or does cider/nrepl 0.22.x take longer to display the results of form evaluation than cider 21?
I can’t think of any change in 0.22 that would contribute to some slowdown of form evaluation. To me it seems exactly the same in terms of speed.#2019-09-0511:25rickmoynihanit’s weird it’s just in the REPL buffer… it’s like it only receives the nrepl responses after I change window.
Evaling forms in the code buffer is fine.#2019-09-0609:25danielcomptonIs there a way to customise the way that CIDER shows the exception messages when an error is thrown? It seems to show all the information for the first exception, and only the exception class for the exception causes. It would be quite helpful if I could also have the exception message shown for all of the causes, and perhaps to not fully expand the first exception. When Integrant throws an exception during init, it provides a lot of data in the ex-data which can be a bit overwhelming.
This is what I currently get
Show: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (0 frames hidden)
2. Unhandled java.net.BindException
1. Caused by clojure.lang.ExceptionInfo
Error on key :duct.server.http/aleph when building system
{:reason :integrant.core/build-threw-exception,
:system
< ... 600 lines ... >
:function #multifn[init-key 0x4f0a4cb8],
:key :duct.server.http/aleph,
:value {:port 8686, :handler #function[clojure.lang.AFunction/1]}}
core.cljc: 285 integrant.core$build_exception/invokeStatic
core.cljc: 284 integrant.core$build_exception/invoke
core.cljc: 296 integrant.core$try_build_action/invokeStatic
<... elided ...>
session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 170 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 834 java.lang.Thread/run
< cursor is here, right at the bottom >
#2019-09-0609:27danielcomptonHere's what I'd like to have by default (I think)
Show: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (0 frames hidden)
2. Unhandled java.net.BindException
Address already in use
1. Caused by clojure.lang.ExceptionInfo
Error on key :duct.server.http/aleph when building system
#2019-09-0609:30danielcomptonI guess a secondary feature request here would be to have more control over expanding the ex-message separately from the ex-data, or perhaps limiting how big the ex-data can be printed in the stacktrace buffer.#2019-09-0611:49bozhidar@danielcompton Not yet. The current display was not intended and is basically the result of the changes in Clojure 1.10. I was actually planning to just strip this data from the first stack frame, as it kind of breaks the structure of the stacktrace.#2019-09-0612:12bozhidarI think there was some ticket where we were discussing how to best handle this, I’ll have to dig it up.#2019-09-0616:11tianshu@robertkrahn is there a huge performance drop down after suitable introduced into cider? I usually do complete by pressing TAB, when the complete menu popup, I can hardly type#2019-09-0616:15robertkrahn@doglooksgood It depends on the speed of the repl connection / how long an eval takes. Suitable evals a code snippet so this might introduce a noticeable lag. It should only happen in interop expressions, though (e.g when typing (.| js/fooo))#2019-09-0616:16robertkrahnWe will add a switch to allow to deactivate suitable, I think. We might also consider having a timeout.#2019-09-0616:19tianshuThis happened when I type (re-frame/|)#2019-09-0616:19tianshuNot sure if the suitable is the cause, I have upgrade cider recently#2019-09-0616:20robertkrahnHmm this should not trigger suitable#2019-09-0616:23tianshuemmm, ok#2019-09-0616:23tianshuI will check with profiler#2019-09-0616:26robertkrahnare you connected to a local browser? is there a lag when you eval an expression?#2019-09-0616:29tianshuyes, local browser.#2019-09-0616:30tianshua little lag when eval an expression#2019-09-0616:42robertkrahnOK, I will check that and whether suitable really won't get triggered for normal symbol completions (it shouldn't eval in that case but I will check). As I said, I'm pretty sure there will be a switch to disable suitable before long. Thanks for letting me know 🙂#2019-09-0618:41exit2Error loading refactor-nrepl.middleware: java.io.FileNotFoundException: Could not locate cider/nrepl/middleware/util/cljs__init.class or cider/nrepl/middleware/util/cljs.clj on classpath., compiling:(refactor_nrepl/middleware.clj:1:1)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: refactor-nrepl.middleware/wrap-refactor in this context, compiling:(/private/var/folders/rd/0xkr22fd1jq8y8j4856s7sy40000gp/T/form-init8061324572855299348.clj:1:2313)
#2019-09-0618:41exit2I can’t seem to get my cider jack in to work, this error keeps coming up. Any ideas?#2019-09-0619:16robertkrahnDo you have the clj-refactor Emacs package installed? In that case see https://github.com/clojure-emacs/cider/issues/2284#2019-09-0619:23exit2yeah I just removed it, and things work \o/#2019-09-0619:36robertkrahnIf you want to keep using it you can add refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"} into your user deps.edn or project deps. Even though it isn't fully compatible anymore I still can use it for various things like import cleanups and such.#2019-09-0621:22m0smith#2019-09-0621:23m0smith#2019-09-1008:56magnarsdid the sesman-integration recently change? I just updated cider, and when I do C-c C-s s to connect a sibling, I get a Select command: prompt with nothing suggested.#2019-09-1008:57magnarsUsually it would suggest a whole series of cider-connect-* commands#2019-09-1012:45magnarsDisregard that. For some other reason my completing-read is not completing anything anymore.#2019-09-1012:47dpsuttondo you use use-package and the lazily loaded helm/swiper hasn't been loaded yet?#2019-09-1012:48magnarsNo, that's not it. But I do use several ido-packages. Luckily I made a backup of my elpa-directory before upgrading, so I'll now dig in and find the culprit with some good old bisecting.#2019-09-1012:57magnarsTurns out it was my fault all along, unsurprisingly, I just noticed it right after upgrading cider. I had a function that would temporarily disable ido-ubiquitous-mode - and then sometimes fail to enable it again. Fixed with an unwind-protect#2019-09-1013:52Yehonathan SharvitHello there
Is there a way to automagically inject figwheel main when lauching a cljs repl.
I am getting this error
error in process filter: Figwheel-main is not available. Please check
#2019-09-1013:55Yehonathan SharvitWith clojure-cli#2019-09-1014:03pezThis seems to be the relevant doc. https://docs.cider.mx/cider/basics/clojurescript.html#_using_figwheel_main
You can add [com.bhauman/figwheel-main"0.2.3"] to your user deps.edn, if no one here shows up and tells us that it can be configured to be inlcuded in jack-in.#2019-09-1016:01robertkrahnIt should be enough to do (cider-add-to-alist 'cider-jack-in-cljs-dependencies "com.bhauman/figwheel-main" "0.2.3") I believe.#2019-09-1016:11dpsuttonmuch better to put it in an alias or a profile#2019-09-1016:11dpsuttonadding it to that alist will put it in every cljs project which seems inadvisable#2019-09-1016:56pezUnless the alist thing can be made so that it is “workspace” (using vscode terms…) local?#2019-09-1019:10Yehonathan Sharvit@dpsutton Why is it better to put it in an alias or a profile?#2019-09-1019:13dpsuttonIt’s a true dependency of your project. Nothing cider specific but your project depends on figwheel main#2019-09-1019:21pezThe development of the project depends on Figwheel Main. So it is not clear cut, I’d say. But, yeah, there are profiles for that, of course. Yet, it is also something CIDER could help with, when it sees that Figwheel Main is involved. Calva does, because I think it makes sense.#2019-09-1019:26dpsuttonsure. so put it in a dev profile/alias#2019-09-1019:27dpsuttonif you don't have that, how would anyone run your project. its not piggieback that a CIDER dep needs, its a dep required to compile your cljs#2019-09-1019:27dpsuttonCIDER shouldn't help with this because people not using CIDER need this as well#2019-09-1019:34pezYes, makes sense.#2019-09-1019:39Yehonathan Sharvit@dpsutton any idea how to add figwheel-main to dev profile for clojure-cli and let CIDER aware of it?#2019-09-1019:40dpsuttondo you mean how do you start CIDER with a profile/alias?#2019-09-1019:40magnars@viebel Add a .dir-locals.el file to root of project, specifying it for cider. Here's mine:
((nil
(cider-clojure-cli-global-options . "-A:dev")
(cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . ":dev")))
#2019-09-1019:41dpsuttonjust stick it in the dev profile. then you can use dir locals as posted above or you can use a prefix argument when jacking-in to edit the command#2019-09-1019:46Yehonathan Sharvithow do I pass aprefix arg to jack-in command? Sorry I am new to spacemacs?#2019-09-1019:48dpsuttoni actually don't know for spacemacs. But for emacs, the normal cljs-jack in command is C-c M-J and to send the prefix is C-u C-c M-J#2019-09-1019:48dpsuttonits just a control U before the normal invocation#2019-09-1019:49dpsuttonand quite possibly its the same#2019-09-1020:18Yehonathan SharvitThanks a lot @dpsutton and @dpsutton. You helped me made another small but significant step towards the epiphany#2019-09-1020:19dominicmSo useful he thanked you twice 😄#2019-09-1020:19dpsuttonthank @magnars for the helpful .dir-locals.el syntax. i get that wrong three times every time#2019-09-1020:36Yehonathan SharvitThanks a lot @magnars and @magnars#2019-09-1020:36Yehonathan Sharvit(Sorry for the typo @dominicm)#2019-09-1104:34dpsuttonis there any way to get CIDER stickers that you had made @bozhidar#2019-09-1106:40Karol WójcikIs it possible to switch repl from clj->cljs & cljs->cljs and then evaluate to form to corresponding repl?#2019-09-1106:51bozhidar> is there any way to get CIDER stickers that you had made @bozhidar
I think I’ve handed them all out during Clojure/south, but I plan to print some more down the road. I have to check how expensive it will be to ship stickers abroad. Alternatively one can order 10 stickers from https://www.stickermule.com/products/die-cut-stickers for $15. After playing with the size I’ve concluded they look best at 75x75mm (the actual sticker is much smaller - 20 x 75 mm).#2019-09-1106:53bozhidar@karol.wojcik Switch in which sense? There’s a command to cycle between the REPLs for a session, but this won’t affect the evaluation in them from source buffers.#2019-09-1209:12Karol Wójcik@bozhidar
1. I've connected to repsl via cider-jack-in-clj&cljs (I'm using shadow-cljs)
2. When I try to evaluate the form:
#?(:cljs
(println "Hello"))
the expression is send to clj repl instead of cljs.
The question is how can I send some expressions to clj repl and some expressions to cljs repl?#2019-09-1210:45bozhidarSo, you’re in a cljc buffer, right?#2019-09-1212:57Lucas BarbosaGuys, is there a way to debug functions defined with custom defns? I'm trying to debug a function declared through prismatic/schema's defn with no success#2019-09-1213:07Karol Wójcik@bozhidar Right!#2019-09-1310:59Karol Wójcik@bozhidar so there is no option to send value to cljs instead of regular clj repl?#2019-09-1311:03bozhidarAt some point I recall we were sending forms to both REPLs when working with cljc, but I’m not quite certain what’s the current state. You can open some ticket and I’ll check this when I can.#2019-09-1311:04bozhidarSee https://docs.cider.mx/cider/basics/clojurescript.html#_working_with_cljc_files#2019-09-1213:21simonkatz@lvbarbosa Just an idea… If CIDER doesn’t support it… if that’s a macro that’s expanding to a defn (I don’t know whether it is), you could use the macroexpansion in place of your definition.#2019-09-1213:26Lucas Barbosa😢#2019-09-1213:27Lucas BarbosaOh I thought it would show a text snippet. Well, that's the macroexpansion-1 of a function. I think I now understand why the debugger does not work on this#2019-09-1213:38simonkatzMaybe you could replace the things in that first let with defs, and then do the defn at the top level (just for debugging purposes). And there’s also that thing after the defn so you’d need that too.#2019-09-1719:29Lucas BarbosaSir, apparently there is a way to do it.#2019-09-1719:30Lucas BarbosaWhen I try to instrument the function, it triggers the debugger. I was hitting C to continue at that moment. Subsequent calls to the instrumented function would not trigger the debugger#2019-09-1719:30Lucas BarbosaInstead of continue, if you hit n (`next`), the function is successfully instrumented. Subsequent calls do trigger the debugger#2019-09-1722:22simonkatzAh, I think I recall that as a bug in an earlier version of CIDER. Are you on the latest version?#2019-09-1723:25Lucas BarbosaI'm using the latest version that is on MELPA: 20190911.1917#2019-09-1723:25Lucas Barbosaso weird#2019-09-1807:02simonkatzDo you get the same behaviour when you debug a defn form?#2019-09-1221:04borkdudehow can I configure emacs/clojure-mode/cider in such a way that it doesn't indent lines starting with a single semi-colon to the middle of the page?#2019-09-1221:15chepprey☝️oooh i wanna know this too#2019-09-1221:17cheppreyI wonder if it's related to classic Emacs Lisp convention at all? https://ftp.gnu.org/old-gnu/Manuals/elisp-manual-20-2.5/html_node/elisp_656.html#2019-09-1221:17chepprey... perhaps the triple-wink will stay aligned to the left?#2019-09-1222:35simonkatzI have a hook that does (set (make-local-variable 'comment-column) 0) — I think that’s why I don’t have single-semicolon comments jumping.#2019-09-1222:40simonkatzYes — I commented that out of my Emacs config and now my single-semicolon comments jump to the middle of the page.#2019-09-1309:21bozhidar> how can I configure emacs/clojure-mode/cider in such a way that it doesn’t indent lines starting with a single semi-colon to the middle of the page?#2019-09-1309:21bozhidarThat’s a classic Lisp convention, not a classic Emacs Lisp convention.#2019-09-1309:21bozhidarDifferent types of comments denote different things - ; denotes an inline comment.#2019-09-1309:22bozhidarSome Clojurists, however, like to use ; everywhere which caused a bit of debate on the subject.#2019-09-1309:23bozhidarSee also https://github.com/clojure-emacs/clojure-mode/issues/516#2019-09-1309:23bozhidarGenerally, however, I think it’s a bad idea to dispense with the semantics of different comments just for the convenience of typing less ; characters.#2019-09-1309:25bozhidarThere’s more on the subject here.#2019-09-1309:31bozhidarhttps://stackoverflow.com/questions/6365334/lisp-commenting-convention#2019-09-1309:32bozhidarAnyways, at some point this will be configurable in clojure-mode, but right now you have to resort to doing some hack if you need it.#2019-09-1310:07simonkatz(An answer at that link mentions Common Lisp single-semicolon comments starting at column 40, but I’m pretty sure that when I used LispWorks Common Lisp that didn’t happen. But maybe I’d changed some default.)
I agree with the different semantics of different numbers of semicolons. For trailing comments, I’d like auto-formatting to do one of two things: (1) leave them as they are, or (2) leave the first of a series as it is and align comments on following lines with the first one.
There are more details and examples at the somewhat-opinionated http://blogish.nomistech.com/how-to-comment-in-clojure/#2019-09-1310:51bozhidarGreat article! I totally agree that the current default for ; to align them at the 40th column is pretty weird and this should probably be improved in general in lisp-mode.#2019-09-1314:05simonkatzI’ve just started playing with shadow-cljs. I have things working nicely with a cider-jack-in-cljs, but if I try to connect to an existing shadow-cljs nrepl server with cider-connect-cljs I’m hitting problems.
Is that something that should work? (Just wondering if I should persevere or give up.)#2019-09-1314:06dpsuttonDoes the shadow build your connecting to have the correct dependencies for cider? And are you using the “shadow-connect” reply type when connecting? (I think that’s the right one)#2019-09-1314:17simonkatzI don’t see “shadow-connect”. How about “shadow-select”? When I try that, I end up with a REPL that sesman-browser seems to think is a CLJ REPL. (But I’m in a slightly strange state at the moment, and probably need to revert some of the hacks I’ve made to try to get things working. For example, I’m using the version of CIDER on master; maybe I should use what my package-list-packages gives me instead.)#2019-09-1314:19simonkatzMy shadow-cljs build has :plugins [[cider/cider-nrepl "0.22.3"]].#2019-09-1314:19simonkatzI’ve tried earlier versions of that too.#2019-09-1314:21dpsuttonAnd do you have piggieback in the mix?#2019-09-1314:21simonkatzNo. 🙂#2019-09-1314:21dpsuttonthis is how CIDER cranks up a shadow project:
> Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d cider/cider-nrepl:0.22.0 server#2019-09-1314:22dpsuttonyou can see everything involved there. i think cider-nrepl can't talk to a cljs environment without piggieback.#2019-09-1314:23simonkatzOK — thanks. Will look at the docs again too.#2019-09-1314:50bozhidar> you can see everything involved there. i think cider-nrepl can’t talk to a cljs environment without piggieback.
Shadow doesn’t use piggieback, but it emulates its API. And, of course, all the ClojureScript support depends on cider-nrepl.#2019-09-1315:05simonkatzI have things working — all very nice!
I’ve simply added the following to my project.clj:
:profiles {:dev {:dependencies [[cider/cider-nrepl "0.22.0"]
[cider/piggieback "0.4.1"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}}
I hadn’t understood that I need piggieback on the CIDER side (although not on the shadow-cljs side).#2019-09-1315:05simonkatzThanks for the help and comments.#2019-09-1315:05dpsuttonDoes shadow wrap the handlers like piggieback does?#2019-09-1315:16bozhidar@dpsutton See https://github.com/thheller/shadow-cljs/blob/a4fc198a2296fdc53590b28d7afaefec03909e0e/src/main/shadow/cljs/devtools/server/nrepl_impl.clj#2019-09-1315:18bozhidarThe shadow nREPL middleware seems much cleaner to me compared to piggieback. We were actually chatting with @thheller that this can potentially become a simpler alternative to piggieback if someone wants to work in this direction. Or some ideas can be applied to piggieback. Unfortunately that’s beyond my understanding of ClojureScript.#2019-09-1318:03simonkatzI said earlier that I got cider-connect-cljs working with shadow-cljs.
It turns out that if I create both a CLJ and a CLJS REPL, things are sensitive to the order in which I create them.
If I first connect to shadow-cljs and then create a CLJ REPL (saying yes to the “create sibling?” prompt), all is fine.
If I first create a CLJ REPL and then connect to shadow-cljs, things don’t work well. I don’t get asked to “Select shadow-cljs build” and I end up with a REPL whose name has “(clj)” at the end instead of “(cljs)“. My application’s single ns is listed by (all-ns), but (ns-publics 'my-namespace) returns an empty map. If I try to evaluate a form in a CLJS file’s buffer, nothing seems to happen — no value is reported.
Perhaps I should raise an issue somewhere. (And if so, would that be for CIDER?)#2019-09-1318:07simonkatzI should have said: I entered (all-ns) and (ns-publics 'my-namespace) in the REPL buffer.#2019-09-1318:25Ian FernandezGuys, when I jack-in using emacs#2019-09-1318:25Ian FernandezI'm having this problem:
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: misc/requiring-resolve, compiling:(nrepl/middleware/print.clj:180:21)
`#2019-09-1318:25Ian Fernandezanyone knows why?#2019-09-1322:56rschmuklerHey all! I'm in the process of upgrading https://github.com/Foxboron/HyREPL to work with the latest version of Hy (I think I'm done!)... I'm now trying to test things out using Cider via cider-connect. It looks like cider is expecting a few middleware that are outside of the minimum nrepl spec (I see calls for out-subscribe and init-debugger) and it seems to be breaking either the server or the client. Should cider be working okay without these?#2019-09-1411:17bozhidar@rschmukler Yeah, it should work without them, at least to some extent.#2019-09-1411:21bozhidarThe bigger problem is that CIDER is kind of coupled with Clojure and will try to evaluate some Clojure code here and there.#2019-09-1411:25bozhidarMight be easier for you to test with https://github.com/sanel/monroe, although it also assumes it’s working with Clojure. One big things that’s missing today is a generic nREPL client, as clients today are typically part of a much bigger and more complex package.#2019-09-1602:39Matthew CurryHi all! Would like to know what’s the best way to start a cider repl with a tools.deps.alpha project (deps.edn), and have it load one of the project’s namespaces like a it does with a leiningen project?#2019-09-1605:14ahungryDitto#2019-09-1606:36bozhidar@mjcurry This comes straight from Lein - it sets some ns as the default ns and that gets reflected in CIDER. If there’s a way to set a default ns in tools.deps I guess this will work automatically as well. CIDER just starts the REPL with whatever *ns* is at the time. Technically we can have some configuration in CIDER about the default ns, but this wasn’t necessary so far.#2019-09-1800:20Matthew Curryah so that’s what lein is doing. thanks.#2019-09-1800:24Matthew CurryJust tried it again, and it doesn’t appear that any of the project’s namespaces are loaded, or at least running cider-repl-handle-shortcut’s ns command doesn’t have any of them.#2019-09-1611:37vinurshello, i use shadow-cljs with cider, but in the cljs file, i can not use C-x C-e to execute the last expression, is that i have no project.clj in the project root dir, so the refactor-nrepl doesn’t enabled?#2019-09-1611:39Christian JohansenI'm seeing this a lot in CIDER now: error in process filter: Sync nREPL request timed out (op eval code (require 'figwheel.main))#2019-09-1611:39Christian Johansenusing CIDER to jack-in-cljs with figwheel-main. is there a known reason for this?#2019-09-1611:48Christian Johansenhmm, figured it out after trying to start the process from a shell. there was a compilation problem. where could I have seen this in CIDER?#2019-09-1612:15plexuspossibly in the *cider-repl ...* or *nrepl-server ..* buffers#2019-09-1612:42Christian Johansenyeah, I probably should've checked the *nrepl-server ..* buffer. would be nice if what goes on there was more "in your face". I've been burned by seemingly silent failures that were reported there before#2019-09-1614:15dpsutton@haiyuan.vinurs what behavior do you observe if you prevent clj-refactor from being included?#2019-09-1614:22vinurs@dpsutton disable clj-refactor-mode in the buffer?#2019-09-1614:22dpsuttonprevent clj-refactor from being injected into the project#2019-09-1614:22dpsuttonif you want to know if clj-refactor is breaking your evaluation, prevent the jar being included and see if it fixes your evaluation#2019-09-1706:33magnarsWhy is my cider suddenly trying to connect to https://clojuredocs-edn.netlify.com?#2019-09-1706:33bozhidar@magnars It’s downloading from there an export of the clojuredocs database.#2019-09-1706:34bozhidarGenerally it should do it only once and cache it afterwards.#2019-09-1706:34magnarsAha. I’m currently on a train with no network, so it’s a bit inconvenient that it stops my repl from working. :)#2019-09-1706:35bozhidarPreviously the Grimoire integration was doing http requests on demand, but when we swapped this for ClojureDocs there wasn’t a real API so we cooked this service that generates an EDN export of all data every day from the official json export.#2019-09-1706:36magnarsI see. That makes sense. I’ll tether my phone to get the update. #2019-09-1706:36bozhidarYeah, we obviously missed this part. 🙂 People behind firewalls were also in for a surprise.#2019-09-1706:36bozhidarI guess we should try to do something sensible in the absence of internet connection.#2019-09-1706:49dominicmAlso make it background#2019-09-1707:11bozhidarYeah, that’s a good point.#2019-09-2008:39jumar@U051BLM8F I also hit this issue today while travelling. It was in a project where everything already worked for a few days before so not sure how many times it tries to update the cache...
But it basically made repl experience very poor - no docs showing (for fns at least, Java classes seemed to work), couldn't jump to function definition (`cider-find-var`), etc.#2019-09-2008:40jumar#2019-09-1706:36magnars🙃#2019-09-1720:04simonkatzIs there a good way to cider-jack-in using a Leiningen profile? I’ve defined my own variable in .dir-locals.el with value “with-profile +clj”, and added advice to cider-jack-in-params to prepend this value (if the variable is defined).
This feels like a nasty hack.#2019-09-1720:26simonkatzAh — I’ve dumped that and defined an alias in project.clj as follows: {"repl" ["with-profile" "+clj" "repl"]}.#2019-09-1802:23Ian Fernandezguys, how can I use cider with shadow-cljs node-repl?#2019-09-1802:23Ian FernandezI'm having some problems on the repl recognizing deps#2019-09-1803:48Ian Fernandezthat was related to this#2019-09-1802:24Ian Fernandezshadow-cljs.edn
{:deps true
:builds {:cloud-function {:target :node-library
:main firstfunction.firstfunction.foo/hello
:output-to "index.js"
:compiler-options {:optimizations :simple}
:exports-var firstfunction.firstfunction.foo/exports}
:test {:target :node-test
:output-to "target/firstfunction.firstfunction.js"
:compiler-options {:optimizations :simple}
:autorun true}
}}
#2019-09-1802:25Ian Fernandezdeps.edn
{:paths ["resources" "src"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.520"}
org.clojure/core.async {:mvn/version "0.4.500"}
org.clojure/tools.logging {:mvn/version "0.5.0"}
ch.qos.logback/logback-classic {:mvn/version "1.2.3"}
tick {:mvn/version "0.4.17-alpha"}
com.lucasbradstreet/cljs-uuid-utils {:mvn/version "1.0.2"}
cljs-bean {:mvn/version "1.3.0"}
thheller/shadow-cljs {:mvn/version "2.8.51"}
funcool/promesa {:mvn/version "2.0.1"}}
:aliases {:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "0.10.0-RC1"}}}
:main-opts ["-m" "cognitect.test-runner" "-d" "test"]}
:build-cloud-function {:main-opts ["-m" "shadow.cljs.devtools.cli" "compile" "cloud-function"]}}}
#2019-09-1803:50Ian Fernandezhere, yes#2019-09-1802:26Ian Fernandezwhen I try M-x cider-jack-in-cljs
using shadow-cljs it gives me:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: env: node: No such file or directory
#2019-09-1802:27Ian FernandezI've added on emacs path the nvm path#2019-09-1802:27Ian Fernandezto execute#2019-09-1803:08Ian Fernandezand when I connect from an external repl initialized on a terminal I can't require mine dependencies#2019-09-1803:22dpsuttonWhat command do you run from a repl and what error message or behavior do you observe when you connect#2019-09-1803:37Ian Fernandez[nREPL] Starting server via /home/ianffcs/.nvm/versions/node/v12.10.0/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.22.0-beta8 -d nubank/midje-nrepl:1.2.0-SNAPSHOT server
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive
error in process sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive#2019-09-1803:31dpsuttoni'm heading to bed so most likely culprits:
1. when starting from the repl. you aren't including the necessary cider-nrepl middleware. Do another jack-in-cljs and see the startup command used (it can be found in *Messages*) and connect to a shadow started from the terminal with that same startup command
2. you still don't have npx on the exec-path for emacs. try running (shell-command-to-string "which npx"). If it returns nil or some kind of message saying no command is found, you need to keep going. I used to use nvm but it didn't play nicely with emacs so i switched to a more traditional installation method#2019-09-1803:37Ian Fernandez[nREPL] Starting server via /home/ianffcs/.nvm/versions/node/v12.10.0/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.1 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.22.0-beta8 -d nubank/midje-nrepl:1.2.0-SNAPSHOT server
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive
error in process sentinel: Could not start nREPL server: /usr/bin/env: “node”: unexistent directory or archive#2019-09-1803:38Ian Fernandezthis are in messages buffer#2019-09-1803:41dpsuttoncan you run node in your terminal?#2019-09-1803:42dpsuttoni think i ran into this with a custom installation directory and shadow expects node to be at /usr/bin/env. Not sure. that's just guess and hazy recollectoin#2019-09-1803:42Ian Fernandezyeah#2019-09-1803:43Ian Fernandez$which node
gives me#2019-09-1803:43Ian Fernandez/home/ianffcs/.nvm/versions/node/v12.10.0/bin/node
#2019-09-1803:43Ian Fernandezmaybe I'll make some symbolic links on bin?#2019-09-1803:44dpsuttonand can you run npx shadow-cljs?#2019-09-1803:45Ian Fernandezyeah#2019-09-1803:46Ian Fernandezmy symbolic links worked#2019-09-1803:46Ian Fernandez=')#2019-09-1803:46Ian Fernandezkinda sad if I have to upgrade nvm#2019-09-1803:48Ian FernandezSyntax error (FileNotFoundException) compiling at (src/firstfunction/firstfunction/foo.cljs:1:1).
Could not locate cljs_bean/core__init.class, cljs_bean/core.clj or cljs_bean/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
#2019-09-1803:48Ian Fernandeznow it's giving this when I try to load the namespace#2019-09-1803:48Ian Fernandezthat was related to this#2019-09-1803:48dpsuttonno idea. do you require cljs-bean anywhere?#2019-09-1803:48dpsuttonor is that some transitive dep?#2019-09-1803:48Ian Fernandez(ns firstfunction.firstfunction.foo
(:require
[cljs-bean.core :refer [bean ->clj ->js]]))#2019-09-1803:48Ian Fernandezhere#2019-09-1803:49dpsuttonand did you add that dep?#2019-09-1803:50Ian Fernandezhere, yes#2019-09-1803:51dpsuttonis that a clj or cljs file?#2019-09-1803:51Ian Fernandezcljs#2019-09-1803:52dpsuttonweird that its saying its looking for .class, clj, or cljc files#2019-09-1803:52Ian Fernandez#2019-09-1803:52Ian FernandezI rerun the repl and it's like these now#2019-09-1803:53dpsuttonask in #shadow-cljs i think there may have been a bug with the node-* repls#2019-09-1803:53dpsuttonits saying its not connected to an app there#2019-09-1803:55Ian Fernandezalso, when I load the buffer#2019-09-1803:56Ian Fernandezit's eternal loading =<#2019-09-1803:56dpsuttonit can't load. you still have a clj repl. it hasn't connected to the js runtime#2019-09-1803:57dpsuttonwhich explains the reason why its trying to load cljs bean as a clj lib#2019-09-1803:57Ian Fernandezyeah, I thought it would be something like this#2019-09-1803:57Ian Fernandezthanks 😃#2019-09-1803:57Ian FernandezI'll try to load that stuff on IntelliJ for now =<#2019-09-1804:45Ian Fernandezaw#2019-09-1804:45Ian FernandezI did it @dpsutton!#2019-09-1804:46Ian Fernandezhttps://andrearichiardi.com/blog/posts/clojurescript-cursive-shadow-setup.html => We need to run that JavaScript file in the node runtime in order to get to our REPL, therefore we run in a terminal ...#2019-09-1804:46Ian Fernandez😃#2019-09-1805:46malchIs there a way to disable suitable?#2019-09-1805:48malchIt breaks for me with the latest snapshot (I'm using CIDER with shadow-cljs)#2019-09-1806:33bozhidar@malch Currently that’s not possible, but if you submit a bug report probably @robertkrahn is going to address it pretty quickly.#2019-09-1806:34bozhidarMaking it possible to disable suitable is in our todo list.#2019-09-1806:41malchOk, thanks! Will do it later today#2019-09-1915:03vinurshello, i use shadow-cljs 2.8.53, and in emacs cider-connect-cljs [nREPL] Establishing direct connection to localhost:53629 ...
[nREPL] Direct connection to localhost:53629 established
error in process filter: user-error: The shadow-cljs ClojureScript REPL is not available
error in process filter: The shadow-cljs ClojureScript REPL is not available#2019-09-1915:05thheller(defun cider-check-shadow-cljs-requirements ()
"Check whether we can start a shadow-cljs REPL."
(unless (cider-library-present-p "shadow.repl")
(user-error "The shadow-cljs ClojureScript REPL is not available")))#2019-09-1915:05thhellercan someone update that check? shadow.repl was never the implementation namespace 😛#2019-09-1915:05thhellerbetter test for shadow.cljs.devtools.server.api or so#2019-09-1915:05thheller@haiyuan.vinurs as a temp fix you can create (ns shadow.repl) in your project I guess#2019-09-1915:06thhellerjust src/shadow/repl.clj or whatever your source path is#2019-09-1915:09dpsuttonThese in general should be warnings somewhere. These are approximations and should guide people when things fail but not fail the process on their own#2019-09-1915:11dpsuttonI would just edit the source of the function and remove the body. Maybe I can change all those user errors to be warnings or stings spit out in the repl buffer#2019-09-2007:26bozhidar> These in general should be warnings somewhere. These are approximations and should guide people when things fail but not fail the process on their own#2019-09-2007:27bozhidarHow can this be a warning? Generally if the required dependency is missing all you get is a weird error. The idea of those checks was to actually repackage the error into something more understandable.#2019-09-2007:28bozhidar> I would just edit the source of the function and remove the body. Maybe I can change all those user errors to be warnings or stings spit out in the repl buffer
It used to be like this, but I wanted to prevent the creation of an useless buffer that doesn’t work as expected.#2019-09-2007:29bozhidar> can someone update that check? shadow.replwas never the implementation namespace#2019-09-2007:29bozhidar@thheller Sure, I can update that.#2019-09-2007:30bozhidarI just needed some ns from the project to check, as this was the only way to figure out if shadow-cljs is available or not. What happened with this ns? Its name sounded somewhat central to me. 😄#2019-09-2008:24thheller@bozhidar it was related to a REPL experiment that never went anywhere, I removed it in a cleanup since nobody was accessing what it provided anyways (not even me). the actual CLJS REPL implementation lives in shadow.cljs.repl but better check for an "official" API namespace like shadow.cljs.devtools.api#2019-09-2008:41bozhidarUnderstood.#2019-09-2008:50bozhidarI’ve just updated this check in CIDER’s master.#2019-09-2009:10erwinrooijakkersHi all#2019-09-2009:11erwinrooijakkersWhen I do cider-jack-in-clj&cljs I get this message:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.1\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.0-beta6\"\] -- repl :headless :host localhost...
And Figwheel does not work then, it shows the Figwheel Dev page instead of the wanted index.html.
A colleague has a working dev environment and has this output:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.4.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.21.1\"\] -- repl :headless :host localhost...
As can be seen he uses refactor-nrepl 2.4.0 instead of 2.5.0-SNAPSHOT and cider/cider-nrepl-0.21.1 instead of 0.22.0-beta6.
How can this be configured?#2019-09-2216:52practicalli-johnDid you get this working? I don't think the minor version numbers should make a difference.
Sometimes clearing the browser cache in the browser dev console can help#2019-09-2420:43erwinrooijakkersThanks. Not yet. Reboot and clearing things does not help.#2019-09-2009:12erwinrooijakkersAnd also piggieback 0.4.0 instead of 0.4.1#2019-09-2009:25erwinrooijakkersUsing Spacemacs#2019-09-2009:33jumar#2019-09-2010:21bozhidar@jumar I have to check this, but I have we try to update the cache every couple of days.#2019-09-2010:23jumarwould be great if it could be just skipped if connection doesn't work.#2019-09-2011:58yuhanIs there any reason why cider-eval-last-sexp displays its overlay result at the end of the line instead of the sexp itself?#2019-09-2012:02yuhanI traced the source and found that cider--make-result-overlay takes a cons cell, but cider--display-interactive-eval-result only ever passes single points/markers to it#2019-09-2012:04bozhidarI don’t remember our reasoning from back then at all. 🙂 Might have been some oversight on our part.#2019-09-2012:05yuhanok, will open a PR to fix it 🙂#2019-09-2012:23bozhidar:thumbsup:#2019-09-2106:15manuel@bozhidar @thheller FYI: with latest CIDER and shadow-cljs I now have a CLJS REPL and a CLJ REPL as expected. Thank you very much for the work you put into these tools.#2019-09-2106:57bozhidar@manuel Happy to hear this! All the credit goes to @thheller who did the actual work on shadow’s side.#2019-09-2107:14pez@manuel, @bozhidar: what has changed? (Asking for a friend, i.e. Calva 😄)#2019-09-2107:15bozhidarNothing user-facing. Just some cleanup/refactoring of the nREPL support in shadow-cljs.#2019-09-2107:16bozhidarhttps://github.com/thheller/shadow-cljs/commit/92bb8076f6d1774bdbcf32dc8b0e14ce949c769a#2019-09-2215:15shemi too noted with delight the double repls working again perfectly#2019-09-2317:03ennI am seeing this error when I try to connect with cider-connect-cljs after choosing shadow-select. I don't believe it is related to the changes mentioned above from this weekend--I get an identical error with the latest stable CIDER as with the latest snapshot.#2019-09-2317:04ennIt looks like the project name is unexpectedly nil.#2019-09-2318:07bozhidarYeah, it seems so.#2019-09-2318:07bozhidarFrankly, I don’t recall whether we’ve tried starting a ClojureScript REPL outside of some project and it seems you’re doing exactly this.#2019-09-2318:08bozhidarFor something like shadow this doesn’t make much sense as you won’t have build files and the shadow dep won’t be injected in your project.#2019-09-2318:09bozhidarActually I didn’t read very well your stacktrace - seems you’re just doing connect, not jack-in, so this should work, but you did invoke it outside of a project dir which is probably the problem.#2019-09-2318:09bozhidarWorth reporting an issue I guess.#2019-09-2318:44hiredmanhttps://github.com/clojure-emacs/cider-nrepl/blob/9020b61672121725a3a8a9283fe2caaf1545cf20/src/cider/nrepl/middleware/test/extensions.clj#L16 this breaks the evaluation order of =, so effects that happen from more happen before effects from expected#2019-09-2319:16bozhidar@hiredman Please, file a ticket for this.#2019-09-2319:17bozhidarI’m surprised it causes any issues as this code has been around for quite a while and I don’t really anyone sharing such a problem so far.#2019-09-2406:31bozhidarAlready fixed on master - https://github.com/clojure-emacs/cider-nrepl/pull/650#2019-09-2410:38witekHi. I am using Spacemacs with CIDER. My projects are configured via deps.edn. When I cider-jack-in-clj in my main project, all CIDER functions (like code completion) work in namespaces of this project. But I also have multiple projects, my main project depends on. When I open a file from one of these projects, code completion does not work there. I have included the other projects via extra-paths in my deps.edn. Is there a way to make CIDER work in these dependency projects as well? Thank you!#2019-09-2411:07yuhanprobably sesman-link-with-project is what you're looking for 🙂#2019-09-2508:58witekThank you! This pushed me into the right direcktion! 🙏#2019-09-2414:13ennI recently attempted to upgrade CIDER. With all versions of cider-nrepl above 0.20.0, I see this error attempting to start a lein repl:
Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
<stacktrace>
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context
#2019-09-2414:13ennHas anyone seen this?#2019-09-2414:25dpsuttonwhat exact steps are you doing? how are you starting everything up#2019-09-2414:31ennlein repl#2019-09-2414:31ennwith this profiles.clj:
{:repl {:plugins [[cider/cider-nrepl "0.22.3"]]}}
#2019-09-2414:33Mario C.I am also having issues with CIDER after upgrading. Its only happening in one project and I believe the issue lies with tools.nrepl and nrepl both being pulled in as dependencies. Although I do not have tools.nrepl listed a dependency in the project.clj nor do I see it in the deps tree. I also do not have a profiles.clj at the .lein level.#2019-09-2414:35dpsuttoncheck deps-tree ?#2019-09-2414:35dpsuttonsorry plugin-tree#2019-09-2414:38ennSorry, I am not familiar with plugin tree, only lein deps :tree. How do I see the plugin tree?#2019-09-2414:39dpsuttonlein deps :plugin-tree will factor in your plugins#2019-09-2414:39ennIt looks like I'm getting nrepl 0.5.3 somehow even though cider-nrepl depends on 0.6.0. That may be the problem. I will try to figure out why that's happening.#2019-09-2416:15bozhidar@enn That’s generally not an issue.#2019-09-2416:16bozhidarWhat’s your lein version?#2019-09-2416:16ennlein itself (2.8.3) was depending on nrepl 0.5.3, overriding cider-nrepl's dependency on 0.6.0. I upgrade to the latest lein, which depends on 0.6.0, and now it works fine.#2019-09-2416:17bozhidarYeah, I was just about to suggest moving to Lein 2.9.1.#2019-09-2416:17bozhidar@mario.cordova.862 I’m guessing you’re on some old version of lein as well, right?#2019-09-2416:20Mario C.No, this actually started happening after upgrading to Lein 2.9.1#2019-09-2416:24bozhidarCan you share the deps tree of the project in question?#2019-09-2416:35Mario C.yes#2019-09-2416:35Mario C.one sec#2019-09-2416:37Mario C.Just had a moment of lucidity#2019-09-2416:38Mario C.I wasn't looking at the right deps tree since I start the repl with lein with-profile clj,dev and ive been looking at lein deps :tree#2019-09-2416:38Mario C.I see the tools.nrepl now so I think i can fix, sorry about that thanks! 😅#2019-09-2417:05Mario C.Now that I got rid of the tools.nrepl I dont see the message but It still freezing. Here is the backtrace I got Debugger entered--Lisp error: (quit)
accept-process-output(nil 0.01)
nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false") #<buffer *cider-repl Projects/decision-service:localhost:63335(clj)*> nil)
cider-nrepl-send-sync-request(("op" "version" "prefix-rewriting" "false" "debug" "false"))
cljr--call-middleware-sync(("op" "version" "prefix-rewriting" "false" "debug" "false") "version")
cljr--middleware-version()
cljr--check-middleware-version()
cljr--init-middleware()
run-hooks(cider-connected-hook)
#f(compiled-function () #<bytecode 0x4631a541>)()
#f(compiled-function (buffer) #<bytecode 0x4503830d>)(#<buffer *cider-repl Projects/decision-service:localhost:63335(clj)*>)
#f(compiled-function (response) #<bytecode 0x44bb38dd>)((dict "id" "4" "session" "7abfa665-75ed-4a05-82d3-2e2d5dfe88ab" "status" ("done")))
#f(compiled-function (response) #<bytecode 0x44bb391d>)((dict "id" "4" "session" "7abfa665-75ed-4a05-82d3-2e2d5dfe88ab" "status" ("done")))
nrepl--dispatch-response((dict "id" "4" "session" "7abfa665-75ed-4a05-82d3-2e2d5dfe88ab" "status" ("done")))
nrepl-client-filter(#<process nrepl-connection> "d2:id1:42:ns40:com.pm.decision-service.handler7:session36:7abfa665-75ed-4a05-82d3-2e2d5dfe88abed2:id1:47:session36:7abfa665-75ed-4a05-82d3-2e2d5dfe88ab6:statusl4:doneee")#2019-09-2417:06Mario C.@bozhidar#2019-09-2506:29bozhidar@mario.cordova.862 I’m assuming you still have some outdated deps. This error is coming from clj-refactor, not from CIDER. Probably removing it/updating it will solve your problem.#2019-09-2517:36jumarHow do people deal with an extensive logging inside cider repl buffer?
It's really making my Emacs slow. And I don't even have a huge amount of data, just usual DEBUG logs from my application - wouldn't even think about it having run the repl in the terminal but Emacs/Cider seems to be pretty bad at handling larger volume of output in the buffer#2019-09-2518:22practicalli-john@jumar I would use an external logger like Elastic search and Kibana and send logs data as objects, or at least just write it to a file (and open it in fundamental mode)#2019-09-2518:25jumarWell that's quite overkill 🙂. It's pretty handy to have logs on STDOUT (i.e. in the repl buffer) and it's not a tremendous amount of logs.
Some docker-related best practices even recommend that approach#2019-09-2708:31rickmoynihanuse a logger like log4j with slf4j and include a log4j.xml on the classpath in dev that directs logs to a file.
in prod include a different log4j.xml in the classpath and send the logs to stdout or where-ever you want.
Use tools.deps aliases or lein profiles to do this.
This is what we’ve done for years and it works well.#2019-09-2709:15jumarHmmm. that could work; but it's just quite handy to see logs in my emacs immediately as I evaluate things.
Also for debugging/tracing: I can copy printed data easily...#2019-09-2709:16jumarI hoped there we some configuration tweaks I could do to make it faster, but seems there's not much...#2019-09-2710:42rickmoynihanThere is an emacs mode for tailing log files#2019-09-2710:42rickmoynihaniirc it ships with emacs these days#2019-09-2710:43rickmoynihanauto-revert-tail-mode#2019-09-2518:49ccannhow do you add refactor-nrepl using tools.deps to get rid of this error:
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
#2019-09-2518:50ccannI’ve tried adding the dependency to :extra-deps in my alias, which doesn’t seem to work#2019-09-2519:06ccannI can’t find anything about this in the docs for tools.deps#2019-09-2519:23dpsutton@jumar some healthy use of C-u C-c C-o to clear the repl buffer should tidy it up#2019-09-2519:29jumarYes, that's what `I use very often, but even one batch processing job can make Emacs slower for quite a while...#2019-09-2519:30dpsuttonyeah. unfortunately emacs doesn't handle long lines well. you can turn off font-locking in the repl buffer if you like. At work i'm gonna soon pipe logging to a rotating file for this very reason#2019-09-2519:30dpsuttonfireplace users don't know our pain 😞#2019-09-2521:32agfyi: M-x clojure-align messing up lambdas by separating # from (. Can someone fix it?#2019-09-2613:35flefiki had this same issue. Do you know how you fixed it?#2019-09-2616:31agDo you have something like this in your config?
(with-eval-after-load 'clojure-mode
(dolist (c (string-to-list ":_-?!#*"))
(modify-syntax-entry c "w" clojure-mode-syntax-table)
(modify-syntax-entry c "w" clojurescript-mode-syntax-table)))
#2019-09-2616:47flefikyes!#2019-09-2616:47flefikremove the #?#2019-09-2616:54agYup#2019-09-2521:34agnevermind, I think it’s due to my local change in my config#2019-09-2522:42escherizeI'd like to have cider(?) look for metadata on a var (similar to the :arglists metadata) , and show me some different eldocs... can someone point me toward the code I should look at for that off hand?#2019-09-2522:44escherizeHere [ https://github.com/clojure-emacs/cider/blob/master/cider-eldoc.el#L221 ] maybe?#2019-09-2613:35flefiki had this same issue. Do you know how you fixed it?#2019-09-2710:34pezWhat would CIDER do? (A question I often ask, when hacking on Calva). Right now I don't have Emacs handy, though, so here goes. What does CIDER do when you evaluate to comment and an error is thrown?#2019-09-2712:45rickmoynihan;; => is what I get 😐#2019-09-2712:45rickmoynihanWhen running M-x cider-pprint-eval-last-sexp-to-comment on (throw (ex-info "foo" {}))#2019-09-2712:46pezThanks! It is sort of true. But I think I'll try to include some little more info. 😃#2019-09-2712:47rickmoynihanYes it is… I also get the *cider-error* buffer pop up — not sure if configuring it differently would change the behaviour though#2019-09-2713:00pezI'm looking at how to support the Design Journal that @jr0cket mentioned in the ClojureScript podcast better. Then it makes sense to include some of the error message in the comment, me thinks.#2019-09-2713:44bozhidar@rickmoynihan That’s definitely a bug. 🙂 It’d be nice if you reported it. I think nothing should be printed in the comment at all in such cases and users should just get the error buffer.#2019-09-2713:54rickmoynihanhttps://github.com/clojure-emacs/cider/issues/2718#2019-09-2713:58bozhidarThanks!#2019-09-2714:10pez> I think nothing should be printed in the comment at all in such cases and users should just get the error buffer.
That's what Calva does today. 😀 But it makes a boring design journal. #2019-09-2714:12bozhidarI’ve got no issues with boring. Printing the condensed error message is always an option, but it seems pointless to me if you get a stacktrace buffer alongside anyways.#2019-09-2714:19pezIt is in the design journal context that I think it is not pointless: https://github.com/jr0cket/tictactoe-reagent/blob/master/src/tictactoe_reagent/core.cljs#2019-09-2714:31practicalli-johnI will sometimes copy the most interesting part of an error message to a comment under the expressions#2019-09-2714:32practicalli-johnEspecially of it's a useful learning experience or a common error the team experiences#2019-09-2714:57yuhansomewhat related, but I'd actually like it if there was an option to display error messages in the result overlay without popping up an error buffer#2019-09-2714:59yuhan90% of the time it's a simple typo and I don't need to see the entire stacktrace and spend half a second dismissing the popup window#2019-09-2715:27practicalli-john@qythium what you ask for is what I use clj-kondo for, it picks up typos and many other errors and warnings. It works as a backend to flycheck#2019-09-2716:43yuhanYeah, I use flycheck-clj-kondo also, but it doesn't pick up on everything (eg. "typos" where I pass arguments in the wrong order)#2019-09-2716:50yuhanjust hacked together a prototype to try out over the next few days and see if it's a good idea 🙂#2019-09-2721:17bozhidar@qythium I like the idea. Feel free to send a PR.#2019-09-2721:18bozhidarI guess the only thing we need to consider is how to summon the stacktrace buffer in those cases, as I assume we won’t be showing it if we are relying on the overlay to communicate the error.#2019-09-2804:42yuhanI suppose we could overload cider-inspect-last-result to show the stacktrace buffer in case of an error?#2019-09-2804:42yuhanconceptually it's the same sort of action - "see more" of the output#2019-09-2806:36bozhidar@qythium Yeah, that sounds reasonable. I guess there are many places where we don’t handle in a smart manner getting an error instead of a result.#2019-09-2806:37bozhidarFor inspect another option would be to pass the inspector the stacktrace as a raw inspectable datastructure.#2019-09-2810:02pez@qythium: This has been tried and tested in Calva since start, and it certainly seems to be a good idea. i have also been wanting to make it easy to inspect the error further.#2019-09-2904:21deep-symmetryI have this crazy Clojure project, beat-link-trigger, which is luring an interesting set of people to learn a little Clojure so they can create crazy integrations as part of their DJ shows. But when people want to go beyond one-liners they copy and paste form my user guide, it is quite painful today, because the embedded editor that I can offer is very limited. Some syntax coloring, and that’s about it. So I am working on embedding an nREPL server so people can use CIDER or Cursive to get a much nicer Clojure experience as they are tinkering.#2019-09-2904:24deep-symmetryFollowing the CIDER docs, I almost got it working, but it turns out that if you are in Java 11, you need to explicitly specify -add-modules jdk.javadoc or the cider-nrepl handler crashes because it is trying to access doclet classes that are not available by default. This means that I can’t offer a simple double-clickable Jar file any more, and I need to figure out what to do about my JDK-embedded native Windows and Mac apps as well. Is this a known issue, and are there any plans to remove this dependency or make it fail more gracefully when the javadoc module is not available?#2019-09-2904:26deep-symmetryAnd a more fundamental question, is adding the cider-nrepl handler safe for situations when CIDER is not being used, such as if someone is connecting via Cursive instead? Or do I need to make that a user-configurable choice?#2019-09-2905:58deep-symmetryI opened an issue about the module dependency, but can anyone answer my question about injecting cider-nrepl and having other editors connect? https://github.com/clojure-emacs/cider-nrepl/issues/651#2019-09-2906:13bozhidarI definitely can’t. I didn’t even know they had moved this out of the default list of modules.#2019-09-2906:15bozhidarProbably we can make this optional, but it will break the javadoc related functionality. It’s strange I can’t see anything in the changelog for JDK 11 about this module.#2019-09-2906:16bozhidar> And a more fundamental question, is adding the cider-nrepl handler safe for situations when CIDER is not being used, such as if someone is connecting via Cursive instead? Or do I need to make that a user-configurable choice?#2019-09-2906:17bozhidarIn theory it is, but it really depends on how the client is implemented. As long as it doesn’t throw some errors on receiving unknown messages, everything should be good.#2019-09-2909:21cflemingI’ve found this not to be the case, and several times I’ve had to get users to remove CIDER middleware to make their projects work with Cursive. I generally don’t enquire much about whether it previously worked with CIDER or not, so it may just be that those projects are borked, I’m not sure.#2019-09-2909:21cflemingHere’s an example from the other day, this was on reading a lein project:
Error reading /Users/andrew/IdeaProjects/trying-clojure/project.clj
Syntax error compiling at (cider/nrepl.clj:1:1).
Could not locate clojure/tools/nrepl/server__init.class, clojure/tools/nrepl/server.clj or clojure/tools/nrepl/server.cljc on class path.
#2019-09-2909:22cflemingThe CIDER middleware often seems to cause problems reading the lein projects in Cursive, it’s not so much once the project is actually working.#2019-10-0511:08bozhidar@U0567Q30W The error you’ve mentioned seems like a standard dependency issue - either old nREPL and new cider-nrepl or the other way around. I was speaking in terms of the nREPL interface provided by cider-nrepl. Dependency issues are dependency issues and have nothing to do with it. 🙂#2019-09-2906:22deep-symmetryThanks. I think what I will do for now is give the use the option of trying to load cider-nrepl but refusing to launch the nREPL server if they request cider-nrepl and the doclet classes are missing (I can just use reflection to check that at runtime). Then I can give them an error about needing to run with the -add-modules argument and a link to some help about it.#2019-09-2906:35deep-symmetryThe plot thickens… Even under JDK 11, if I run my project via Leiningen (and cider-jack-in), this package is available. But when I run it as an überjar by double-clicking (or java -jar), then it isn’t.#2019-09-2907:09deep-symmetryOk, I closed the issue, it is looking more like a problem with the jar launcher on my Mac than with cider-nrepl. Sorry about the false alarm.#2019-09-2907:14deep-symmetryAs of JDK 11, the concept of users double-clicking on a Jar file to run a program is dead anyway, so I will have to update my instructions. (I provide native installers for Mac and Windows anyway, so unix people will just have to use the command line.)#2019-09-2917:55bozhidarGot it. Thanks for the follow-up!#2019-09-3011:58alexyakushevHey folks#2019-09-3011:58alexyakushevI've stumbled upon a problem of error buffer not popping up because deep inside stacktrace middleware parse-java fails with java.lang.IllegalAccessError: com/sun/tools/javadoc/Messager$1#2019-09-3011:59alexyakushevWhen this is called: https://github.com/clojure-emacs/orchard/blob/master/src/orchard/java/legacy_parser.clj#L70#2019-09-3012:02alexyakushevShould the whole function be wrapped into try-catch Error or is there something else to do about it?#2019-09-3017:29bozhidar@alexyakushev Did you notice anything special about the code triggering the error? I’ve never seen such a problem so far and I’m curious what might be the root cause of it.#2019-09-3017:32ghadiare you on 9+ ?#2019-09-3017:32alexyakushevInterestingly enough, it's not easily reproducible. I don't get this error when working in fresh REPL. But I can reliably reproduce it in a complex project after I use tools.namespace to reload the namespaces.#2019-09-3017:33alexyakushevAnd only if I do that as a boot repl hook. It's very convoluted:) And doesn't reproduce in other cases.#2019-09-3017:33alexyakushev@ghadi Nope, 1.8.0_222#2019-09-3017:34ghadi¯\(ツ)/¯#2019-09-3017:35alexyakushevYeah, my sentiment exactly:)#2019-09-3017:36bozhidarOrchard has two different parsers - one for JDK 8 and one that’s modules aware for JDK 9+.#2019-09-3017:37bozhidarAs the legacy parser has been around for a very long time I’m always surprised to see some new issue report for it.#2019-09-3017:38alexyakushevI'll try to work a bit more with this, see if I can make a small reproducible case. Thanks meanwhile#2019-09-3017:43bozhidar:thumbsup:#2019-09-3017:54Lucas BarbosaI am looking for a way to automatically trigger evil-insert-state whenever cider--debug-mode happens (and go back to evil-normal-state afterwards). Anybody knows a good way to do it in Spacemacs?#2019-09-3018:00practicalli-johnPerhaps ask in #spacemacs channel#2019-09-3021:26jjttjjI did a fresh linux install a few weeks ago and only ever installed jdk 12 using sdkman. Now when I cider-jack-in it's somehow using java 1.8. Anyone know where that might be coming from?#2019-09-3021:27dpsuttonprobably ask in #clojure#2019-09-3021:28jjttjjwill do thanks#2019-10-0101:58frozenlockI have websockets between client applications and my backend. Is there an easy-ish way to forward/tunnel nrepl from the clients by using the backend?#2019-10-0105:08solfI'm trying to connect to a running figwheel session. I started it using lein figwheel, it said Starting server at 0.0.0.0/3449, then I connected using cider-connect-cljs to localhost:3449. Is that correct?
Here's the errors in *Message*:
[nREPL] Establishing direct connection to localhost:3449 ...
[nREPL] Direct connection to localhost:3449 established
nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1 time-stamp 2019-10-01 13:04:11.403736153)
(It works using cider-jack-in-cljs, I'm just trying to learn how repl connections and stuff work behind the scenes)#2019-10-0105:09frozenlock@dromar56 port 3449 is probably for your browser.#2019-10-0105:10frozenlockYou might be able to find the nrepl port in the figwheel configuration under the key :nrepl-port.#2019-10-0105:12solfOh thanks. There's no :nrepl-port, I guess that means the project wasn't supposed to be used that way. I'll add it and see how it goes#2019-10-0113:30dpsuttontests have been failing on CIDER for a while due to:
- Installing [ 3/11] spinner (1.7)... not available
- Installing [ 4/11] queue (0.2)... not available
#2019-10-0113:33bozhidar@dpsutton I know. Seems like some issue with GNU ELPA. I don’t think we can do much about this.#2019-10-0113:34dpsuttonbummer. surprising to see it take so long#2019-10-0113:34dpsuttonare there similar packages on melpa we can use?#2019-10-0114:17manuelthere was some talk on MELPA about spinner recently: https://github.com/melpa/melpa/pull/6462#2019-10-0115:13bozhidarI’ll have to ask Artur about this. We work together in the same company.#2019-10-0115:14bozhidar> are there similar packages on melpa we can use?
Probably we can think of something. I definitely don’t think queue is used much in CIDER and spinner is on MELPA already if I recall correctly.#2019-10-0117:29dogenpunkHi, I’m using cider-connect-clj (v0.23.0snapshot) to connect to a remote application running nrepl 0.7.0-alpha1. Cider makes a connection successfully, but I get intermittent errors:#2019-10-0117:29dogenpunkjava.io.FileNotFoundException: ?C:\Windows\system32\config\systemprofile\AppData\Local\orchard\clojuredocs\export.edn (The filename, directory name, or volume label syntax is incorrect)
#2019-10-0117:30dogenpunkERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns com.example.foo.handler, :symbol with-bindings, :session a36ec554-7565-4521-932d-6b29e5d49497, :id 7}#2019-10-0117:30dogenpunkAnyone else run into something like this?#2019-10-0117:34dogenpunkIt seems to go away when I turn off cider-eldoc-display-for-symbol-at-point#2019-10-0120:17bozhidar@dogenpunk It’s a but in Orchard that we’ve been unable to track down yet.#2019-10-0120:17bozhidarLet me dig up the original report.#2019-10-0120:18dogenpunkCool. Thanks!#2019-10-0120:18bozhidarSee https://github.com/clojure-emacs/orchard/issues/73#2019-10-0306:10bozhidarFYI - I plan to cut a new CIDER release over the weekend. If someone wants to get some fixes in - now would be the time to do so. 🙂#2019-10-0312:09orestisIf I throw ex-info with some data assigned to it, should CIDER show the ex-data somehow in the *cider-error* buffer? I'm still in cider 0.21.0 btw.#2019-10-0312:11orestisAha, CIDER does show the ex-data but not when I attach a "causing" exception.#2019-10-0313:56tianshuHi, will the clojurescript project size affect the completion speed?
I feel like the completion in my project is a little bit slow.
But it's just 6k lines of clojurescript.#2019-10-0313:58bozhidar@doglooksgood Did this slowdown begin with CIDER 0.22? Might be something to do with the new cljs completion we employ there.#2019-10-0313:58tianshumaybe, but I'm not sure. I see there's a new option to disable the enhancement cljs completion.#2019-10-0314:03tianshuin my case, the option seems doesn't work. I'm on version 20190926.701.#2019-10-0314:30tianshu😢 After upgrade, cider-find-var is broken.#2019-10-0314:53bozhidarThe option was introduced yesterday. 🙂#2019-10-0314:54bozhidarI don’t recall any changes to cider-find-var recently. What exactly is broken for you?#2019-10-0314:59tianshuIf I run cider-find-var, it will freeze for a while, then prompt for Symbol: #2019-10-0315:00dpsuttondoes it work after it prompts for Symbol:?#2019-10-0315:03tianshu@dpsutton No, If I input the symbol name, it will freeze again, then timeout.#2019-10-0315:03tianshuI hope to provide more information, but how?#2019-10-0315:03dpsuttoncan you enable nrepl message logging and see what's up?#2019-10-0315:09tianshu@dpsutton do you mean the message in nrepl buffer?#2019-10-0315:09dpsuttonm-x nrepl-toggle-message-logging#2019-10-0315:10dpsuttoninvoke the find-var, then check out the (nrepl) messages buffer#2019-10-0315:13tianshu#2019-10-0315:13tianshuThis error also occur with eldoc.#2019-10-0315:14tianshuI found it in nrepl buffer#2019-10-0315:14dpsuttoncan you check the nrepl messages buffer?#2019-10-0315:16tianshuyes, I'm trying#2019-10-0315:20tianshu#2019-10-0315:20tianshu@dpsutton I expand the errors, it's pretty long.#2019-10-0315:20dpsuttoncan you just grab the messages where you are looking for the var?#2019-10-0315:21dpsuttondon't need everything. its just a series of requests and responses. so find the requests that interest you. i think op will be "find-var" maybe?#2019-10-0315:23tianshu(-->
id "10"
op "eldoc"
session "b51c61f3-0280-4ed9-8a48-fa9807d4e826"
time-stamp "2019-10-03 23:18:33.774739750"
ns "cat-lotto.core"
symbol "cache/api-cache"
)
(-->
id "11"
op "eldoc"
session "b51c61f3-0280-4ed9-8a48-fa9807d4e826"
time-stamp "2019-10-03 23:18:33.847791097"
ns "cat-lotto.core"
symbol "mount/start"
)
(<--
id "9"
session "b51c61f3-0280-4ed9-8a48-fa9807d4e826"
time-stamp "2019-10-03 23:18:33.940008113"
err "ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns cat-lotto.core, :symbol mount/start, :session b51c61f3-0280-4ed9-8a48-fa9807d4e826, :id 11}
"
)
(<--
id "9"
session "b51c61f3-0280-4ed9-8a48-fa9807d4e826"
time-stamp "2019-10-03 23:18:33.959079063"
err "ERROR: java.lang.RuntimeException: EOF while readingUnhandled REPL handler exception processing message
{:op eldoc, :ns cat-lotto.core, :symbol cache/api-cache, :session at clojure.lang.Util.runtimeException(Util.java:221) b51c61f3-0280-4ed9-8a48-fa9807d4e826, :id 10}
"
)
I think this is it#2019-10-0315:23tianshusame error will occur on find-var and eldoc.#2019-10-0315:24tianshulooks like some form is not sent completely? the error says EOF.#2019-10-0315:35bozhidar@doglooksgood Seems your clojuredocs cache is corrupted.#2019-10-0315:36bozhidarProbably deleting it will fix the problem.#2019-10-0315:36tianshumaybe is because I stick the nrepl at version 0.4.5?#2019-10-0315:36tianshuyou mean .cpcache?#2019-10-0315:36bozhidarI think the current CIDER snapshot suppresses all such errors.#2019-10-0315:36bozhidarNo, it’s something like clojuredocs-export.edn. Don’t recall the exact file name.#2019-10-0315:38tianshuemmm, where can I find this file?#2019-10-0315:46tianshuOh, I know, .cache/orchard?#2019-10-0315:46tianshujust deleted it, now restart cider#2019-10-0315:46bozhidarYep, that’s the one.#2019-10-0315:47tianshuemm, the same problem#2019-10-0315:49tianshu@bozhidar that file export.edn in my case is not finished. It ends with something like:
{:added "1.0",
:ns "clojure.core",
:name "some",
:file "clojure/core.clj",
:static true,
:type "function",
:column 1,
:see-alsos
[:clojure.core/every?
:clojure.core/not-any?
:clojure.core/keep
:clojure.core/ke
#2019-10-0315:50bozhidarThat’s why CIDER blows up for you. It didn’t download properly for some reason.#2019-10-0315:50bozhidarYou can just retrieve it manually and replace whatever you current have.#2019-10-0315:51bozhidarhttps://clojuredocs-edn.netlify.com/export.compact.edn#2019-10-0315:51tianshuthis file will not change during development?#2019-10-0315:51bozhidarNo, it’s lookup only.#2019-10-0315:53tianshuIt works!#2019-10-0315:53tianshuvery sad to say, the network is always a huge problem in china.#2019-10-0315:54tianshuthank you very much!#2019-10-0316:06bozhidarYou’re welcome!#2019-10-0316:18Drew VerleeHi cider lovers.
I sometimes have a clojure test suite where i just want to run the "tests" at a "testing" point and all their children. e.g
deftest
testing
testing <--------- run this
is awesome
is really awesome
testing <--------- not this
is fail
i'm skimming the docs and the way to do this isn't jumping out at me. I know i can comment the code out, is there another way 🙂#2019-10-0316:19bozhidar@drewverlee I think this can’t be done, as what CIDER does internally is run the function created by the deftest macro.#2019-10-0316:21Drew VerleeAh ok. Thanks, at least i was right about the commands i was seeing. I had a bit of a head scratchier for a moment because i thought i was targeting a testing tree and i was actually getting everything in the macro 😖#2019-10-0319:48zaneI'm noticing some strange behavior when jacked into a deps.edn ClojureScript project.#2019-10-0319:49zaneWhen I start typing in a comment block I first see this printed after the third character or so typed:
{"type":"result","repl":"clojure-agent-send-off-pool-4","status":"success","value":"false"}
#2019-10-0319:50zaneThen I start getting repeated CIDER middleware errors.#2019-10-0319:51zaneI'm on 0.22.1.#2019-10-0320:31zaneMaybe this? https://github.com/clojure-emacs/cider-nrepl/issues/447#2019-10-0320:40zaneWhat on earth?#2019-10-0405:11bozhidar@zane Seems you’ve encountered a bug in clj-suitable, which you should report to @robertkrahn. In the mean time you can disable suitable via the configuration (if you’re on the CIDER snapshot).#2019-10-0405:16zaneI see! Thanks for the pointer. How did you know it was suitable?#2019-10-0406:19zaneNever mind. I see it there in the stack trace.#2019-10-0406:46bozhidarIndeed. 🙂#2019-10-0412:28robertkrahn@zane can you please share your project setup? what repl did you use? in what version? any other deps?#2019-10-0422:10zane@robertkrahn Of course! I'll try to create a minimally reproducible gist for you.#2019-10-0422:14robertkrahnThank you!#2019-10-0416:43manueldid something change again between CIDER and shadow-cljs? Can't seem to get 2 working REPLS (CLJS+CLJ) right now. I'm using shadow-cljs 2.8.59 and cider-nrepl 0.22.4-SNAPSHOT#2019-10-0416:44manuelno wait, false alarm#2019-10-0416:44bozhidarNothing has been changed on CIDER’s side recently.#2019-10-0416:44manuelrestarting everything made it OK. Sorry for the noise.#2019-10-0516:47bozhidarFYI - https://metaredux.com/posts/2019/10/05/hard-cider-project-specific-configuration.html#2019-10-0721:09blueberry@bozhidar Thanks for that tip! I have a technical issue with cider-selector's keybinding. I'm using the latest prelude/cider but C-c M-s says "C-c M-s is undefined". When I call cider-selector I get the prompt asking me to choose, so the functionality seems to be there. Is it expected that I connect that keybinding, or something else may be the problem? Arch Linux, it's latest emacs, updated prelude/cider...#2019-10-0721:27bozhidar@blueberry It’s bound only in clojure-mode. I’m assuming you tried to call it from some buffer where clojure-mode wasn’t active.#2019-10-0721:27bozhidarI guess I’ll have to add a note about this.#2019-10-0721:30blueberry@bozhidar I called it from a .clj buffer. Now I restarted the REPL, and it is active. Thanks! Solved (but better add that note to the doc)#2019-10-0721:34bozhidarHmm, that’s pretty weird.#2019-10-0809:56r0manHello, I'm having problems with alot of our projects at work when jacking in with cider. After jacking in, when I load a namespace with cider-load-buffer I sometimes get this clojure.lang.Compiler$CompilerException in the :compile-syntax-check phase saying some namespace can't be found. For example namespace 'taoensso.faraday' not found. I'm sure that this namespace exists on my classpath, because requiring this file manually by evaluating (require 'taoensso.faraday :reload) works. After loading random files in the project in a order I never remember I eventually can get the initial namespace loaded and can work from there. We do have a lot of dependencies and it might be that somewhere things are messed up. Any idea how to debug this?#2019-10-0810:08dominicm@r0man I would be betting that your project is using namespaces without requiring them 🙂 clj-kondo is pretty good at picking up on that.#2019-10-0810:08dominicmjoker might be too actually#2019-10-0810:10dominicmI'm lying, kondo doesn't catch this. Joker does though.#2019-10-0810:10borkdudeclj-kondo does report unused namespaces. can you give an example where it doesn't do this where it should?#2019-10-0810:11borkdudeoh you mean the other way around: you're using the namespace but you haven't required it. yeah#2019-10-0810:12dominicm@borkdude just found the "wontfix" issue 🙂#2019-10-0810:12dominicm@r0man in the past I've resolved this by writing a script to start a fresh JVM and require every namespace. That usually roots out any failures.#2019-10-0810:15dominicmSorry. Looks like the code is gone. It could be patched up with some clever grep + bash-fu though#2019-10-0810:19dominicmgrep -Poh '(?<=^\(ns )[a-z_\.]+$' **/*.clj will get you a list of namespaces#2019-10-0810:20dominicmdepending on lein, clj, boot, you'll have to differ what you do, but something like: while read -r namespace; do clj -e "(require '${namespace})"; done
And then you pipe these together. So#2019-10-0810:20dominicmgrep -Poh '(?<=^\(ns )[a-z_\.]+$' **/*.clj | while read -r namespace; do clj -e "(require '${namespace})"; done#2019-10-0810:13dominicmI'll see if I have the code anywhere.#2019-10-0810:13borkdudemight be worth reconsidering but I think it resulted in many false positives#2019-10-0810:33dominicmI think it's the right stance until a solution is found which knows about the env.#2019-10-0810:33dominicmactually, I do have an idea#2019-10-0810:34dominicmyou have the full list of namespaces from the initial analysis right? So if there's a use of a namespace from that list without an explicit require then it's a lint line.#2019-10-0810:36borkdudeThere are still things like Java classes and goog/...#2019-10-0810:36borkdudeOf course we could whitelist goog#2019-10-0810:36dominicmthat doesn't matter though 🙂#2019-10-0810:36dominicmyou're blacklisting the namespaces you found in analysis.#2019-10-0810:37dominicm(unless they are required)#2019-10-0810:37borkdudeyou mean from the export?#2019-10-0810:37dominicmanalysis cache.#2019-10-0810:37dominicmthose two terms have too much overlap 🙂 too much ambiguity.#2019-10-0810:38borkdudeit could be a custom linter which works on the export if you want to do it like that. but clj-kondo should always be able to work without the initial cache as well, so it's not an option to use that for built-in linting#2019-10-0810:38dominicmah, but it will still work! 🙂#2019-10-0810:38dominicmyou just won't get that kind of lint.#2019-10-0810:39dominicmif kondo doesn't know about any namespaces, then none of them will be on the blacklist, hence they will all be okay.#2019-10-0810:39borkdudeloading the entire cache isn't an option for built-in linting: it's too slow#2019-10-0810:39dominicmI don't understand. Isn't the cache used for e.g. arity checks?#2019-10-0810:39borkdudeyes, but kondo carefully only loads what it needs from the cache#2019-10-0810:40dominicmso, potentially, this could be carefully loaded?#2019-10-0810:41borkdudeit only loads namespaces from the cache which have been required by the user. it seems you want to know about all namespaces, even if they aren't required?#2019-10-0810:42borkdudeI have the same kind of problem with the private var linter. private vars might be validly used in other namespaces (e.g. foo.cljs + foo.cljc), but I can't really check for that while linting only one file. using the cache for this is too slow, because I'd have to scan all the previously linted namespaces as well#2019-10-0810:42dominicmwe only need to know if clojure.string exists or not, so the presence of the file is sufficient. The file doesn't need to be parsed necessarily. Alternatively you could spit out a tiny extra file with all the ns' in (assuming loading that doesn't take a long time that is)#2019-10-0810:43borkdudeif there is no cache yet, how can clj-kondo know about the existence of a namespace? it should be able to work with that#2019-10-0810:44borkdudeto prevent false positives#2019-10-0810:45dominicmthat's why you blacklist, not whitelist 🙂#2019-10-0810:46dominicm(when (and (file/exists? "cache/clojure.string") (not (required? ana "clojure.string")) (add-lint-error!))#2019-10-0810:46dominicmif there's no cache then file/exists? will not pass, and there will be no false positive.#2019-10-0810:46borkdudescenario without cache:
user types (foo/bar). clj-kondo doesn't know foo. so no error.
scenario with cache:
user types (foo/bar) and foo is in the cache. but hasn't been required. now you get an error?#2019-10-0810:46borkdudethat could work yeah#2019-10-0810:47borkdudeI'm finally getting it, thanks 😉#2019-10-0810:47dominicmbingo!#2019-10-0810:47borkdudeand this will be performant. yeah#2019-10-0810:47dominicmseems like a very good compromise imo 🙂#2019-10-0810:48borkdudehttps://github.com/borkdude/clj-kondo/issues/515#2019-10-0810:13dominicm@borkdude makes sense in a static sense because of the reasons you mentioned. 🙂#2019-10-0810:13borkdude(which issue was this?)#2019-10-0810:14dominicmhttps://github.com/borkdude/clj-kondo/issues/339#2019-10-0810:14r0manhey guys, thanks for the tips, trying joker then and see if it finds anything suspicious ...#2019-10-0810:35dominicmbetter way to list all namespaces: echo "(require '[clojure.tools.namespace.find :as f]) (run! println (f/find-namespaces (map *command-line-args*)))" | clj -Sdeps '{:deps {org.clojure/tools.namespace {:mvn/version "0.3.1"}}}' - src#2019-10-0810:21dominicmwhen I used joker it was a bit trigger-happy with this stuff. I'd go for the grep/require solution: https://clojurians.slack.com/archives/C0617A8PQ/p1570530047263100?thread_ts=1570529577.260100&cid=C0617A8PQ not very sophisticated.#2019-10-0810:21borkdudeyou might also be able to use the clj-kondo analysis export for this. right now it spits out:
:var-usages [{:filename "<stdin>", :row 1, :col 1, :from user, :to nil, :name foo/bar, :arity 0}]
:to nil = unknown, while the symbol does have a namespace#2019-10-0810:22borkdudeThis is the output from:
clj-kondo --lint - --config '{:output {:analysis true :format :edn}}' <<< '(foo/bar)'
#2019-10-0810:22dominicminteresting.#2019-10-0816:21bozhidarCIDER 0.23 is out https://metaredux.com/posts/2019/10/08/cider-0-23-lima.html#2019-10-0918:37r0man@dominicm @borkdude I got a step further with the problem I described above. All my problems went away when I removed clj-refactor from my setup. But now I want clj-refactor back 😕#2019-10-0918:44dominicmOh#2019-10-0918:44dominicmI may know the problem#2019-10-0918:44dominicmThere's an issue opened by Malcolm Sparks on one of the refactor repos#2019-10-0918:45dominicmIn big projects, the ast warming may still be happening as you are doing things, making 💥#2019-10-0918:46dominicmhttps://github.com/clojure-emacs/refactor-nrepl/issues/176#2019-10-0918:49r0manhaha, just reading about https://github.com/clojure-emacs/refactor-nrepl#warm-ast-cache#2019-10-0922:36agHey guys, anyone knows the best way to get fully-qualified name of the symbol-at-point?#2019-10-0922:39agoh… shoot… seems I already asked this question and I already have it in my config:
(defun cider-fully-qualified-symbol-at-point (args)
(interactive "P")
(let ((s (cider-interactive-eval (concat "`(" (cider-symbol-at-point t) ")"))))
(kill-new s)
(message s)))
#2019-10-0923:26agmeh, it doesn’t always work ;(#2019-10-0923:31agOkay, I did a bit of digging and made one that works:
(defun cider-fully-qualified-symbol-at-point ()
(interactive)
(let ((cb (lambda (x)
(when-let ((v (nrepl-dict-get x "value"))
(s (replace-regexp-in-string "[()]" "" v)))
(kill-new s)
(message s)))))
(cider-interactive-eval
(concat "`(" (cider-symbol-at-point t) ")")
cb)))
updated it: apparently quoting is better than using resolve - that way it works for keywords as well#2019-10-1011:54bozhidar@ag Why do you need this?#2019-10-1016:18agwell, to be honest it’s not that often when you need something like that. I was writing tests for a few complex functions that involved things from multiple namespaces and I was getting confused where the things are coming from.#2019-10-1017:08agAlso sorta related question. Didn’t we have something like “peek” where function definition could be previewed in a popup (without having to jump), similar how git-messenger:popup-message works? I’ve been looking for that, but can’t find it. I somehow thought something like that was already implemented#2019-10-1017:16bozhidarThat was deleted a long time ago, as after surveying users almost everyone said they preferred to just jump to the definition.#2019-10-1017:25agah I see. Not that I need it, just thought that I was sure we had it, but couldn’t find it#2019-10-1020:58mikerodWhen there are multiple repl buffers open & in a visible “window” of emacs in a project, eg. for a cider-jack-in-clj&cljs setup, I’ve noticed that cider-find-var often doesn’t work.#2019-10-1020:58mikerodsay I have 3 buffers in 3 windows, repl-clj, repl-cljs, source buffer for clj#2019-10-1020:59mikerodcider-find-var will not resolve the var (appears to do nothing)#2019-10-1020:59mikerodif I just delete-window on the repl-cljs, it then works#2019-10-1020:59mikerodso it’s as if the repl buffer being up causes “session confusion” or something?#2019-10-1021:20dpsuttonIt’s unfortunately based on the last visited repl so it doesn’t know about clj vs cljs repls. You don’t need to kill a buffer but just focus the one you want for a second#2019-10-1021:56mikerod@dpsutton ah ok, I’ll try that out#2019-10-1021:57mikerodstill sort of annoying, but at least better than having to close the window etc#2019-10-1021:57dpsutton100% agree#2019-10-1022:00mikerodthanks though. That’s actually not something I immediately realized and it makes it nicer to work with just having that info#2019-10-1022:00mikerodI feel enlightened#2019-10-1022:22dpsutton(cl-defmethod sesman-more-relevant-p ((_system (eql CIDER)) session1 session2)
(sesman-more-recent-p (cdr session1) (cdr session2)))
#2019-10-1022:23dpsuttonis the code#2019-10-1022:31mikerodAh nice!#2019-10-1107:38yuhanI got a bunch of errors recently when working offline and just navigating around a file, it looks like eldoc is trying to connect to Clojuredocs and throwing an exception:
ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns ***, :symbol if-let, :session 40218e58-e5a0-427c-8f71-4b37ea36214f, :id 30160}
java.net.UnknownHostException:
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:220)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
at java.base/sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:265)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:372)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
...
#2019-10-1107:38yuhanIs it a known issue? I recall seeing discussion about it recently but couldn't find any mention on the github page#2019-10-1110:30bozhidar@qythium Supposedly we fixed this in the most recent Orchard release, which is used by CIDER 0.23.#2019-10-1110:30bozhidarPerhaps you’re still on 0.22?#2019-10-1110:33yuhanI'm on 23.0 in emacs, but I start a repl in a terminal and then connect to it instead of jacking in, maybe the cider-nrepl dep is outdated#2019-10-1110:36bozhidarYou need cider-nrepl 0.22.4 if I recall correctly.#2019-10-1110:41yuhanThat's odd, I specified {cider/cider-nrepl "RELEASE"} in my deps.edn thinking it would always pull the latest version, but it was in fact 0.21.1 according to clj -Stree#2019-10-1110:41yuhanthanks for the help!#2019-10-1110:43bozhidarYou’re welcome!#2019-10-1110:43bozhidarFYI - that’s the commit that adds the internet connectivity check https://github.com/clojure-emacs/orchard/commit/8f86b04990b9ba0b801b2eaa2abe1d941b07e920#2019-10-1113:29yuhanNow I'm getting an odd middleware error on printing large data structures:#2019-10-1113:30yuhan(sorry for screenshot, the stacktrace doesn't appear anywhere else in the REPL output)#2019-10-1113:42yuhanI have no idea how to debug this further - any attempt to print values in the middleware functions results in a stackoverflow and having to restart the REPL#2019-10-1113:46yuhanbut it looks like inside cider.nrepl.middleware.track-state/make-transport, the variable status is expected to be a set but it gets passed a list (:nrepl.middleware.print/truncated)#2019-10-1113:52yuhanhere's an example input which triggers it, appears to be linked to the Emacs variable cider-print-quota
((fn gen [n]
(if (zero? n) 0 {n (repeat n (gen (dec n)) )}))
10)
#2019-10-1114:15bozhidarWhy did you disable print streaming in Emacs?#2019-10-1114:16bozhidarAlthough in general non-streamed prints should continue to function normally, so I’m not quite sure what’s the triggering the unhandled error.#2019-10-1114:28bozhidarBtw, it seems your error is coming from the track-state middleware, but we haven’t changed this in ages and I’m wondering how can something like this happen.#2019-10-1114:39yuhanoh, what's print streaming? I didn't disable anything in Emacs as far as I know#2019-10-1114:48bozhidarRead this https://metaredux.com/posts/2019/03/29/nrepl-0-6.html#2019-10-1114:48bozhidarBasically it splits big results over multiple nREPL messages to improve the response time and to make it possible to interrupt printing some huge output.#2019-10-1114:49bozhidarBy default CIDER will enable streaming.#2019-10-1305:10yuhanThis doesn't seem to be the case here?
https://github.com/clojure-emacs/cider/blob/master/cider-client.el#L328#2019-10-1305:12yuhanagain, I don't know how the internals work but changing that to "1" solved my issue#2019-10-1115:12yuhanhmm, I didn't disable that by setting cider-print-quota to nil, but changing the value of the quota changes the threshold where the error occurs.#2019-10-1115:35yuhaneven stranger, the error only happens in a project with dozens of dependencies (which I can't share here), and then only when the REPL session is started outside of emacs and connected instead of jacked in.#2019-10-1115:36yuhanI'll try to investigate further and provide a minimal repro#2019-10-1115:26jpmonettashi everybody! I see orchard.inspect/def-current-value which is exactly what I was looking for but I see no reference to it in cider-nrepl, am I missing something or is just not implemented yet?#2019-10-1309:42magraHi, thank you for Cider!!! Yesterday I startet getting completion Stacktraces. I am on cider0.24.0snapshot (package 20191009.1253), emacs 26.3, shadow-cljs 2.8.64, using jack-in clj&cljs, shadow-cljs with deps.edn for a browser (fulcro) target.#2019-10-1310:20bozhidarYou’ve encountered a bug in clj-suitable. You can set cider-enable-enhanced-cljs-completion to nil to disable it.#2019-10-1310:26magraThanks!!#2019-10-1415:02bozhidarThis made my day:#2019-10-1415:02bozhidar#2019-10-1415:03dpsuttonoutstanding!#2019-10-1415:03pezAchievement unlocked!!!!#2019-10-1415:04danielnealamazing congrats!!#2019-10-1415:05ivangalbansgreat 👏, congrats!!!#2019-10-1509:56MacrozAnybody know should this work or how CIDER tries to detect Shadow-CLJS projects? Asking before reading the source.#2019-10-1519:10MacrozI'll report here also that I was using my own forked clojure-mode that was old enough not to contain shadow-cljs files#2019-10-1513:00dpsuttonI’ve seen this before. Is it possible the warning is from refactor-clj which doesn’t recognize shadow cljs as a project root. Does everything still work? Possible to just remove refactor#2019-10-1514:48MacrozThat didn't seem to do a thing, and nothing still works.#2019-10-1514:49dpsuttongot a minimal repro? i'd love to investigate and help out#2019-10-1514:51Macrozhow about just do https://github.com/thheller/shadow-cljs#quick-start and switch to node-script#2019-10-1514:52dpsuttonah, i think shadow and CIDER don't play nice with node-script. But i don't remember the reason#2019-10-1514:55Macrozquite depressing#2019-10-1514:56MacrozI don't see it mentioned in the docs#2019-10-1514:57Macrozis there something I could do to fix it#2019-10-1515:05dpsuttoni don't remember the details. i asked in #shadow-cljs and can look into it#2019-10-1519:10MacrozI'll report here also that I was using my own forked clojure-mode that was old enough not to contain shadow-cljs files#2019-10-1613:58andrea.crottiit would be great to be able to configure cider to run tests with kaocha/repl#2019-10-1613:59andrea.crottiI can still run them from the repl and there is an emacs package to help with that as well I think#2019-10-1613:59andrea.crottibut if it could be made the default per project and cider could just use it would be even better#2019-10-1614:07manuelI use this:#2019-10-1614:07manuelhttps://github.com/magnars/kaocha-runner.el#2019-10-1615:49andrea.crottiYeah I tried that too#2019-10-1615:50andrea.crottiBut would be nicer if cider test could use kaocha directly#2019-10-1617:05bozhidarIsn’t kaocha mostly meant to be used as a command-line runner?#2019-10-1617:05bozhidarI haven’t had time to play with it yet, I’ve heard only great things about it, though. With @plexus involved I’d expect nothing else. 🙂#2019-10-1617:05bozhidarCan you explain to me how do you envision integration with kaocha to look like?#2019-10-1619:15andrea.crottiWell you can run it with kaocha.repl#2019-10-1619:15andrea.crottiWhich allows you to run inside the repl, and you can pass the same options you would pass to the command line#2019-10-1619:16andrea.crottiFor example kaocha does all the spec instrumentation by default without#2019-10-1619:16andrea.crottiSo running the same tests with cider or kaocha is not exactly the same unless you also instrument every namespace manually#2019-10-1619:18andrea.crottiI introduced it to many projects and found lots issues that were not detected otherwise#2019-10-1704:00jumarYou can just call stest/instrument and that's it - e.g. in project.clj#2019-10-1705:06myguidingstarI'm trying to cider-jack-in-cljs (in a dir having both project.clj and shadow-cljs.edn), with this:
Connected to nREPL server -
;; CIDER 0.23.0 (Lima), nREPL 0.6.0
;; Clojure 1.10.1, Java 11.0.3
but got this:
ERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/options {:right-margin 70}, :op init-debugger, :session edab9481-bbf5-4e25-b4c3-a39a94a4720c, :id 6}
Syntax error compiling at (cider/nrepl/inlined_deps/orchard/v0v5v3/orchard/java/parser.clj:1:1).
...
Caused by: java.lang.Exception: namespace 'cider.nrepl.inlined-deps.orchard.v0v5v3.orchard.java' not found
did I miss something?#2019-10-1709:39plexus@bozhidar kaocha is meant to be the holy grail of test running. It is great at the command line, it is great at the REPL (kaocha.repl), and it is great for tooling (kaocha.api)#2019-10-1709:40plexusalso potentially interesting: https://github.com/liquidz/kaocha-nrepl#2019-10-1709:41plexusI'd say the biggest benefit is that it transparently handles many test types. You can run Clojure, ClojureScript, Cucumber all exactly the same way. It's pretty feature rich out of the box, and has plugins to add whatever else people feel they need.#2019-10-1710:26bozhidarYeah, I guess that’d be quite beneficial in a tool like CIDER. Our current approach doesn’t work with ClojureScript at all currently. I’ll take a look at this middleware and the kaocha.api when I can. @andrea.crotti and whoever else has ideas about integrating Kaocha with CIDER is welcome to file tickets with suggestions what we can do.#2019-10-1712:40andrea.crottiok great thanks#2019-10-1810:34yuhanIs anyone else bothered by the fact that Cider requires the entirety of org-mode just for one function cider-docview-format-tables?#2019-10-1810:34yuhanI had to restart Emacs many times recently and noticed that it was adding 5-6 seconds to my startup time#2019-10-1810:36yuhanNot sure though if this would be considered an issue#2019-10-1812:59manuelI don't use Org-mode, but couldn't you defer CIDER loading to when you actually open a .clj/.cljs file?#2019-10-1813:26yuhanyes, that's what happens, but I open CLJ files immediately after starting Emacs so it almost counts as part of the startup time#2019-10-1822:59bozhidar@qythium I’m definitely bothered by this. 😄#2019-10-1822:59bozhidarI didn’t notice we were doing this.#2019-10-1905:03Thanh VuongWhat is cider function that can work like cider-find-var but for symbols which are functions arguments?
For example with this fn:
(defn me [a b]
(+ a b))
if my cursor is on symbol a on line 2, what will take me to the definition of a in line 1? Thanks#2019-10-1905:46yuhanI usually just use text-based commands for that, like the auto-highlight-symbol package#2019-10-1905:48yuhanahs-forward and ahs-backward in particular, inside a hydra which makes visually jumping around very fast#2019-10-1906:02Thanh Vuongthanks, I am using something similar to yours (`#` or * in spacemacs), but it feels lacking. I wish I have a function that jumps straight to the argument definition like cider-find-var does for other symbols other than function arguments.#2019-10-1906:28yuhanHmm, you could probably look at cider--parse-and-apply-locals for reference and hack together something of the sort#2019-10-1906:30yuhanFor myself, what I'd find useful is a cider-find-ns-var command that would completing-read all the vars in scope in the entire project, similar to Emacs' find-function / find-variable#2019-10-1915:28bozhidar@qythium If I recall correctly cider-find-var actually does this. Just press TAB. 🙂#2019-10-1916:57yuhanHmm, I couldn't get this to work.. pressing TAB doesn't do anything#2019-10-1915:30bozhidarNow that it’s easy to parse a method definition using parse-clj we can provide some lookup of locals relatively easy.#2019-10-1919:52agwhen you create a test namespace file, it gets created with a specific header, i.e. it automatically makes something like:
(ns my-app.foo
(:require [clojure.test :as t])
I would like to change this so it is always like this:
(ns my-app.foo
(:require [clojure.test :refer [deftest is testing]])
can somebody please point me to the relevant elisp code that is responsible?#2019-10-1921:26dpsuttonThat’s probably refactor I think? Clojure mode does the insert but I think I remember refactor adding the test stuff?#2019-10-1922:49yuhanyup that's the variable cljr-clojure-test-declaration#2019-10-2004:52bozhidarWe should probably move this to CIDER, as I don’t see much reason for this to be in cljr. It’s not really related to refactoring and I assume it’s not tied to anything complex in the other package.#2019-10-2005:22dpsuttonI think I’d be down for all of the non-nrepl refactoring to move over. If they don’t need the middleware and are decently understandable#2019-10-2015:44bozhidarThat has been the plan for a while now. 🙂 There’s no nREPL specific refactoring, but there are a lot of things that require an AST to work 9(e.g. rename-symbol). We’ve agreed a long time ago to move everything that doesn’t require the AST to orchard and cider-nrepl, but no one had much time to work on this. The AST-powered commands will be revisited once we figure out a better way to do the analysis. @benedek is working on some ideas in this area.#2019-10-2015:44dpsuttonoh great!#2019-10-2015:47pezRegarding AST, there is also the tree-sitter path. It was mentioned in some other channel. Thinking about how the AST situation is for Calva, it almost hurts thinking about all the ASTs that are built and thrown away all the time. I really should look at consolidating that…#2019-10-2015:49bozhidar@pez It’s not like we know tree-sitter is here to stay. 😄#2019-10-2015:49bozhidar(and I don’t think there’s a Clojure parser based on tree-sitter yet)#2019-10-2015:50pezI know. Just throwing it in here. 😃#2019-10-2015:51bozhidarThere are a couple of projects like https://github.com/oakmac/tree-sitter-clojure, but they don’t seem particularly mature. So, even if we go in this direction there’s some ground work that needs to be done.#2019-10-2015:51bozhidarGot it.#2019-10-2015:52bozhidarThe real value of tree-sitter would be if it really gets universally adopted. For our needs it’s all the same what do we use as long as it gets the job done.#2019-10-2015:54pezI’m pretty sure MS are not planning to adopt it. They have their own tech that they fancy for this.#2019-10-2016:03dominicmCould be done in user space though#2019-10-2016:11pezYeah, but in VS Code the built in syntax highlighter (for instance) is first class. Hopefully, whatever they decide to use, they will make the AST available to extensions.#2019-10-2016:22dominicmYou could use the ast for non highlighting though :)#2019-10-2016:49pezIndeed. #2019-10-2101:17Lucas BarbosaHey folks! I am having troubles to make cider and shadow-cljs play nice together. When I perform a cider-jack-in-cljs from the shadow-cljs.edn file, I get a repl working. However, I cannot evaluate code inside .cljs files, nor switch to the repl buffer. I get a message saying: No cljs REPLs in current session "clojure/app:localhost:62659". More info in the thread.#2019-10-2101:19Lucas BarbosaProject structure:
.
├── shadow-cljs.edn
└── src
└── my
└── app.cljs
shadow-cljs.edn:
{:dependencies
[]
:source-paths
["src"]
:builds
{:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:entries []}}}}
:dev-http
{8000 "public"}}
my/app.cljs:
(ns )
#2019-10-2101:21Lucas Barbosarepl buffer:
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (134 files, 1 compiled, 0 warnings, 1.92s)
To quit, type: :cljs/quit
[:selected :app]WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
shadow.user>
#2019-10-2104:40pezHave you connected to the app with the browser?#2019-10-2113:05Lucas BarbosaYep!
Screen Shot 2019-10-21 at 10.04.39 (3).png#2019-10-2113:05Lucas BarbosaWhen I cider-switch-to-repl-buffer from the shadow-cljs.edn file, It transports me to the repl buffer#2019-10-2113:06Lucas BarbosaIf I do it from a cljs file, it says No cljs REPLs in current session "clojure/acme-app:localhost:55074"#2019-10-2113:06Lucas Barbosa(This is anothe sample project btw)#2019-10-2113:07Lucas BarbosaI got in through a cider-jack-in-cljs -> localhost -> 55074 -> shadow -> :frontend#2019-10-2114:23pezThe web page is blank. It's your app showing a blank page?#2019-10-2114:25Lucas BarbosaYes, the html only has a script tag referencing the javascript build result#2019-10-2114:25Lucas BarbosaI am just trying to setup a development environment#2019-10-2114:32pezWhat do you have in the console of that page?#2019-10-2114:33Lucas Barbosaa "Hello World" from my init-fn and two shadow-cljs messages, one saying "websocket connected" and other saying "repl session start successful"#2019-10-2114:34Lucas BarbosaI can evaluate code at the repl buffer in Emacs. It sends the code to the browser and gets the result back. What I cant't do is evaluate code in the cljs buffer#2019-10-2114:35pezWhich version of shadow-cljs is this?#2019-10-2114:35Lucas BarbosaI can't also perform a cider-switch-to-repl-buffer. It says "No cljs REPLs in current session", even though there is one#2019-10-2114:35Lucas BarbosaOne important detail is that the repl buffer says "clojure" instead of "clojurescript"#2019-10-2114:36Lucas Barbosa> Which version of shadow-cljs is this?
{:tag :a, :attrs {:href "/cdn-cgi/l/email-protection", :class "__cf_email__", :data-cfemail "55263d34313a227836393f2615677b6d7b6360"}, :content ("[email protected]")}#2019-10-2114:37pezTry with 2.8.52#2019-10-2115:03Lucas BarbosaIt worked!#2019-10-2115:21pezIt's a temporary glitch in shadow right now. Being worked on. #2019-10-2116:16thhellerso apparatently cider-nrepl will clone the nREPL session after it has been upgraded to CLJS. can anyone tell me why? pretty sure that most things aren't cloneable in a CLJS session#2019-10-2116:17thhellerie. sending 1 to one CLJS session and 2 to the clone will still affect the *1 of the first#2019-10-2116:42pezIs it cider-nrepl or cider that does this? Cider, right?#2019-10-2116:48thhellerhmm right, no clue. could be cider or cider-nrepl#2019-10-2206:28bozhidar@thheller cider-nrepl doesn’t do anything with sessions, so I guess you mean CIDER itself. However, some pointer to the code would be useful as I’m fairly certain we start a regular Clojure session and just run the ClojureScript init code in it.#2019-10-2207:56pezSo, with shadow-cljs 2.8.65, if you cloned the session after that init code was run, then you would get an unpromoted session. It seemed like that was happening to @lvbarbosa, yesterday. However, shadow-cljs 2.8.66 fixed that, so we can keep cloning the CLJS sessions, even if we should not assume our clones are very isolated from each other. (Which I did, thinking it would work similar to how it is with CLJ sessions.)#2019-10-2210:45bozhidar@pez Well, how related can they be? After all they’d have a different set of session bindings, right?#2019-10-2210:48pezNot sure what session bindings mean here. For a lot of bindings, they share them. So, for instance, *1 is shared. Which is not the case for two Clojure sessions.#2019-10-2211:03bozhidarHmm, that sounds weird. Each nREPL session is backed by a different thread and has its own thread-local bindings for *1 and friends. I think we copy some of those on clone, but they are independent from one another afterwards.#2019-10-2211:07bozhidarThe implementation is pretty simple https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/middleware/session.clj#L124#2019-10-2211:08bozhidarAnd that’s what cloning does https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/middleware/session.clj#L227#2019-10-2213:33pezThe user has two CLJS sessions in Calva. One backing the editor, and one for the REPL prompt. Evaluating something in the editor changes *1-3 for the REPL prompt. Is there a similar test that can be carried out for CIDER?#2019-10-2214:25bozhidarIn CIDER we use the same session for the editor and the REPL, but I we can always find some way to test what happens with two different sessions.#2019-10-2214:30dpsuttoni thought we used two different sessions on the same connection
(response-main (nrepl-sync-request:clone client-conn))
(response-tooling (nrepl-sync-request:clone client-conn t))
#2019-10-2215:23bozhidarWe do, but they are not used like @pez is using them in Calva. In CIDER the main session is used for user-triggered evaluations and the second is reserved for tooling commands that are based on evaluating some code. The tooling session exists for two reason - not to block user evaluations and not to overwrite the results (`*1`, etc) in them.#2019-10-2215:36dpsuttonyes. which seems to go right against "we use the same session for the editor and the repl". unless for the editor means evaling from the editor and not the tooling stuff of the editor#2019-10-2215:36dpsuttoni guess i misread it at first 🙂#2019-10-2215:41pezThen it should be possible to test if *1 is isolated by evaluating something and then trigger the tooling to evaluate something and then evaluating *1.#2019-10-2214:40mgrbyteGetting a strange error all of a sudden:
Exception in thread "nRepl-session-17f6fff6-e0c0-4846-a078-f6e5b35df3ec" java.lang.NullPointerException
Can't seem to find any more info (no other cider or nrepl buffers other than repl)
I did upgrade cider this morning, but getting this now both with cider 0.24.0snapshot/cider-nrepl 0.23.0-snapshot and cider 0.23.0-SNAPSHOT + cider-nrepl 0.22.0/0.23.0-SNAPSHOT.
Can anyone point me to where to look to figure out what I've done/what the source exception is please?#2019-10-2214:42mgrbytecontext: this happens when running tests within cider with cider-run-project-tests#2019-10-2215:28bozhidarThat’s pretty strange. I don’t recall any related changes recently, but also it’s hard to say what’s wrong without a full stacktrace.#2019-10-2218:22Zac BirHi, all. I’m trying to figure out how to integrate the cider debugger with a running quil process. I can debug a function in the repl, having C-u C-M-x it previously, but I typically run the quil sketch with C-c C-k to get it going and any debugging decoration disappears from the source view. I’ve asked in #quil, but it’s pretty low-traffic.#2019-10-2222:44Drew VerleeArent cider versions usually in sync?
WARNING: CIDER 0.23.0-snapshot requires cider-nrepl 0.22.4-SNAPSHOT, but you're currently using cider-nrepl 0.23.0-SNAPSHOT. The version mismatch might break some functionality!
#2019-10-2307:42bozhidarNot anymore. As many editors are using cider-nrepl we’ve decided to decouple CIDER releases from cider-nrepl releases.#2019-10-2306:18MartinI can't seem to get cider to pass my arguments to clj:#2019-10-2306:18Martin(use-package cider
:ensure t
:after (clojure-mode)
:init
(setq cider-clojure-cli-global-options "-A:dev")
:config
(setq cider-clojure-cli-global-options "-A:dev")
(setq nrepl-log-messages t)
(add-hook 'cider-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'eldoc-mode)
(add-hook 'cider-repl-mode-hook #'paredit-mode)
(add-hook 'cider-repl-mode-hook #'rainbow-delimiters-mode))
#2019-10-2306:19Martin[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.22.3"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2019-10-2306:19Martinhow can I debug this?#2019-10-2307:43bozhidarDid you restart Emacs/reload your config after making those changes?#2019-10-2309:44mgrbyteYes; i use two other packages that depend on cider (`helm-cider` and flycheck-clojure) - so did a package-del -> eval pinning code -> package-ins -> restart dance before testing anew.#2019-10-2309:52mgrbyteI figured it out, but not sure how to fix (fix running tests in cider I mean).
I'm using clojure CLI tools. Tests work with that from the command line however, which made me realise that the only thing I've changed that I think that could cause this within cider is that I moved the inclusion of webasets (resources subfolder) into an alias (to support depstar's way of uberjar-ing)... which probably means that I need to figure out how cider runs tests under clj. I have some code that reads configuration from the resources folder which is causing the NPE.#2019-10-2309:54mgrbyteI guess there's a few options:
1. Put the "resources" folder back into :paths in deps.edn, move the webassets elsewhere. Means tests can't hit any code path that hits the static resources route in the webapp tho.
2. Move the reading of configuration into a fn (instead of a module-level def) such that the exception doesn't ocur when attempting to load the namespaces/files.#2019-10-2314:38Martin@U051BLM8F yes I’ve restarted emacs everytime I’m making changes#2019-10-2306:40agCan we add something like this to cljr-clean-ns
(defun cljr-ns-align ()
"Align ns requires."
(interactive)
(end-of-buffer)
(when (re-search-backward "^\(ns.*\\(\n.*\\)*\(:require" nil t nil)
(mark-sexp)
(align-regexp (region-beginning)
(region-end)
"\\(\\s-*\\)\\s-:")))
My team recently decided to start aligning requires and I think we like that. It probably should be done maybe via middleware, but I don’t know where the relevant code is.#2019-10-2307:40dominicmhttps://github.com/clojure-emacs/refactor-nrepl#2019-10-2309:16yuhanlooks like it's a text formatting matter and shouldn't involve the middleware at all?#2019-10-2309:17bozhidarGenerally all sort of formatting functions that don’t require middleware or external deps should end up in clojure-mode. We’ve actually been moving out things from clj-refactor in recent years, but at a rather slow pace due to our limited time.#2019-10-2316:42ag> looks like it’s a text formatting matter and shouldn’t involve the middleware at all?
Well, I was looking at cljr-clean-ns and it seems using middleware. Also maybe it should be possible to have similar functionality not just in Emacs.#2019-10-2401:28jrwdunhamHey cider-maniacs. I'm using spacemacs and cider and I'm an emacs ignoramus. I'm wondering if there is a standard technique for refreshing my dependencies after I update my project.clj (or deps.edn) without quitting spacemacs and starting it up again (as I'm currently doing). cider-restart doesn't seem to do it. Thanks in advance for any help.#2019-10-2401:45dpsuttonCider-quit and then jack in again#2019-10-2401:45dpsuttonYou need to dump the process and restart. Killing emacs accomplishes that but is a bit bigger fly swatter than what is required #2019-10-2404:10jrwdunhamthanks @dpsutton#2019-10-2406:17bozhidarJust as an FYI - cider-restart restarts only the connection to the nREPL server, not the nREPL server itself.#2019-10-2406:19bozhidarThere’s sesman-restart command which does what you want - C-c C-s r.#2019-10-2409:38Carsten HeisterkampHi, I am new clojure and try to set it up with emacs but it doesnt appear in the package list. I am using the clojure friendly config from the book for the brave and true and also tried to install via the Melpa repo instructionshttp://stable.melpa.org/#/cider as well as the additions mentioned here https://docs.cider.mx/cider/basics/installation.html it just does not appear. Using it on windows 10. any help appreciated!#2019-10-2409:40yuhanwhat's the value of your package-archives?#2019-10-2409:43Carsten HeisterkampHow do I check this, I am new to emacs#2019-10-2409:49yuhanC-h v ( describe variable ), then type package-archives#2019-10-2409:50yuhanC-h f describes functions, and C-h k keybindings, those are your most helpful friends for starting out on Emacs 🙂#2019-10-2409:53Carsten HeisterkampMany thanks 🙂 Its value is (("gnu" . ""))#2019-10-2409:57yuhanyup, you need to add Melpa to that list#2019-10-2409:58yuhan(add-to-list 'package-archives
'("melpa" . ""))#2019-10-2409:58yuhanput that in your init file#2019-10-2410:00Carsten HeisterkampThat is the strange thing, I have it in my ini file#2019-10-2410:03yuhanWhere did you name and place your init file?#2019-10-2410:03yuhanmake sure it's not being shadowed by anything else#2019-10-2410:04yuhaneg. ~/.emacs takes precedence over a ~/.emacs.d directory#2019-10-2410:07yuhanHonestly I don't like that Brave Clojure starts out with asking people to learn Emacs, you should use whatever editor you're already using and comfortable with#2019-10-2410:07yuhanEspecially on Windows which I believe has its own set of issues with Emacs#2019-10-2410:10Carsten HeisterkampIt definetly has not only with Emacs. It is a breeze on linux or Mac and installing clojure on Win was already complicated due to the windows security rules and powershell etc#2019-10-2410:11Carsten HeisterkampThe emacs directory is in the user folder and on in AppData Roaming I guess this could be the reason#2019-10-2410:00practicalli-john@ch the Emacs setup in BraveClojure is really out of date. Ignore that setup and use the excellent docs at https://docs.cider.mx/cider/basics/installation.html#2019-10-2410:02Carsten HeisterkampI used the one from the github repo which was updated some month ago. Will check the above docs many thanks!#2019-10-2414:17FiVoAny evil users here? If so, have you somehow setup some cider-eval for visual selection?#2019-10-2500:48yuhanI use evil + lispyville, and lispy-eval works out of the box with visual selection#2019-10-2500:48yuhanwhich I have bound to S-RET#2019-10-2500:49yuhanbut you could always define your own:
(evil-define-key 'visual clojure-mode-map ... 'cider-eval-region)
#2019-10-2511:36FiVoThe visual selection actually works out of the box with C-c C-v r, but I didn't switch the namespace so I thought it wasn't. My bad.#2019-10-2418:36Drew VerleeWhen running cider-jack-in and choosing clojure-cli (deps)
1. is it necessary to specifyi nrepl and any other dependcies for this to work? The docs suggest no.
2. how would one specify any devevelopment dependices? is it jusing an alias like :dev ? does cider know to look for specific keyworks or do i have to specify them when running cider jack in.#2019-10-2419:58practicalli-johnI believe with Cider 0.23 onwards it should prompt you for aliases to run. Otherwise you can create a dir-local.el file, for example https://practicalli.github.io/blog/posts/cider-jack-in-to-clojure-cli-projects-from-spacemacs/#2019-10-2418:45dpsuttonUse a prefix to manually edit the startup string#2019-10-2419:12Drew VerleeThanks a ton. I think i sorted it out with your help 🙂#2019-10-2418:46dpsuttonI’ll look up a var you can use in a second #2019-10-2418:50dpsuttonhttps://docs.cider.mx/cider/config/project_config.html check out cider-clojure-cli-global-options there's an example of what you want right there#2019-10-2418:52dpsuttonand to answer your first question, no its not necessary. if you check the *Messages* buffer it will show you the exact command used and you'll see all of the necessary deps injected automatically#2019-10-2418:53dpsuttoni've been wanting to make a ticket to show the startup command and cljs repl incovation in the repl alongside the startup banner to show that CIDER does no magic at all and just starts nrepl for you#2019-10-2418:53dpsuttonso its easy to start it on a command line if desired#2019-10-2419:06dominicmCross injection of ideas: vim dispatch has a x11 command which will start a terminal which is detached from the current process.#2019-10-2419:06dominicmMight be a nice way to support closing emacs and opening it again#2019-10-2419:08dominicmhttps://github.com/tpope/vim-dispatch/blob/master/autoload/dispatch/x11.vim#2019-10-2419:08dominicmThere's a Windows one too#2019-10-2513:57asrailHi all,
I have a shared project which requires nrepl 0.5.3. When using cider-jack-in for this project, it fails with:
Error loading cider.nrepl: java.lang.RuntimeException: No such var: misc/requiring-resolve, compiling:(nrepl/middleware/print.clj:180:21)
and
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context, compiling:(/tmp/form-init5496667179235205609.clj:1:8006)
Emacs version: 26.1 (Debian)
Cider version: 0.22.0-snapshot (from MELPA 20190821.1002)
I was able to fix the issues by removing the nREPL from the project.clj. The project starts up a nREPL server in some cases, that's why it is part of the project.clj.
Is there anything I can do to avoid removing the nrepl from the deps locally? This could lead to an issue where it works locally because cider injects nrepl 0.6.0, but the project would be invalid because there would be no repl available for the remote system in the case I sync the modified version somewhere else.#2019-10-2514:46bozhidar@caiotiago Recent CIDER versions require nREPL 0.6. Is it a problem to just upgrade the project dep? I’m pretty sure bumping the dep can’t cause any issues for the project itself.#2019-10-2514:46asrail@bozhidar I will ask my team to update the deps, thanks.#2019-10-2611:29David RenoI’m not positive if this is a CIDER or shadow-cljs question but I’ll try here:
I was having trouble evaluating in a spacemacs code window until I came across a stackoverflow article describing how (for :target :node-script) I need to run node from the command line and evaluate the compiled code. (I also had to run npm install). This makes me feel like I’m missing some key documentation but I didn’t see anything about that here: https://shadow-cljs.github.io/docs/UsersGuide.html#target-node
Here’s the stackoverflow article that had the answer: https://stackoverflow.com/questions/58060822/how-to-connect-a-clojurescript-node-repl-to-my-node-library-shadow-cljs-project
Question: Is there more documentation that I need to read about how CIDER is launching npx shadow-cljs that will mention things like “then go to the shell and manually run node on the generated JS artifact”?#2019-10-2611:31thheller@dcreno https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting maybe this helps?#2019-10-2611:33David Renoadmittedly, I haven’t read that whole doc yet, but yes, it will help me understand the architecture. I’ll read that before asking more questions.
I was hoping to find a “walk-through” type of thing that mentions all the required steps in a single place.#2019-10-2611:34thhellerwell the "walk-through" depends on what exactly you are building#2019-10-2611:34David RenoI think this is a key statement in 14.3:
> Regular shadow-cljs builds do not manage any JS runtime of their own so you are responsible for running them.#2019-10-2611:35thhellercan't write 50 different walkthroughs for all the possible things people may be doing 😛#2019-10-2611:35David RenoSorry, I’m new and don’t fully understand the flexibility.#2019-10-2611:36David RenoIn my head, there’s browser app and node.js app, but I know that’s oversimplified.#2019-10-2611:36thhellerhmm? thats exactly how it is?#2019-10-2611:36David Renoonly in my head… 😉#2019-10-2611:37thhelleryou "run" the browser by opening the page#2019-10-2611:37thhelleryou "run" the node.js app by running node script.js#2019-10-2611:37thhellerno difference. you are still always responsible for running things#2019-10-2611:38thhellerif you want to skip the manual "run" you use shadow-cljs node-repl or shadow-cljs browser-repl#2019-10-2611:38thhellerthat runs stuff for you#2019-10-2611:38thheller(dunno how that is intergrated with cider though)#2019-10-2611:38David Renothat’s the part that confused me, I would have thought that CIDER would have run shadow-cljs node-repl based on :target :node-script.#2019-10-2611:39thhellernode-repl is independent from builds#2019-10-2611:39thhellerit can run entirely without a build config#2019-10-2611:39thhellerthink clj or lein repl#2019-10-2611:40David Renomaybe when I figure this out I’ll try to write a node.js quickstart that gives all the steps. Then I’ll realize how much I’m missing.#2019-10-2611:40thhellerit helps me immensely if you ask specific questions about what confuses you#2019-10-2611:40thhellerI mostly have no clue which docs to write#2019-10-2611:40David Renosorry, let me try again…#2019-10-2611:40thhellerbut will happily add stuff if it helps people#2019-10-2611:41David Renorightly or wrongly, I think of CIDER as starting and connecting to any background processes required to evaluate code in the emacs buffer.#2019-10-2611:41thhellerthe stuff really isn't all that complicated in my head ... but granted that I work on this stuff for years I'm not the best to judge#2019-10-2611:42thhellercan we take cider out of the equation for a second since I don't know what it does when it comes to "starting" things#2019-10-2611:42thhellerlet us assume for a second that you run shadow-cljs server separately#2019-10-2611:42thhellerin a terminal and then connect to it via Cider remotely#2019-10-2611:43thheller(this is likely what Cider is doing when you "start" things through it)#2019-10-2611:43David Renowarning, this is losing me because I have only a noobie understanding of how these pieces work…#2019-10-2611:43David Renobut I will study what you write here!#2019-10-2611:43thhellerhmm maybe I can guess by what cider commands you are running ...#2019-10-2611:44thhellerwhat do you run in emacs?#2019-10-2611:44David RenoCIDER runs this: `[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.0 -d cider/cider-nrepl:0.22.0-SNAPSHOT server...
`#2019-10-2611:44thhellerright .. yeah ok that starts the shadow-cljs server I mentioned#2019-10-2611:44David Renoafter I run cider-jack-in-cljs and pick “shadow” and provide the build name.#2019-10-2611:45thhelleralright. that may be the problem. does it even let you continue WITHOUT selecting a build? or is generic node-repl or browser-repl an option?#2019-10-2611:45David Renono, pretty sure you have to pick a build.#2019-10-2611:45thhellerok, that should then be files as a bug for cider#2019-10-2611:45thhellerthat is not how this is intended#2019-10-2611:46thheller(I don't use emacs so I don't follow what is happening with that)#2019-10-2611:46David Renowhen cider is starting, I can pick shadow or shadow-select, I always pick shadow.#2019-10-2611:46thhellerwell, ok then you pick the :node-script build you created#2019-10-2611:47David Renothen it prompts for Select shadow-cljs build (e.g. dev):#2019-10-2611:47David Renoright, I choose app because I have :builds {:app #2019-10-2611:48thhellerok. then you have your CLJS repl ready#2019-10-2611:48thhellerbut since this is a standalone build you still need to "run" the created output#2019-10-2611:48David Renoright. Then I have to go to the shell and run node -e "require('./target/main.js')"#2019-10-2611:48thhelleryes exactly#2019-10-2611:48David Renoas per your comment in the above mentioned stackoverflow article.#2019-10-2611:49thhellerok and your confusion comes from why you needed to run node?#2019-10-2611:50David Renoyes#2019-10-2611:50David RenoI was expecting to do something very “nominal” and see a brief description of the steps. I suppose I was wrong in the number of things I’ve integrated with and possible steps.#2019-10-2611:50thhellerok. I'll try to think of something and add it to the docs#2019-10-2611:50David RenoI’ll try too! Thanks for trying to get in the head of a beginner like me.#2019-10-2611:51thhellerthanks for explaining#2019-10-2702:24Drew VerleeHi cider lovers.
At my projects root i have a dir-locals.el that looks like this:
((clojurescript-mode
(cider-default-cljs-repl . shadow)
))
Which i hoped would mean that when i did cider-jack-in-cljs it would just pick shadow. instead i get that helpful select menu to pick clojure-cli or shadow.
I took inspiration from shadow : https://shadow-cljs.github.io/docs/UsersGuide.html#_simplify_startup_with_dir_local
and cider docs: https://docs.cider.mx/cider/0.23/config/project_config.html#2019-10-2706:24dpsuttonThat setting is for which repl type. You’re getting asked which build tool to use which is a separate car#2019-10-2706:25dpsuttonvar #2019-10-2711:20erwinrooijakkersWhat license do the CIDER docs have? https://docs.cider.mx/cider/index.html#2019-10-2711:20erwinrooijakkersAlso GPL?#2019-10-2711:22erwinrooijakkersSpecifically this image: https://docs.cider.mx/cider/_images/cider_architecture.png#2019-10-2714:37David RenoI’m not an authority but that image appears here: https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/assets/images/cider_architecture.png
That repo license is GPL 3.0: https://github.com/clojure-emacs/cider/blob/master/LICENSE#2019-10-2808:47bozhidarThat’s for CIDER’s code itself. I guess it’s fine for the docs to be under it also.#2019-10-2808:47bozhidarI never actually spent much time thinking about their license.#2019-10-2922:01erwinrooijakkersThanks#2019-10-2922:02erwinrooijakkersGPL means everything that uses it needs to be also licensed under GPL#2019-10-2922:02erwinrooijakkersAnd if I understand correctly every source file needs this GPL statement#2019-10-2922:07erwinrooijakkersI think if I mention that the image is licensed GPL it’s fine#2019-10-2922:07erwinrooijakkersNo need to make the whole interactive talk GPL too#2019-10-2922:07erwinrooijakkersSince the image is not bundled with the softwarwe#2019-10-2922:17erwinrooijakkersNo derivative is made#2019-10-2813:13Ian Fernandezpeople, how I use .dir-locals.el with cider?#2019-10-2813:13Ian FernandezI'm running the cider-jack-in-command and its not workin#2019-10-2813:14Ian Fernandez((clojure-mode
(cider-clojure-cli-global-options . "-A:test")))
this is mine .dir-locals.el#2019-10-2913:01practicalli-johndid you close and re-open your Clojure source code buffer. dir-locals is only read when opening a new buffer. So if you created your .dir-locals.el file after you opened your Clojure code it probably hasn't been read by Emacs.#2019-10-2913:02practicalli-johnor you can use revert-buffer which has the same effect.#2019-10-2813:16dpsuttonuse nil instead of clojure-mode#2019-10-2813:17dpsuttonthen you can just check the value of the var with c-h v to see if it has worked rather than do the whole cider jack in thing#2019-10-2813:27bozhidarWell, don’t you usually run jack-in from a clojure-buffer? I really hate using major mode wildcards as those pollute all buffers.#2019-10-2814:21Ian FernandezI usually run jack-in from a clojure buffer, yea#2019-10-2814:24bozhidarI’m guessing the generated command doesn’t feature this, right?#2019-10-2814:26Ian Fernandezdidn't understood what you've said#2019-10-2814:26Ian Fernandezbut the variable cider-clojure-cli-global-options
does not have a value#2019-10-2814:30dpsuttontry running (hack-local-variables)#2019-10-2914:16jpmonettashi! is there a way of starting two repls to the same project?
I would like to run both clojure and clojurescript repls but they can't be siblings repls since deps for the server side are declared in deps.edn while the UI side are coming from shadow-cljs.edn#2019-10-2914:18dpsuttonsure#2019-10-2914:18dpsuttonjack in and then jack in clojurescript#2019-10-2914:21jpmonettasI tried that but it says that a session with the same parameters exists and offers to connect a sibling instead#2019-10-2914:21dpsuttonand say yes to that#2019-10-2914:25jpmonettasif I do that the first one starts but the second doesn't#2019-10-2914:26jpmonettasI'm being able to select the type of repl in the second one but then nothing happens, no new repl buffer#2019-10-2914:27dpsuttonanything in the *Messages* buffer?#2019-10-2914:32jpmonettasnothing interesting, just gets stuck there
[nREPL] Starting server via /home/jmonetta/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d refactor-nrepl:2.4.0 -d cider/cider-nrepl:0.30.0 server
[nREPL] server started on 44693
[nREPL] Establishing direct connection to localhost:44693 ...
[nREPL] Direct connection to localhost:44693 established
A session with the same parameters exists (my-projects/clograms:localhost:44693). You can connect a sibling instead. Proceed? (y or n) y
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.30.0"}}}' -A:profiler:dev:test -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
#2019-10-2915:58bozhidarcider-nrepl 0.30? There’s no such version. 🙂#2019-10-2916:43jpmonettashahah true XD, I'm using cider-nrepl master, maybe that is the problem#2019-10-2917:06bozhidarI think it’s 0.23-SNAPSHOT 🙂#2019-10-3001:00fiddlerwoaroofHas anyone successfully setup jump to definition from clojure to Java?#2019-10-3008:03dominicmYes. Not with decompilation though.#2019-10-3008:03dominicmYou just need sources on the classpath#2019-10-3023:47futuroThe hard part I’ve run into is automatically downloading sources, and adding them to the classpath #2019-10-3105:17dominicmThere's a lein plugin kicking around#2019-10-3111:54futuroDo you remember it’s name? I’d love to have this in plugin form.#2019-10-3111:55dominicmIt was on an issue on github for either cider / cider-nrepl.#2019-10-3111:55dominicmthe plugin was hosted on gitlab#2019-10-3111:55dominicmhttps://github.com/clojure-emacs/cider-nrepl/issues/64 -> https://github.com/vise890/lein-pocketbook#2019-10-3111:56dominicmworked out of the box with vim, so should also work for emacs#2019-10-3111:57dominicmYou commented on that issue, so maybe it didn't work for you 🙂 but maybe you missed, dunno#2019-10-3121:20fiddlerwoaroofThanks, I'll look into that#2019-10-3121:20fiddlerwoaroofHas anyone worked on decompilers?#2019-10-3121:21fiddlerwoaroofAnd synchronizing the classpath with something like lsp-java?#2019-10-3001:01fiddlerwoaroof(and, possibly, decompilation of class files if the source isn't available)#2019-10-3002:29dpsutton@macrobartfast how are you starting your cljs project?#2019-10-3002:29macrobartfastI start it with lein repl
#2019-10-3002:29macrobartfastthen switch to emacs, and then#2019-10-3002:30macrobartfastcider-connect
#2019-10-3002:30macrobartfastfollowed by, in the repl that appears in emacs#2019-10-3002:30macrobartfast(use 'figwheel-sidecar.repl-api)
#2019-10-3002:31macrobartfastand finally#2019-10-3002:31macrobartfast(start-figwheel!)
#2019-10-3002:32macrobartfastat that point, the site appears, and reflects changes to the code, but, cider-eval-defun-at-point for any :require produces a class not found exception or the equivalent.#2019-10-3002:34macrobartfast(+ 1 1)
#2019-10-3002:34macrobartfastcauses Unable to resolve symbol: + in this context
#2019-10-3002:34macrobartfastas well.#2019-10-3002:37dpsuttonok. you still have a clojure repl. you need to start a clojurescript repl. can you try cider-jack-in-clojurescript and select figwheel as your repl type?#2019-10-3002:37dpsuttonbut to do this you'll need to have figwheel sidecar in your deps#2019-10-3002:38macrobartfastgotcha.#2019-10-3002:38dpsuttondo you have cider-nrepl in your deps so lein repl includes it?#2019-10-3002:38macrobartfastlemme see#2019-10-3002:38dpsuttoni'm wondering if there's any CIDER stuff at all#2019-10-3002:40macrobartfasthmm... I've found all the figwheel stuff commented out...#2019-10-3002:40macrobartfastthe project was the result of lein new app test -- --reagent"
#2019-10-3002:41macrobartfastI could have also done lein new reagent test
which is something I'm not clear on.#2019-10-3002:42macrobartfastso I'll uncomment the figwheel stuff and see what happens.#2019-10-3002:45dpsuttonhave you read the figwheel docs to see what is required?#2019-10-3002:49macrobartfastI tried to read them... it has become very confusing as there seem to be quite a few variations on how to go about it.#2019-10-3002:49macrobartfastand shadow-cljs has only made it more complex for me.#2019-10-3002:50macrobartfastright now though, I'm regenerating a project with lein new reagent test
as opposed to lein new app test -- --reagent
and will see if the problem persists.#2019-10-3002:59macrobartfastwell, generating a project with lein new reagent testtwo
then starting a repl with lein repl
and connecting to it from emacs via cider-connect
and then, in the emacs repl, (use 'figwheel-sidecar.repl-api)
followed by (start-figwheel!)
allows me to evaluate (+ 1 1)
from a cljs buffer, but any eval of a namespace declaration with a :require such as (ns testtwo.core
(:require
[reagent.core :as reagent :refer [atom]]
[reagent.session :as session]
[reitit.frontend :as reitit]
[clerk.core :as clerk]
[accountant.core :as accountant]))
in this case produces an Unhandled java.lang.IllegalAccessError
atom does not exist
error and commenting that out causes the same error to be thrown on the reagent.session :require and so on right down the line.#2019-10-3003:00macrobartfasthmm.#2019-10-3003:10macrobartfastI'm guessing this has something to do with my needing a cljs repl instead of a clj one, or something, as my buffer is a cljs one, but dunno.#2019-10-3003:11dpsuttonyeah. you're just starting a clojure repl. lein-figwheel is a bit old. are you sure you can't try out shadow?#2019-10-3003:12macrobartfastI can and should.#2019-10-3003:12dpsuttoncool. i think you'll have a better time with that#2019-10-3003:12dpsuttonand if you configure it in a standard way you can just run cider-jack-in-cljs and it will all work#2019-10-3003:12macrobartfastok. I'm super afraid of the shadow-cljs learning curve.#2019-10-3014:48aisamuYou really shouldn't be! It's as straightforward as the alternatives, and brings some very nice things to the table if you rely on npm libs.#2019-10-3003:13macrobartfastand I'll try cider-jack-in-cljs now.#2019-10-3003:16dpsuttonIt’s far smaller than lein figwheel#2019-10-3003:17dpsuttonAnd suggestion. Get it running where you have a repl from the command line and only then try putting CIDER in#2019-10-3003:57macrobartfastok, will do.#2019-10-3004:22macrobartfastjust a sanity check, first... I assume I'll be able to evaluate forms from within a buffer in emacs as per usual when I use shadow-cljs in my pipeline, right?#2019-10-3004:29macrobartfastI guess that is the role of cider, which seems to still play well with shadow-cljs.#2019-10-3005:02dpsuttonyes. get your project working from the command line first though#2019-10-3005:02dpsuttonbut you'll be able to evaluate in line in the buffer, have a repl in emacs, all the goodies#2019-10-3009:20bartukais it possible to change the indentation of vectors to match the following requirements:
clojure
(defrecord Valores [])
[Valores (= 1 1)
(= 2 2)
(= 2 3)]
[Valores (= 1 1)
(= 2 2)
(= 2 3)]
#2019-10-3009:49jumarAs mentoined here https://clojurians.slack.com/archives/CEFN9UP8R/p1572424846034600, I'm trying to setup rebl with cider.
I managed to make it work with plain lein repl but not with a complete cider setup.
It fails when starting the repl:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.3\"\] -- repl :headless :host localhost
Error loading nrebl.middleware: Syntax error compiling at (nrebl/middleware.clj:1:1).
...
Syntax error compiling var at (/private/var/folders/hn/tgwyrdmj1tb5pmmbdkd1g_qc0000gn/T/form-init8412568572949758697.clj:1:10031).
Unable to resolve var: nrebl.middleware/wrap-nrebl in this context
When I manually edit the start command to just lein repl then it works (but obviously cider repl is sort of broken)#2019-10-3009:50jumarIs this a known limitation or is there a way how to make REBL work with cider?#2019-10-3011:26bozhidarI thought nrebl was the way, but I’ve never tested it.#2019-10-3011:27bozhidarI’m guessing you also have to add this to your list of plugins/middleware for it to be loaded properly (unless it’s set up in your project.clj).#2019-10-3011:38jumarI added it to my ~/.lein/profiles.clj as mentioned in the linked thread.
Here's the current version (minus lot of other stuff):
{
:user
{
:dependencies [
;; REBL
;;
[rickmoynihan/nrebl.middleware "0.3.1"] ;; set this to the latest nrebl version
[org.clojure/core.async "0.4.500"]
;; to support java 11:
;; or rather
[org.openjfx/javafx-fxml "11.0.1"]
[org.openjfx/javafx-controls "11.0.1"]
[org.openjfx/javafx-graphics "11.0.1"]
[org.openjfx/javafx-media "11.0.1"]
[org.openjfx/javafx-swing "11.0.1"]
[org.openjfx/javafx-base "11.0.1"]
[org.openjfx/javafx-web "11.0.1"]
;; downloaded to "/Users/jumar/tools/clojure/rebl/REBL-0.9.220/REBL-0.9.220.jar"
;; and installed to the local maven repo:
;; mvn install:install-file -Dfile=REBL-0.9.220.jar -DgroupId=com.cognitect -DartifactId=rebl -Dversion=0.9.220 -Dpackaging=jar
[com.cognitect/rebl "0.9.220"]
]
;; REBL - must be inlined in :user, cannot be separated to :nrebl profile
;; see
;; TODO: make this work!!!
:repl-options {:nrepl-middleware [nrebl.middleware/wrap-nrebl]}
:injections [
;; REBL
(require '[cognitect.rebl :as rebl])
]
}}
#2019-10-3011:38jumarI'm gonna try if it works with just this minimalistic version#2019-10-3011:41jumarNope, the same error again:
Syntax error compiling var at (/private/var/folders/hn/tgwyrdmj1tb5pmmbdkd1g_qc0000gn/T/form-init10118661615782107768.clj:1:9797).
Unable to resolve var: nrebl.middleware/wrap-nrebl in this context
#2019-10-3011:42jumar@U06HHF230 I'm not sure if you're using Cider or not but perhaps you have some advice on this?#2019-10-3023:22rickmoynihanHi @U06BE1L6T.
Yes, when I use nrebl I use it with cider.
I’ve not used it with leiningen for a while, and tbh I don’t tend to use REBL much on a day to day basis.
Regarding the nrebl profile I tend to have nrebl and other profiles defined, and then merge them into :user e.g.
:nrebl {:repl-options {:nrepl-middleware [nrebl.middleware/wrap-nrebl]}
:dependencies [[rickmoynihan/nrebl.middleware "0.2.1-SNAPSHOT"]
;;[rickmoynihan/nrebl.middleware "0.2.0"]
[org.clojure/core.async "0.4.490"]
[org.openjfx/javafx-fxml "11.0.1"]
[org.openjfx/javafx-controls "11.0.1"]
[org.openjfx/javafx-swing "11.0.1"]
[org.openjfx/javafx-base "11.0.1"]
[org.openjfx/javafx-web "11.0.1"]
]
:resource-paths ["/Users/rick/Software/rebl/REBL-0.9.220.jar"]
:injections [(require '[cognitect.rebl :as rebl])]
}
:user [
:nrebl
:cider
,,,
]
#2019-10-3023:29rickmoynihanhow are you starting it, cider-jack-in? I tend to cider-connect to a lein repl run from a terminal#2019-10-3107:26jumar@U06HHF230 I've tried the "profile merging" option but it didn't work at all (I have many other things in profiles.clj)
But as posted above I've also tried a minimalistic profiles.clj with the same result.
I don't normally use cider-connect, always cider-jack-in which runs something like this:
/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.22.3\"\] -- repl :headless :host localhost
#2019-10-3107:29jumarWith plain lein repl and cider-connect I get this warning:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!
More information.WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
#2019-10-3107:42jumarI tried to profile merging again with cider-nrepl, but still the same error, now even with plain lein-prel
Error loading nrebl.middleware: Syntax error compiling at (nrebl/middleware.clj:1:1).
Syntax error compiling var at (/private/var/folders/hn/tgwyrdmj1tb5pmmbdkd1g_qc0000gn/T/form-init7074044914497216362.clj:1:9555).
Unable to resolve var: nrebl.middleware/wrap-nrebl in this context
#2019-10-3107:44jumar#2019-10-3107:51jumarPerhaps this error message can be relevant - I'm getting that for all lein commands:
lein -v
Error: cannot resolve lein-tools-deps.plugin/resolve-dependencies-with-deps-edn middleware
Leiningen 2.9.1 on Java 11.0.2 OpenJDK 64-Bit Server VM
#2019-10-3107:53jumarI have no idea where that's coming from though (maybe I just forgot). Is it somehow bundled in the leinigen itself?#2019-10-3108:13jumarI tried to for the nrebl.middleware repo and ran lein repl there -> it fails with the similar error.
When I remove this line it sort of works: https://github.com/RickMoynihan/nrebl.middleware/blob/master/project.clj#L29
However, I cannot require the namespace:
lein do clean, repl
nREPL server started on port 49538 on host 127.0.0.1 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 11.0.2+9
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require '[nrebl.middleware])
Syntax error (FileNotFoundException) compiling at (nrebl/middleware.clj:1:1).
Could not locate cognitect/rebl__init.class, cognitect/rebl.clj or cognitect/rebl.cljc on classpath.
#2019-10-3108:14jumarBut I have no idea how this thing is supposed to work so I don't know if it really make sense to use it like this#2019-10-3108:57rickmoynihanare you using my lein-tools-deps as well??
https://github.com/RickMoynihan/lein-tools-deps#2019-10-3109:05rickmoynihanare you also sure you’re running it on clojure 1.10.1?#2019-10-3109:33rickmoynihanI can confirm I can recreate the issue. Not sure what it is either.
rebl is a bit of a PITA tbh I think largely because it’s shipped as a binary, and it has some weird dependency issues that it weirdly pushes downstream.
Not sure if that might be what is causing it — if you can downgrade REBL you might have more luck.
Another complication might be the Java version. Are you running it on java 11 or java 8? If not why are you including the java 11 FX deps? Some bits of cider/leiningen might not work properly on that, not sure.#2019-10-3110:48jumarI'm using Java 11 and clojure 1.10.1#2019-10-3110:49jumarLeiningen 2.9.1 on Java 11.0.2 OpenJDK 64-Bit Server VM
Clojure 1.10.1
#2019-10-3113:28jumarHmm, I can confirm it works with 0.9.157. Unfortunately, I don't have access to newer versions before 0.9.220. I guess they are not publicly available, right?#2019-10-3113:29rickmoynihanI’d ask in #rebl but yeah as far as I’ve seen cognitect currently only supply the latest version.#2019-10-3113:31jumarWell it sort of works. I got this exception when trying tap> (which might be a known issue in the old version):
Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: com/sun/javafx/jmx/MXNodeAlgorithm
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lan
#2019-10-3113:31rickmoynihanthe tap panel in rebl only started working recently afaik#2019-10-3113:32jumarAnyway, thanks a ton for your help. I'll see if I can get a working solution anytime soon..#2019-10-3113:35rickmoynihann/p let me know how you get on; and maybe file an issue describing any findings.
I find REBL pretty hard to test and work against because of its binary nature and there are various incompatibilities and dependency issues that can arise which are hard to debug because it’s so inscrutable.#2019-10-3013:33practicalli-john@macrobartfast I have been using lein new figwheel-main project-name -- --reagent for my projects. Works very well with clojurescript-jack-in. I havent found the opportunity to try out shadow-clj and figure out what npm packages I want to use. There is a reasonably simple example of a figwheel-main project here https://github.com/practicalli/practicalli-landing-page#2019-10-3013:36practicalli-johnThere is also an article if you decide to use Clojure CLI tools and deps.edn instead of Leiningen https://practicalli.github.io/blog/posts/development-workflow-with-clojure-cli-tools/#2019-10-3014:48aisamuYou really shouldn't be! It's as straightforward as the alternatives, and brings some very nice things to the table if you rely on npm libs.#2019-10-3017:07macrobartfastthank you all! ( @dpsutton @jr0cket @aisamu ) I feel much better about all this thanks to your help. 😉#2019-10-3023:50futuro@iagwanderson clojure-mode defines indentation, though I can’t remember the setting off the top of my head#2019-10-3023:57bartukathanks @U0JJ68RBR I will try to take a look at this later#2019-10-3112:10Lucas BarbosaAny clues on why clj -R:cider -m nrepl.cmdline -i --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]' works while clj -A:cider doesn't? It fails with this message:
Execution error at nrepl.cmdline/parse-cli-values$fn (cmdline.clj:248).
EOF while reading
Full report at:
/var/folders/hw/rwwwsw714zzfn6kq8p8m7p280000gn/T/clojure-9168802566467764242.edn
My deps.edn:
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/core.async {:mvn/version "0.4.500"}
com.wsscode/pathom {:mvn/version "2.2.26"}}
:aliases
{:cider {:extra-deps {cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}
refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"}
nrepl {:mvn/version "0.6.0"}}
:main-opts ["-m" "nrepl.cmdline"
"-i"
"--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\", \"cider.nrepl/cider-middleware\"]"]}}}
#2019-10-3112:12Lucas BarbosaThe full report:
{:clojure.main/message
"Execution error at nrepl.cmdline/parse-cli-values$fn (cmdline.clj:248).\nEOF while reading\n",
:clojure.main/triage
{:clojure.error/class java.lang.RuntimeException,
:clojure.error/line 248,
:clojure.error/cause "EOF while reading",
:clojure.error/symbol nrepl.cmdline/parse-cli-values$fn,
:clojure.error/source "cmdline.clj",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.RuntimeException,
:message "EOF while reading",
:at [clojure.lang.Util runtimeException "Util.java" 221]}],
:trace
[[clojure.lang.Util runtimeException "Util.java" 221]
[clojure.lang.EdnReader readDelimitedList "EdnReader.java" 746]
[clojure.lang.EdnReader$VectorReader invoke "EdnReader.java" 672]
[clojure.lang.EdnReader read "EdnReader.java" 145]
[clojure.lang.EdnReader read "EdnReader.java" 111]
[clojure.lang.EdnReader readString "EdnReader.java" 67]
[clojure.edn$read_string invokeStatic "edn.clj" 46]
[clojure.edn$read_string invokeStatic "edn.clj" 37]
[clojure.edn$read_string invoke "edn.clj" 37]
[nrepl.cmdline$parse_cli_values$fn__1266 invoke "cmdline.clj" 248]
[clojure.lang.PersistentArrayMap
kvreduce
"PersistentArrayMap.java"
377]
[clojure.core$fn__8437 invokeStatic "core.clj" 6845]
[clojure.core$fn__8437 invoke "core.clj" 6830]
[clojure.core.protocols$fn__8167$G__8162__8176
invoke
"protocols.clj"
175]
[clojure.core$reduce_kv invokeStatic "core.clj" 6856]
[clojure.core$reduce_kv invoke "core.clj" 6847]
[nrepl.cmdline$parse_cli_values invokeStatic "cmdline.clj" 246]
[nrepl.cmdline$parse_cli_values invoke "cmdline.clj" 242]
[nrepl.cmdline$args__GT_cli_options invokeStatic "cmdline.clj" 261]
[nrepl.cmdline$args__GT_cli_options invoke "cmdline.clj" 253]
[nrepl.cmdline$_main invokeStatic "cmdline.clj" 447]
[nrepl.cmdline$_main doInvoke "cmdline.clj" 443]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause "EOF while reading"}}
#2019-10-3112:30dominicmUse a , instead of a space in your deps.edn#2019-10-3112:34Lucas Barbosa@dominicm that shouldn't be the issue, since it uses clojure.edn/read-string to read the vector and , are optional :thinking_face: But anyways, I tried and got the same error 🙁
https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/cmdline.clj#L244#2019-10-3112:35dominicmIt doesn't do positional parameters properly though, there's limitations because reasons#2019-10-3112:36dominicmhttps://clojurians-log.clojureverse.org/tools-deps/2019-09-20#2019-10-3112:39Lucas BarbosaOk, I didn't try replacing the space with a comma, but inserting the comma between the first symbol and the space facepalm removing the space makes it work! Thanks a lot @dominicm#2019-10-3112:39dominicmSorry. I wasn't very clear. Mobile typing isn't amenable to this sort of thing unfortunately.#2019-10-3112:42Lucas BarbosaNo problems! Thanks for the help, I spent like 30 minutes trying to figure this one out#2019-10-3115:50chrisnIS there a public API document for cider-nrepl? For instance, if I want to build a new client unrelated to any current clients?#2019-10-3115:51bozhidar@chris441 Yes. See https://docs.cider.mx/cider-nrepl/nrepl-api/ops.html#2019-10-3115:51chrisn👍#2019-10-3116:23chrisnActually, along those lines, is there a simple web-based cider-nrepl client?#2019-10-3116:23chrisnIdeally one that supports vega.#2019-10-3116:53bozhidarI’m not aware of any web-cased nREPL clients.#2019-10-3122:24m0smithWhat is the trick to attach to an nRepl running remotely in a docker container. EMACS thinks it is talking to it but cider gets lost somehow. The last of the nrepl-tunnel logs looks happy:#2019-10-3122:32m0smith#2019-11-0111:34yuhanDoes anyone else get a null pointer exception with a 2-3 second delay every time the cider debugger is quit with q?#2019-11-0111:35yuhanWith an accompanying emacs exception error in process filter: Format specifier doesn't match argument type#2019-11-0113:20bozhidarSeems like some format is getting unexpected params.#2019-11-0202:08yuhanYeah, the root cause seems to be Clojure side of things which throws an unhandled NPE, causing cider-stacktrace to error out on some text formatting functions.#2019-11-0202:19yuhanIt's proving very hard to track down, I was just wondering if it's some odd configuration or setup on my end or if everyone else experiences it too#2019-11-0206:37bozhidarI’ve never encountered this.#2019-11-0408:52yuhanI reproduced it on a clean installation of Cider jacked into an empty Lein project:
;; CIDER 0.24.0snapshot, nREPL 0.6.0
;; Clojure 1.10.1, Java 12.0.1
#2019-11-0408:53yuhanevaluate #dbg (inc (inc 0)) and press q#2019-11-0408:53yuhan1. Unhandled java.lang.NullPointerException
(No message)
Matcher.java: 1770 java.util.regex.Matcher/getTextLength
Matcher.java: 416 java.util.regex.Matcher/reset
Matcher.java: 253 java.util.regex.Matcher/<init>
Pattern.java: 1133 java.util.regex.Pattern/matcher
core.clj: 4856 clojure.core/re-matcher
core.clj: 4886 clojure.core/re-matches
core.clj: 4886 clojure.core/re-matches
debug.clj: 598 cider.nrepl.middleware.debug/instrument-and-eval
debug.clj: 591 cider.nrepl.middleware.debug/instrument-and-eval
Var.java: 384 clojure.lang.Var/invoke
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 137 clojure.lang.RestFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 660 clojure.core/apply
regrow.clj: 18 refactor-nrepl.ns.slam.hound.regrow/wrap-clojure-repl/fn
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 79 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 142 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 170 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 835 java.lang.Thread/run
#2019-11-0408:55yuhanit appears that (.getMessage e) in instrument-and-eval returns nil#2019-11-0206:11macrobartfastis there a way to get clojure docs for a symbol in emacs? cider-grimoire doesn't seem to work... I've found cider-clojuredocs at https://github.com/clojure-emacs/cider/blob/master/cider-clojuredocs.el but it's not available as a command in my emacs... is there a way to get this functionality?#2019-11-0206:19jumar@U0X9N9ZK5 I have cider-clojuredocs as a command; in spacemacs under , h d#2019-11-0206:36bozhidar@m0smith See https://docs.cider.mx/cider/0.23/basics/up_and_running.html#_working_with_remote_hosts#2019-11-0423:10m0smithI checked there and CIDER is connecting to the remote port ok, but the cider-repl buffer is not attached to it#2019-11-0218:42bozhidarThe first ever “State of CIDER” survey is out https://metaredux.com/posts/2019/11/02/state-of-cider.html#2019-11-0219:23pezFollowing!#2019-11-0400:10justinbarclayFilling it out, but I think two blank questions made it into the form:
Screen Shot 2019-11-03 at 5.07.38 PM#2019-11-0221:07joelittlejohnHey, in recent versions of Cider, cider-restart no longer kills the REPL and launches it again. Now it just disconnects and reconnects to the same REPL. Since hot loading of dependencies is also disabled these days, what's the easiest way to bring a new library to the classpath after changing my project.clj?#2019-11-0221:37dpsuttonthere's a sesman-restart that does what you want#2019-11-0222:11joelittlejohnCool, thanks! It was nice that cider-restart had some feedback in the mini buffer to show that the new REPL was starting, but I'll definitely use sesman-restart :thumbsup:#2019-11-0222:12dpsuttonyeah i'm not sure what the benefit or purpose of cider-restart is now ¯\(ツ)/¯#2019-11-2716:33funkriderAfter trying to set the cljc file to use clojure-mode I find that the C-c C-e does not send to the REPL.#2019-11-2617:56respatializedI'm cross-posting this here so that the question is in the most directly relevant channel as well as a broader one. Any help is much appreciated.#2019-11-2707:44hkjelsexec-path-from-shell will only copy a few variables, you have to set it up manually if you need something more then PATH and MANPATH#2019-11-2710:06tianshuCan I let cider open the REPL buffer when specific text(like error or exception) occurs in repl?#2019-11-2815:16manuel@bozhidar when will the results of the State of CIDER Survey be published? 🙂#2019-11-2816:46bozhidar@manuel I’ve been asking myself the same question for a couple of weeks now. 😄 It’s been really crazy at work since I posted the survey. This weekend we’ll have guests from Italy, but I hope I’ll find some time for the summary sometime next week. Or I’ll just share the raw data with the awesome @danielcompton and he’ll do his magic like here https://danielcompton.net/2019/02/06/clojure-survey-2019 🙂#2019-11-2821:54danielcompton😃#2019-11-2906:51manuelgreat, thanks for the update#2019-11-3002:25bherrmannDoes anyone else have the issue that using "cider-repl-output-clear" doesnt clear the cider-repl buffer of output? (Emacs 26.3 , CIDER 0.22.0snapshot (package: <tel:201904191025|20190419.1025>), nREPL 0.6.0, Clojure 1.10.1, Java 11.0.5-ea)#2019-11-3003:17dpsuttonAnything in particular it’s not clearing? That’s an older CIDER if I’m not mistaken#2019-12-0214:15bherrmannThanks, I bumped to the latest CIDER.
I think when I use the cider repl interactively and then use it to eval from source code - cider seems to get confused abut the contents of the "cider-repl" buffer. And when I invoke the cider-repl-clear-buffer - it only clears part of the buffer...#2019-12-0214:18dpsuttonwhat do you mean by "use it to eval from source code"#2019-12-0214:19bherrmannC-c C-c cider-eval-defn-at-point#2019-12-0214:20bherrmannSo sometimes I eval things from source code, but once in a while I pop over to the cider-repl and type something directly. I guess I can just not do that.#2019-12-0214:20bherrmannThat screenshot was supposed to be in this thread fyi.#2019-12-0214:21bherrmannoh by the way, thanks for your rely. I appreciate it.#2019-12-0214:21bherrmannI will try to only eval source code, and not enter code directly in to the "cider-repl" buffer .... and see how far that gets me.#2019-12-0214:21bherrmannTHANKS#2019-12-0214:26dpsuttonthat shouldn't be the problem. i do that constantly as well#2019-11-3008:17robert-stuttafordis there a way to print strings in the *cider-result* buffer such that carriage returns output as newlines?#2019-12-0115:03bozhidar@robert-stuttaford There’s nothing built-in in CIDER to do this, but you can easily override the printing function.#2019-12-0115:51tianshuIs cider-inspector suppose to work in clojurescript? I'm trying to inspect a very simple data {:a 1}, but it fails.#2019-12-0116:21robert-stuttafordthanks @bozhidar - i ended up monitoring the repl buffer and crafting what i need with println + pprint#2019-12-0122:04frozenlockIs there a general approach to work with dependency injection (Component, mount, integrant...) in CIDER?
Usually I use M-. to jump to the source of a function. However with dependency injection all I have is a keyword extracting a function from a map at runtime 😕#2019-12-0208:19dominicmI wrote juxt/clip to address this problem, in part.#2019-12-0208:19dominicmIt uses symbols instead of keywords, and those symbols correspond to vars#2019-12-0122:10dpsuttonnot really. that's part of dependency injection that is frustrating: dependencies are runtime configurations#2019-12-0122:13frozenlockFrustrating indeed. Thanks, at least I know I'm not just being bad 😛#2019-12-0122:15frozenlockPerhaps there's something to be done with a mix of enlighten and jump to source. For example once we run it, it could show temporary vars that can be used to jump to namespaces.#2019-12-0122:23dpsuttoni don't follow. but taking component to be concrete, you'd want to jump to the source of a function parameter. that sounds tough#2019-12-0207:25Christian JohansenI have the following in .dir-locals.el:
((nil
(cider-clojure-cli-global-options . "-A:dev")
(cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . ":dev")))
But CIDER still prompts me for which figwheel build to start after connecting#2019-12-0208:29kirill.salykindid you restart your emacs? #2019-12-0208:30kirill.salykinemacs should recognize it and propose to add#2019-12-0208:35Christian Johansenemacs picks up the first two values, but I'm prompted for the figwheel build#2019-12-0217:13kirill.salykinoh, i see, sorry#2019-12-0207:25Christian Johansenam I doing something wrong? I'm pretty sure this used to work#2019-12-0208:28bozhidarSeems to me your setup is correct. You can debug what’s happening in cider-figwheel-main-init-form when you invoke it. It’s supposed to take the build from the default options if present.#2019-12-0208:29kirill.salykindid you restart your emacs? #2019-12-0208:49Christian Johansenseems to be project-specific. just created another project that only has one target, and it works as expected. the project I'm experiencing this in has multiple builds and several .dir-locals.el files in various directories#2019-12-0208:49Christian JohansenI'll look into debugging that function @bozhidar#2019-12-0322:06acim1Is there a convenient way to use cider-load-buffer without having an associated file? I just have a scratch buffer and I jacked into cider and I want to load the buffer into the REPL and play without without having a file on disk, but trying to load the buffer gives "Buffer 'my-buffer' is not associated with a file"#2019-12-0408:13bozhidarYou can use cider-eval-region.#2019-12-0322:06dpsuttontyped in emacs first? 🙂#2019-12-0322:10dpsuttonstrange. because cider-load-buffer sends the contents as a string. i don't know why it requires a filename#2019-12-0408:10bozhidarnREPL actually expects a filename, that’s why. It has a different op for evaluating files and for evaluating strings.#2019-12-0408:12bozhidarSee https://nrepl.org/nrepl/0.6.0/ops.html#_load_file#2019-12-0322:12acim1Right, that's what I thought too...minor thing, but would be convenient for just messing around#2019-12-0322:13dpsuttonare you comfortable editing elisp?#2019-12-0322:14dpsuttonsome people have used emacs for 3 minutes, some people have been using for 30 years. never know the level of comfort 🙂#2019-12-0322:14acim1I don't fool with it much, pretty much set up the nuts and bolts and left alone, but I can#2019-12-0322:15dpsuttonm-x find-function [ret] cider-load-buffer and comment out that error#2019-12-0322:15dpsuttonand then you're 50% done for a patch#2019-12-0406:17yuhan(defrecord Foo []
clojure.lang.IDeref (deref [x] x) )
(Foo.)
;; =>
;; 2. Unhandled clojure.lang.ExceptionInfo
;;
;; 1. Caused by java.lang.IllegalArgumentException
;; Multiple methods in multimethod 'simple-dispatch' match dispatch value: class
;; scratch.Foo -> interface clojure.lang.IDeref and interface
;; clojure.lang.IPersistentMap, and neither is preferred
#2019-12-0406:17yuhanI traced this error down and turned out to be cider.nrepl.print-method extending clojure's print-method to IDeref, causing conflict when trying to print an object which supports both interfaces#2019-12-0406:22yuhanShould cider-nrepl be doing this in the first place? The solution seems to be overriding print-method for each concrete type to favor one implementation over the other#2019-12-0408:08bozhidar@qythium Seems to me we simply need to be explicit about the preferred print-method in such cases and all will be good.#2019-12-0410:09yuhanAh okay, like this?
(prefer-method print-method
clojure.lang.IPersistentMap
clojure.lang.IDeref)
#2019-12-0410:12yuhanWould that belong in cider-nrepl? (It seems a little iffy monkey-patching clojure.core like that, I wasn't previously aware that Cider was doing these extensions)#2019-12-0410:43bozhidar@qythium Yeah, exactly. Well, hacks are never pleasant, but from time to time we had to do some of them “for the greater good”. 🙂 It’s not like everything in core is ideal.#2019-12-0410:44bozhidarIn this case we simply wanted to render certain values in an easier to understand fashion, which is unlikely to ever be changed upstream.#2019-12-0410:45bozhidarI guess few people would argue that #object[clojure.core$_PLUS_ 0x4e648e99 \"clojure.core$_PLUS_@4e648e99\"] doesn’t read as nice as #function[clojure.core/+]. 😄#2019-12-0410:46bozhidarBtw, the feature is CIDER can be disabled via a dynamic variable, and I think you’re the first person to ever run into issues with it.#2019-12-0410:57yuhanYeah, I ran into it with the library thi.ng.color, which uses records that implement IDeref#2019-12-0411:08yuhanwhich... does not seem a very sensible thing to do, I think it was in order to abuse the @ syntax#2019-12-0415:29yuhanThoughts on enabling the "-XX:-OmitStackTraceInFastThrow" jvm option by default when jacking in with clojure-cli?#2019-12-0415:30yuhanLein enables it on startup: https://github.com/technomancy/leiningen/commit/110e2a14e96ae88fad486365962106fac3eedd8d#2019-12-0415:32yuhanWithout it stacktraces would start getting mysteriously omitted after a long-running session, causing the cider-stacktrace buffer to throw elisp-side errors#2019-12-0415:34yuhan(Specifically in the cider-stacktrace-render-frame function which expects a stacktrace frame)#2019-12-0415:45dpsuttontools gonna tool#2019-12-0415:45dpsuttonwe don't mess with lein, don't think we should with clj#2019-12-0416:30bozhidarNot sure about this. If Lein already sets this internally I guess there’s some reason. What’s this flag supposed to do exactly?#2019-12-0416:40yuhanSee the convo a while ago on the #clojure channel, apparently it prevents the JVM from optimizing away stacktraces#2019-12-0416:41yuhanhttps://blog.jakubholy.net/2014/05/19/clojurejava-prevent-exceptions-with-trace-missing/#2019-12-0416:41yuhanFor a long time I thought it was a Cider bug and would just restart the repl#2019-12-0417:54dpsuttoni'm hesitant to change the defaults of tools like that. that would be infuriating to find the reason something didn't work as expected#2019-12-0418:05dominicmUsers can set it by themselves#2019-12-0418:45bozhidar@qythium Perhaps we should just document this in the manual. I guess many people will come across it this way.#2019-12-0419:41fiddlerwoaroofIf I have a line like this in my REPL output, it breaks indentation of all my repl lines because the closing ] is escaped by the ;
INFO: Initializing c3p0-0.9.5.4 [built 23-March-2019 23:00:48 -0700; debug? true; trace: 10]
Is there some way to have CIDER ignore repl output for formatting purposes?#2019-12-0420:23dpsuttonThat’s a constant pain where I work too. The logs are enormous and not structured. I always ensure to clear the repl with the short cuts before working in the repl#2019-12-0421:26fiddlerwoaroof@dpsutton one thought would be to put ;; at the beginning of every output line#2019-12-0422:25dpsuttonbut then your actual logs are gross#2019-12-0422:41bozhidarYou can always turn off font-locking in the REPL. It’s a compromise, of course.#2019-12-0422:42bozhidarAt some point I wanted to be able to redirect logs to dedicated buffers, but I dropped this idea. I don’t recall why exactly.#2019-12-0422:42dpsuttonthey used to go to the server process buffer right?#2019-12-0422:43bozhidarI just remember when I started working on it I realized it didn’t make as much sense as I thought it would.#2019-12-0422:43dpsuttoni think i discouraged you because it would require a custom logger logic (thresholds, etc) in CIDER itself#2019-12-0422:43bozhidarYeah, they used to go there due to an output capture issue.#2019-12-0422:44bozhidarYou can still enable this behaviour if disable the output redirecting done by cider-nrepl#2019-12-0422:45bozhidarBtw, keep in mind this server buffer exists only when you’ve jacked-in, which was part of the original problem.#2019-12-0422:49fiddlerwoaroofOne thing I like about Cider/Slime is that they look like a real repl#2019-12-0422:49fiddlerwoaroofCalva and intellij do this thing where the entry area is a text box below the log buffer, and I've always found that arrangement awkward#2019-12-0422:51fiddlerwoaroofI guess, if `*out*` was redirected, but not the repl results, this wouldn't be a problem#2019-12-0422:55fiddlerwoaroofMy current "solution" is C-M-u and then replacing the unpatched opening delimiters#2019-12-0423:06bozhidarThere’s no problem to redirect output out of the REPL, but this would be unnatural for something like println.#2019-12-0423:08fiddlerwoaroofyeah#2019-12-0509:59clariceHey, I don't know if this is Cider related or solely related to spacemacs. I wonder if anyone has come across this issue before and how to fix it. Basically, I can't run my clojure tests. There is no test report. Please can someone help or direct me to an appropriate channel. 🙏
https://stackoverflow.com/questions/59191082/spacemacs-test-runner#2019-12-0510:03bozhidar@cbillowes Hey there! What’s the error you’re getting?#2019-12-0510:03bozhidarAnd what command are you trying to run?#2019-12-0510:04clariceI don't see any error. , t t#2019-12-0510:04clariceI just want to try again, getting set up again because it closed for some reason#2019-12-0510:07clariceI start my rep. Then I focus on a test. It looks like it evaluates the test. Nothing goes green or red to show if the test passed or failed. In the messages buffer it showed that it loaded the test. Ran the test. Then shows the ns and function of the evaluation of the test.#2019-12-0510:09bozhidarCan you share some screenshot?#2019-12-0510:10bozhidarKeep in mind that the test report is displayed in a separate buffer only on failures/errors. Normally you should just get a message in your minibuffer saying that a test has passed.#2019-12-0510:10bozhidar#2019-12-0510:11clariceThe test in question is actually supposed to fail. On my Mac I get a test report for all passing tests. Is it different based on distribution or configuration?#2019-12-0510:11bozhidarAlso - make sure you did evaluate the test namespace first.#2019-12-0510:11clariceI don't get an assertions bar either#2019-12-0510:11claricelet me try that quick#2019-12-0510:12clariceI evaluated the buffer, then reran that test. I tried to run all tests now and I still don't get the expected output. Very strange#2019-12-0510:13clariceI am going to try upgrade emacs on fedora. I installed directly from dnf but the version is still on 26.2#2019-12-0510:13bozhidarIt shouldn’t be the Emacs version, though.#2019-12-0510:14clariceOk, holding off on that then#2019-12-0510:15bozhidarI’m on Emacs 26 and I target Emacs 25 for CIDER.#2019-12-0510:16clariceHow can I check what I am targeting for cider?#2019-12-0510:17bozhidarI meant I target Emacs 25 when I’m developing CIDER. (I’m its author)#2019-12-0510:17clariceOh 😄#2019-12-0510:17bozhidarCan you check in *nrepl-messages* for something like:#2019-12-0510:17bozhidar(-->
id "32"
op "test"
session "64d5b457-6268-45ac-a3a1-371e9ce61eca"
time-stamp "2019-12-05 12:08:54.849312000"
load? "true"
ns "orchard.apropos-test"
tests ("var-name-test")
)
(<--
id "32"
session "64d5b457-6268-45ac-a3a1-371e9ce61eca"
time-stamp "2019-12-05 12:08:54.872459000"
gen-input nil
results (dict ...)
summary (dict ...)
testing-ns "orchard.apropos-test"
)#2019-12-0510:17bozhidarI’m curious what are the responses you get from the nREPL server when you’re running tests.#2019-12-0510:18clariceI need to step out for about an hour now. Do you mind if I reply when I get back. It's closed now 😞 May I just DM you until we have a resolution which we can post here and on StackOverflow?#2019-12-0510:18bozhidarYou might have to enable this logging if its not active - see https://docs.cider.mx/cider/troubleshooting.html#_missing_nrepl_messages_buffer#2019-12-0510:18clarice:thumbsup:#2019-12-0510:18bozhidarSure.#2019-12-0510:18clariceI'll let you know asap#2019-12-0510:18clariceThanks so much!#2019-12-0513:45erwinrooijakkersHow can running code from an uberjar on a production environment be “hot-patched”, what happens?#2019-12-0513:53dominicmIf you, eg re-eval a function#2019-12-0604:01frozenlockI'm trying to see some specs, but when I call cider-browser-spec I get "user-error: No linked CIDER sessions". I tried on 2 completely different projects, both with which Cider works fine. Does it ring any bell?#2019-12-0604:01frozenlockhttps://docs.cider.mx/cider/usage/misc_features.html#_browsing_the_clojure_spec_registry#2019-12-0604:17dpsuttoni'm assuming you've jacked in? can you evaluate other expressions just fine?#2019-12-0604:38frozenlockYes, everything works fine.#2019-12-0604:38frozenlockWell, except for browsing specs.#2019-12-0617:18FiVoWhen I do cider-jack-in and evaluate my first form my syntax highlighting changes. Expected behavior. So far so good. But sometimes this syntax highlighting changes back to way it was before during the session. I don't actually know what the key sequence is as it only happens sporadically. When inspecting cider-font-lock-dynamically it is still set to (macro core deprecated) . How do I go back to "normal" syntax highlighting without jacking in again? What are possible causes for this behavior?#2019-12-0618:29yuhanlooks like there's a M-x cider-refresh-dynamic-font-lock, does that help?#2019-12-1016:55FiVo@UCPS050BV tried it but it didn't help#2019-12-0702:53rjrayGetting a Java exception when I try to start CIDER:#2019-12-0702:53rjray#2019-12-0703:08frozenlock@rjray > Caused by: java.lang.RuntimeException: Invalid token: ::clojure.test/once-fixtures
Could it be that the given keyword is invalid?#2019-12-0703:21dpsuttonThat was a bug that was fixed in August of 2017. What version are you running?#2019-12-0703:22dpsuttonhttps://github.com/clojure-emacs/cider/issues/2081#2019-12-0704:31rjrayGood call... turns out my CIDER is out of date, because emacs' package manager can't update a needed dependency in order to update CIDER.#2019-12-0704:45dpsuttonDo you know which one? #2019-12-0704:46dpsuttonAnd probably best to just delete the dir from the elpa directory and reinstall #2019-12-0704:54rjrayThat's the problem-- this emacs seems to think it can't validate the GPG key for elpa, so no elpa packages were showing up after package-list-packages.#2019-12-0704:55rjrayI cheated: I downloaded queue.el 0.2 directly from elpa and installed it via package-install-file. Updated cider, and now I'm working.#2019-12-0705:04dpsuttonAh. Update your emacs or google how to update the key. They had to update the keys and unfortunately the older emacsen were left in the lurch#2019-12-0705:05dpsuttonHas it been a while since you’ve done clojure development?#2019-12-0709:34slipsetSo, cljr-find-usages is b0rken on our main project at work. I’d like to take a stab at debugging/fixing this, but I’m unfamiliar with how to effectively debug/change nrepl middleware. Anyone has any good resources on that?#2019-12-0709:35slipsetThings I’d like to achieve:
1) call the middleware directly from the REPL.
2) change said middleware without restarting the REPL. #2019-12-0711:39papachan@rjray i had the same problem last month. i just package-install this package to force emacs to renew his GPG key, the package name is: gnu-elpa-keyring-update#2019-12-0801:29rjrayGreat, I think that fixed it!#2019-12-0818:26luizmineoHi, can I use clj-refactor with shadow-cljs projects?
I'm trying to enable it in a project created with the default re-frame template, but the repl complains that refactor-nrepl is missing
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
Already tried to add it as a dependency, on both project.clj and shadow-cljs.edn#2019-12-0822:09aisamuYes, you can!
It looks like you're not loading the refactor-nrepl dependency (i.e. refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"})#2019-12-0900:01luizmineoHi @alsamu,
I already added refactor-nrepl as a dependency in project.clj and shadow-cljs.edn#2019-12-0900:02luizmineo[refactor-nrepl "2.5.0-SNAPSHOT"]#2019-12-0900:03luizmineoWhen the repl starts, it shows up in the startup command:
;; Connected to nREPL server -
;; CIDER 0.24.0snapshot (package: 20191129.901), nREPL 0.6.0
;; Clojure 1.10.1, Java 11.0.4
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; Startup: /usr/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.23.0-SNAPSHOT server
;;
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
;;
[:app] Configuring build.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.[:app] Compiling ...
[:app] Build completed. (519 files, 1 compiled, 0 warnings, 11,39s)
#2019-12-0900:06luizmineoBut when I try to invoke a clj-refactor command, like C-c C-m a m . It complains that refactor-nrepl is not available:
user-error: The refactor-nrepl middleware isn't available! Did you remember to install it?#2019-12-0900:09luizmineoI know I'm probably doing something stupid here, just couldn't figure it out yet 🙂 Do you have any idea?#2019-12-0900:33luizmineoSolved! I just added the refactor-nrepl middleware in shadow-cljs.edn, and it's working properly now
:nrepl {:port 8777
:middleware [refactor-nrepl.middleware/wrap-refactor]}
Thanks for the help#2019-12-0901:24frozenlockIs this a bug? cider-browse-spec doesn't seem to be able to handle aliases for namespace qualified keywords.#2019-12-0919:19bozhidarProbably it is. We didn’t get very far with cider-browse-spec unfortunately.#2019-12-0919:36frozenlockThanks, I'll play around a bit more and see if there are more rough edges.#2019-12-0918:33chrisnWe (libpython-clj) have gotten quite far in Clojure integration. Our next prong of research involves the best way to expose python classes to the repl environment and tools like company mode in emacs.
We are stuck at figuring out how the best way to integrate arbitrary python objects with cider now that we have modules and such working. We can query an object to find the attributes, and there are a subset of callable attributes on an arbitrary that provide metadata like docstrings and arglist information.#2019-12-0918:33chrisnWhere should we go to discuss this pathway and the options available with the existing orchard?#2019-12-0919:18bozhidarYou’ve come to the right place. 🙂#2019-12-0919:19bozhidarI’ll just need a bit more background about your project and what you’re trying to achieve.#2019-12-0920:21chrisnlibpython-clj is a library that provides a native embedding of libpython into the jvm via JNA. This allows you to do things like run tensorflow and pretty much anything in the python ecosystem via Clojure. Just recently, you can also do things like (require-python '[numpy :refer [linspace] :as np])
We are trying to get a full, native integration of python into the Clojure REPL and toolkits so that Python devs can use Clojure without giving up their tools and Clojure people can use Python without going nutz:
https://github.com/cnuernber/libpython-clj
We have gotten quite far and now would like to extend the orchard with some of our integration efforts.#2019-12-1016:52bozhidarI see. Looks like a cool project, but I’m not sure how we can integrate Orchard with it, as I assume this would need a lot of deps and Orchard is supposed to have none to avoid runtime conflicts.#2019-12-1023:54chrisnCompletely agreed that orchard should not have deps.#2019-12-1023:54chrisnMaybe next best step is to study compliment a bit and see if we can work with that system.#2019-12-1016:50bozhidar@manuel https://metaredux.com/posts/2019/12/10/state-of-cider-2019-results.html 😉#2019-12-1107:44manuelSuperb, thank you!#2019-12-1016:56mikerodFound a similar slurp middleware in cider-nrepl issue to <https://github.com/clojure-emacs/cider-nrepl/issues/534>
(URL. "<http://www.admin.ch/ch/e/rs/c221_302.html>")
#2019-12-1016:56mikerodcauses NPE#2019-12-1016:57mikerodOne of these style:
ERROR: Unhandled REPL handler exception processing message {:op slurp, :url , :session <id>, :id <id>}#2019-12-1016:57mikerodwith relevant stack being:
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.<init>(Matcher.java:229)
at java.util.regex.Pattern.matcher(Pattern.java:1093)
at clojure.core$re_matcher.invokeStatic(core.clj:4856)
at clojure.core$re_find.invokeStatic(core.clj:4898)
at clojure.core$re_find.invoke(core.clj:4898)
at cider.nrepl.middleware.slurp$normalize_content_type.invokeStatic(slurp.clj:46)
at cider.nrepl.middleware.slurp$normalize_content_type.invoke(slurp.clj:41)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:95)
at
#2019-12-1016:58mikerodso again, it seems like perhaps a nil is coming to this content-type matching fn#2019-12-1016:58mikerodwondering if this is something that has some info out there already or not? Or do I need to add to that issue above or new one?#2019-12-1017:00mikerodwell, put it here as well https://github.com/clojure-emacs/cider-nrepl/issues/534#issuecomment-564130121#2019-12-1100:45danielcompton@bozhidar interesting chart I made from the survey results: https://docs.google.com/spreadsheets/d/1qnuYelzWXrLhdCWHT1aqLZOggw9gC2DW8DWJPZCfSRY/edit#gid=772304059#2019-12-1100:47danielcompton#2019-12-1107:23bozhidarQuite insightful!#2019-12-1110:37solfAny way of not sending the result of eval functions (like C-x C-e) to the echo area?
I'd prefer to only have the result as an overlay#2019-12-1121:51bozhidar@dromar56 Set cider-use-overlays to nil.#2019-12-1121:52dpsuttonthat would inhibit the message?#2019-12-1121:52bozhidarMy bad. I misread the question. No, I think we didn’t make this part customizable.#2019-12-1121:54bozhidarMy bad. Actually we did. 😄#2019-12-1121:54bozhidarIf you set cider-use-overlays to t it doesn’t show results in the minibuffer.#2019-12-1201:48solfOh perfect! I knew about cider-use-overlays but not about that effect#2019-12-1121:54dpsuttonthoughtful @malabarba#2019-12-1121:57bozhidarIndeed! Also a master of confusing defcustom names. 😄#2019-12-1122:17malabarba😁#2019-12-1123:31rjrayHas anyone seen cider-jack-in given an error of, "Direct connection to localhost:XXX failed"?#2019-12-1123:32rjrayThis is a Linux (Ubuntu) machine, with CIDER et al all up to date. I have a similar machine at home (Ubuntu, same version) that starts the REPL just fine.#2019-12-1123:49dpsuttonCan you check the messages buffer for the command that CIDER runs and try running that command in the terminal#2019-12-1123:53rjrayWell, to muddy it up a bit more... if I exit/restart emacs, I can jack in. It seems to be a problem only after I kill a nREPL session and try to start a new one.#2019-12-1123:54rjrayAlso, when it has failed to create a session, there is still a running java process in the background, running the nREPL code. If I kill that process, I get a notification message in emacs. Even though I had no active connection to a nREPL...#2019-12-1214:26bozhidarWhat are the exact commands you’re using?#2019-12-1220:08rjrayI'm not sure. I just call cider-jack-in, and it starts the nREPL. This process starts up successfully, and is running (I can check this with ps). For some reason, emacs itself is not able to get the connection to the given port on localhost.#2019-12-1213:46andrea.crottisometimes it would be nice to restart Emacs without having to then kill all the nrepls open#2019-12-1213:47andrea.crottiI wonder if it's possible to keep the flow as it is, but using something like tmux to start the lein process, so that killing Emacs won't kill it#2019-12-1213:48andrea.crottiI can of course start a repl manually outside of Emacs and connect, but if there was a semi automatic way it would be great#2019-12-1214:26bozhidarAnother day, another CIDER blog post https://metaredux.com/2019/12/12/hard-cider-customizing-the-evaluation-results.html#2019-12-1214:26bozhidarcider#2019-12-1216:34Setzer22Hi! I'm having a very strange issue with cider. I'm developing a docker application, and during development, I spawn a repl using leingen inside the container, map the port to the host, and connect from my emacs using cider-connect. When launching my containers normally, this works without issue. However, when I use an alternative deployment method called docker-swarm, I get a "Sync nREPL request timed out" error right after attempting a cider-connect.
On a terminal in the same machine emacs is running on, I can run LEIN_REPL_PORT=1234 lein repl :connect, and this connects to the repl inside the container just fine (assuming it's running on port 1234). This makes me thing cider may be at fault here. But I can't think of anything that may be different between a plain lein :connect and what cider does internally that would cause the second to time out.
Any ideas?#2019-12-1217:31Setzer22A bit more context: Also tried connecting using Calva (VS Code) and it all seems to work flawlessly. It definitely looks like an issue on the cider side, so I'm submitting a bug report#2019-12-1221:30agThere was a function for sorting ns requires, was it removed recently?#2019-12-1221:35agnevermind.. it’s still here. helm update borked something up, it wouldn’t come up in M-x menu#2019-12-1306:45bozhidar@jsanchezf I don’t use Docker, but @dpsutton might be able to help you with this.#2019-12-1307:59Setzer22@bozhidar Thanks! Let's wait and see then. Fortunately, I don't need docker-swarm on my dev machine (it would just be more convenient), so I still can get a REPL and get some work done in the meantime 😅. I've also submitted this as an issue to the repo: https://github.com/clojure-emacs/cider/issues/2769 I took some time to do proper testing with a clean emacs to rule out this may be anything in my emacs config.#2019-12-1808:21tianshuCan I ask cider to use a release jar, instead of download snapshot everyday?
The network to clojars is pretty bad for me 😞#2019-12-1808:28dominicmI think it does if you're on stable#2019-12-1809:22bozhidarIndeed.#2019-12-1809:23bozhidarGenerally even the master build uses snapshots only up to a point - when we get to the first alpha release.#2019-12-1815:18FiVoWhen stepping in the cider debugger is there a way so that the buffer with the locals gets updated automatically?#2019-12-1816:38tianshu@dominicm @bozhidar thanks!#2019-12-1817:17erwinrooijakkers> Favourite Features
> When asked to highlight their favourite features in CIDER most people pointed out the following:
> The debugger
> The (value) inspector
> Interactive programming#2019-12-1817:17erwinrooijakkersWhat is the (value) inspector??? 🙂#2019-12-1817:18erwinrooijakkerscider-inspect of cider-inspect-value I guess#2019-12-1817:41tianshuI found this inspector not work in ClojureScript in my case.
But I can't find an issue about this, I think this problem should be obvious, because in my case, cider-inspect can work even with very simple value, like {:a 1}.#2019-12-1913:45aisamuSame here, it spits an error but prints the thing in the process 😬#2019-12-1818:22frozenlockIs there a library to enable NAT traversal for CIDER, or perhaps more specifically NREPL? I have an application installed on a remote machine behind a firewall and I'd like to connect to its REPL. I also have a server that could act as the reachable 3rd party for both this remote machine and my workstation. Obviously I want to keep everything secure, otherwise I'd just forward the REPL port in the firewall settings.#2019-12-1913:46aisamuWould https://github.com/nrepl/drawbridge help?#2019-12-1917:16frozenlockIt would still require a 3rd party to allow the firewall traversal and I'm not sure it would be any simpler. However I will keep it in mind, thanks!#2019-12-1818:22frozenlockI also can't SSH directly into the remote machine.#2019-12-1818:28mccraigmccraig@frozenlock ssh -L tunnel via your jump host should work, the tunnel target can be on a remote machine#2019-12-1818:32frozenlockBy that I also meant that the machine might not have ssh available. I should have been more explicit. In my current case on it's on Windows. All I really have to work with is my application jar.#2019-12-1818:42frozenlockHmm actually I wonder if something could be done with a SSH library. @mccraigmccraig thanks for the hint, I'll explore this path.#2019-12-1903:36yuhanace-link now supports cider inspector 🙂 https://github.com/abo-abo/ace-link/pull/59
I find it really handy for navigating directly to an inspectable object#2019-12-1909:54bozhidarNice!#2019-12-1910:21Setzer22I think I've spotted a minor bug in the CIDER step debugger. When trying to instrument for debugging a function which contains a method call imported with the (old!) import-static library (https://clojure.github.io/clojure-contrib/import-static-api.html), cider-nrepl throws a StackOverflow error.
This is because the way in which this library works. For example, if I say:
(import-static java.lang.Integer parseInt)
A parseInt macro is created in my current namespace, which expands like this:
(parseInt "3") ==> (. java.lang.Integer (parseInt "3"))
Trying to evaluate this with the debugger crashes with a SatckOverflow.
I suspect cider is not correctly interpreting the dot special form, and recursively macroexpands the (parseInt) static call until it crashes. Note that this code compiles just fine, it's just when cider tries to instrument it that it fails because the macroexpand phase is not done correctly.
Do you think I should I report this as an issue? Or is support for something like this not considered?#2019-12-1915:40solfOkay time to check the options cider has to limit the pretty-print output, I've had to restart emacs twice already after the wrong eval command on a big variable#2019-12-1921:42papachanhttps://docs.cider.mx/cider/usage/pretty_printing.html#_limiting_printed_output#2019-12-2004:16solfYep, what I needed! I think I'm going to put a fairly low value, something like 10-20k maybe? I tried with 100k (original value is 1M) and it still crashes emacs.#2019-12-2216:29KevinHow come when I run cider-jack-in-clj it executes shadow-cljs instead of lein ?#2019-12-2216:30KevinWhile being in a .clj file#2019-12-2216:30KevinIs that intended?#2019-12-2216:30Kevin(I do have a shadow-cljs.edn file, but I want to run lein)#2019-12-2216:40dpsuttonWhen there’s two build files present it should ask you to choose. There’s a var you can set called something like cider-preferred-build-tool. Perhaps you have set this in the past?#2019-12-2216:53KevinAhh that was it. It was added to my custom config for Emacs, and didn’t realize it 🙂#2019-12-2216:53KevinThanks!#2019-12-2216:54dpsuttonFor sure. That type of var is usually best in dir-locals for exactly that reason#2019-12-2216:55KevinGood point#2019-12-2310:11andrea.crottisomething weird going on since yesterday, starting a repl with cider I get
Caused by: java.lang.IllegalAccessError: reader-error does not exist
at clojure.core$refer.invokeStatic (core.clj:4249)
clojure.core$refer.doInvoke (core.clj:4217)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$load_lib.invokeStatic (core.clj:5966)
clojure.core$load_lib.doInvoke (core.clj:5928)
clojure.lang.RestFn.applyTo (RestFn.java:142)
clojure.core$apply.invokeStatic (core.clj:667)#2019-12-2310:11andrea.crottiworks fine if I do lein repl from the terminal, anyone else seeing this?#2019-12-2310:12andrea.crottiI'm on CIDER 0.24.0snapshot (package: #2019-12-2310:12jumarHmm. Funny.
I've just tried to start our app and suddenly getting this error when I try to run cider-jack-in :
error in process sentinel: Could not start nREPL server: clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/tools/reader/edn.clj:41:7).
#:clojure.error{:phase :compile-syntax-check, :line 41, :column 7, :source "clojure/tools/reader/edn.clj"}
at clojure.lang.Compiler.analyze (Compiler.java:6808)
...
lein repl works fine
I tried to add an explicit dependency on tools.reader into my project.clj:
[org.clojure/tools.reader "1.3.2"]
But that doesn't help.#2019-12-2310:13jumarI've found this one: https://github.com/clojure-emacs/cider/issues/2236
But they say adding an explicit dependency on tools.reader did help them#2019-12-2310:14andrea.crottiah right I'm not the only one then, and doesn't actually happen in all the projects either#2019-12-2310:16andrea.crottiI cleared also everything I had in my lein profiles just to be sure#2019-12-2310:17jumarAnd still the same error?#2019-12-2310:19andrea.crottiyes same thing#2019-12-2310:20andrea.crottialso adding tools.reader as dependency doesn't help#2019-12-2310:21andrea.crottistarting the repl from the terminal and doing cider-connect works#2019-12-2310:22andrea.crottiso definitively one of the libraries used in the cider startup is acting funny#2019-12-2310:23andrea.crottiI get the same problem with an open source project btw: https://github.com/FundingCircle/topology-grapher/
if anyone else could give it a try, I'll file an issue in the meanwhile or reopen that same one?#2019-12-2310:28andrea.crottiI just tried even starting with Emacs -Q with 0 config and it's the same problem#2019-12-2310:32dominicmDo you have refactor installed?#2019-12-2310:38andrea.crottiyes#2019-12-2310:38andrea.crotticlj-refactor is an installed package.
Status: Installed in ‘clj-refactor-20191217.909/’ (unsigned).
Version: 20191217.909#2019-12-2310:38andrea.crottishould I try to delete that?#2019-12-2310:40andrea.crottimm no same thing after I delete it#2019-12-2310:41andrea.crottistrange thing is that everything was working fine until a few days ago, but I don't even see any suspicious commit recently#2019-12-2310:46jumarYep, the same for me too. I had older cider release from september so I tried to upgrade but the issue remains even with the latest version#2019-12-2310:46andrea.crottiis the full lein command printed somewhere apart from the minibuffer? it doesn't go to Messages, would be nice to see that#2019-12-2310:47andrea.crottitrying to run it without some arguments#2019-12-2310:47jumarIt goes to messages 😉#2019-12-2310:47jumar/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhost
#2019-12-2310:48jumarI get further if I exclude the refactor-nrepl plugin but then it freezes before the repl prompt shows up:
/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhostWARNING!!! version ranges found for:
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtext/org.eclipse.xtext.xbase.lib "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtend/org.eclipse.xtend.lib.macro "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].
[org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4"] -> [org.eclipse.xtend/org.eclipse.xtend.lib.macro "2.8.4"] -> [org.eclipse.xtext/org.eclipse.xtext.xbase.lib "2.8.4"] -> [com.google.guava/guava "[10.0.1,14.0.1]"]
Consider using [org.eclipse.xtend/org.eclipse.xtend.lib "2.8.4" :exclusions [com.google.guava/guava]].
Instrumented specs
nREPL server started on port 57012 on host localhost -
# and then nothing ...
#2019-12-2310:49jumarBtw. you can customize that via prefix, e.g. C-u , '
But that doesn't help anyway in this case 🙂#2019-12-2310:51jumarBtw. I'm using spacemacs#2019-12-2310:52andrea.crottiwell for me it works with the full command from the shell
$ /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl
nREPL server started on port 64850 on host 127.0.0.1 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 12.0.1+12
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=>#2019-12-2310:54andrea.crottiah the reason why I don't see it in Messages is that the buffer size is too small#2019-12-2310:54andrea.crottiand I lose that message 😄#2019-12-2310:55andrea.crottimessage-buffer-max-lines should help#2019-12-2310:56jumarAh, that's interesting. For me the error is basically the same regardless if I run it from Cider or from cmd - it's weird that it's different for you;
But then I experience a slightly different issue:
clojure.lang.Compiler$CompilerException: Syntax error compiling at (clojure/tools/reader/edn.clj:41:7).
#:clojure.error{:phase :compile-syntax-check, :line 41, :column 7, :source "clojure/tools/reader/edn.clj"}#2019-12-2310:56andrea.crottiok yeah anyway it's definitively refactor-nrepl somehow, I reproduced it also in the shell now#2019-12-2310:56andrea.crottino I think it's the same error#2019-12-2310:57andrea.crottiI was testing on another project, in that project it didn't actually fail#2019-12-2310:57jumarI tried refactor-nrepl 2.4.0 but it freezes in a similar way as if I try to exclude it completely#2019-12-2310:57jumarYep, other (simpler) project works for me too#2019-12-2310:58jumarI have tons of dependencies so it's hard to tell....#2019-12-2310:58andrea.crottimaybe one of these changes#2019-12-2311:00andrea.crottito me this command works
/usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.18\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0-SNAPSHOT\"\] -- repl :headless :host localhost, so using 2.4.0 for refactor-nrepl#2019-12-2311:18practicalli-johnI suggest also removing sayid from your Cider configuration when having issues, especially with newer versions of Cider and nrepl. Cider has its own debugger and Sayid does not get a lot of maintenance as far as I know.#2019-12-2312:02andrea.crottithe question is how do I actually disable it?#2019-12-2312:02andrea.crottiI mean apart from running the command manually in the repl without the extra args#2019-12-2312:03andrea.crottican't find anything in the cider config to do that#2019-12-2312:18practicalli-johnSayid no longer includes Cider by default, so it seems you have some code to add the sayid package (or did a packages-list-packages install). If you are using Spacemacs develop branch then just update spacemacs (git pull) and check your .spacemacs layer configuration is not including sayid (no sayid variable or sayid variable set to nil)#2019-12-2312:18andrea.crottithe problem is not sayid it's refactor-nrepl#2019-12-2312:19andrea.crottihttps://github.com/clojure-emacs/refactor-nrepl/issues/283#2019-12-2312:22practicalli-johnYou are running sayid based on the lein command line in Emacs when running cider-jack-in. Sayid has been a cause of many issues in the past. Unless you are actively debugging your entire project on a regular basis, then it is recommended that you remove sayid. The same goes for clj-refactor.
Even if there is a bug elsewhere, sayid and clj-refactor should be removed unless your development workflow actively depends on them to avoid experiencing issues that seem to be other packages when really these packages are the cause.#2019-12-2311:00andrea.crottiso yeah definitively that, can I just disable it entirely somehow?#2019-12-2311:01jumar@bozhidar could it be some recent change to https://clojars.org/refactor-nrepl/versions/2.5.0-SNAPSHOT ?#2019-12-2311:05andrea.crottiI would guess it's in one of https://clojurians.slack.com/archives/C0617A8PQ/p1577098713041900#2019-12-2311:05andrea.crottiI can't find how to disable refactor-nrepl entirely or at least pin it to 0.24 btw#2019-12-2311:05jumarI've tried to build my own version but ./build.sh install failed (`Caused by: http://java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class or clojure/spec/alpha.clj on classpath.`)#2019-12-2311:06andrea.crottiprobably too old version of clojure?#2019-12-2311:08jumarlein do clean, install works but I'm not sure that's the proper way to do it#2019-12-2311:10andrea.crottiI created this issue in the meanwhile https://github.com/clojure-emacs/refactor-nrepl/issues/283#2019-12-2312:15andrea.crottiafter a bit of bisecting this is the commit that broke it https://github.com/clojure-emacs/refactor-nrepl/commit/75f5255f0e4e701f50d30cc58216e03c2d558905#2019-12-2312:29andrea.crottiif anyone wants a workaround in the meanwhile just:
• checkout locally the refactor-nrepl project
• git checkout e35af1d1b972cfecbf5e857384234ac3f683652d to get to a working version
• lein install to install it in your maven dir (overriding the 2.5.0-SNAPSHOT that would be downloaded)#2019-12-2312:31jumarExactly what I did too. Seems to work fine#2019-12-2318:42Daniel SlutskyThank you so much for this @U0524T275!#2019-12-2312:29andrea.crottiwith that it should all work locally (at least it does for me)#2019-12-2408:15bozhidar@andrea.crotti I think the problem is caused by the fact that the currently deployed snapshot doesn’t obfuscate its dependencies (due to a bug in the Makefile).#2019-12-2408:31bozhidarI just fixed the issue. Sorry about that!#2019-12-2618:30theeternalpulseIs there a command I can call to re-display the info that first displays in the repl?#2019-12-2618:35dpsutton(cider-repl--insert-banner)#2019-12-2618:39theeternalpulsenice#2019-12-2715:09FiVoCider marks the evaluated expressions nicely on the left. Is there a way to change the color of the marker, as in my case its barely visible?#2019-12-2721:24practicalli-johnVisible evaluation markers in the fringe is the only feature I'd like for MXmas 🙂
If the pull request isn't finished off soon, I will create a new one and finish it... save me hacking cider elisp files each time I upgrade...#2019-12-2715:10dpsutton@finn.volkel https://github.com/clojure-emacs/cider/pull/2751#2019-12-2721:24practicalli-johnVisible evaluation markers in the fringe is the only feature I'd like for MXmas 🙂
If the pull request isn't finished off soon, I will create a new one and finish it... save me hacking cider elisp files each time I upgrade...#2019-12-2816:17danielglauserRecently started coding after a bit of a hiatus. Previously when working with files or directories on the file system I’ve passed around http://java.io.File objects. Things work fine for files but I run a function in the REPL that returns a http://java.io.File object that corresponds to a directory I get an exception in the REPL.
( "/tmp")
#object[.File 0x62d0be87 "/tmp"]ERROR: Unhandled REPL handler exception processing message {:op slurp, :url file:/private/tmp/, :session 8e4e013a-57b2-472d-8fb7-bbcaf27fb7ba, :id 39}
.IOException: Is a directory
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
at java.nio.file.Files.read(Files.java:3105)
at java.nio.file.Files.readAllBytes(Files.java:3158)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:90)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invoke(slurp.clj:82)
at cider.nrepl.middleware.slurp$handle_slurp.invokeStatic(slurp.clj:116)
at cider.nrepl.middleware.slurp$handle_slurp.invoke(slurp.clj:108)
#2019-12-2816:19danielglauserUsing cider 0.23.0 and cider/cider-nrepl "0.22.4"#2019-12-2816:59dpsuttonhttps://docs.cider.mx/cider/repl/configuration.html see the section on images in the repl. It works by just fetching urls and it’s a bad default I think#2020-12-2907:00bozhidarYeah, probably this should be disabled, but then I doubt we’ll ever fix it that way. The problem is long-standing and no one tried to tackle it so far. I might just delete this functionality and consider it a failed experiment.#2020-12-2907:01bozhidarThat particular issues seems trivial, though, and is easily fixable.#2020-12-2922:06mikerodThis issue has occurred for me before as well. A coworker had it happening and I had to help diagnose it as a cider issue they were seeing. Was an NPE on this content type thing. And he wasn’t trying to look at an image or anything like that. #2019-12-2816:59dpsuttonTurn it off and it should be fine#2019-12-2817:13frozenlock@dpsutton Thank you so much for this. I was wondering why I was getting weird things in my repl when handling files.#2019-12-2817:22danielglauserSweet! That worked, thanks Dan.#2020-12-2919:33flefikGetting an interesting stacktrace when connecting using cider-connect after upgrading my deps.edn to the latest version of nrepl and cider. Ideas?#2020-12-2919:36flefikThis seems related
https://github.com/clojure-emacs/orchard/issues/56#2020-12-2919:40flefikjust requiring orchard raises the same error#2020-12-2919:51flefikOkay resolved.
Solution was:
java -version returned "ubuntu-9" which could not be parsed by orchard#2020-12-2919:51flefikAfter reinstalling java from apt, the version returned looked a bit more sensible and that seems to have resolved the issue.#2020-12-2920:14bozhidarThat’s quite weird. There was no real version somewhere in there?#2020-12-2922:36flefik~ % java -version
openjdk version "9-Ubuntu"
OpenJDK Runtime Environment (build 9-Ubuntu+0-9b181-4)
OpenJDK 64-Bit Server VM (build 9-Ubuntu+0-9b181-4, mixed mode)
~ %
#2020-12-2919:33flefikERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/options {:right-margin 80}, :op init-debugger, :session f5103dea-a9c2-448a-ab8b-1f2089eaf42c, :id 24}
Syntax error compiling at (java.clj:66:5).
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3707)
at clojure.lang.Compiler$BodyExpr.eval(Compiler.java:6134)
at clojure.lang.Compiler$IfExpr.eval(Compiler.java:2729)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457)
at clojure.lang.Compiler.eval(Compiler.java:7181)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at cider.nrepl.inlined_$eval2292$loading__6706__auto____2293.invoke(info.clj:1)
at cider.nrepl.inlined_$eval2292.invokeStatic(info.clj:1)
at cider.nrepl.inlined_$eval2292.invoke(info.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at cider.nrepl.middleware.stacktrace$eval2213$loading__6706__auto____2214.invoke(stacktrace.clj:1)
at cider.nrepl.middleware.stacktrace$eval2213.invokeStatic(stacktrace.clj:1)
at cider.nrepl.middleware.stacktrace$eval2213.invoke(stacktrace.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at cider.nrepl.middleware.debug$eval1891$loading__6706__auto____1892.invoke(debug.clj:1)
at cider.nrepl.middleware.debug$eval1891.invokeStatic(debug.clj:1)
at cider.nrepl.middleware.debug$eval1891.invoke(debug.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7176)
at clojure.lang.Compiler.eval(Compiler.java:7165)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:463)
at clojure.lang.RT.load(RT.java:428)
at clojure.core$load$fn__6824.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6765.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cider.nrepl$run_deferred_handler$fn__1433.invoke(nrepl.clj:38)
at clojure.lang.Delay.deref(Delay.java:42)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cider.nrepl$wrap_debug$fn__1501.invoke(nrepl.clj:137)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_enlighten$fn__1509.invoke(nrepl.clj:163)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at nrepl.middleware.session$add_stdin$fn__1084.invoke(session.clj:326)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_clojuredocs$fn__1655.invoke(nrepl.clj:488)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_out$fn__1559.invoke(nrepl.clj:297)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_resource$fn__1583.invoke(nrepl.clj:369)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_classpath$fn__1483.invoke(nrepl.clj:111)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_spec$fn__1591.invoke(nrepl.clj:381)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_xref$fn__1647.invoke(nrepl.clj:473)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at cider.nrepl$wrap_ns$fn__1551.invoke(nrepl.clj:263)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__1069.invoke(session.clj:272)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__881.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__848.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__624.invoke(middleware.clj:16)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:18)
at nrepl.server$handle_STAR_.invoke(server.clj:15)
at nrepl.server$handle$fn__1106.invoke(server.clj:27)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.IllegalArgumentException: No matching field found: getJarFileURL for class .
at clojure.lang.Reflector.getInstanceField(Reflector.java:397)
at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:440)
at cider.nrepl.inlined_deps.orchard.v0v5v4.orchard.java$fn__2810.invokeStatic(java.clj:67)
at cider.nrepl.inlined_deps.orchard.v0v5v4.orchard.java$fn__2810.invoke(java.clj:66)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3702)
... 150 more#2020-12-3010:34jmayaalvGetting this error when trying to connect to a remote repl.
(fn STR PREDICATE ACTION)] nil edge:52446 nil t nil t helm-comp-read-get-candidates helm-cr-default helm-pattern] 6]’
(user-error \"No linked CIDER sessions\")")
Error running timer: (error "In 'cider-connect' source: '#[0 \\307\\300\\301\\305\\306\\304\\203\\303\\204
\\202\\310%\\311\\302\"\\207 [#[771 \\306\\300\\301G\\303%\\307!\\310=\\205\\311\\303\\312\"\\206\\313\\314A\\203%\\314\\241\\210\\205*\\315\\316!\\262\\317\\302\\205?\\320>\\205?\\302C\\321\\203R G\\322V\\203R!\\202S\\304\\305#\"\\207 [((edge:52446 edge 52446)) nil edge:52446 (metadata) nil nil completion-all-completions last emacs completion-metadata-get display-sort-function #[257 \\300\\301\"\\207 [sort helm-generic-sort-fn] 4
(fn CANDIDATES)] nil t copy-sequence append (helm helm-fuzzy) helm-completion-in-region--initial-filter 0 helm-completion-style helm-completion--sorting-done] 13
(fn STR PREDICATE ACTION)] nil edge:52446 nil t nil t helm-comp-read-get-candidates helm-cr-default helm-pattern] 6]'
(user-error \"No linked CIDER sessions\")")
ring any bells to someone?#2020-12-3010:34jmayaalvi get the error when typing the port#2020-12-3010:35jmayaalvafter trying a random amount of times, it works#2020-12-3010:35jmayaalvbut then it starts happens again#2020-12-3013:00alexyakushev@bozhidar Funnily enough, with the latest cider-nrepl I get a JVM crash.#2020-12-3013:00alexyakushevClasspath conflict: cider/cider-nrepl version 0.23.0-20191105.175422-4 already loaded, ALSO loading version 0.23.0-20191230.114706-5
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0xa) at pc=0x000000010d1b9e92, pid=73028, tid=0x0000000000006b0b
#
# JRE version: OpenJDK Runtime Environment (8.0_232-b09) (build 1.8.0_232-b09)
# Java VM: OpenJDK 64-Bit Server VM (25.232-b09 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C [libzip.dylib+0x2e92] newEntry+0x154
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/alex/projects/.../hs_err_pid73028.log
#
# If you would like to submit a bug report, please visit:
#
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#2020-12-3014:52bozhidar@alexyakushev Hmm, that’s weird. Other than the small updates you made to Orchard there’s almost nothing new there. Just a couple of bumped deps if I recall correctly.#2020-12-3014:54alexyakushevI also wonder where the classpath conflict might be coming from#2020-12-3015:23bozhidarIt’s weird that the error says that you’ve got 2 versions of cider-nrepl at the same time. Could it be something to do with refactor-nrepl?#2020-12-3015:24bozhidarWe recently cut a new snapshot release there as well, but I highly doubt its the culprit.#2020-12-3015:53alexyakushev@bozhidar I've tried without refactor-nrepl and it is still like that.#2020-12-3015:56alexyakushevIt doesn't fail with tools.deps, only with Boot, so there's that#2020-12-3110:08bozhidarI guess this explains why no one else has reported this problem. 🙂#2020-12-3016:24Felipe MarquesHello! I'm using spacemacs and recently, I have being seen the following error:
Error building classpath. Could not transfer artifact refactor-nrepl:refactor-nrepl:jar:2.5.0-20191224.082108-5 from/to clojars (): Range Not Satisfiable (416)
The command being used to start the repl is:
/usr/local/bin/clojure -A:dev -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
Setting cider-inject-dependencies to nil solved it. But it removes the refactor capabilities.
When changing the version with universal argument, it works.
Does any one have any idea how to solve this?
Is there a way to specify the version of this packages for cider?
Thanks!#2020-12-3017:37yuhanLooks like the dependencies are taken from cider-jack-in-lein-plugins (which is odd given that clojure-cli is being used)#2020-12-3017:39yuhanSo you could set that directly in the project dir-locals, or modify it globally#2020-12-3017:39yuhan(setf (cadr (assoc "refactor-nrepl" cider-jack-in-lein-plugins))
"your.version.here")#2020-12-3018:42Felipe Marquesthank you!#2020-12-3018:52practicalli-johnFor reference, I get the following command in Spacemacs develop branch when calling cider-jack-in in a dep.edn project.
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
I updated in the last week or so, so its pretty recent. I did not enable clj-refactor in the Spacemacs Clojure layer, so not experiencing the same problems.#2020-12-3018:53practicalli-johnIf you are on Spacemacs develop you can always disable clj-refactor to narrow down where the issue is coming from.#2020-12-3110:35alexyakushev@bozhidar FYI, I deleted the latest cider-nrepl jar from .m2 and let it redownload, and the problem is now gone. Which could mean that somehow I downloaded a corrupted jar, but my colleague had the exact same problem yesterday which was also fixed by redownloading.#2020-12-3116:16practicalli-johnIf you are using Spacemacs, I have a PR to add keybindings for the sesman session manager. There are a few Emacs keybindings, but nothing in which-key. Feedback most welcome.
https://github.com/syl20bnr/spacemacs/pull/13140
As there are no keybindings in the Clojure major mode for sesman, I didn't realise I was missing out on some useful features. I have found sesman-start so much easier to start my repls. Linking projects to a sesman session is also very useful too.#2020-01-0204:08flefikI don't like that it moves from SPC m s to SPC m R. My objection is not so that there is a change, but rather that we'll now have to depress Shift in addition to the key for a binding that is used very often (at least for me)#2020-01-0204:11flefikI use , s s, , s x and , s N several times per minute when working, so it might add a strain on my pinky.
So therefore my personal preference would probably be to keep all the repl commands under s not R.#2020-01-0220:08practicalli-john@UAEFFG05B I assume you are always pushing those three kebinging combinations as you only evaluate code in the REPL buffer directly. They can all be replaced by just , e f if you evaluate in the source code buffer rather than switching back and forth between the repl buffer and source code buffer, saving even more strain on your pinky. I also use . when evaluating multiple expressions, so even less pinky strain.#2020-01-0316:27flefikI use , e f quite a bit too. I type out or rerun test cases directly from the REPL before moving them out into test files. Thinking a little bit more about this, I should probably stop using , s s as much as I do, and just work from a buffer like you suggest.
I also don’t want to be this guy: https://xkcd.com/1172/#2020-01-0319:58practicalli-johnI appreciate that getting a consensus on how we use Emacs is not very Emacs like 🙂 Eveyone have been very reasonable and I am very greatful and much enlightened to know how everyone is using Clojure in Spacemacs.
I will leave the PR and issue for a week to see if we get more feedback from others. I have a slight modification that I think might alleviate concerns (beyond the suggestions in the issue). I will try this out over the coming week.#2020-01-0205:44fabraohello all, is there possible extend C-c C-e evaluation to show like image file or something else than text?#2020-01-0210:58bozhidarIt’s possible, but we never got to do it.#2020-01-0210:59bozhidarThe REPL already supports displaying images, but in the source buffers we never decided how exactly to approach rich data types. I recall we discussed to maybe display them in a different buffer, but we never got to doing it.#2020-01-0210:59bozhidarAnyways, the hard work was already done way back, so it should not be very hard to support this for interactive evaluations.#2020-01-0211:16fabraoHello bozhidar, I´m asking this because I saw this:#2020-01-0211:17fabraois this the way I can show images into REPL?#2020-01-0211:19fabraofrom https://github.com/clojure-emacs/cider/issues/1510#2020-01-0211:27fabraobut it´s in repl buffer, not in-line evaluation#2020-01-0211:52bozhidarThe REPL thingy is enabled by default. I just meant to do this inline you have to use the same underlying functionality.#2020-01-0212:30ziltiI am using cider with deps.edn and I'm trying to pass through a JVM option. I tried adding it to my :dev alias as :main-opts ["-J--add-modules=java.xml.bind"] since that works for building my program, but then I get errors. Same when I add it to cider-clojure-cli-global-options. Is there a place to add it?#2020-01-0212:41ziltiAh, I forgot to remove it from deps.edn when I added it to my dir-locals#2020-01-0212:41fabraoOk thanks#2020-01-0219:33didibusAny work to support spec for auto-complete?#2020-01-0220:33vemvCIDER uses https://github.com/alexander-yakushev/compliment which is extensible... you could give it a try#2020-01-0219:34didibusLike if I Spec a map, and have a fdef spec that says the arg is of that spec, then the keys could be auto-completed?#2020-01-0219:34didibusAnd similarly, the fn that I can call on that map would as well, based on showing me all fns that take that spec as an arg#2020-01-0517:22theeternalpulseI have cider-special-mode-truncate-lines t set but the cider test result buffer doesn't truncate.#2020-01-0517:56Chris O’DonnellI'm running into an interesting bug that appears to be caused by cider-nrepl middleware. If I start an nrepl server with /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' in an empty project, connect, and evaluate (.URI. ":@localhost:5432/postgres") at the repl, I get the error
Error printing return value (MalformedURLException) at .URL/<init> (URL.java:600).
unknown protocol: postgresql
Doing the same, but without --middleware '["cider.nrepl/cider-middleware"]' results in the expected result: #object[.URI 0x16b4a650 ":@localhost:5432/postgres"].#2020-01-0517:58Chris O’DonnellCan anyone else reproduce this? Should I create a github issue?#2020-01-0518:05dpsuttonI believe that’s the image displaying middleware trying to fetch the uri in your repl buffer#2020-01-0518:06dpsutton#2020-01-0518:13Chris O’Donnell@dpsutton Turning off cider-repl-use-content-types did the trick. Thank you!#2020-01-0521:43deep-symmetryYes, that is sounding more and more like it was a bad idea. It’s caused me confusion too.#2020-01-0600:42mikerodThe content type thing seems to keep causing issues #2020-01-0600:43mikerodI’ve seen NPE come from it from certain URLs too (not images either) #2020-01-0600:43mikerodSeems like if it were to exists it should have been really permissive about error cases and just fall back to not doing its image stuff. #2020-01-0600:44mikerod(I think that’s what it does? )#2020-01-0600:49deep-symmetryI agree, it should catch exceptions and just display the URL object with no complaint if it turns out to be something that isn’t a loadable image.#2020-01-0602:39yuhanWhoa, I never knew Cider could handle images - any way this could be enabled in regular eval overlays?#2020-01-0602:39yuhan(My workflow almost never involves viewing the REPL buffer)#2020-01-0608:48bozhidar@qythium Currently not, but it shouldn’t hard to build. We just couldn’t figure out the best way to display rich data for interactive evaluation. Inserting it in the buffer would be ugly, using the minibuffer is not an option and using a separate buffer might not be to everyone’s liking. Not sure if we have other options. At any rate - all the groundwork exists.#2020-01-0608:49bozhidar@mikerod @deep-symmetry Yeah, unfortunately the current solution is a little more than an alpha version and it needs some love. The original author of the feature no longer works with Clojure and progress on the rich inline results stalled afterwards. We’re looking for a hero to pick this up, as I’m knee deep in other tasks across all the projects.#2020-01-0617:58deep-symmetryAh, that’s unfortunate! Since even when it works it’s a somewhat frivolous feature, and as things stand it breaks on people who aren’t trying to do rich inline results, perhaps it should default to off until it is robust? I wish I could dive in to help but I’m also drowning in my own projects. #2020-01-0615:32mikerod@bozhidar yeah, makes sense. I wonder if there are already issues logged for it to work from?#2020-01-0615:53Drew VerleeI get the following when i try i run cidder-connect-clj
[nREPL] Establishing direct connection to <computer>-1:44589 ...
helm-M-x-execute-command: [nREPL] Direct connection to <computer>-1:44589 failed
Where can i go to find out more about why it failed?#2020-01-0615:54Drew VerleeI assumed the cider error messages buffer, but that buffer doesn't seem to be open (or i cant find it) so i assume it has no information.#2020-01-0616:14mikerod*Messages* perhaps? @drewverlee#2020-01-0616:15Drew VerleeThat is from the messages buffer.#2020-01-0616:18Drew VerleeIt seems i was picking the wrong host. I had two host options (for as long as i can remember) and they both always worked, until now. I'll have to look into it.#2020-01-0616:23Drew VerleeI need to figure out how to get information about those hosts. But i'll look into that after i get stuff done.#2020-01-0616:31mikerodah I see#2020-01-0617:58deep-symmetryAh, that’s unfortunate! Since even when it works it’s a somewhat frivolous feature, and as things stand it breaks on people who aren’t trying to do rich inline results, perhaps it should default to off until it is robust? I wish I could dive in to help but I’m also drowning in my own projects. #2020-01-0710:45yuhanIs there a command which will clean up all vars in the current ns and reload it?#2020-01-0710:46bozhidar@qythium cider-ns-refresh?#2020-01-0710:47bozhidar(it uses tools.namespace internally)#2020-01-0710:47yuhanI find that to be too unreliable and extreme, it tries reloading all code in the entire project#2020-01-0710:47bozhidarThere’s also cider-ns-reload, which does (require :reload).#2020-01-0710:47yuhancider-ns-reload doesn't get rid of temporary defs though#2020-01-0710:48bozhidarTrue.#2020-01-0710:48bozhidarWe were thinking in the past it might be a good idea to have a variant of undef-var that removes everything from an ns and then does require afterwards, but this was never implemented.#2020-01-0710:48bozhidarShouldn’t be hard, though.#2020-01-0710:49bozhidarJust one more op in cider-nrepl.#2020-01-0710:49yuhanwould it simply be something like
(doseq [[sym _] (ns-map *ns*)]
(ns-unmap *ns* sym))
followed by cider-load-buffer?#2020-01-0711:07bozhidarYep.#2020-01-0714:16kirill.salykinhi,
I am trying to expose nrepl from docker container
but facing [nREPL] Connection closed unexpectedly (connection broken by remote peer)
command: ["clojure", "-R:repl:test",
"-m", "nrepl.cmdline",
"--port", "9091",
"---host", "0.0.0.0",
"--middleware", "[\"cider.nrepl/cider-middleware\"]"]#2020-01-0714:16kirill.salykin:repl {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"}
cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}
#2020-01-0714:16kirill.salykinport 9091 also exposed#2020-01-0714:17kirill.salykinplease advice what can be the issue?#2020-01-0714:19kirill.salykinit should’ve been bind to 0.0.0.0#2020-01-0714:19kirill.salykinissues solved#2020-01-0801:42yuhanHow come orchard libs don't get added to the classpath along with cider-nrepl?#2020-01-0801:43yuhaneg. I'm trying to override a multimethod of orchard.inspect/inspect-value from the REPL to get more useful displays in the Cider inspector#2020-01-0801:59yuhanah.. I was looking at cider-nrepl's deps.edn file instead of project.clj#2020-01-0802:00yuhanwhich uses mranderson to inline all its deps 👀#2020-01-0802:03dpsuttonmaybe there's an argument to not inline the orchard deps? Those have a very small chance of colliding with the project's deps#2020-01-0802:05yuhanyeah, I was wondering why I couldn't sesman-link my local cider-nrepl project and eval the ns forms#2020-01-0802:06yuhanturns out all the orchard namespaces are renamed to eg.`cider.nrepl.inlined-deps.orchard.v0v5v5.orchard.misc`#2020-01-0802:27yuhanThe inspector could really benefit from some sort of interface to choose and display the most salient keys of a large map upfront :thinking_face:#2020-01-0815:06bozhidarWhat form of interface? Some configuration of preferred keys? I guess that will be pretty simple to do.#2020-01-0815:14yuhanYeah, although I don't know what would be the best place for that to go#2020-01-0815:15yuhanan elisp var that's passed as an argument to the :inspect op?#2020-01-0815:16yuhanor a dynamic clj var in cider.nrepl.* or orchard.* namespace?#2020-01-0802:28yuhaneg. a summary like this isn't very helpful#2020-01-0807:57dominicmI actually use orchard in my projects for miscellaneous tooling. Please keep inlining it.#2020-01-0814:02yuhan@dominicm Just curious, are you using a significantly older version of orchard that's incompatible with the cider-nrepl dep? I've never had to deal with conflicting deps on the JVM before, so not sure what effect not-inlining would produce#2020-01-0814:16dominicmI might be using a significantly older version one day, I don't want to have to change code if I have to debug an unrelated issue on an old project.#2020-01-0816:02yuhanI guess there's an inherent tension between these different uses of the library, unless there's a portable way of doing the following in a project's dev namespace:
(ns my.cider-helpers
(:require
[cider.nrepl.inlined-deps.orchard.v0v5v5.orchard.inspect :as orchard.inspect]
[my.awesome.library]))
;; human-readable display of Things in the cider-inspector buffer
(defmethod orchard.inspect/inspect my.awesome.library.Thing
[inspector obj]
(-> inspector
(orchard.inspect/render-labeled-value "Frobble" (map str (.zork obj)))))
Without similarly requiring code changes (to the v0v5v5) for every user who jacks in with a different version of cider-nrepl#2020-01-0816:08dominicmThe only solution is to not make breaking changes, and orchard is too young to promise that.#2020-01-0814:10yuhanMy perspective is having just dug into the inspector code and finding that it was easily user-extendable via the orchard.inspect/inspect multimethod, which would open up lots of possibilities eg. for user-friendly representations of domain objects like in REBL#2020-01-0814:11yuhanHowever due to inlining one would actually have to refer to the cider.nrepl.inlined-deps.orchard.v0v5v5.orchard.inspect namespace, which would break every time cider-nrepl bumps the version number#2020-01-0815:05bozhidarBtw, keep in mind there’s one more problem with not inlining orchard - currently it still has one dependency that needs to be eliminated - dynapath. It’s used only to add some resource jars to the classpath, so probably we will move this to cider-nrepl at some point.#2020-01-0816:02yuhanI guess there's an inherent tension between these different uses of the library, unless there's a portable way of doing the following in a project's dev namespace:
(ns my.cider-helpers
(:require
[cider.nrepl.inlined-deps.orchard.v0v5v5.orchard.inspect :as orchard.inspect]
[my.awesome.library]))
;; human-readable display of Things in the cider-inspector buffer
(defmethod orchard.inspect/inspect my.awesome.library.Thing
[inspector obj]
(-> inspector
(orchard.inspect/render-labeled-value "Frobble" (map str (.zork obj)))))
Without similarly requiring code changes (to the v0v5v5) for every user who jacks in with a different version of cider-nrepl#2020-01-0816:33bozhidarAlternatively - you can build a version of cider-nrepl without inlined deps and just locally override the one you downloaded from clojars.#2020-01-0817:34didibusDoes cider do something weird with ns ?#2020-01-0817:34didibusWhen using overlay eval ?#2020-01-0817:35didibusIf I eval this in order from top to bottom:
(ns foo)
*ns*
(ns bar)
*ns*
#2020-01-0817:35didibusAnd then I eval the first *ns* it shows foo, if I go eval the second *ns* it shows bar.#2020-01-0817:36didibusAs if it is automatically looking above the line I am evaling for the first ns it finds and executing the ns call before evaling the line#2020-01-0817:37didibusIf I execute the second *ns* but with (ns bar) commented out for example, it shows foo again#2020-01-0817:49didibus#2020-01-0817:57dpsuttonevaling sends the namespace of the file#2020-01-0817:58dpsutton(-->
id "750"
op "eval"
session "9eac7398-98da-4943-9188-413884151cbc"
time-stamp "2020-01-08 11:53:58.559066000"
code "*ns*"
column 1
file "/Users/dan/projects/aclaimant/acl/src/aclaimant/services/cor..."
line 78
nrepl.middleware.print/print "cider.nrepl.pprint/pr"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? nil
ns "foo"
)
#2020-01-0818:00didibusHum, interesting, so when doing buffer eval, it always eval in the context of the first ns found#2020-01-0818:01didibusabove your form#2020-01-0818:01dpsuttonyes#2020-01-0818:12bozhidarTo add a bit of details - that’s coming from clojure-mode, as CIDER just uses its mechanism for ns detection. To me this behavior seems pretty reasonable, but I guess I’m biased. 🙂#2020-01-0818:12bozhidarIf you set the ns as a buffer local for some buffer that’s going to take precedence over any ns form in the buffer.#2020-01-0818:22didibusThere's an emacs buffer local var for ns ?#2020-01-0818:22didibusAnd that would be used instead?#2020-01-0818:23didibusAnd ya, I think its reasonable, but surprising when you don't know and have code that does funky stuff with ns 😛 like using it in a do and wondering why its not changing *ns*#2020-01-0818:01didibusAnd is that eval also inside its own thread ?#2020-01-0818:03didibusOr more, I've always wondered how cider-interrupt worked#2020-01-0818:10bozhidarThere’s one session thread that’s re-used for all evaluations until you interrupt an evaluation.#2020-01-0818:10bozhidarI wrote a blog post about this here https://metaredux.com/posts/2019/12/20/userstanding-nrepl-sessions.html#2020-01-0818:35didibusAwesome! Will read up on it#2020-01-0818:14bozhidarBtw, @didibus why do you think the current behaviour is weird? To me it stands to reason that the closes ns form should be the effective ns.#2020-01-0818:26didibusMore that it is surprising, because its doing implicit things that aren't standard REPL behavior. I normally expect that what happens to the REPL are the forms I send to it, in the order I send them in. In this case, its like implicitly sending another form prior, switching the ns. I can see how that's a convenient feature most of the time. But in my case, I was wrapping the ns call inside a do and I had a macro that switches ns and back and all that. And as I was trying to test my code, I thought somehow it didn't work, but then realized it does work if run in the repl buffer or with lein run, but just not when using the overlay eval.#2020-01-0818:28didibusNow I know that it does that, so it won't be a problem.#2020-01-0818:28dpsuttonif your repl ns is foo and you're in the buffer for bar you need inline results to be evaluated in terms of bar, not whatever ns is in your repl#2020-01-0818:29dpsuttonits a convenient feature almost all of the time#2020-01-0818:30didibusI mean, need is a strong word. It's a good default I totally agree. I actually think it's cool that cider does that. Since that's what I want 99% of the time. In fact, I used to use CounterClockWise before coming to Cider a while back, and CounterClockWise was much more standard REPL based. So all evals would always be in the context of the REPL, And I got used to doing buffer eval instead of eval last-sexpr specifically because of this#2020-01-0818:32didibusBut like all "magic", when it doesn't work, you waste a lot of time wondering what the hell is going on 😛 Unless you know about the magic and what it does under the hood.#2020-01-0818:33didibusAnyways, thanks all. I have no complaints, just needed to be educated on the feature.#2020-01-0818:34dpsuttonyeah. agreed on that#2020-01-0907:09didibusI'm trying this: (setq cider-repl-shortcut-dispatch-char ?\?), but it doesn't seem to work, , is still the shortcut#2020-01-0907:14didibusHum, maybe that doesn't do what I think it does, now comma types a question mark#2020-01-0909:42bozhidar@didibus You might have to set this before requiring CIDER, as it gets bound in the keymap of cider-repl-mode.#2020-01-0915:31mikerodI read the (awesome) docs @ https://docs.cider.mx/cider/config/project_config.html#2020-01-0915:31mikerodand a question or 2 perhaps sprung into my mind that I cannot find answers to.#2020-01-0915:32mikerodI notice the mode selected is clojurescript-mode - and it discusses using clojure-mode too.#2020-01-0915:32mikerodHow do we know decide what major mode the var needs set in?#2020-01-0915:32mikerodFor instance, the example given includes cider-clojure-cli-global-options#2020-01-0915:32mikerodwhich is used during something like a cider-jack-in-*#2020-01-0915:33mikerodand the buffer you have open can be anything within the project, so not necessarily are you “in” clj/cljs major modes already when you do that action#2020-01-0915:34mikerodif I had to “guess the mode” I would have guessed cider-repl or something#2020-01-0915:34mikerodso how do you know which mode is relevant for commands you run like this#2020-01-0915:51mikerodan as an update to above question, I wanted to set cider-figwheel-main-default-options and tried these 3 in this order - closing and opening a project.clj (has clojure-mode active) buffer each time (the buffer I initiated cider-jack-in-clj&cljs from (since dir-locals are reloaded when buffer opens docs say):
((clojurescript-mode . ((cider-figwheel-main-default-options . "dev")))) ;; <- prompt asked me for build still
((clojure-mode . ((cider-figwheel-main-default-options . "dev")))) ;; <- prompt asked me for build still
((nil . ((cider-figwheel-main-default-options . "dev")))) ;; <- no more prompt - var setting was used
#2020-01-0918:39bozhidarclojurescript-mode is derived from clojure-mode, so anything you set for clojure-mode will get applied in clojurescript-mode as well.#2020-01-0918:40bozhidarYou can always find the major mode of some buffer by pressing C-h m there.#2020-01-0918:44bozhidarAs for the other part of your question - the syntax you’ve used is incorrect.#2020-01-0918:45bozhidar((major-mode
(some-var . "foo-bar"))
#2020-01-0918:45bozhidarI’m puzzled how this worked at all.#2020-01-0919:17mikerod@bozhidar woah! didn’t realize syntax was wrong - will have to try all over again - but yeah, weird the nil case worked if that’s why it wasn’t working#2020-01-0919:18mikerodbut you are saying what you do with the M-x command here has it’s mode just depend on the file you are in?#2020-01-0919:18mikerodso clojure-mode is more universal than clojurescript-mode for a clj/cljs project (covers more files). but if I try to jack-in from some, say html file buffer - the mode would still be wrong#2020-01-1009:03bozhidarYeah, if you want to jack-in from all sorts of buffers you might use nil (all modes) then. I always open some clojure file first, that’s why this is not an issue for me. :)#2020-01-0919:18mikerodeven though I think jack-in supports being called upon from any buffer from a file in the project dir#2020-01-0922:32Mehdi H.hi again @dpsutton, M-x cider-version returns CIDER 0.21.0 (New York)#2020-01-0922:35dpsuttoncan you upgrade your cider version?#2020-01-0922:37Mehdi H.ok yeah will try to move to 0.23.0#2020-01-0922:48Mehdi H.It was indeed all that was needed. Thank you for your guidance. I am mildy embarrassed that it was that easy a fix... but I did try to look at reported issues before asking, albeit not closed ones 🙂 Thanks!#2020-01-0922:50dpsuttonno embarrassment ever!#2020-01-0922:50dpsuttonhappy to help 🙂#2020-01-0922:51Mehdi H.You did! Many thanks!#2020-01-1314:22FiVoI have cider-auto-jump-to-error set to errors-only. Is there also a possibility to not popup a buffer for warnings, especially files outside of my project? I get some reflection warnings. Setting *warn-on-reflection* doesn't help as the liberaries I am loading reset it to true.#2020-01-1316:33bozhidarCan you post here a screenshot? I thought warnings ended up in the REPL only.#2020-01-1320:45FiVo@U051BLM8F Sorry for being a bit unclear. It's not actually the warning that pops up in a new buffer, but the file where the warning happens. The cursor doesn't jump to the warning, but with my setup I still see all these "open" buffers. You still want a screencast?#2020-01-1322:29FiVoHere you go. You see the buffers popup at the top left.#2020-01-1408:12bozhidarI don’t see any popups in the screencast you shared - just warning appearing in the REPL buffer as they are supposed to. I guess I’m missing something.#2020-01-1410:30FiVo@U051BLM8F popup is misleading. I used it for a lack of a better word. In the beginning there are two buffers open. I am not talking about buffers visible on the screen, but buffers I am working on. One is core.clj and the other retrieve.clj. You can see them at the top left. When I run the code more buffers "popup" in this location. I iterate through those new buffers in the end of the screencast. I want to avoid these buffers getting "opened". I hope it makes sense now.#2020-01-1506:39didibusIt seems that Cider uses snapshot versions of cider/cider-nrepl and refactor-nrepl#2020-01-1506:39didibusWhy is that?#2020-01-1507:48dominicmOnly if you aren't using it from the stable repo#2020-01-1509:12bozhidarExactly.#2020-01-1516:16bozhidarOver the weekend I’ve started working on https://docs.cider.mx/cider/cljs/overview.html (a dedicated section in the user manual for ClojureScript). It’s still in its early stages, but I’ll certainly appreciate any input and contributions from CIDER’s users, who are into ClojureScript development.#2020-01-1517:14aisamuShadow's section looks great!
Might be useful to mention shadow-select (and perhaps suggest it as the default?), since I suspect it's not uncommon to have multiple builds running in parallel (e.g. test + devcards + app, each on a separate page).#2020-01-1519:09bozhidarPRs welcome! 🙂 There’s a lot I want to add to each section, but I’ll have to find some time for this first.#2020-01-1517:46mikerod@didibus @dominicm I don’t use spacemacs, but a lot of people I work with do. I keep seeing them using the melpa latest version instead of melpa stable. Perhaps it’s just default config there - but it seems like it results in them often using a snapshot of cider. wonder if this relates to your version.#2020-01-1518:02dominicmIt is the default there#2020-01-1518:19mikerodI think that’s unfortunate. I don’t particularly find a dev environment of all cutting-edge snapshots to be that stable of an experience. Using the latest seems more of something you’d do if you wanted to actively test things to give feedback and/or work on dev.#2020-01-1519:21dominicmYeah, agree. I've always thought it an odd choice. But all you emacs people are weird vim#2020-01-1519:25mikerodWell I don’t use spacemacs but I do use emacs but default to melpa stable #2020-01-1522:26practicalli-johnYour comments are about a year out of date I believe. You can choose to if you want to a use stable package repository in the .spacemacs config.#2020-01-1522:26mikerodah, well everyone I’m referring to probably installed prior to this - so that may make sense#2020-01-1522:27mikerodis it documented anywhere where you can have it use stable instead? @U05254DQM ?#2020-01-1522:39practicalli-johndotspacemacs-use-spacelpa t in your .spacemacs config file.#2020-01-1522:42practicalli-johnIt has been around since the end of 2017 it seems.
(I haven't used the stable package repo myself, as I've not had any issues with Cider snapshots)#2020-01-1522:44practicalli-johnIt maybe that spacelpa is only available on the Spacemacs develop branch, which is very stable itself#2020-01-1522:45mikerodAh I see. Thanks for the details. When troubleshooting cider things in the past it was just confusing to see them use snaphot versions. And I wasn’t sure how to adjust it to not do that to rule it out. #2020-01-1604:18didibusBut, why does nRepl stable uses snapshot?#2020-01-1604:18didibusCider complains of mismatch version otherwise?#2020-01-1604:19didibusI also find, in practice, latest melpa is better then stable#2020-01-1604:19didibusSince most things you're behind on are bug fixes#2020-01-1604:19didibusI'm not even sure all melpa package ever transition into stable#2020-01-1604:20didibusSo sometimes stable means old outdated and buggy#2020-01-1604:30mikerodI didn’t know a stable did or could use snapshot. Hah. #2020-01-1604:32mikerodAnd your theory on snapshot is interesting. I think it seems unstable to have projects upgrading automatically with every “fix” but perhaps it works well in practice#2020-01-1604:42didibusYou might still be right though. It could be unstable cider from melpa telling me to use a weird combo of snapshot and non snapshot for middleware#2020-01-1609:42bozhidar> But, why does nRepl stable uses snapshot?
I don’t get this. Can you explain what do you mean?#2020-01-1612:44practicalli-johnSpacemacs can role back any package update. So I have had confidence to update the Emacs packages on a rough monthly basis (or a few days after bozhdar releases more awesomeness from the orchard)#2020-01-1710:06didibus@U051BLM8F I mean:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2020-01-1710:06didibusHere nrepl 0.6.0 is used with snapshot versions of the middleware#2020-01-1710:14bozhidarWell, that’s simply because we don’t need anything from the snapshot nREPL at this point.#2020-01-1710:14bozhidarOccasionally the versions of the middleware on the dev branch would be non-snapshot as well.#2020-01-1710:15didibusHum, okay, and what about this warning:
WARNING: CIDER 0.24.0-snapshot requires cider-nrepl 0.23.0-SNAPSHOT, but you're currently using cider-nrepl 0.22.4. The version mismatch might break some functionality!
More information.WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)#2020-01-1710:16didibusThough I think I just got it. CIDER 0.24.0-snapshot is the Emacs package ?#2020-01-1710:17didibusSo it means my Emacs package is not in sync with my Clojure dependency on cider-nrepl ?#2020-01-1715:16practicalli-john@didibus the error message you get is usually because you have versions of these libraries in your project. This is usually experienced when using cider-connect rather than cider-jack-in , as jack-in pushes the right version of libraries in the command line. So its usually something adding an older version in your project or build tool (Clojure CLI, Leiningen profie, etc.).
The other possibility is that it is clj-refactor as I am running the same version of Cider as you and do not have the same error when running ckder-jack-in
Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
I dont know if clj-refactor has a dependency on an older version that it is pulling in. It seems strange if so, but that is the only think I can think of from the information you have provided so far.#2020-01-1521:10ognen.ivanovskiHi everyone. Does anyone experience this behavior:
• jacked into cider
• type few spaces within a form before the closing bracket
• wait just under a second
• the form is automatically reformatted (spaces removed)
If one quits the cider session, this behavior is gone, one can type normally.
Video: https://www.dropbox.com/s/90sp9kk73yjyajh/typing.mov?dl=0#2020-01-1609:43bozhidarSeems to me you have some hook to reformat the code on save or something like this. CIDER doesn’t reformat anything by itself.#2020-01-1610:59Suvrat ApteDo you have aggressive indent installed?#2020-01-1613:43ognen.ivanovskiThanks for the hints. Yes, it seems something from my doom emacs rig is aggressively formatting. Good that I can exclude Cider. I'll check for aggressive indent; it seems like a candidate, given the github page.#2020-01-1613:44Suvrat ApteTry disabling aggressive-indent-mode and see if the behaviour changes. If it does, it’s surely aggressive-indent.#2020-01-1614:55bozhidarGenerally I don’t recommend using aggressive-indent-mode, as it tends to affect performance a lot in bigger source files.#2020-01-1615:53Suvrat ApteI completely agree with you. It makes Emacs very slow with big files. I add aggressive-indent-defun to before-save-hook. Do you know any better approach?#2020-01-1621:31ognen.ivanovskiFinally tracked the issue down. It wasn't agressive-indent-mode but this little "helper" https://github.com/abo-abo/lispy/blob/af1054843d1e258408d1bbe4cc936886aadec634/le-clojure.el#L487#2020-01-1621:32ognen.ivanovskiI suspect it errors out wihtin those save-excursion and leaves the buffer in a "cleaned up state".#2020-01-1702:51Suvrat ApteAh, okay.#2020-01-1600:22tungstenanyone know a way to make test results show up in hsplit instead of vsplit#2020-01-1602:17solfIf there isn't one built-in in cider, you can use the package shackle to do it: https://github.com/wasamasa/shackle#2020-01-1619:21tungstenthank you!#2020-01-1717:50yuhanManaged to hack together a way of displaying images in the cider inspector :)#2020-01-1808:47bozhidarGreat work! Hopefully some PR is coming our way. 🙂#2020-01-1717:53yuhanThe emacs-lisp side of things was surprisingly simple, after looking at the cider-repl code#2020-01-1722:17erwinrooijakkersHi#2020-01-1722:18erwinrooijakkersIs there a way to ” eval-last-sexp-and-pretty-print-comment “?#2020-01-1722:19erwinrooijakkersE.g., in a buffer I have:
(+ 1 2)
Then when I am after that expression and I do this command I want to see:
(+ 1 2)
;; => 3
#2020-01-1722:19erwinrooijakkershttps://emacs.stackexchange.com/a/41660/11605 suggests that it exists#2020-01-1722:23dpsuttoncider-pprint-eval-last-sexp-to-comment?#2020-01-1722:24dpsuttondoes what you want in my copy#2020-01-1722:27erwinrooijakkersHmm#2020-01-1722:27erwinrooijakkersIn mine too! 😄#2020-01-1722:30erwinrooijakkersThank you!#2020-01-1911:11borkdudeI'm getting stdin isn't a terminal when doing projectile-replace. I didn't get this before, not sure what's wrong ... any hints?#2020-01-1911:16borkdudeah, I found it. it's related to stty icrnl which I have in my zsh config#2020-01-1911:24borkdudeis there a way to use projectile-replace on only .cljc files in my project and ignore all other files?#2020-01-1922:22bozhidarNope. It goes over all files in a project, although it should be hard to add some filtering by filetype/filename.#2020-01-1918:57rschmuklerHey all! I'm running into an issue where cider-apropos seems to be freezing my emacs. This only happens when using JDK 13 and 14 preview... JDK 8 seems to work fine. Any tips on how I could troubleshoot this?#2020-01-1919:12rschmuklerHmmm looks like it's no longer working with JDK 8 either - but I think switching the JDK caused it to break in the first place - although I'm not 100% sure of that#2020-01-1919:27rschmuklerFurther investigation reveals that if I call cider.nrepl.middleware.apropos/apropos from my nrepl process it returns matches / works as expected#2020-01-1919:30rschmuklerLooks like it's a helm cider issue...#2020-01-1920:03ahungryhey all - is there any cider functionality similar to "Invoke defn at point" (where it would perhaps prompt for input for the arguments)? I find I'll often redefine/work on a function and want to execute it - this requires switching to that NS in the REPL, and then retyping to call it#2020-01-1920:05ahungryMaybe the closest workflow based thing is to wrap in a (comment and C-c C-v C-v#2020-01-1920:35ahungryok, it was simple to implement#2020-01-1920:35ahungry(defun my-cider-tinker ()
(interactive)
(let ((eval-result (call-interactively #'cider-eval-defun-at-point)))
(cider-interactive-eval
(format "(@*1 %s)" (read-string "args: ")))
))#2020-01-1920:38ahungryalthough it doesn't display the nice overlay inline like the standard C-c C-c does...guess I'll have to tinker with that#2020-01-1920:41dpsuttonyour read-string will not be able to handle most clojure literals#2020-01-1920:42ahungryWhat ones do you think it may fail on? I've tested with various literals, numbers, quoted strings, vectors, maps#2020-01-1920:44dpsuttonI think a #_(my-fun foo bar) right above the function is what i would do. i thought read-string would choke on maps and sets but i guess not#2020-01-1920:46ahungryI saw a #dbg reference in another cider-eval internal - is that something specific to cider? the hash<some form> syntax?#2020-01-1920:46ahungrynot the syntax, but the macro expansion / meaning behind it#2020-01-1920:47dpsuttonyeah that's CIDER specifichttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/data_readers.clj#L1#2020-01-1920:47ahungryty#2020-01-2019:26dmegasHi all! I am having some trouble making CIDER + shadow-cljs work with clj suitable. I cider-jack-in-cljs to my app and try to get JS autocompletion for instance in (.| js/console) (with | being my cursor) but with no result. The messages I get when I enable nrepl logging are
(-->
id "25"
op "complete"
session "dbea4a15-21ca-4b01-b3de-79dd32d13472"
time-stamp "2020-01-20 21:22:35.206522000"
context ":same"
enhanced-cljs-completion? "t"
ns "cljs.user"
symbol #("." 0 1 (type "special-form" ns "cljs.core"))
)
(<--
id "25"
session "dbea4a15-21ca-4b01-b3de-79dd32d13472"
time-stamp "2020-01-20 21:22:35.244830000"
completions ((dict "candidate" "." "ns" "cljs.core" "type" "special-form")
(dict "candidate" ".." "ns" "cljs.core" "type" "macro"))
status ("done")
)
Any idea how I could further debug my issue?#2020-01-2120:31robertkrahnSo it should work out of the box with recent cider and shadow cljs versions. Does it work e.g. with figwheel or node cljs repls?#2020-01-2221:44dmegasI tried with a figwheel-main project, unfortunately with the same results. One thing I was wondering is wether I should be seeing a context = `(prefix__ js/console)` in the message exchange with nrepl..#2020-01-2522:06robertkrahnDunno if that helps at all: https://github.com/rksm/clj-suitable/issues/2#issuecomment-578447046#2020-01-2522:09robertkrahnHere is what I'm seeing for#2020-01-2522:09robertkrahn#2020-01-2522:09robertkrahn(-->
id "31"
op "complete"
session "50c693bf-d907-4d7d-af0c-402105498456"
time-stamp "2020-01-25 23:07:46.616102642"
context "(__prefix__ js/console)"
enhanced-cljs-completion? "t"
ns "foo.main"
symbol "."
)
(<--
id "31"
session "50c693bf-d907-4d7d-af0c-402105498456"
time-stamp "2020-01-25 23:07:46.672047154"
completions ((dict "candidate" "." "ns" "cljs.core" "type" "special-form") ...)
status ("done")
)
#2020-01-2620:48dmegasThat should help me forward, I’ll try to replicate your example and see where I can go from there - thank you very much @U08LZDL1H!#2020-01-2107:37bozhidarI guess it’s best to ask @robertkrahn about this. Everything seems fine to me, but I recall there were some issues with shadow and suitable.#2020-01-2112:39andrea.crottiany clue why cider would shadow a local-set-key I've added?
I have something like
(defun ca-cider-or-dumb-jump ()
(interactive)
(if (cider-connected-p)
(cider-find-var)
(dumb-jump-go)))
(add-hook 'clojure-mode-hook
(lambda ()
(setq-local cider-repl-use-pretty-printing t)
(local-set-key (kbd "M-.") 'ca-cider-or-dumb-jump)
#2020-01-2112:40andrea.crottibut M-. is still always just cider-find-var#2020-01-2112:40andrea.crottiM-. ca-cider-or-dumb-jump
(that binding is currently shadowed by another mode)
#2020-01-2112:40andrea.crottidoes the order matter somehow? I don't think I ever noticed an issue like that#2020-01-2114:13tatutI too often accidentally print or otherwise log huge datastructures or otherwise enormously long lines... bringing emacs to its knees. is there a way to limit printing to something sensible (like max 2k line length)#2020-01-2114:23tatutI do remember seeing some truncation of output sometimes#2020-01-2114:24tatutexamining the *nrepl-messages ...* for example the "eval" response messages is something I'd like to truncate#2020-01-2114:31tatutis there a client implementation in CIDER for this closed issue? https://github.com/nrepl/nrepl/pull/79#2020-01-2114:31tatutcan't find anything with apropos#2020-01-2115:11bozhidarYeah, there is. The default however is 1MB of output.#2020-01-2116:46Eric IhliI had something semi-working before. I think it was a comint filter function that truncated stuff. Problem is it messed up syntax highlighting in my buffer because it might truncate after an opening quote but before a closing quote. I gave up. But if someone has a solution to that then I think the comint filtering would work.#2020-01-2120:41tatutwhat's the name of the config? I couldn't find it#2020-01-2120:41tatutI'd like to decrease it from 1MB to 2k#2020-01-2120:42tatutsorry if this is in the docs and I just missed it#2020-01-2123:10zane@U11SJ6Q0K I’m assuming you’re already aware of *print-length* and *print-level*?#2020-01-2206:28tatutthat should affect the accidental print ing but does it affect eval results?#2020-01-2207:12tatutfound cider-print-quota#2020-01-2209:23bozhidarIndeed.#2020-01-2309:44tatutit looks like an exception with a huge ex-info payload will still get printed without truncation#2020-01-2200:44dpsuttonI think it’s important to have the test namespaces evaled?#2020-01-2207:38dominicmI would guess that your tests folder isn't on the classpath#2020-01-2213:05oliverHi everyone,
I'm trying to set up shadow-cljs with CIDER. I've cloned the official demo repo from https://github.com/minimal-xyz/minimal-shadow-cljs-browser. I can successfully run the following from the command line:
shadow-cljs compile app
shadow-cljs cljs-repl app
shadow-cljs watch app
According to the Docs (https://docs.cider.mx/cider/cljs/shadow-cljs.html, (https://shadow-cljs.github.io/docs/UsersGuide.html#cider) CIDER should work with shadow-cljs out of the box. However, when I run cider-jack-in-cljs I first get asked
Are you sure you want to run 'cider-jack-in' without a Clojure project?
Then, after specifying shadow as REPL type and :app as the build I get the following:
error in process filter: user-error: ClojureScript is not available.
then I drop into a pure Clojure-REPL with no CLJS.
Info on this Error is scarce (see here e.g. https://clojurians-log.clojureverse.org/cider/2018-05-26), it's likely a Classpath error of some kind. (I'm running Java 1.8.0_232, Clojure 1.10.1. Emacs 26.3 and CIDER 20200120.711.)
I'm probably missing something obious here, just taking my first step with shadow-cljs (@dpsutton, you may have guessed that I'm following your suggestion to resconstruct the macchiato template in shadow-cljs)
Many thanks for any ideas you may share on this problem!#2020-01-2213:23dpsutton@services what’s your CIDER version. From memory, it’s been a while since support for shadow was added#2020-01-2213:44papachan@services thats weird it works fine for me. i have this version {:tag :tel:_20200109172020200109.1720, :attrs nil, :content nil}
You could just build a new project from scratch with this template?
lein new shadow-cljs <your-project-name> +reagent
or npx create-cljs-project [project-name]#2020-01-2213:53papachananother good ressource for cider: https://shadow-cljs.github.io/docs/UsersGuide.html#cider#2020-01-2214:36oliverOk, I've tried with the template suggested by @papachan … same result. Also I've replaced my previous version of CIDER (most recent from MELPA, 20200120.711) with the current version from MELPA-stable, which is 0.23.0… no change#2020-01-2214:38Eric IhliAre you running cider-jack-in-cljs in an emacs buffer of a file that is inside the repository? You can't run the command from a scratch buffer etc...#2020-01-2214:40oliverThat I know, I've tried running it from the shadow-cljs.edn buffer and from one of the .cljs-files under src#2020-01-2214:40dpsuttoncan you update your clojure-mode?#2020-01-2214:40oliverI am troubled however by the question Are you sure you want to run 'cider-jack-in' without a Clojure project?#2020-01-2214:41oliverNever got that using Boot or Leinigen#2020-01-2214:41oliver@dpsutton, will do#2020-01-2214:43Eric IhliYou can also do a debug-on-entry on cider--update-jack-in-cmd and then run cider-jack-in-cljs and step through and see if you notice anything funny. Like, you should probably have a (:project-dir "~/.../minimal-shadow-cljs-browser/") entry in the param plist. If not, trace it back to figure out why.#2020-01-2214:46dpsuttoni think clojure-mode is responsible for the project root. So if it doesn't speak shadow then a newer version will#2020-01-2214:49oliver@dpsutton, You got it! Turned out my clojure-mode was 20171008.743… back from when I tookmy first stab at Clojure…#2020-01-2214:50oliver…it works now … I'm wondering what other pains finding this earlier would have saved me from#2020-01-2214:52oliverMany thanks to all of you… that was really swift!#2020-01-2214:53oliverOna side note: I'm a bit surprised that CIDER didn't complain about this upon install… clojure-mode is a dependency after all…#2020-01-2214:58dpsuttoni think emacs works like that. it only ensures a dependency is satisfied, not its version unfortunately#2020-01-2215:03dpsuttonbut glad you're up and running! cider#2020-01-2215:06oliverSo am I, thanks again for your help… when it works CIDER gives me the best tooling eperience I've ever had!#2020-01-2217:42oliver@dpsutton, just for closure (no pun intended): I have now successfully ported the Macchiato template to shadow-cljs. Except for some streamlining left to be done CIDER integration works like a breeze…
At some point it might make sense to share this as an alternative on clj-templates… for now: Many thanks for your help in the process!#2020-01-2320:28dpsuttonhttps://emacsair.me/2020/01/23/magit-section/ might be interesting#2020-01-2404:04Bardia PourvakilEvery time I get an error in the REPL, this happens and I can’t find a fix #2020-01-2404:04Bardia PourvakilIt keeps indenting and I can’t get it to go back to normal #2020-01-2416:58vemvdid you try M-x cider-clear-...?#2020-01-2423:10Drew Verleei have never seen that before#2020-01-2518:29dominicmI triggered this on a colleagues computer the other day also!#2020-01-2518:30dominicmI'm a vimmer, so I pressed something unconventional#2020-01-2404:04Bardia PourvakilAnyone have any idea why this might be happening and how I could go about fixing it ? #2020-01-2415:35FiVo@bardiapourvakil I had the a similar issue sometime ago. Do you have aggressive-indent loaded?#2020-01-2415:35FiVoIn that case try
(add-to-list 'aggressive-indent-excluded-modes
'cider-repl-mode)#2020-01-2503:07Bardia PourvakilI think so thanks for the fix hopefully it works #2020-01-2503:20Bardia PourvakilWhere exactly should I be adding this? Sorry I’m a noob lol #2020-01-2503:21Bardia Pourvakil(defun spacemacs-editing/init-aggressive-indent ()
(use-package aggressive-indent
:defer t
:init
(progn
(spacemacs|add-toggle aggressive-indent
:mode aggressive-indent-mode
:documentation "Always keep code indented."
:evil-leader "tI")
(spacemacs|add-toggle aggressive-indent-globally
:mode global-aggressive-indent-mode
:documentation "Always keep code indented globally."
:evil-leader "t C-I"))
:config
(progn
(add-hook 'diff-auto-refine-mode-hook 'spacemacs/toggle-aggressive-indent-off)
(spacemacs|diminish aggressive-indent-mode " Ⓘ" " I"))))
#2020-01-2517:49FiVo@bardiapourvakil Just add it as toplevel form in your .emacs or you can try something in the :config part. Something along the lines of (add-hook 'cider-repl-mode-hook 'spacemaces/toggle-aggressive-indent-off). I don't know if that hook exists.#2020-01-2423:16Drew Verleeerr whats the best way to do repl driven develompent with libraries included as deps with a relative path.
I know there is probably a way to use the cider debugger to step into functions. as one option.
Is there a way to, idk start a repl in the main app then connect to it from the lib?#2020-01-2507:44jumarWhat do you mean by relative path?#2020-01-2507:46jumarOr rather what you are trying to achieve?#2020-01-2715:37Drew Verleesay you have project A with a dep "../some-lib" and you start a repl for project A then notice an issue with how its communicating with some-lib. So you want to see how some-lib is using the data you passed it.#2020-01-2721:12Drew Verleeactually, on second try, ^ what i described seems to just work already.#2020-01-2517:45jmckitrickI’m able to connect to a shadow build in CIDER. Now I want to connect to the CLJ part of the project, which was generated by Luminus.#2020-01-2517:46dpsuttonok. did you run cider-jack-in?#2020-01-2517:46jmckitrickYes.#2020-01-2517:46jmckitrickIt asked the sibling question. I said ‘yes’ and it silently failed. I think.#2020-01-2517:46dpsuttonand you said it silently failed? can you look in the *Messages* buffer to see if there's any information in there?#2020-01-2517:46jmckitrickOpening a CLJ file doesn’t indicate a connection, and compile buffer does not work.#2020-01-2517:47jmckitrickWill do.#2020-01-2517:47jmckitrickA session with the same parameters exists (bank/bank1:localhost:7002). You can connect a sibling instead. Proceed? (y or n) y
[nREPL] Starting server via /Users/jmckitrick/bin/lein update-in :dependencies conj \[nrepl\ \“0.6.0\“\] -- update-in :plugins conj \[cider/cider-nrepl\ \“0.23.0\“\] -- repl :headless :host localhost
Loading /Users/jmckitrick/devel/bank/bank1/src/clj/bank1/core.clj...
#2020-01-2517:47dpsuttonalso, do you have anything in ~/.lein/profiles.clj#2020-01-2517:47jmckitrickLet’s see…#2020-01-2517:48jmckitrickProfiles have all been commented out, with only ‘lein-ancient’ remaining.#2020-01-2517:49dpsuttonand you can see in your buffers list that there is only the cljs repl?#2020-01-2517:50jmckitrickI just restarted… I’m connected to CLJS/shadow. Running jack-in-clj….#2020-01-2517:51jmckitrickCorrect, only CLJS repl buffers.#2020-01-2517:51dpsuttonand you've run jack-in-clj?#2020-01-2517:52jmckitrickyes#2020-01-2517:52dpsuttonand has it silently failed again?#2020-01-2517:52jmckitrickIt asked the ‘sibling’ question and then…. nothing.#2020-01-2517:52jmckitrickCorrect.#2020-01-2517:52dpsuttonhow long have you waited?#2020-01-2517:52jmckitrick3 minutes?#2020-01-2517:53jmckitrickMaybe I should start the back end in a terminal, and just connect….#2020-01-2517:53dpsuttondo you see any buffers open? I have an *nrepl-server clojure/my-app ... buffer#2020-01-2517:53dpsuttonmaybe but it should work#2020-01-2517:53dpsuttoncan you check in *Messages* buffer for any stacktraces or errors from the startup ?#2020-01-2517:55jmckitrickSo ‘connect’ acts like it works, and I have a repl buffer, but it’s warning me that I don’t have cider-nrepl, and the buffer doesn’t have cider functionality.#2020-01-2517:55jmckitrickLet me check the buffer….#2020-01-2517:55jmckitrickNo errors at all.#2020-01-2517:55dpsuttonyeah. if you go the connect route your are responsible for ensuring that the middleware are set up#2020-01-2517:55dpsuttoni'd for sure go with the cider-jack-in version#2020-01-2517:56jmckitrickok let’s try again…#2020-01-2517:56jmckitrickcider-jack-in-cljs first#2020-01-2517:57jmckitrickSelect shadow, then the app build, then visit the ‘active builds’ page. So far so good.#2020-01-2517:57jmckitrickNow cider-jack-in#2020-01-2517:57jmckitrickConnect using sibling, Y#2020-01-2517:57jmckitrickcommand to use: lein#2020-01-2517:58jmckitrick‘Starting server…’#2020-01-2517:59dpsuttonand no error-in-process or anything like that?#2020-01-2517:59dpsuttonsee this? [nREPL] Direct connection to localhost:36703 established#2020-01-2517:59jmckitrick[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d cider/cider-nrepl:0.23.0 server
[nREPL] server started on 7002
[nREPL] Establishing direct connection to localhost:7002 ...
[nREPL] Direct connection to localhost:7002 established
Visit '' in a browser? (y or n) y
A session with the same parameters exists (bank/bank1:localhost:7002). You can connect a sibling instead. Proceed? (y or n) y
[nREPL] Starting server via /Users/jmckitrick/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl :headless :host localhost
Mark set [2 times]
line-move-visual: End of buffer [8 times]
line-move-visual: End of buffer
#2020-01-2517:59jmckitrickThat’s my *Messages*#2020-01-2517:59dpsuttonand how long did you wait?#2020-01-2518:00jmckitrickStill waiting….#2020-01-2518:00dpsuttonrun /Users/jmckitrick/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl :headless :host localhost (the exact same command) from a terminal and see if you get more output#2020-01-2518:01jmckitrickWarning: implicit middleware found: cider-nrepl.plugin/middleware
Please declare all middleware in :middleware as implicit loading is deprecated.
nREPL server started on port 50827 on host localhost - <nrepl://localhost:50827>
#2020-01-2518:02dpsuttonwhat's your lein --version?#2020-01-2518:03jmckitrick2.8.3#2020-01-2518:04dpsuttontry upgrading lein upgrade 2.9.1#2020-01-2518:05jmckitrickok#2020-01-2518:09jmckitrickSo CIDER still won’t start the CLJ REPL, but in the terminal I don’t get the warning about middleware.#2020-01-2518:10dpsuttonand you're on 2.9.1?#2020-01-2518:10dpsuttonof lein#2020-01-2518:10dpsuttondid you delete the shadow-cljs key from the project.clj file?#2020-01-2518:14jmckitrickYes and yes.#2020-01-2518:16jmckitrickNow, for what it’s worth…#2020-01-2518:16dpsuttoncan you try this?#2020-01-2518:16dpsutton~/p/c/my-app ❯❯❯ lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl
nREPL server started on port 34237 on host 127.0.0.1 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (+ 1 1)
2
user=> #2020-01-2518:16jmckitrickIf I start CLJ first it works.#2020-01-2518:17dpsuttonoh interesting. let me try tat#2020-01-2518:18jmckitrickSo it seems I can start one or the other, but not both.#2020-01-2518:20dpsutton[nREPL] Starting server via /home/dan/projects/node/bin/npx shadow-cljs -d nrepl:0.6.0 -d cider/piggieback:0.4.2 -d cider/cider-nrepl:0.23.0 server
[nREPL] server started on 7002
[nREPL] Establishing direct connection to localhost:7002 ...
[nREPL] Direct connection to localhost:7002 established
Visit '' in a browser? (y or n) n
A session with the same parameters exists (clojure/my-app:localhost:7002). You can connect a sibling instead. Proceed? (y or n) y
[nREPL] Starting server via /home/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.23.0\"\] -- repl :headless :host localhost
[nREPL] server started on 36361
[nREPL] Establishing direct connection to localhost:36361 ...
[nREPL] Direct connection to localhost:36361 established
works for me. i have no idea. is your CIDER up to date?#2020-01-2518:20dpsuttonthat's cljs and then clj#2020-01-2518:21dpsuttonand you're saying y to the sibling question?#2020-01-2518:21jmckitrickYes, CIDER 20200120.711#2020-01-2518:21jmckitrickYes, I am#2020-01-2518:21dpsutton#2020-01-2518:22jmckitrickWow, that stinks. I mean, I have had it running like that before, but not recently, and not with shadow, IIRC.#2020-01-2518:22jmckitrickWhat luminus template params did you use?#2020-01-2518:23dpsuttoni think it was lein new luminus my-app +shadow#2020-01-2518:23dpsuttonor shadow-cljs. don't remember#2020-01-2518:26jmckitrickLet me try one from scratch again.#2020-01-2518:33jmckitrickRats. I give up.#2020-01-2518:36dpsuttoni'm really sorry. would you like to try screensharing or something? that sucks that you can't get it going#2020-01-2518:38dpsuttoni can jump on a zoom and work with you if you have the time. or tomorrow if that's better for you#2020-01-2518:39jmckitrickThat would totally work for me.#2020-01-2518:39jmckitrickI’m free for the next few hours anytime.#2020-01-2518:41dpsuttonCool. In about an hour? I’ve got to do lunch first#2020-01-2518:41jmckitrickNo problem. Thanks!#2020-01-2711:09anonimitorafIs #break or #dbg still supposed to work? Because it doesnt for me. Using spacemacs btw#2020-01-2711:11anonimitorafI can start a debug session fine, can step through each line of code, etc. But, using continue doesnt stop on my #break statements#2020-01-2717:40practicalli-john@nicdaoraf are you using c or C to continue? They skip over current / all breakpoints respectively. I usually walk through with n for next and o if I want to skip over anything, like a lazy sequence.
In Spacemacs you can use , d b or M-RET d b instead of #dbg . Just re-evaluate the expression when you want to clear the debug breakpoints. I have not used #dbg or #break explicitly.#2020-01-2806:34anonimitorafOh right, yea I use , d b to start the debug session and also n or o to go through lines/blocks. But it's pretty inconvenient when you have a lot of lines of code. Can you try using #dbg or #break and see if it works for you?#2020-01-2806:53jumarI use it very rarely (#dbg) but I think you need to just "eval" the expression (functional call) and don't instrument the function explicitly (otherwise it will include breakpoints all over the place and you won't get the desired behavior.
When I do this (without calling `cider-debug-defun-at-point) it (sort of) works:
(defn test [x]
(println x)
(inc x)
(inc (#dbg ^{:break/when true} inc x)))
(test 2)
But it only stops at the given expression, it seems you cannot step-by-step after that.#2020-01-2807:01yuhanI use both #dbg and #break pretty frequently and they're working fine for me - as far as I understand, only the tagged form is instrumented, so you can't "step outside" of it#2020-01-2820:40anonimitoraf@U06BE1L6T How do you just "eval" without instrumenting?
@UCPS050BV Right, as a later post in the channel sugfested, I took a look at the docs and apparently there are interesting and non-interesting forms(?) so maybe I should just have a play around with where I place #break or #dbg#2020-01-2908:10jumar@U0B1V8NLU put #dbg inside the function body and then cider-eval-defun-at-point. After that you can call the function and evaluation should stop at the breakpoint.#2020-01-2721:10mikerodEncountering a case where most of my *out* is going only to *nrepl-server X* buffer instead of showing up in the repl with cider-version
0.24.0snapshot#2020-01-2721:10mikeroddoes anyone know what causes that situation? I’m only seeing some really old cider issues that discuss similar things - way out of date#2020-01-2721:11mikerodbasically, I can just put a println in a fn body and call that fn and not see the output#2020-01-2721:11mikerodtrying to figure out how to even narrow down where to look at this point#2020-01-2721:12mikerodI do see the out middleware being loaded on startup#2020-01-2723:19mikerodmust have had some env issues because after a clean of everything and cider restart I’m getting output to my client repl buffers now again - woops#2020-01-2806:34anonimitorafOh right, yea I use , d b to start the debug session and also n or o to go through lines/blocks. But it's pretty inconvenient when you have a lot of lines of code. Can you try using #dbg or #break and see if it works for you?#2020-01-2807:55jumarThis might be a more general emacs question but I often found cider opens a new window (such as repl window, inspector window, etc.) at the bottom; but I'd like to open it at right.
is there a way to enforce that?#2020-01-2808:03solf@jumar You can check all cider customizations using M-x customize-group cider, but if I remember correctly there weren't options for that. Now, as a more general emacs answer, the way to configure emacs to open windows the way you wants is through modifying buffer-display-alist [1]. There are also packages that help you achieve that such as shackle [2]
[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Displaying-Buffers.html
[2] https://github.com/wasamasa/shackle#2020-01-2808:46jumar@U7S5E44DB thanks for suggestions.
I haven't found anything in cider's custom vars.
I'll check those links later.#2020-01-2810:38practicalli-johnhttps://github.com/bmag/emacs-purpose might be useful too#2020-01-2813:17FiVoI also sometimes have trouble understanding the debugger. For example the following won't even compile:
(defn test2 []
(loop [i 0]
#dbg ^{:break/when (= i 7)}
(when (< i 10)
(println i)
(recur (inc i)))))
whereas the following works fine
(defn test2 []
(loop [i 0]
(when (< i 10)
#dbg ^{:break/when (= i 7)}
(println i)
(recur (inc i)))))
when replacing the #dbg... with a simple #break in the first function example, I can compile, but am not dropped in the debugger.#2020-01-2814:38yuhanyeah, the "unable to resolve STATE" errors are quite opaque especially when inside macros#2020-01-2814:45yuhanI think it conflicts especially with forms involving recur , usually I try moving the #dbg tag around to see if it compiles or resort to another method of debugging like scope-capture#2020-01-2814:47yuhanmaybe you could open an issue on Github, I've opened a few relating to the debugger but it seems to be quite a complex and not well-understood part of the codebase#2020-01-2817:18bozhidarIt’s not very complex, btw. Unfortunately no one has had time for it lately.#2020-01-2817:19bozhidarThere’s even a bit of high level documentation https://docs.cider.mx/cider/debugging/debugger.html#_debugger_internals#2020-01-2815:02FiVoyes maybe I append them to your debugger loop/recur issue#2020-01-2907:43David PhamIs there a way to use CLJ-Kondo and Cider to automatically remove unused dependencies in a namespace?#2020-01-2907:52dominicmClj refactor.el has that feature#2020-01-2916:32dmegasAn update to my effort to make cider and clj-suitable work ( https://clojurians-log.clojureverse.org/cider/2020-01-20).
I believe that clj-suitable dot completion (`(.| js/console)`) does not work with cider REPL because context does not work due to:
(defun cider-completion-get-context ()
"Extract context depending on `cider-completion-use-context' and major mode."
(let ((context (if (and cider-completion-use-context
;; Important because `beginning-of-defun' and
;; `ending-of-defun' work incorrectly in the REPL
;; buffer, so context extraction fails there.
(derived-mode-p 'clojure-mode))
;; We use ignore-errors here since grabbing the context
;; might fail because of unbalanced parens, or other
;; technical reasons, yet we don't want to lose all
;; completions and throw error to user because of that.
(or (ignore-errors (cider-completion-get-context-at-point))
"nil")
"nil")))
(if (string= cider-completion-last-context context)
":same"
(setq cider-completion-last-context context)
context)))
(https://github.com/clojure-emacs/cider/blob/master/cider-completion.el#L128).
It works perfectly from within a cljs buffer.
@robertkrahn#2020-01-3111:39FiVoHey. Trying to dig a bit into the debugger. This file mentions some read-and-instrument function which I can't seem to find. Are these some old comments? https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/util/instrument.clj#L29#2020-01-3113:08bozhidar@finn.volkel Yep. The debugger was massively changed here https://github.com/clojure-emacs/cider-nrepl/commit/807b250b0048298948c453a1c6c9527f05a93932#diff-156621f66b9a5c16a8d5eabf6bc46cd7#2020-01-3113:08bozhidarSeems we never updated some of the comments.#2020-01-3114:08FiVo@U051BLM8F Thanks. Do you mind sharing how you would actually look at instrumented code. I am currently doing something of the form:
(binding [*data-readers* (assoc *data-readers* 'break #'breakpoint-reader)]
(cider.nrepl.middleware.util.instrument/print-form
(cider.nrepl.middleware.util.instrument/instrument-tagged-code
(read-string "(dotimes [i 10] #break (prn i))"))
true true))
Which seems a bit overkill and I am not even sure this is correct. Is there an easier way?#2020-02-0116:13bozhidarThat looks reasonable to me, although if you’re playing with the code from CIDER probably you don’t need the binding form, as cider-nrepl should be setting this already.#2020-02-0116:14bozhidarI guess I really need to find some time for documenting things better. 🙂#2020-01-3115:46andrea.crottiI can't understand why cider keeps on overriding my local-set-key for "M-.", my clojure-mode-hook looks like this
ELISP> clojure-mode-hook
(smartparens-strict-mode
(lambda nil
(set
(make-local-variable 'cider-repl-use-pretty-printing)
t)
(local-set-key
(kbd "M-.")
'ca-cider-or-dumb-jump)
(local-set-key
[f5]
'helm-imenu)
(local-set-key
[f6]
'cljr-helm)
(local-set-key
(kbd "<C-f5>")
'cider-test-run-test)
(cider-auto-test-mode t))
cider-mode
#[0 "\301\300!\210\302\211\207"
[sesman-system make-local-variable CIDER]
2]
(lambda nil
(set
(make-local-variable 'sesman-system)
'CIDER))
clojure--check-wrong-major-mode)#2020-01-3115:47andrea.crottibut M-. is always bound to cider-find-var instead of the function I define#2020-02-0115:21aptHey. Sometimes I get this message when using jack-in for a project that I already had an open repl:
Dead REPLs exist. Reuse? (y or n)
The thing is, I have no idea what’s the consequence of using y or n. Also, I’m not sure if I understand what’s a ‘dead repl’. I always use n. What would be the advantage of y?
Also, would it be desirable to have an option for skipping this prompt and always using a default option?#2020-02-0115:31dpsuttona dead repl is a repl buffer whose underlying process is no longer running. You can see all of the text that has been entered but can't evaluate anymore. When you jack in, it sees you had a repl buffer and its offering to reuse that buffer since its not super useful any longer. But maybe you want to just crank up a new one instead. Your choice. No harm either way unless you want to preserve the old repl as a log or something#2020-02-0115:33aptGot it. Thanks :thumbsup:#2020-02-0217:05jhacksAm I missing something or does *print-meta* not work as intended in a cider repl? When *print-meta* is true, it only prints the metadata for vars. For example:
In a cider repl:
user> (set! *print-meta* true)
true
user> (with-meta [1 2 3] {:foo "bar"})
[1 2 3] ;; <--- MISSING METADATA
user> (def xs (with-meta [1 2 3] {:foo "bar"}))
^{:line 50, :column 7, :file "*cider-repl ~:localhost:59980(clj)*", :name xs, :ns #namespace[user]} #'user/xs
user> xs
[1 2 3] ;; <--- MISSING METADATA
user> #'xs
^{:line 50, :column 7, :file "*cider-repl ~:localhost:59980(clj)*", :name xs, :ns #namespace[user]} #'user/xs
In a bare $ lein repl started from a shell, *print-meta* works as expected:
user=> (set! *print-meta* true)
true
user=> (with-meta [1 2 3] {:foo "bar"})
^{:foo "bar"} [1 2 3]
user=> (def xs (with-meta [1 2 3] {:foo "bar"}))
^{:line 1, :column 1, :file "NO_SOURCE_PATH", :name xs, :ns #object[clojure.lang.Namespace 0x12bda6a "user"]} #'user/xs
user=> xs
^{:foo "bar"} [1 2 3]
#2020-02-0416:13jhacksAfter some digging, this issue appears to be due to a bug (https://clojure.atlassian.net/browse/CLJ-1445) in clojure.pprint/pprint, which is the default pretty-printing function in CIDER.
According to https://docs.cider.mx/cider/usage/pretty_printing.html
> [Set cider-print-fn to] nil to defer to nREPL to choose the printing function. This will use the bound value of nrepl.middleware.print/*print-fn*, which defaults to the equivalent of clojure.core/pr.
After trying this setting in Emacs:
(setq cider-print-fn nil)
I got the same output as I did in the bare $ lein repl, with proper printing
of the metadata.#2020-02-0312:16FiVoHey working on some on cider-nrepl and lein test gives me
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: *print-namespace-maps* in this context, compiling:(leiningen/core/main.clj:342:5)
other projects and for example lein repl run fine. Any ideas ?#2020-02-0313:05FiVoOk seems to be some issue related to clojure 1.8. But I still can't run the tests. With lein with-profile 1.9 test I get
Exception in thread "main" .FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath., compiling:(cider_nrepl/plugin.clj:1:1)
also tried with mranderson but that didn't help.#2020-02-0313:26FiVoOk. I had to include the dev profile. That makes 1.9, 1.10 tests work, but still stuck on 1.8.#2020-02-0319:33bozhidarUsed make test.#2020-02-0319:33bozhidarThe profile incantations are rather complex. 🙂#2020-02-0319:57FiVoAh thanks. Didn't know that needed to run before.#2020-02-0319:59FiVo@U051BLM8F that also fails with
lein with-profile +1.10,+test,+plugin.mranderson/config test
Syntax error (FileNotFoundException) compiling at (cider/nrepl/middleware/apropos.clj:1:1).
Could not locate orchard/apropos__init.class, orchard/apropos.clj or orchard/apropos.cljc on classpath.
#2020-02-0320:01bozhidarHmm, perhaps a make clean would help?#2020-02-0320:01bozhidarOrchard is definitely a dep, so I can’t imagine why this class would not get loaded.#2020-02-0320:02FiVoI also don't know if the plugin part of cider-nrepl still works with clojure 1.8. As leiningen itself now depends on some stuff of 1.9#2020-02-0320:02FiVothe make clean did the trick#2020-02-0320:03FiVoat least for now 😉#2020-02-0508:18bozhidarBtw, if you have a moment - please update those outdated comments you’ve spotted in the debugger’s implementation. Thanks in advance!#2020-02-0512:14FiVoWill do at some point.#2020-02-0514:31Joe CorneliHi everyone, I am struggling to get CIDER connected to a CLJS REPL using Figwheel.#2020-02-0514:32Joe CorneliI can get to this:#2020-02-0514:32Joe CorneliFigwheel: Stopped watching build - admin
Figwheel: Stopping Websocket Server
Figwheel: Starting server at
Figwheel: Watching build - admin
Compiling build :admin to "resources/public/js/admin.js" from ["src/cljs" "src/cljc" "test/cljs"]...
Successfully compiled build :admin to "resources/public/js/admin.js" in 1.408 seconds.
Launching ClojureScript REPL for build: admin
Figwheel Controls:
(stop-autobuild) ;; stops Figwheel autobuilder
(start-autobuild id ...) ;; starts autobuilder focused on optional ids
(switch-to-build id ...) ;; switches autobuilder to different build
(reset-autobuild) ;; stops, cleans, and starts autobuilder
(reload-config) ;; reloads build config and resets autobuild
(build-once id ...) ;; builds source one time
(clean-builds id ..) ;; deletes compiled cljs target files
(print-config id ...) ;; prints out build configurations
(fig-status) ;; displays current state of system
(figwheel.client/set-autoload false) ;; will turn autoloading off
(figwheel.client/set-repl-pprint false) ;; will turn pretty printing off
Switch REPL build focus:
:cljs/quit ;; allows you to switch REPL to another build
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application
user> #2020-02-0514:33Joe Cornelibut the prompt is still user> which is not what I want#2020-02-0514:33Joe CorneliIf I look in the browser, I see:#2020-02-0514:34Joe Corneli[Figwheel REPL] Session ID: 2bae1fc5-52ca-4b0c-bc34-60ec5e85ff6b console.js:203:20
[Figwheel REPL] Session Name: Brant console.js:203:20#2020-02-0514:34Joe CorneliSo, if I understand correctly Figwheel has connected to the application#2020-02-0514:36Joe CorneliClojureScript REPL init form: (do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))#2020-02-0514:36Joe CorneliI don't see any complaints from CIDER about missing dependencies, but I don't get the desired repl.#2020-02-0514:45Joe CorneliIs it relevant that I get the same Figwheel REPL session name when I reload the page?#2020-02-0514:54dpsuttonif you edit a file does the UI hotload the changes?#2020-02-0515:35Joe Corneli@dpsutton yes, that works#2020-02-0516:05Joe CorneliAttempting to run this inside inf-clojure I got a somewhat more revealing error message:
Prompt will show when REPL connects to evaluation environment (i.e. a REPL hosting webpage)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Syntax error (SocketException) compiling at (/tmp/form-init8063575831097884698.clj:1:73).
Permission denied
Full report at:
/tmp/clojure-8929986480762187171.edn
Process inf-clojure exited abnormally with code 1#2020-02-0516:22dpsuttoncan you run this all from the command line wihtout CIDER?#2020-02-0516:29Joe CorneliI get the same Socket Exception error as just above when running it from the command line.#2020-02-0516:32dpsuttonthen CIDER can't help you. if your project doesn't work, it can't work in CIDER#2020-02-0516:41Joe CorneliWell it maybe depends on how lein is being started... Clearly the project is working when it is run in Docker (as I said, I can connect via a web browser)#2020-02-0516:42Joe CorneliI am running it with lein repl now and I see:#2020-02-0516:42Joe Corneli[Figwheel] Successfully compiled build shared to "target/public/cljs-out/shared-main.js" in 25.204 seconds.
[Figwheel] Watching paths: ("src/cljs" "src/cljc" "test/cljs") to compile build - shared
[Figwheel] Starting Server at
JavaScript environment will not launch automatically when :open-url is false
"To start a cljs repl call `(figwheel/cljs-repl \"app\")`"
"where `app` is the build you want to attach to."
nREPL server started on port 3888 on host 0.0.0.0 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> #2020-02-0516:44Joe CorneliThe socket error came when starting it with lein fig -- -bb shared -bb shopping -b admin -r. It seems to go better without the extra instructions.#2020-02-0516:49mikerod@holtzermann17 https://clojurians.slack.com/archives/C0617A8PQ/p1580913198082800
why is this not what you want? what are you wanting?#2020-02-0516:54dpsuttonneeds the cljs prompt that shows when the app is connected#2020-02-0517:22mikerodDidn’t realize that wasn’t the one#2020-02-0517:25Joe CorneliHere's an interaction log on the command line:#2020-02-0517:25Joe Corneli$ lein repl
2020-02-05 17:19:03.291:INFO::main: Logging initialized @4551ms to org.eclipse.jetty.util.log.StdErrLog
"To start a cljs repl call `(figwheel/cljs-repl \"app\")`"
"where `app` is the build you want to attach to."
nREPL server started on port 3888 on host 0.0.0.0 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (use 'figwheel-sidecar.repl-api)
(use 'figwheel-sidecar.repl-api
nil
user=> (start-figwheel!)
(start-figwheel!
Figwheel: Starting server at
Figwheel: Watching build - admin
Figwheel: Cleaning build - admin
Compiling build :admin to "resources/public/js/admin.js" from ["src/cljs" "src/cljc" "test/cljs"]...
WARNING: cljs.core/<=, all arguments must be numbers, got [#{nil js/Number} number] instead at line 1193 resources/public/js/admin/clojure/test/check/generators.cljc
WARNING: cljs.core/<=, all arguments must be numbers, got [#{nil js/Number} number] instead at line 1193 resources/public/js/admin/clojure/test/check/generators.cljc
WARNING: Cannot resolve property getElementById for inferred type js/HTMLDocument in expression (. js/document getElementById "app") at line 14 src/cljs/com/openmarkets/exchange/ui/shopping/core.cljs
Successfully compiled build :admin to "resources/public/js/admin.js" in 34.411 seconds.
nil
user=> (cljs-repl)
(cljs-repl
Launching ClojureScript REPL for build: admin
Figwheel Controls:
(stop-autobuild) ;; stops Figwheel autobuilder
(start-autobuild id ...) ;; starts autobuilder focused on optional ids
(switch-to-build id ...) ;; switches autobuilder to different build
(reset-autobuild) ;; stops, cleans, and starts autobuilder
(reload-config) ;; reloads build config and resets autobuild
(build-once id ...) ;; builds source one time
(clean-builds id ..) ;; deletes compiled cljs target files
(print-config id ...) ;; prints out build configurations
(fig-status) ;; displays current state of system
(figwheel.client/set-autoload false) ;; will turn autoloading off
(figwheel.client/set-repl-pprint false) ;; will turn pretty printing off
Switch REPL build focus:
:cljs/quit ;; allows you to switch REPL to another build
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application#2020-02-0517:25Joe CorneliWhen I browse to 0.0.0.0:3449 I see a white page, and I found this interesting error in the log: "ClojureScript could not load :main, did you forget to specify :asset-path?"#2020-02-0517:27Joe CorneliSo, yeah, this a CIDER issue as far as I can tell!#2020-02-0517:27Joe CorneliI will ask in the #figwheel channel.#2020-02-0518:41Joe CorneliOK, I have managed to connect CIDER to the app#2020-02-0518:41Joe CorneliBut I am running into another error#2020-02-0518:41Joe CorneliThe backtrace indicates that it may have to do with cider piggieback#2020-02-0518:41Joe Corneli... Do I even need cider-piggieback?#2020-02-0518:43Joe CorneliMy sense is that I do#2020-02-0518:43Joe CorneliI think the problem was that I was browsing to the base URL in the project, not the relevant path from whith to engage with the particular app.
Now that I am past that, here are my interactions leading to the next error:
user> (require '[figwheel-sidecar.repl-api :as fs])
nil
user> (figwheel/cljs-repl "admin")
Prompt will show when REPL connects to evaluation environment (i.e. a REPL hosting webpage)
Figwheel Main Controls:
(figwheel.main/stop-builds id ...) ;; stops Figwheel autobuilder for ids
(figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
(figwheel.main/reset) ;; stops, cleans, reloads config, and starts autobuilder
(figwheel.main/build-once id ...) ;; builds source one time
(figwheel.main/clean id ...) ;; deletes compiled cljs target files
(figwheel.main/status) ;; displays current state of system
Figwheel REPL Controls:
(figwheel.repl/conns) ;; displays the current connections
(figwheel.repl/focus session-name) ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Open URL
To quit, type: :cljs/quit
nil
cljs.user> (require 'cljs.analyzer.api)
nil
cljs.user> (cljs.analyzer.api/all-ns)
And here is the error:#2020-02-0518:43Joe CorneliShow: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (12 frames hidden)
1. Unhandled clojure.lang.ExceptionInfo
#object[Error Error: No protocol method IDeref.-deref defined for
type null: ]
{:type :js-eval-exception,
:error
{:status :exception,
:value
"#object[Error Error: No protocol method IDeref.-deref defined for type null: ]",
:ua-product :firefox,
:stacktrace
"cljs$core$missing_protocol@http://exchange-cljs.test/cljs-out/admin/cljs/core.js:309:9\ncljs$core$_deref@http://exchange-cljs.test/cljs-out/admin/cljs/core.js:2162:17\ncljs$core$deref@http://exchange-cljs.test/cljs-out/admin/cljs/core.js:4927:18\ncljs.analyzer.api.all_ns.cljs$core$IFn$_invoke$arity$1@http://exchange-cljs.test/cljs-out/admin/cljs/analyzer/api.js?zx=huuvsoaczikn:197:73\ncljs$analyzer$api$all_ns@http://exchange-cljs.test/cljs-out/admin/cljs/analyzer/api.js?zx=huuvsoaczikn:183:33\ncljs.analyzer.api.all_ns.cljs$core$IFn$_invoke$arity$0@http://exchange-cljs.test/cljs-out/admin/cljs/analyzer/api.js?zx=huuvsoaczikn:193:33\ncljs$analyzer$api$all_ns@http://exchange-cljs.test/cljs-out/admin/cljs/analyzer/api.js?zx=huuvsoaczikn:179:33\n@http://exchange-cljs.test/cljs-out/admin/figwheel/repl.js line 751 > eval:1:94\n@http://exchange-cljs.test/cljs-out/admin/figwheel/repl.js line 751 > eval:9:3\nfigwheel$repl$eval_javascript_STAR__STAR_@http://exchange-cljs.test/cljs-out/admin/figwheel/repl.js:751:24\n@http://exchange-cljs.test/cljs-out/admin/figwheel/repl.js:799:56\nG__12816__2@http://exchange-cljs.test/cljs-out/admin/cljs/core.js:35676:106\nG__12816@http://exchange-cljs.test/cljs-out/admin/cljs/core.js:35943:20\nfigwheel.repl.ws_connect.cljs$core$IFn$_invoke$arity$variadic/</<@http://exchange-cljs.test/cljs-out/admin/figwheel/repl.js:1053:30\ngoog.events.EventTarget.prototype.fireListeners@http://exchange-cljs.test/cljs-out/admin/goog/events/eventtarget.js:284:23\ngoog.events.EventTarget.dispatchEventInternal_@http://exchange-cljs.test/cljs-out/admin/goog/events/eventtarget.js:381:26\ngoog.events.EventTarget.prototype.dispatchEvent@http://exchange-cljs.test/cljs-out/admin/goog/events/eventtarget.js:196:34\<http://ngoog.net|ngoog.net>.WebSocket.prototype.onMessage_@http://exchange-cljs.test/cljs-out/admin/goog/net/websocket.js:426:8\n"},
:form (cljs.analyzer.api/all-ns),
:js
"try{cljs.core.pr_str.call(null,(function (){var ret__6754__auto__ = cljs.analyzer.api.all_ns.call(null);\n(cljs.core._STAR_3 = cljs.core._STAR_2);\n\n(cljs.core._STAR_2 = cljs.core._STAR_1);\n\n(cljs.core._STAR_1 = ret__6754__auto__);\n\nreturn ret__6754__auto__;\n})());\n}catch (e184785){var e__6755__auto___184786 = e184785;\n(cljs.core._STAR_e = e__6755__auto___184786);\n\nthrow e__6755__auto___184786;\n}"}
repl.cljc: 578 cljs.repl$evaluate_form/invokeStatic
repl.cljc: 499 cljs.repl$evaluate_form/invoke
piggieback_impl.clj: 207 cider.piggieback/eval-cljs
piggieback_impl.clj: 206 cider.piggieback/eval-cljs
piggieback_impl.clj: 243 cider.piggieback/do-eval/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 1973 clojure.core/with-bindings*
core.clj: 1973 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
piggieback_impl.clj: 220 cider.piggieback/do-eval
piggieback_impl.clj: 219 cider.piggieback/do-eval
piggieback_impl.clj: 266 cider.piggieback/evaluate
piggieback_impl.clj: 264 cider.piggieback/evaluate
Var.java: 384 clojure.lang.Var/invoke
piggieback_impl.clj: 297 cider.piggieback/wrap-cljs-repl/fn/fn/fn
piggieback_impl.clj: 190 cider.piggieback/enqueue/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 171 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 170 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 834 java.lang.Thread/run#2020-02-0518:43Joe Corneli#2020-02-0518:49Joe CorneliMaybe this, again, hasn't got anything to do with CIDER#2020-02-0518:50Joe CorneliBut I see all of these mentions of cider.piggieback in the trace#2020-02-0519:31johanatanI reported this one a few weeks ago on spacemacs' github but so far it hasn't gotten any response:
https://github.com/syl20bnr/spacemacs/issues/13193#2020-02-0520:45EmmanuelOgaHey there, I have a [kinda quiet] thread going on figwheel-main but I thought here would be a good place to ask these questions too.
I'm wondering what happens when you cider-jack-in-clj&cljs ?
1. I'm using figwheel-main and deps.end, I'm wondering if there's going to be just one nREPL server (the one figwheel starts) and then cider just opens up two client connections, one for clj and one for cljs.
2. Another source of confusion is that, when starting figwheel-main from command line, I don't see which port it is running on, only the HTTP server port. I think I saw a .nrepl.port file being created on the folder of the project but I don't know under which circumstances and by whom (is it figwheel or cider?) Will that be there if I start the repl from the command line?
My use case: I want to write a "full stack" clojure app, I'm writing some middleware to handle the API for the cljs app. I'd like to connect to a clj REPL to interact with the code of the ring-middleware mounted by figwheel, but also be able to connect to the cljs repl in order to interact with the browser code.#2020-02-0604:25EmmanuelOgajust quickly answering my own questions:
1. I'm pretty sure the answer is yes, a single nREPL is enough for clj+cljs, the piggieback middleware handles the cljs specific evaluations
2. That file seems to be created by nrepl's cmd line utility: https://github.com/nrepl/nrepl/blob/be37e0ebd13c2d341bf6a7bcd5735da45b78f909/src/clojure/nrepl/cmdline.clj#L403 which cider uses when jacking-in. #2020-02-0604:26EmmanuelOgaI'm sure there's a way to specify a custom nREPL port too, but haven't found it so far.#2020-02-0604:27EmmanuelOgaFounds this repo that just worked when running cider-jack-in-clj&cljs https://github.com/EmmanuelOga/deps-cider-cljs-reagent/blob/master/.dir-locals.el#2020-02-0604:27EmmanuelOgaMore details here: https://clojurians.slack.com/archives/CALJ3BFLP/p1580899631068000#2020-02-0604:28EmmanuelOgaEOF! 🙂 #2020-02-0604:28EmmanuelOgaah! btw, here's the command cider is running for that particular repo#2020-02-0604:28EmmanuelOgaclojure -A:cider -Sdeps '{:deps {nrepl {:mvn/version ""0.6.0""} cider/piggieback {:mvn/version ""0.4.2""} cider/cider-nrepl {:mvn/version ""0.23.0""}}}' -m nrepl.cmdline --middleware '[""cider.nrepl/cider-middleware"", ""cider.piggieback/wrap-cljs-repl""]'#2020-02-0604:29EmmanuelOga...and there it is the -m nrepl.cmdline part that invokes the code that writes teh port to that file#2020-02-0520:45dpsuttonif its the interaction between clojure-mode and another package configured through spacemacs probably not much we can do in CIDER#2020-02-0522:08johanatan@dpsutton can you take a look at the issue I reported in spacemacs? It’s definitely a bug in the clojure layer of spacemacs #2020-02-0522:10dpsuttoncan you tag me on github? working now and have a haircut after work#2020-02-0522:15johanatanWhat is your GitHub username?#2020-02-0522:16dpsuttondpsutton. same as here#2020-02-0522:18johanatanWeird. It does not autocomplete. But I did type it out manually. Hopefully it will tag you.#2020-02-0522:20dpsuttongot an email. i'll look into it 👍#2020-02-0522:23johanatanAwesome, thank you!! 🙏 #2020-02-0522:11johanatan👍:skin-tone-2:#2020-02-0609:54Bardia PourvakilEvery time I get an error in my spacemacs cider repl, it indents my prompt all the way to the right. Only way to remove it is to restart. Anyone run into this problem before and have a fix ? #2020-02-0611:30bozhidarI’ve seen a bunch of people report this problem recently, but I can’t think of any recent changes that might have caused it.#2020-02-0611:31bozhidarIt seems that the error message somehow messes up the prompt boundary’s detection. You seem to have a simple repro, so please file this on GitHub.#2020-02-0613:22dpsuttonYou should be able to clear the repl output (C-c C-c C-o) and the be back left aligned#2020-02-0615:12practicalli-john@bardiapourvakil it , s l in Evil normal state or M-RET s l in Emacs state to clear the REPL buffer in Spacemacs, although the CIDER keybinding should still be there too.#2020-02-0618:25frozenlockWhen a function argument is a map with destructuring, is there a way to keep it from disappearing as soon I start typing the map? (From eldoc / the minibuffer). For example if the arguments are ([{:keys [key1 key2]}) and I start typing (my-fn {:key1 .#2020-02-0619:12bozhidarCurrently there’s not.#2020-02-0619:15frozenlockOk, thanks#2020-02-0701:10fabraohello all, is there any way to include a parameter like '-d <some-stuff>' in cider running?#2020-02-0710:49practicalli-johnUse the Emacs universal argument before calling the command to start the repl and you get an editable prompt with the command to start the repl
C-u in Emacs or SPC u in Spacemacs followed by the sesman-start command or any of the specific cider-jack-in or cider-connect commands
If you always want to add a parameter, then use a .dir.local.el file in your project.
If using deps.edn project, define an alias and use that when editing the command, or set the alias as default in the .dir.local.el file.#2020-02-0702:15dpsuttonYou mean in the startup command?#2020-02-0718:32FiVoHey, I just stumbled across this post https://www.hackingcider.com/posts-output/2017-04-30-eval-walkthrough/ via clojure-emacs repos. I think it would be good to link to that from the hacking cider section of the docs. Is there a reason this was split from the normal docs? I think it would be great to have one place for internal doc, but just my 2cents.#2020-02-0718:36FiVoAlso I have some trouble figuring out where in the debugger the actual reading happens. I mean the message has a :code field that at some point gets read and evaled. But I can't quite figure where the reading (from string to clojure data) is happening. At this point we already have the "read" code: https://github.com/clojure-emacs/cider-nrepl/blob/d474399665454e64a759870235df1084319a3bd7/src/cider/nrepl/middleware/debug.clj#L595#2020-02-0718:59bozhidar@finn.volkel I think @dpsutton was running http://hackingcider.com. I recall he wrote a few great posts early on.#2020-02-0719:00bozhidarI wouldn’t mind have a section like this one in the official docs. We just have to be careful to keep it in sync with the implemenation.#2020-02-0719:16dpsuttonyeah. i made http://hackingcider.com to have people post articles. things that are more how to work on CIDER. they could have tips on setting up dev environment, walkthroughs, etc. more article rather than reference/doc#2020-02-0811:53FiVoHow would I best go about hacking on cider-nrepl and nrepl simuntanously?#2020-02-0817:09bozhidar@finn.volkel That’s how I do it https://nrepl.org/nrepl/0.6.0/hacking_on_nrepl.html#_interactive_hacking#2020-02-0817:10bozhidarhttps://docs.cider.mx/cider/contributing/hacking.html#_hacking_on_cider_nrepl_clojure#2020-02-0817:10bozhidarIt’s easier for cider-nrepl, because you don’t have to restart the server and you can just keep evaluating code and you’ll get instant feedback.#2020-02-0817:50FiVo@bozhidar Maybe I misunderstood you, but I was more wondering how to do it in the same repl session. So you jack-in into cider-nrepl and also point the cider-nrepl to the local copy of the nrepl and whenever something in the nrepl changes you create a new connection?#2020-02-0817:51bozhidarYeah, exactly.#2020-02-0817:51bozhidarWhatever you evaluate will replace the definitions that have been loaded. Interactive development inception. 😄#2020-02-0817:54FiVoYeah, I mean for cider-nrepl I was already doing it, but now for two projects at the same time, that's new.#2020-02-1110:52plexuswhen I eval a form in a cljc file, is there a way to tell cider that for this buffer I only want it to use the cljs context?#2020-02-1110:58kommen@plexus I think I once looked into it and the only thing I found was to change the major mode from clojurec-mode to clojurescript-mode#2020-02-1116:26FiVo@bozhidar Is there a reason that the force-out debugger operation is not yet implemented on the emacs side?#2020-02-1116:26FiVohttps://github.com/clojure-emacs/cider/blob/990023abe1c4eb8c2cf0ef73fd179081721a69bb/cider-debug.el#L411#2020-02-1116:27FiVohttps://github.com/clojure-emacs/cider/blob/990023abe1c4eb8c2cf0ef73fd179081721a69bb/cider-debug.el#L435#2020-02-1116:29FiVoIt's even in the docs.#2020-02-1204:37bozhidarI don’t remember. Likely some oversight.#2020-02-1204:37bozhidar@U051C77FP Might remember things better, as he was doing most of the debugger-related work.#2020-02-1402:22malabarbaNot sure. I think it just didn't seem necessary m#2020-02-1202:08fiddlerwoaroofIs it possible to prevent cider from printing out errors?#2020-02-1202:11fiddlerwoaroofnevermind#2020-02-1307:02tianshuIs it possible to automatically set namespace in repl after :cljs/quit ?#2020-02-1307:05bozhidarCurrently not. Generally something like this should ideally be handled by the REPLs themselves, not by CIDER.#2020-02-1307:31tianshuokay, thanks!#2020-02-1412:23Joe CorneliI am working on a web app where the debugger often stops after I have had one round of debugging (C-u C-M-x, load web page, debug function, load web page, debugger doesn't work anymore). I saw the issue here and added a comment: https://github.com/clojure-emacs/cider-nrepl/issues/460 However I am missing a nice minimal reproduction case.#2020-02-1412:23Joe CorneliCan anyone advise me on how to gather information on the "health" of the debugger, so that I can at least make a more meaningful report?#2020-02-1417:11Joe CorneliHere are a couple of aberrant cases summed up: https://github.com/clojure-emacs/cider/issues/2796#2020-02-1508:47bozhidar@holtzermann17 Maybe @finn.volkel can help you with this? He has been working on some debugger fixes recently. In a week or two I should have a bit more time for CIDER myself.#2020-02-1508:48bozhidarBtw, CIDER 0.24 (“India”) is out! Check out the release notes here https://github.com/clojure-emacs/cider/releases/tag/v0.24.0#2020-02-1509:18FiVo@holtzermann17 I think it would be good if you post the function you are debugging even if the context is missing and describe the steps even more elaborate. When you debug, do you call continue, next or quit etc? Do you do the page reload while still in debug mode etc.. Otherwise it's difficult to know what might be the problem#2020-02-1509:55tvirolaiHi. I’m setting up a new machine and seem to be bitten by this old issue: https://github.com/clojure-emacs/cider/issues/1945. When doing a cider-jack-in, I get this:
[nREPL] Starting server via /Users/tuomo.virolainen/bin/lein update-in :dependencies conj \[nrepl\ \"0.6.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.24.0\"\] -- repl :headless :host localhost
[nREPL] server started on 49378
[nREPL] Establishing direct connection to localhost:49378 ...
error in process filter: nrepl--direct-connect: [nREPL] Direct connection to localhost:49378 failed
error in process filter: [nREPL] Direct connection to localhost:49378 failed
When trying to connect to that port with telnet, I get this:
❯ telnet 127.0.0.1 49378
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
❯ telnet localhost 49378
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
So it seems exactly like the issue described in the ticket. But that should be fixed by now, right? And the original workaround, putting `:repl-options {:host "::"}` in the Leiningen profile doesn’t help either. But can connect to the nREPL server started by Cide using Vim (Fireplace)… Any ideas how to fix this?#2020-02-1509:58tvirolaiI’m on OS X Catalina, OpenJDK 11 and my /etc/hosts looks like this:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1
#2020-02-1515:26dpsuttonone thing to check, can you spin up `
python -m SimpleHTTPServer 8000
somewhere and then hit that from a web browser at localhost:8000? I'm wondering if you lack the localhost alias in your hosts file#2020-02-1610:48tvirolaiThat works, so the issue doesn’t seem to be in the hosts file. But now it seems that my whole Emacs setup is somehow messed up, since I can’t fetch packages anymore.#2020-02-1610:44Joe Corneli@finn.volkel The first part of https://github.com/clojure-emacs/cider/issues/2796 should be easy to reproduce and hopefully easy to fix. Reproduction steps are "Cider jack in, debug function, cider-quit."#2020-02-1710:54pithylessThe cider-format-* functionality (on the spacemacs develop branch) is not applying my indent rules specified via define-clojure-indent in the clojure-mode-hook . Is this by-design? Should I be using a different approach? Or perhaps defining it for a different mode? It works if I indent via = in evil-mode. The cider docs seem to only cover the {:style/indent ...} metadata approach.#2020-02-1714:02plexushow do I link a buffer to a repl in another project? I feel like sesman-link-with-* should do this, but it doesn't#2020-02-1714:02plexusor something's off, I can see the link in sesman-browser, but the buffer still says [not connected]#2020-02-1714:03plexusoh nevermind seems it has to do with clj/cljs repl type#2020-02-1715:14Andrzej PHi. I’m attempting to use clj-refactor and am using the latest stable Emacs, and Cider.
• As per the instructions I install clj-refactor version 2.4.0 from MELPA Stable and have (require 'clj-refactor) in my init.el.
• In a fresh Leiningen project I do cider-jack-in and see that the refactor-nrepl middleware is loaded
• Doing cljr-rename-symbol on e.g. the local x in foo in core.clj asks if the project should be evaluated
• Saying y results in the message “Symbol’s value as variable is void: peg-stack”
What am I doing wrong? 😕#2020-02-1812:23bozhidar@andrzej046 There were some breaking changes to the peg.el library that clj-refactor is using internally. I recall that a workaround was to use an older version. I was also under the impression work started to replace edn.el (which uses peg.el) with @plexus’s parseedn.el. I’ll have to check how far we got there.#2020-02-1812:24bozhidarI’m assuming the problem you encountered is https://github.com/expez/edn.el/issues/7#2020-02-1819:02Andrzej PYes! That was exactly it!#2020-02-1819:06Andrzej PThanks 🙂 . I’ve pinned peg to the melpa-stable archive for now and installed peg version 0.6. It works as expected now.#2020-02-1812:24bozhidarI also see we have yet to switch to the new library.#2020-02-1812:29bozhidarAs the changes are trivial I’ll try to handle them myself later this week. There’s no time like the present. 🙂#2020-02-1816:48rschmuklerWhen using cider w/ both cljs + clj, cider-apropos inside a cljs buffer seems to be using the clojure apropos instead of cljs.repl/apropos - is there a different function / nrepl op that I should be using to get cljs results? If not, where would be the best place to extend this functionality (and perhaps submit a PR)#2020-02-1816:49rschmuklerNote that it's using the cljs host process clojure apropos, not the sibling clojure apropos (ie. it seems to be dispatching to the correct nrepl, just using clojure's namespace, instead of cljs')#2020-02-1816:56dominicmI don't think we have an implementation in orchard for clojurescript var searching.#2020-02-1817:11rschmuklerLooking through that code now... Looks like perhaps a function could be added to cljs/analysis.cljc that dispatches to the cljs.repl and returns maps in the same shape as the stock apropos? Once that's added, nRepl would also have to be extended to support a new op that calls that code too right? and then lastly cider w/ a function that calls the dispatch op?#2020-02-1910:47bozhidarIdeally we’ll just have in Orchard a version of apropos that works for the ClojureScript and cider-nrepl will pick the right function in Orchard based on the type of the current nREPL session (Clojure or ClojureScript). You can see how macroexpansion, info or completion works in cider-nrepl to get an idea of what I mean.#2020-02-1910:45bozhidarFYI - I’ve updated clj-refactor.el to use parseedn! party-corgi#2020-02-1914:39Ian Fernandezhey guys, I'm having a problem on C-x C-e an expression here on emacs#2020-02-1914:40Ian Fernandezerror in process filter: eval: Wrong type argument: characterp, nil#2020-02-1914:40Ian FernandezI dunno why this ocurring#2020-02-1914:41dpsuttoncan you M-x toggle-debug-on-error to get a stacktrace#2020-02-1914:42Ian FernandezDebugger entered--Lisp error: (wrong-type-argument characterp nil)
pretty-font-lock-compose-symbol((("sqrt" . 8730) ("nil" . 8709) ("=>" . 8658) ("->>" . 8608) ("->" . 8594) ("<-" . 8592) ("fn" . 955) ("or" . 8744) ("and" . 8743) ("not" . 172) ("not=" . 8800) (">=" . 8805) ("<=" . 8804)))
eval((pretty-font-lock-compose-symbol (quote (("sqrt" . 8730) ("nil" . 8709) ("=>" . 8658) ("->>" . 8608) ("->" . 8594) ("<-" . 8592) ("fn" . 955) ("or" . 8744) ("and" . 8743) ("not" . 172) ("not=" . 8800) (">=" . 8805) ("<=" . 8804)))))
font-lock-fontify-keywords-region(1 4 nil)
font-lock-default-fontify-region(1 4 nil)
font-lock-fontify-region(1 4)
cider-font-lock-as(clojure-mode "nil")
cider-font-lock-as-clojure("nil")
cider--display-interactive-eval-result("nil" #<marker at 1700 in missing_authorization_number.clj>)
#f(compiled-function (buffer value) #<bytecode 0x178c9fd>)(#<buffer missing_authorization_number.clj> "nil")
#f(compiled-function (response) #<bytecode 0x16648e5>)((dict "id" "35" "ns" "missing-authorization-number" "session" "9d1e083f-27d1-49c2-8e16-5d24b499fea9" "value" "nil"))
#f(compiled-function (response) #<bytecode 0x166499d>)((dict "id" "35" "ns" "missing-authorization-number" "session" "9d1e083f-27d1-49c2-8e16-5d24b499fea9" "value" "nil"))
nrepl--dispatch-response((dict "id" "35" "ns" "missing-authorization-number" "session" "9d1e083f-27d1-49c2-8e16-5d24b499fea9" "value" "nil"))
nrepl-client-filter(#<process nrepl-connection> "d2:id2:352:ns28:missing-authorization-number7:session36:9d1e083f-27d1-49c2-8e16-5d24b499fea95:value3:niled2:id2:357:session36:9d1e083f-27d1-49c2-8e16-5d24b499fea96:statusl4:doneee")#2020-02-1914:44dpsuttonlooks like a bug in pretty-mode?#2020-02-1915:07Ian Fernandezyeah, deaticvated pretty-mode#2020-02-1915:07Ian Fernandezthanks 😃#2020-02-1917:43FiVoIs it possible to set host and port for cider-connect in dir-local.el?#2020-02-2008:41bozhidarWe used to have nrepl-port and nrepl-host vars for this, but we removed them at some point and probably there’s nothing that you can use right now. Shouldn’t be hard to change this, though.#2020-02-1921:14bfayAnyone have tips on debugging weird out of memory repl issues?
I'm inconsistently getting this thing where starting a repl in one of my work projects and eval'ing a form in it (sometimes even just a simple (+ 2 2))), I get a timeout and heap space exception.
Stack trace is pretty huge but here's most of it in a snippet:#2020-02-1921:14bfay#2020-02-1921:15bfayI guess it's something to do with compliment, which is for autocompletion, perhaps getting into an infinite loop?#2020-02-2008:39bozhidar@bfay Yeah, it looks like a bug in compliment. Might be something to do with the deps in your projects. It’d be best to file a ticket, so @alexyakushev can investigate the problem.#2020-02-2021:49bfayThanks, I'm unfortunately having trouble reproducing it consistently, I'm in a project that has a ton of stuff on the classpath from amazonica and sun and apache commons, there's literally tens of thousands of classes. It's amazing to me that it ever works at all
When I have the issue I can't really debug it, because my repl is in an unresponsive state. I can open an issue, but I feel like I couldn't really be specific enough about the problem for others to reproduce it, without just sharing the whole project (which unfortunately is private code that I can't share)#2020-02-2010:26solfAfter I added a new dependency to project.clj, is there a cider command that would allow to download & install that dependency without having to restart lein?#2020-02-2010:45bozhidar@dromar56 Currently no.#2020-02-2013:10Joe CorneliIs it possible, within an interactive debug session, to save a variable to the REPL?#2020-02-2013:10Joe CorneliI can inspect the value with "p" but this isn't in a homoiconic format#2020-02-2014:42aisamueval: (def vvv value) does the trick for me#2020-02-2016:39bozhidar@holtzermann17 The inspector has a command to save the current value to a var.#2020-02-2016:40bozhidar(it’s bound to d)#2020-02-2017:45Joe Corneli@bozhidar 🎆 thanks#2020-02-2019:43Drew VerleeWhen try to connect to my cljs project via cider-connect-cljs it just says "direct connection failed" What would inform me as to why?#2020-02-2019:47Drew Verleeit's probably due to the fact i dont have cider as dependency anywhere. cider-jack-in doens't need it but i believe connect would#2020-02-2019:48Drew Verleewhy did that work before? I probably changed my ./clojure/dep.edn file for an unrelated reason#2020-02-2019:49dpsuttonAre you sure there’s an nrepl server running there?#2020-02-2108:42manuel@bozhidar look at CIDER leading the pack: https://clojure.org/news/2020/02/20/state-of-clojure-2020 🙂#2020-02-2108:44bozhidarYeah, that’s nice, although it also seems CIDER’s market share has slowly been eroding the past couple of years.#2020-02-2108:45bozhidarI’ll have to check previous surveys, but I recall there was a time it was sitting at 50%. On the bright side - it’s great to see that the biggest star of the user (Calva) is pretty much CIDER’s sibling.#2020-02-2109:04pezA proud CIDER sibling! ❤️#2020-02-2109:09bozhidarcider calva#2020-02-2109:13dominicmDiversity is a good thing. I think it indicates different backgrounds coming to clojure, not people leaving.#2020-02-2109:20bozhidarYeah, I agree.#2020-02-2109:34pezMy statistics indicates that Clojure has grown considerably since last survey. So the CIDER user base has probably grown a lot, even w/o the sibling.#2020-02-2109:43bozhidar@pez How did figure out the community has been growing? I recall reading some article stating the opposite (I think they were tracking the Clojurians Slack and Clojure’s Reddit or something like this).#2020-02-2109:55pezTwo data points. One is homebrew download statistics of clojure. The other is Calva's user base that started to grow steadily some months ago, and I can't find any Calva mention anywhere that would explain it. It is reasonable to assume that Calva has a bit higher share of the Clojure growth, so the Calva user stats should be an early indicator.#2020-02-2110:00pezI posted a screenshot of a Calva user stats graph as a reply on Alex's announcement, which shows the growth a bit.#2020-02-2110:30bozhidarGot it. CIDER’s download statistics are not very useful, as most people use snapshot builds and I can’t get a breakdown by version for the stable builds.#2020-02-2110:32bozhidarI see that the total number of stable downloads is just 16k for the entire life of the project (on MELPA Stable at least), which means we don’t really have that many users - maybe a couple of thousand.#2020-02-2110:52pezClojure is tiny. 😀#2020-02-2112:17practicalli-johnWe have 33 students signed up to learn Clojure this weekend at ClojureBridge London.
There are also lots of people joining this slack community all the time. So Clojure continues to grow.#2020-02-2113:37benedeki think this was always the lisp story. a steady but not huge user base. i am sure paul graham wrote about this at some point#2020-02-2113:37benedekl33t time!! :)#2020-02-2216:35piyerHey guys, beginner question: c-c c-d c-d give me a nice documentation,
1. is there a way to figure out the type of the argument?
2. examples like how I see in the clojuredocs would be nice, is there a way of getting that?#2020-02-2216:41jumarWhat do you mean by the type of the argument?
Clojure is dynamically typed so it (usually) cannot know what the type is.#2020-02-2216:45piyerTo some degree there is, e.g into take a sequence#2020-02-2216:51jumarYes, but there's no type information, it fails at runtime if you provide a wrong argument.#2020-02-2217:10dpsuttonC-c C-d C-c will load the clojuredocs examples in a buffer#2020-02-2217:17piyer@U11BV7MTK ho nice!#2020-02-2216:41piyerMy mini buffer did show clojure.core/into: ([] [to] [to from]) if it showed something like clojure.core/into: ([] [to:seq] [to:seq from:seq]) it would have been way easier.#2020-02-2216:41jumarThat would mean you have to somehow parse the docs and infer "types" from there. There's no standard for that.
For functions that have spec you can look at that though#2020-02-2216:47piyerright, my argument is that it would boost the productivity.#2020-02-2313:08practicalli-johnIn the example you would potentially have a long list of types that into accepts, or the more generic xs. Into can take any collection types and not just sequences.
Most functions in clojure.core are designed to be very generic.#2020-02-2303:30EmmanuelOgaTalking about documentation, maybe slightly related: I just found that my JDK sources folder was wrong and had to jump through a few hoops to set it right. In case anybody is interested, I documented what I found here: https://github.com/clojure-emacs/cider/issues/2745#issuecomment-590022133#2020-02-2303:30EmmanuelOgaIf I get it right this should also gimme better javadocs for some stuff? Not sure... but jumping to source is for sure really useful 🙂#2020-02-2408:42jumarI tried your advice and this gives me access to Clojure sources but unfortunately it doesn't work with JDK sources for some reason.
I added tha java.base module subpath but still nothing:
("~/workspace/clojure/clojure/clojure-1.10.1-sources" "~/workspace/java/jdk-sources/jdk-14-src" "~/workspace/java/jdk-sources/jdk-14-src/java.base" ...)#2020-02-2408:44jumarOh, no - I was too optimistic - It doesn't work for clojure sources either.
It's just that I added clojure source artifact directly to my project.clj in one particular project; but it doesn't work without this in another project#2020-02-2409:03EmmanuelOgagot it, sorry to hear that#2020-02-2409:03EmmanuelOgaperhaps there's a way you can instrument cider.el to print the paths it is using to look for the sources#2020-02-2409:03EmmanuelOgahttps://github.com/clojure-emacs/cider/blob/6ad997e7f35a303757d15d5498e567182678163c/cider-util.el#L780-L799#2020-02-2409:07jumarThat's an interesting tip.
Without going through the whole machinery I tried this in ielm and that looks good:
(cider-resolve-java-class "java.lang.String")
".../workspace/java/jdk-sources/jdk-14-src/java.base/java/lang/String.java"
#2020-02-2409:09jumarI'm trying cider-find-var and also jump-to-definition but neither one works (while it works for Clojure sources when I add them as a dependency in project.clj)#2020-02-2409:11jumarI suspect it's something broken with JDK 8+ but your trickwith adding java.base subdirectory looked promising...#2020-02-2409:15jumarOuch, so it works only in stacktraces!
That's indeed where I've found the only reference to cider-resolve-java-class : https://github.com/clojure-emacs/cider/blob/052290d080f58edc814dd7aa00b014d639c62974/cider-stacktrace.el#L560
@U051BLM8F is that intentional?#2020-02-2409:15EmmanuelOgaoh#2020-02-2409:16EmmanuelOgawhat version of cider is this?#2020-02-2409:16EmmanuelOgabah, I'm sure you are using a recent one 🙂#2020-02-2409:21jumarYes, I updated it the last week#2020-02-2307:56pezUsing Evil in spacemacs, I fail to evaluate top level forms using C-c C-e when in command mode, because i can't place the cursor outside the closing paren. I need to be in insert mode. Is there something I can do about it?#2020-02-2308:37jumarI don’t remember its name but there’s a setting which allows you to move the cursor beyond the last column in a row#2020-02-2310:13jumarIt's evil-move-beyond-eol - this is what I have in my .spacemacs file:
;; evil-move-byond-eol true will alow you to move one position after the last char
;; which makes evaluation of Clojure sexps with Cider much more convenient
(setq evil-move-beyond-eol t)
#2020-02-2311:26pezThanks!#2020-02-2313:05practicalli-john@U0ETXRFEW Why do you need to go to the end of a line to evaluate an expression?
cider-eval-defun-at-point will evaluate the top-level form under the cursor. Or simply go to next line and evaluate the last sexp using cider-eval-last-sexp
Also not sure why you are using Emacs keybindings if you are using Evil?
In spacemacs you have , e f , , e e , , e ; and many more useful keybindings that dont require any changes to the way Evil works.#2020-02-2313:35pez@U05254DQM it is all I remember from my short endeavour with Emacs some four years ago. 😃 That and M-x which I use for discovering commands. Is there a spacemacs equivalent?#2020-02-2313:36pez(I only very seldom use Emacs, and only to investigate how something works there, since it is a source of Calva inspiration.)#2020-02-2313:40practicalli-johnSPC SPC is the Spacemacs M-x in Evil mode, or strangely enough M-x in Emacs (holy) mode. It did take me a while to learn Evil and get the most out of it, but its definately been worth it.#2020-02-2313:41pezI use Evil in order to be able to do anything at all in Emacs. 😃#2020-02-2313:42practicalli-johnI am at the same point as well, I am lost without Evil. C-x C-e is the only Emacs shortcut I can remember, as I used it so much :)#2020-02-2313:54practicalli-johnIf you want to know the Clojure commands in Spacemacs, just press , with a Clojure buffer open and you will get a which-key menu which has the command names organised by what they do 🙂#2020-02-2314:04pezCool! (A somewhat equiv in Calva is cmd+shift+p then type Calva, FYI, in case you get to help some Calva users.)#2020-02-2319:02jumarFor me, cider-eval-last-sexp is quite useful to evaluate and that's what I use the setting for.#2020-02-2319:46practicalli-johnEmacs can be configured to do anything. It just seems a little strange to modify the behaviour of Evil when there are plenty of alternatives built in for evaluating Clojure.
Evaluating the last sexp is great for nested expressions.
It seems strange to jump to the end of a top level and then move past the end of the expression just to eval the top level, when you have , e f.
When using Evil, then jumping to the next empty line after the top level is typically less keys than jumping past the end of expression on the same line.
Of course you should use what ever works for you though, this is one of the benefits of Emacs.#2020-02-2418:32bfayI personally use cider-eval-sexp-at-point, which lets me eval from the beginning from the form rather the end.
I'm using the vim keybindings so I just bound ; to eval this. Move the cursor to the first paren of the thing I want to eval, then hit ; and boom, it's eval'ed
The config to do this goes in dotspacemacs/user-config
(evil-define-key 'normal clojurescript-mode-map ";" 'cider-eval-sexp-at-point)
(evil-define-key 'normal clojure-mode-map ";" 'cider-eval-sexp-at-point)
#2020-02-2420:27practicalli-john@U0MF00YRX that command is already bound to , e v in the Clojure layer, assuming you are on a recent develop branch, along with several others commands that were missing.
, e ; is already bound to cider-eval-defun-to-comment to match Spacemacs conventions.#2020-02-2420:29bfayOh nice - I just mean use ; without even using , e
, e ; actually will still work for eval to comment.
Maybe there's a stock vim keybinding I'm breaking by overriding ;? I personally really like it, it's nice to be able to eval things with one keystroke#2020-02-2420:44bfayOh, by default vim apparently uses ; to navigate to your most recently searched character from a f or t motion.
So I guess I can't use that with my change, but this seems more useful to me.#2020-02-2421:14practicalli-johnAh, ; works the same in Spacemacs, that's handy. I never knew that, thanks.#2020-02-2313:17jmckitrickWhen running both CLJ and CLJS connections, I find that sometimes a code buffer reports ‘not connected’ or seems to drop the connection. This happens most often with CLJS, but sometimes with CLJ as well. The workaround is to open the REPL buffer and then go back to the code buffer, an CIDER generally has re-connected the buffer to the backend.#2020-02-2314:58jmckitrickI should add, the CLJS connection is shadow, if that matters.#2020-02-2315:15dpsuttoni don't think it matters. due to a limitation in the api of sesman CIDER only knows about the last connection. So when the clj repl last had focus the cljs code buffer thinks the repl type is clj and therefore not connected. you should see similar behavior if you have the cljs repl focused and a clj code buffer opened.#2020-02-2315:50jmckitrickAh! ok, good to know.#2020-02-2315:50jmckitrickYes, that’s exactly what I see.#2020-02-2402:17EmmanuelOgaHi! I need to add a single additional middleware to the way cider-jack-in works. I'm reading this: https://docs.cider.mx/cider/basics/up_and_running.html#_auto_injecting_dependencies
I already have a cider-clojure-cli-global-options customization on a .dir-locals.el file on my project that looks something like: -A:alias1:alias2:etc but I 'm not sure if there's a way to modify that option or some other to add something the the list of middleware cider jack in uses.#2020-02-2402:18EmmanuelOgaSpecifically I'm trying to add nrepl-rebl to the middleware that is added when cider-jack-in is called#2020-02-2402:18EmmanuelOgahttps://github.com/DaveWM/nrepl-rebl#with-depsedn#2020-02-2402:22EmmanuelOgaThis seems promissing:#2020-02-2402:22EmmanuelOgahttps://github.com/clojure-emacs/cider/blob/0a176d0f9182befe2f1853d7a04f3104c878ff72/cider.el#L459-L468#2020-02-2402:29EmmanuelOgaThis is why long term logs rock:#2020-02-2402:29EmmanuelOgahttps://clojurians-log.clojureverse.org/cider/2018-12-30#2020-02-2402:29EmmanuelOga🙂#2020-02-2402:39EmmanuelOgacopied here for convenience in case someone finds this log:#2020-02-2402:39EmmanuelOga; .dir-locals.el
((clojure-mode
(cider-clojure-cli-global-options . "-A:dev")
(cider-jack-in-nrepl-middlewares . ("nrebl.middleware/wrap-nrebl"
"cider.nrepl/cider-middleware"))))#2020-02-2402:44EmmanuelOgaas it turns out, if that list is defined, it replaces the standard list of whatever version of cider is being used#2020-02-2402:45EmmanuelOgawhich is a bit inconvenient because I need to manually add the cider middleware and other stuff like the clj-refactor middleware, which previously just worked#2020-02-2402:49EmmanuelOgathis is what the list looks like before overriding it:#2020-02-2402:49EmmanuelOga(("refactor-nrepl.middleware/wrap-refactor" :predicate cljr--inject-middleware-p) "cider.nrepl/cider-middleware")#2020-02-2402:49EmmanuelOgaunfortunately I don't know how to append to that list instead of replacing it#2020-02-2402:50EmmanuelOgaSo I'm just gonna copy-paste it on my .dir-locals.el and add the rebl-wrapper ref for now#2020-02-2402:56EmmanuelOgaohhhhh it worked#2020-02-2402:56EmmanuelOga((nil
(cider-jack-in-nrepl-middlewares . ("nrepl-rebl.core/wrap-rebl"
("refactor-nrepl.middleware/wrap-refactor"
:predicate cljr--inject-middleware-p)
"cider.nrepl/cider-middleware"))
(cider-clojure-cli-global-options . "-A:cider:xml:rebl")
(cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . ":dev")))#2020-02-2402:56EmmanuelOgamy final setup#2020-02-2402:58EmmanuelOganow I have both REBL and clj-refactor and the cider middleware all working together yaaaay 🙂 #2020-02-2405:18dpsuttonone thing you could do is put all that in a function. (let ((.. ..)) (cider-jack-in-cljs))#2020-02-2405:31EmmanuelOgainteresting dpsutton. I have no idea how to do that though haha. I guess it will eventually come time for me to finally learn elisp 😛#2020-02-2405:33EmmanuelOgaI suspect there might be a way using add-hook-###-### since that's what clj-refactor does#2020-02-2405:33EmmanuelOgahttps://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L4118-L4127#2020-02-2408:40bozhidarYou might open a ticket about this, so we can discuss how we can improve this setup and the documentation surrounding it.#2020-02-2408:41bozhidarGenerally it’s better to use add-to-list than to just override the middleware config - e.g. https://github.com/clojure-emacs/sayid/blob/master/src/el/sayid.el#L151#2020-02-2408:42bozhidarOf course, this was meant mostly for extensions to plug-in something extra. For end users it might also make sense to have an extra config that’s just gets appended to the “core” list.#2020-02-2500:26EmmanuelOgathanks bozhidar! will collect my logs about this issue when I get home and put them on a cider issue.#2020-02-2414:22ziltiI also only stumbled upon Calva by accident when looking for tooling to recommend for newcomers. Though I have to say I find it a bit weird that it isn't implemented in ClojureScript.#2020-02-2414:23pezParts of it is. But yeah, it is a bit of a trauma.#2020-02-2616:20NathanI'm not a smart man, I had my emacs config directing .cljs files to clojure-mode rather than clojurescript-mode#2020-02-2616:20dpsuttondoes that resolve it?#2020-02-2616:21NathanIf anyone saw the post I made, it's irrelevant! Yeah, problem resolved 🙂#2020-02-2616:21dpsuttonthe best types of problems 🙂#2020-02-2701:35Quest@dpsutton I have the cider-jack-in-cljs repro steps that cause selecting clojure-cli (when using shadow-cljs + deps.edn) to fail.
The repository is at https://github.com/Quezion/re-frame-react-native/tree/demo-cider-deps-clj-err ; you'll need npm to do execute a couple npm install.
I've included the repro info at https://github.com/Quezion/re-frame-react-native/blob/demo-cider-deps-clj-err/cider-repro.txt
The root of the error is why shadow.cljs.devtools.server.runtime/get-instance! is failing though I can't say why.#2020-02-2701:36Quest(This is a followup from #shadow-cljs the other day: https://clojurians.slack.com/archives/C6N245JGG/p1582604733081400 )#2020-02-2701:43QuestI do want to note that running M-x cider-jack-in-cljs -> shadow-cljs works just fine so it's not like this is stopping development.
Happy to provide more info if useful. I got the same errors when testing on both CIDER 0.21 and 0.24.
I can't guarantee this isn't PEBCAK on my part; it probably is if there's an existing repo that works with this flow#2020-02-2707:48bozhidar@quest Might be a better idea to file some ticket, so this won’t slip between the cracks here.#2020-02-2800:10QuestCreated https://github.com/clojure-emacs/cider/issues/2812#2020-02-2710:17achikinDoes anybody use clj-refactor? I’m trying to find usages in cljs code, call the command, then the message is shown
To perform this op the project needs to be evaluated.
Analyzing a large project might take a while: hit C-g to abort.
(Set cljr-warn-on-eval to nil to analyze the project without warning)
Do you want to proceed? (y or n) y
I press y and nothing happens
No messages in Messages buffer, nothing#2020-02-2711:05benedekno support for cljs in terms of that feature unfortunately#2020-02-2809:55benedek@achikin clojure-lsp has it btw, wo/ a repl too. worth a try, good to use side by side with cider#2020-02-2810:22achikin@benedek didn’t know it exists, thank you. I’ll give it a try.#2020-02-2811:26achikin@benedek are there any instructions regarding clojure-lsp setup in Spacemacs?#2020-02-2811:27benedekno idea I am afraid, I use vanilla emacs. is it available in spacemacs at all?#2020-02-2811:37achikinYes it is. Spacemacs has an lsp layer, which consists of lsp-mode and lsp-ui#2020-02-2813:07benedeknice you just need the clojure-lsp server i suppose#2020-02-2813:08benedekfile:///android_asset/md/#installation#2020-02-2813:08benedekhaha this did not work#2020-02-2813:09benedekhttps://github.com/snoe/clojure-lsp#2020-02-2813:09benedekinstall section#2020-02-2816:47practicalli-john@benedek some reports of LSP being slow for Clojure on the Spacemacs Gitter channel. Would be interesting to know if anyone has this working very efficiently for Clojure. (although I find CiDER plenty fast enough and always run a REPL).#2020-02-2816:48dpsuttonslow startup but efficient and speedy for me#2020-02-2816:48practicalli-johnIs there a config for LSP and Clojure you can share ?#2020-02-2816:50benedekhm.. i use it regularly and have not experienced any slowness. that said i use it in parallel with cider/repl so i might not have noticed...#2020-02-2816:51practicalli-johnOn a different note, Is there a function in CIDER to jump to the end of line and evaluate the last s-expression, similar to lisp-state-eval-sexp-end-of-line . I couldnt find anything that specifically did that, although it sounds quite common to use it in Emacs lisp. I suppose something like cider-eval-sexp-end-of-line#2020-02-2816:52dpsutton(use-package lsp-mode
:init
(setq lsp-clojure-server-command '("bash" "-c" "cd ~/projects/clojure/clojure-lsp && lein run"))
(setq lsp-enable-indentation nil)
(setq lsp-enable-completion-at-point nil)
;; (setq indent-region-function #'clojure-indent-function)
(add-hook 'clojure-mode-hook #'lsp)
(add-hook 'clojurec-mode-hook #'lsp)
(add-hook 'clojurescript-mode-hook #'lsp)
:config
(require 'lsp-clojure)
(add-to-list 'lsp-language-id-configuration '(clojure-mode . "clojure"))
(add-to-list 'lsp-language-id-configuration '(clojurec-mode . "clojure"))
(add-to-list 'lsp-language-id-configuration '(clojurescript-mode . "clojurescript")))
(use-package lsp-clojure-hydra
:after (lsp-mode lsp-mode cider)
:load-path "~/projects/elisp/lsp-clojure-hydra"
:bind (("C-c C-l" . lsp-clojure-refactor-menu/body)
:map
cider-mode-map
("C-c C-l" . lsp-clojure-refactor-menu/body)))#2020-02-2816:52dpsuttoni made a hydra for lsp that i need to get onto elpa#2020-02-2816:53dpsuttonhttps://github.com/dpsutton/lsp-clojure-hydra#2020-02-2818:37Eamonn SullivanApologies in advance for a dumb newbie question, but eldoc has stopped working for me in cider. I have (clojure-mode . turn-on-eldoc-mode) in my init. I also have (emacs-lisp-mode . turn-on-eldoc-mode) and eldoc is working fine in elisp buffers. If I try to manually M-x eldoc-mode in a clojure buffer, I get "There is no ElDoc support in this buffer". I have started cider (jacked in) and C-c C-k to load the code in the buffer. This was working fine recently (i think -- like 99% sure. I really like the eldoc hints, so I'm sure I would have noticed it missing). Can anyone think of anything I'm missing?#2020-02-2818:44Eamonn SullivanMy cider and elisp config, if it helps: https://github.com/eamonnsullivan/emacs.d/blob/master/lisp/init-lisp.el#2020-02-2821:32papachanthank you for sharing. my config is a little bit too old when clj-kondo wasnt existing already, will try your config, seems to be promising.#2020-02-2908:41bozhidarBtw, eldoc is enabled by default in recent versions of Emacs. There’s no need to turn anything on explicitly anymore.#2020-02-2911:59benedekthanks for the clj-refactor release @bozhidar#2020-02-2912:27bozhidar@benedek You’re welcome! 🙂 I had a couple of hours to kill today and I thought it was high time we released something, as the previous release was from summer 2018.#2020-02-2912:31robert-stuttaford+1!#2020-02-2919:27vemvHi 👋 I make some developer tooling, which justifies placing cider/cider-nrepl in project.clj in my CI, even if I don't directly use it.
I noticed that bumping cider/cider-nrepl "0.21.1" -> cider/cider-nrepl "0.24.0" breaks some clojure.test tests, only on JDK 11. Reason being indiscernible to me (at least at first)
Does this sound familiar?#2020-02-2920:49vemvRepro'd -> https://github.com/clojure-emacs/cider-nrepl/pull/668#2020-03-0109:19bozhidarI saw your ticket, but didn’t have time to comment on it yet. I’m guessing it’s related to use moving away from c.j.classpath to orchard.java.classpath.#2020-03-0109:21bozhidarSee https://github.com/clojure-emacs/orchard/blob/master/src/orchard/java/classpath.clj#2020-03-0109:25vemvYes I took a look at it. I guess a custom classloader is set to the current thread, which interferes with c.j.p's assumptions
Might be considered 33% a bug in c.j.c, 33% in orchard, and 33% in applications like mine which invoke (classpath-directories) and take its result at face value#2020-03-0109:32bozhidar😄#2020-03-0213:54oliverHi, is there an easy way to paste the last result rather than inspect it? Main use case would be creation of test data… Thanks!#2020-03-0214:25yuhanusually what I do is cider-eval-to-comment (and then uncomment)#2020-03-0214:25yuhanor clone the form and then cider-eval-and-replace#2020-03-0214:29oliverMany thanks… this is exactly what I needed! Cheers!#2020-03-0214:17ak-coramis eldoc broken for anyone else on current master? I'm getting There is no ElDoc support in this buffer#2020-03-0214:48manuelI think eldoc-documentation-function and/or eldoc-documentation-functions must be set for ElDoc to work properly now.#2020-03-0214:51manuelI see the first one is set to cider-eldoc, but the other one is nil. Although, I don't know exactly what has changed for ElDoc on Emacs master#2020-03-0214:55manuelNot sure, but on master I see:
‘eldoc-documentation-function’
This variable holds the function which is used to retrieve
documentation for the item at point from the functions in the hook
‘eldoc-documentation-functions’. By default,
‘eldoc-documentation-function’ returns the first documentation
string produced by the ‘eldoc-documentation-functions’ hook.
Could this be the problem?#2020-03-0214:58manuelFor the sake of completeness, eldoc-documentation-functions documentation says:
Hook for functions to call to return doc string.
Each function should accept no arguments and return a one-line
string for displaying doc about a function etc. appropriate to
the context around point. It should return nil if there's no doc
appropriate for the context. Typically doc is returned if point
is on a function-like name or in its arg list.
Major modes should modify this hook locally, for example:
(add-hook 'eldoc-documentation-functions #'foo-mode-eldoc nil t)
so that the global value (i.e. the default value of the hook) is
taken into account if the major mode specific function does not
return any documentation.
#2020-03-0215:00manuel@ak407 adding (add-hook 'eldoc-documentation-functions #'cider-eldoc nil t) should fix it. 🙂#2020-03-0215:02ak-coram@manuel thanks a lot, I'll try your suggestion#2020-03-0215:03manuel@bozhidar do you think a similar solution could be added to cider-eldoc-setup? I'm not sure that's the proper way to fix this problem, but I can confirm it is working for me.#2020-03-0311:37bozhidarJust confirmed this was added in Emacs 28.1 - https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS#L131#2020-03-0311:38bozhidarNot sure why this broke the old behavior exactly, but at least we have a good idea what’s going on. Please, file a ticket so we can investigate this further.#2020-03-0311:55manuel@ak407 would you care to open the ticket with the problem you had?#2020-03-0313:28ak-coramcreated the issue: https://github.com/clojure-emacs/cider/issues/2816#2020-03-0215:05bozhidarWhat’s your Emacs version? CIDER’s eldoc setup hasn’t been changed in years.#2020-03-0215:05manuelGNU Emacs 28.0.50 (build 1, x86_64-debian-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
of 2020-03-02
#2020-03-0215:07ak-coramsame issue with GNU Emacs 28.0.50 (build 1, x86_64-unknown-freebsd12.1, Motif Version 2.3.8, cairo version 1.16.0) of 2020-03-02#2020-03-0215:10manuelweird, it is working fine for me with that hook in place.#2020-03-0215:11manuellong shot: try restarting Emacs 🙂#2020-03-0215:15manuelcould you try cider-load-buffer and see if you see something different?#2020-03-0215:15ak-coramah, I see this needs to be set locally#2020-03-0215:57bozhidarEmacs 28? 🙂 I’m guessing that’s some dev build and they changed something there. They still haven’t even released Emacs 27.#2020-03-0221:22practicalli-johnemacs-snapshot packages from Ubuntu Emacs PPA are all from the Emacs 28 branch now. So I assume that there will be a release of Emacs27 before long.#2020-03-0223:25deep-symmetryHey, everyone! I’ve long been a happy CIDER user in Clojure, and suddenly find myself working in ClojureScript for a bit because I am building an integration for building diagrams in Asciidoctor/Antora, and can’t figure out how to get a shadow-cljs repl working. Can someone give me a hand? The project is here: https://github.com/Deep-Symmetry/bytefield-svg#2020-03-0223:27deep-symmetryWhen I jack in, I seem to get a clj repl, but no cljs repl. A compounding factor may be that this is a project which builds a node module, so there is no “server”?#2020-03-0223:33dpsuttonit generates lib.js you should just run node lib.js and everything will wire up correctly#2020-03-0223:44deep-symmetryBut node lib.js terminates right away. It’s a library, not a server.#2020-03-0223:45deep-symmetryI can get a repl in the terminal via npx shadow-cljs node-repl but CIDER doesn’t seem to be doing that.#2020-03-0223:47deep-symmetryBut, ah ha! If I do that and leave the terminal repl running, CIDER does seem to be able to connect to it.#2020-03-0223:47deep-symmetryI just assumed that jack-in would take care of that the way it does for clojure projects.#2020-03-0223:57dpsuttonshadow should emit stuff to keep it running#2020-03-0300:12dpsutton#2020-03-0300:12dpsuttonworks just fine for me. cider-jack-in-cljs and on a terminal node lib.js#2020-03-0300:16deep-symmetryWow, I wonder what the difference is for me? When I type node lib.js it exits 0 in 155 milliseconds.#2020-03-0300:17deep-symmetryBut I have something that works, so I’m happy anyway.#2020-03-0300:19dpsuttonrm lib.js and make sure its a fresh compilation output. when in dev mode shadow makes sure it stays open. just as if you jacked into core.match. its a library but repls are forever#2020-03-0300:55deep-symmetryWhat is dev mode?#2020-03-0300:56deep-symmetryThings have stopped working again. Now when I try to connect the cljs nrepl I get an Assert failed: (keyword? repl-env)#2020-03-0300:56deep-symmetry(This was after adding borkdude/sci as a dependency.)#2020-03-0300:58deep-symmetryI removed lib.js and recreated it (`npm run build`), and still node lib.js terminates immediately.#2020-03-0300:59deep-symmetry(Context reminder, I am a Clojure developer totally new to the ClojureScript world with only rare brief exposure to npm et. al.)#2020-03-0301:05dpsuttonDon’t npm run build#2020-03-0301:05deep-symmetryOk, how do I build it then?#2020-03-0301:06dpsuttoncider-jack-in-cljs#2020-03-0301:06dpsuttonfor dev building. for release shadow-cljs release :lib#2020-03-0301:06deep-symmetryThe latter is what my npm run build script does.#2020-03-0301:07dpsuttonok. then rm lib.js, go to emacs cider-jack-in-cljs and then when it says its done compiling node lib.js#2020-03-0301:08deep-symmetryOk, working on that!#2020-03-0301:09deep-symmetrycider-jack-in-cljs failed with that AssertionError. 😞#2020-03-0301:10dpsuttonare you up to date? there was some polishing done on the shadow stuff#2020-03-0301:10dpsuttonit should present a list of avialable builds. make sure to type :lib rather than just lib if it doesn't#2020-03-0301:10dpsuttonand upgrade soon#2020-03-0301:11deep-symmetryHmm, I am on CIDER <tel:202002271414|20200227.1414>#2020-03-0301:12deep-symmetryIt blows up before prompting me for a list of available builds.#2020-03-0301:14dpsuttonIn emacs?#2020-03-0301:14deep-symmetryYes.#2020-03-0301:14dpsuttonAre you using clj-refactor?#2020-03-0301:14deep-symmetryYes.#2020-03-0301:14dpsuttonCan you try without that?#2020-03-0301:14deep-symmetryHappy to.#2020-03-0301:15dpsuttonWhat startup command is it using#2020-03-0301:15deep-symmetryI can just comment out the use-package in my init.el?#2020-03-0301:18dpsuttonUse a prefix Arg to jack in and you can edit the command and just take out the middleware#2020-03-0301:19deep-symmetryOK, I had disabled clj-refactor and it was still injecting refactor-nrepl. Trying with arg.#2020-03-0301:20deep-symmetrySame deal; as soon as I choose node as the repl type it crashes with that assertion error.#2020-03-0301:21deep-symmetryAnyway, this has used up all the time I was hoping to spend developing tonight, so I guess I will try to just limp along with no REPL connection. It feels so paralyzing though!#2020-03-0301:22dpsuttonAh! Choose shadow#2020-03-0301:22deep-symmetryOoh!#2020-03-0301:22dpsuttonThen choose lib#2020-03-0301:24deep-symmetryAll right! Now when I run node lib.js it stays running.#2020-03-0301:25dpsuttonPerfect. And you should have a cljs repl running then#2020-03-0301:25dpsuttonIf you eval in the repl buffer. Also go to definition, all the good stuff#2020-03-0301:25deep-symmetryStrangely, I still get a warning about clj-refactor and refactor-nrepl being out of sync despite editing that out of the command.#2020-03-0301:26dpsuttonI forget how that works but i remember it being sticky like that#2020-03-0301:26deep-symmetryBut you’re right the things I was trying for are working. Thanks so much for your help!#2020-03-0301:31dpsuttonFeel free to ping me with questions#2020-03-0305:18EmmanuelOgasup! I wonder if there's a way to ask cider to eval an expresion on the repl w/o opening, like M-: for elisp#2020-03-0305:19EmmanuelOgaM-: asks for an input expression on the bottom of the screen . Like: Eval: <...user-input...>#2020-03-0305:47solf#2020-03-0305:56EmmanuelOgaperfect! out of curiosity, how did you find that?#2020-03-0305:58EmmanuelOgaonly problem is that i snot a global binding#2020-03-0305:58EmmanuelOgaso, if I'm editing, say, an XML file that is source of a process, I cannot trigger cider eval#2020-03-0305:58EmmanuelOgaoh, I think I can M-x that command though#2020-03-0305:58EmmanuelOgathat should suffice#2020-03-0305:59EmmanuelOgayeah, that's good enough for now 🙂#2020-03-0306:00EmmanuelOgaat some point I should use the extra buttons of my keyboard#2020-03-0306:42bozhidarThis command is in the user manual and the eval menu, btw. 🙂#2020-03-0314:00deep-symmetryAnd the user manual is so beautiful now! 🙂#2020-03-0314:00deep-symmetryAnd it has a search box!#2020-03-0314:01deep-symmetry(I’m not saying you should have found it this way, just thanking @U051BLM8F for how far things have come.)#2020-03-0317:06fabraohello all, is Cider works with deps.edn?#2020-03-0317:08dpsuttonabsolutely#2020-03-0317:09fabraois that correct this -> c:/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe" -encodedCommand YwBsAG8Aag.... ?#2020-03-0317:09fabraowhy encodedCommand?#2020-03-0317:10fabraowhat is the default clj -A:.... commands#2020-03-0317:10fabrao?#2020-03-0317:10dpsuttonoh. deps.edn doesn't officially support windows. i think someone has taken time to work on windows but i can't help you at all there#2020-03-0317:11fabrao😞#2020-03-0317:13dpsuttonhttps://github.com/clojure-emacs/cider/pull/2691#2020-03-0317:14dpsuttonhttps://github.com/clojure-emacs/cider/pull/658#2020-03-0321:56magraI have a fulcro/pathom server + db in a cheap little FreeBSD Jail somewhere far away and a furcro app for a few users. I can be jacked into my development environment with shadow-cljs + deps.edn and at the same time have a second sesman session via ssh -L with a jump host to the production server with a live repl into production from the same code. And all of that just works!!! You guys are wonderful!!! Thank you for all your work!!!#2020-03-0322:33papachansounds interesting. would be great if you can share all what you have successfully done with a post or some guide.#2020-03-0417:26magraI did 🙂 https://markusgraf.net/2020-03-03-Remote-Cider-nREPL.html#2020-03-0322:00dpsuttonthat's awesome and terrifying.#2020-03-0322:34practicalli-john@fabrao there is a #clj-on-windows channel that discusses options for Clojure CLI tools and deps.edn on Windows#2020-03-0415:55Lone Rangerso I'm working on this clojurescript project.
I have files like this:
(ns myapp.some-ns
(:require [myapp.something]
[symlinked-dir.foo :as foo]
[symlinked-dir.bar :as bar]))
My deps.edn contains
:paths ["src" "resources" "target"]
I'm running figwheel-main, if that matters.
contents of src:
/path/to/src $ tree -L 1
.
├── myapp
├── symlinked-dir -> ../../symlinked-base/src/symlinked-dir/
└── js
Everything works fine (clojurescript repl etc) EXCEPT when I nav to to symlinked-dir.foo , repl stuff doesn't work. File just won't load into REPL.
However... if I navigate to target/public/cljs-out/dev/symlinked-dir/foo.cljs , repl stuff works fine. That's all well and good except, obviously, that I need to copy/paste changes from that back to the actual source file or I'll lose work. Not an ideal workflow.
I've also observed that if I COPY the files to ../src/symlinked-dir (instead of making symlinked-dir a symlink) everything works completely fine.
Does anyone have any experience with this or have any suggestions?
(by the way, in case you're wondering, this setup has to do with workplace limitations of not being able to publish to clojars and weird stuff with docker builds)
Notes:
I'm also open to using :local/root for the symlinked-dir (which is effectively a separate library) or simply having multiple :paths , i.e.,
:path ["src" "../../symlink-base/src/" "resources" "target"]
I have tried all three of those and they've had the exact same results as using a symlink -- that is to say, they don't work for loading stuff into the REPL (but still work from target).
However hard-copied files into src work.
Thanks, I realize this is probably a bit of an odd workflow but I'm hoping someone has had some experience with this.#2020-03-0415:55Lone RangerI'm not sure if I'm just using CIDER "wrong" (i.e., this is not a supported development pathway), if this is a "bug", or I'm just not configuring something properly#2020-03-0416:07magraHi, the feedback from @jr0cket and the perfect, succinct summary from @dpsutton prompted me to really write a https://markusgraf.net/2020-03-03-Remote-Cider-nREPL.html about an editor nREPL into production.#2020-03-0416:07magrahttps://markusgraf.net/2020-03-03-Remote-Cider-nREPL.html#2020-03-0519:42papachanHow i could set up env vars for a session repl in cider?#2020-03-0721:23magraMaybe emacs
(setenv "JAVA_HOME" "/usr/local/openjdk11")
is what you are looking for#2020-03-0920:18papachani will try it#2020-03-0520:30dpsuttonwhich vars do you have in mind? proper env vars or cider vars per project?#2020-03-0522:49papachanah. proper env vars#2020-03-0615:56andrea.crottiis there a way to get the cider debugger when you get to a certain line?#2020-03-0615:56andrea.crottia bit like in Python import ipydb; ipydb.debug() which allows you to run the thing nromally and when it reaches that you get the debugger#2020-03-0616:05dpsuttonhttps://docs.cider.mx/cider/debugging/debugger.html#_using_the_debugger look at #break#2020-03-0616:07andrea.crottiah nice, I think I looked for this long time ago and I was convinced it was impossible 😄#2020-03-0616:07andrea.crottiworks great#2020-03-0714:48Iwo HerkaHi, I have a question. I want to run Cider on a project with different delivery systems (web, cli, etc). Each delivery has a profile with specific dependencies. If I run cider-jack-in as is, cider-ns-refresh will fail on missing dependencies. How can I exclude certain directories? Do I have to somehow manipulate classpath? I've tried setting source-paths but it doesnt work.#2020-03-0714:49Iwo Herka(I've also managed to jack in with certain profile via cider-lein-parameters)#2020-03-0714:50Iwo HerkaWhat I'm trying to achieve is to configure Cider so that reloads only namespaces for currently selected delivery system.#2020-03-0714:50Iwo HerkaIs it possible?#2020-03-0717:54bozhidarCurrently it’s not, but that’s mostly a limitation of the underlying tools.namespace library.#2020-03-0717:54bozhidarI’m guessing in your case you can try using the simpler cider-ns-reload instead.#2020-03-0723:53Iwo HerkaI see, thanks for the info!#2020-03-0901:21jmckitrickIs there an emacs mode connected with CIDER or REPL mode that shows a ‘¢’ in the mode line?#2020-03-0906:12bozhidarThere’s nothing that I know of.#2020-03-0908:59slipsetFWIW, just upgraded all emacs packages including CIDER, and I’m seeing this:
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:220) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) ~[na:na]
at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:214) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:203) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:74) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.buffer.UnpooledByteBufAllocator.<clinit>(UnpooledByteBufAllocator.java:37) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.buffer.ByteBufUtil.<clinit>(ByteBufUtil.java:70) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at io.netty.buffer.ByteBufAllocator.<clinit>(ByteBufAllocator.java:24) ~[netty-all-4.0.56.Final.jar:4.0.56.Final]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:416) ~[na:na]
at clojure.lang.RT.classForName(RT.java:2211) ~[clojure-1.10.1.jar:na]
at clojure.lang.RT.classForName(RT.java:2220) ~[clojure-1.10.1.jar:na]
at refactor_nrepl.inlined_deps.toolsanalyzerjvm.v0v7v3.clojure.tools.analyzer.jvm.utils$maybe_class_from_string.invokeStatic(utils.clj:85) ~[na:na]
At refactor_nrepl.inlined_deps.toolsanalyzerjvm.v0v7v3.clojure.tools.analyzer.jvm.utils$maybe_class_from_string.invoke(utils.clj:78) ~[na:na]
#2020-03-0909:00slipsetCIDER 0.25.0snapshot (package: <tel:202003081030|20200308.1030>), nREPL 0.7.0-beta1
Clojure 1.10.1, Java 13.0.1#2020-03-0909:19bozhidarSeems like some issue with refactor-nrepl and Java 13. All is working fine without refactor-nrepl, right?#2020-03-0909:19bozhidarLooking at the trace I’m guessing we’ll need to update the bundled tools.analyzer.#2020-03-0909:33slipsetThat’s what I figured as well. You want me to file an issue against refactor-nrepl? (Or add this to some existing issue?)#2020-03-0909:34slipsetI know that expez is now on jdk 13, so maybe he’ll finally be motivated to fix some of this stuff…#2020-03-0910:00bozhidar@slipset Yeah, please file a ticket and we’ll look more into this.#2020-03-0913:36practicalli-johnWhat CIDER function are people using to browse clojure spec definitions? I am asking as there are no Spacemacs keybindings for this as yet.
The documentation shows cider-browse-spec if you know which spec you want and cider-browse-spec-all to browse all the specs in the project and filter the list of specs with a regex. Does this cover everyones use-cases?
https://docs.cider.mx/cider/usage/misc_features.html#_browsing_the_clojure_spec_registry
I am looking through https://github.com/clojure-emacs/cider/blob/master/cider-browse-spec.el and it seems the there are several interactive functions, just wondering if calling any of these functions directly are useful, as well as the above two functions:
• cider-browse-spec--print-curr-spec-example - shows an example of the current spec, looks interesting
• cider-browse-spec--example-revert-buffer-function although this just seems to call the above function
• cider-browse-spec-regex - assuming this is just called via cider-browse-spec-all
I haven't used Clojure spec that much yet, but will be doing soon, so just wondering what everyone else uses. Thank you.#2020-03-0915:09dimaHello! Is there a way to pass cljfmt :indents option to cider nrepl?#2020-03-0915:11bozhidarI see the middleware take an options map https://docs.cider.mx/cider-nrepl/nrepl-api/ops.html#_format_code#2020-03-0915:11bozhidarNot sure if we exposed it in CIDER via some config or not.#2020-03-0915:12bozhidarSeems we didn’t but that shouldn’t be a hard change.#2020-03-0915:14dimaThanks, i’ll dig more into that and open an issue (or maybe PR) about it#2020-03-0915:15bozhidar:thumbsup:#2020-03-0920:56ziltiWhat is the best way to cider-jack-in into a codebase inside a VM? I guess there isn't really a proper way? Or can it inject its dependencies when connecting to an already-running nrepl?#2020-03-0921:20dominicmYou could perhaps configure it to run "ssh 192... clj" instead of "clj"#2020-03-0921:38ziltiHmm yes, that could be an option#2020-03-0921:46ziltiThe problem with that approach is that those dependencies are going to be outdated inevitably, then ruin your day#2020-03-1005:50jumarI've already asked in #spacemacs but didn't get any response so trying here
What's the best way to customize indentation for things like try+ (slingshot) macro?
I'd like to behave it exactly as try#2020-03-1005:55yuhanHave you seen this?
https://docs.cider.mx/cider/config/indentation.html#2020-03-1014:57jumar@UCPS050BV yes but If I understood it it's pretty invasive - basically defining intendetation as function's metadata. Also doesn't seem to be a good fit for 3rd party libraries#2020-03-1108:59yuhanhmm, personally I don't see an issue with using (alter-meta ,,, assoc :style/indent 0) on 3rd-party vars, since it's a namespaced key and all#2020-03-1109:00yuhanyou could also do define-clojure-indent in elisp but that's purely text based and won't know about namespace refers or aliases#2020-03-1114:11jumarIt feels very strange to have to use this, especially when working on a team's project where people are using other editors.
I'm wondering if there's a better way to do it...#2020-03-1114:19yuhanuse cider-repl-init-code in .dir-locals.el to inject the metadata on jack-in? 😆#2020-03-1010:54pmooserI'm sure I've done something wrong with configuration, but I'm having some issues where I'll get a stack trace in cider, with basically 0 frames, and no information on how to debug further. Any tips on how I might unwind this?#2020-03-1010:54pmooserLike I'm generating basically a ClassCastException, but it doesn't give me any lines or tell me where it is occurring.#2020-03-1014:56jumarThis might be a JVM optimisation. Try -XX:-*OmitStackTraceInFastThrow*#2020-03-1011:01pmooserI'm wondering if somehow my logging configuration is wrong or ...#2020-03-1020:50Ryan WatkinsHey all, I'm trying to lookup .toUpperCase as a C-c C-d d command but somehow Emacs (it seems) can't find my java sources?#2020-03-1108:18ak-coram@ryanwatkins54 I needed to set cider-jdk-src-paths for it to work#2020-03-1108:43bozhidarAs long as some Java sources are on your classpath the code lookup should work.#2020-03-1113:45Joe CorneliI have gotten Drawbridge integrated into my app 🎉 ... and now I am wondering whether it's possible to get CIDER to connect to that.#2020-03-1113:46Joe CorneliLooks like the relevant issue in the issue tracker is this one: https://github.com/clojure-emacs/cider/issues/39 currently closed as of 2014, last updated in 2017, so I guess the answer is "not without some work."#2020-03-1113:49Joe CorneliThe last comment in the thread there talks about something called Lein Catapult https://github.com/malyn/lein-catapult which seems like in principle it could be used#2020-03-1113:51Joe CorneliIt has one commit from six years ago, but hey, it's worth a try!#2020-03-1114:17Joe CorneliDidn't work out of the box, but maybe it won't be too hard to debug. https://github.com/malyn/lein-catapult/issues/2#2020-03-1114:52Joe CorneliHowever, that bug doesn't seem to matter, since if I rerun lein catapult : I get a message that I am connected to Drawbridge!#2020-03-1114:52Joe CorneliI've created a fork with modern dependencies [com.github.holtzermann17/lein-catapult "4fa2f909f334d2094b2885567f0f036da3518820"] via Jitpack, but I don't think this matters at the moment.#2020-03-1114:55Joe CorneliOK, but now, trying to connect with CIDER I get the following print out:#2020-03-1114:55Joe Corneli$ lein catapult :
#2020-03-1114:56Joe CorneliCIDER still shows the loading symbols [=== ] [====] [ ===] [ ==] etc., and I don't get a prompt. However the cider-repl buffer does say this at the top:
;; Connected to nREPL server -
;; CIDER 0.24.0 (package: 20200215.223) (India), nREPL 0.6.0
#2020-03-1115:02Joe CorneliI updated CIDER issue https://github.com/clojure-emacs/cider/issues/39 with this information. It looks like it is pretty close to working...#2020-03-1115:50Joe CorneliAh, here's an error message printed out by my app:#2020-03-1115:51Joe CorneliException in thread "nRepl-session-ba6f45c9-8bc1-4e9b-8bf6-85c51fa10aec" java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Character (java.lang.String and java.lang.Character are in module java.base of loader 'bootstrap')
#2020-03-1116:03Joe CorneliWoah, I also see that despite being very slow more things are happening on the lein catapult repl if I leave if for a while.
>>> {:op eval, :code (seq (.split (System/getProperty "java.class.path") ":")), :session a7a5cfcd-d460-4924-9b8d-b4aa6eef7607, :id 6}
Followed by a big list with all of the dependencies in the app!
{:id 6, :session a7a5cfcd-d460-4924-9b8d-b4aa6eef7607, :ns user, :value ("/home/joe/system-test/exchange/test" "/home/joe/system-test/exchange/test/clj" "/home/joe/system-test/exchange/src/clj" ... "/usr/local/lib/m2/viebel/codox-klipse-theme/0.0.1/codox-klipse-theme-0.0.1.jar")}#2020-03-1116:13robert-stuttafordis there a way to have the *cider-result* buffer print newlines instead of the literal \n , inside an EDN output?#2020-03-1121:40agSomehow for some reason eldoc tips not showing up for me anymore. cider-eldoc-display-for-symbol-at-point and cider-eldoc-display-context-dependent-info are set to t.
I have global-eldoc-mode enabled, but whenever I try to run M-x eldoc-mode it says: “There is no ElDoc support in this buffer”. Can someone help me to investigate why it’s not working?#2020-03-1122:04dpsuttonAre you running a custom built emacs? 27 or 28?#2020-03-1122:05agAh… this is what I’m seeing: CIDER sets eldoc-documentation-function but eldoc-documentation-functions is nil, that prevents eldoc from enabling the mode in the buffer#2020-03-1122:05ag@dpsutton yes I’m running 28, because I want jansson support#2020-03-1122:06dpsuttonWell it sounds like you’re on your way. I think I heard this api changed in 28#2020-03-1122:07ag> Well it sounds like you’re on your way
Not really. I’m still not sure how to fix this#2020-03-1122:12agNevermind. Fixed it by doing (add-hook 'eldoc-documentation-functions #'cider-doc nil t)#2020-03-1202:23solfAny way into tricking CIDER M-x cider-clojuredocs into thinking my clojurescript project is a clojure one?#2020-03-1202:23solfcider-clojuredocs doesn't work on clojurescript, but 99% of the time I'm looking into the doc of functions common to clj and cljs anyway#2020-03-1204:03Ryan Watkins@ak407 unfortunately for whatever reason that only works for a given *cider-error* buffer jump to source...#2020-03-1204:04Ryan Watkins@bozhidar any ideas?#2020-03-1204:05Ryan WatkinsI tried manually setting my CLASSPATH but there's almost no documentation anywhere about exactly how to set it right, I just pointed it to where I also set cider-jdk-src-paths#2020-03-1204:08Ryan WatkinsLooking at *cider-classpath* I see /opt/icedtea-bin-3.14.0/jre/lib/somelib.jar but idk, should I be seeing some core jdk stuff or something?#2020-03-1204:08Ryan WatkinsI'm a complete java noob lol#2020-03-1204:59jumar@ryanwatkins54 Someone shared this before but I haven't been able to make it fully work; as you said, it works (for me) only in the error buffer (stacktraces)#2020-03-1205:00jumarThis one was, in particular, for java 9+ (module system).
I tried it like this:
;; customize jdk sources path
;; see also
(setq cider-jdk-src-paths '("~/workspace/clojure/clojure/clojure-1.10.1-sources"
"~/workspace/java/jdk-sources/jdk-14-src"
;; adding most common modules, otherwise it doesn't work with modularized JDK
"~/workspace/java/jdk-sources/jdk-14-src/java.base"
"~/workspace/java/jdk-sources/jdk-14-src/java.desktop"
"~/workspace/java/jdk-sources/jdk-14-src/java.sql"
"~/workspace/java/jdk-sources/jdk-14-src/java.xml"
))#2020-03-1204:59Ryan Watkins@jumar interesting#2020-03-1205:00Ryan Watkins@jumar I tried looking at the source code but nothing came to me as of yet, I mean it's not totally terrible but yeah#2020-03-1205:00Ryan WatkinsI saw in the talk where @bozhidar demonstrated it, he was using a macbook, maybe it's how it's distributed (the source), idk#2020-03-1205:01jumarI'm using latest Mac OS X#2020-03-1205:01Ryan Watkinsah#2020-03-1205:01jumarThe issue can be java 9+; maybe he was using Java 8#2020-03-1205:01Ryan Watkinsoh okay#2020-03-1208:42bozhidarWell, Java 9 certainly created a lot of problems for us https://github.com/clojure-emacs/cider/issues/2732#2020-03-1208:50bozhidarAnd you’re right - I was showing this working on Java 8. It’s still broken on 9+.#2020-03-1205:01jumarJava interop is a big weakness of Emacs/Cider - or rather probably not a focus;
Cursive is so much better in this space#2020-03-1208:45bozhidarYeah, unfortunately that’s a weakness currently. Mostly due to our (mine) limited bandwidth.#2020-03-1208:45bozhidarThe massive changes in Java 9 didn’t help us either - the module system made a lot of things way more complicated…#2020-03-1220:29jumarYeah, I can imagine that. Thanks for all the hard work anyway - I'm still a massive fun of emacs/cider.
For me, more a important issue is actually a poor performance when writing a lot of stuff (especially larger data structures) in logs; e.g. logging a ring requestif
If could find a solution how to significantly improve performance in that scenario.
I've tried experimenting with font locking but that didn't help much; not sure if there's some other way but Emacs often blocks for quite a while when I try to print debug data. 😞#2020-03-1205:01Ryan WatkinsCursive, hmm..#2020-03-1205:01Ryan Watkinstrue @bozhidar did say this#2020-03-1205:02Ryan WatkinsI guess java interop isn't something you'd do all too often in Clojure d2d?#2020-03-1205:02jumarYeah, hopefully not 🙂#2020-03-1205:02Ryan Watkinsand I guess I can see javadocs anywho#2020-03-1205:02Ryan Watkinsyeah haha#2020-03-1205:03Ryan WatkinsI am steering clear of Java but who knows, maybe I will have to one day work a job in this haha#2020-03-1207:37pezIn /r/clojure some day ago: https://www.reddit.com/r/Clojure/comments/fg3rzv/new_clojurians_ask_anything/fk3m44w/#2020-03-1211:42practicalli-johnThe evaluation indicators in the fringe are an unobtrusive way to show if a function definition has changed or has not been evaluated.#2020-03-1211:42practicalli-johnThe evaluation indicators in the fringe are an unobtrusive way to show if a function definition has changed or has not been evaluated.#2020-03-1211:43practicalli-johnThere was a PR to make these more obvious, but I think it wasn't completed.#2020-03-1300:52jmckitrickHere’s a question… I’m using CIDER to connect to an older project running the older figwheel. It starts up, seems to work fine, but then in the minibuffer, I see a prompt Stdin: that never seems to go away.#2020-03-1300:54jmckitrickIt seems to echo the input into the REPL prompt.#2020-03-1300:54jmckitrick#2020-03-1301:31dpsuttonThat’s the cljs repl behavior without figwheel. It’s asking for standard in (the R in REPL) without middleware of piggieback#2020-03-1312:23eval-on-pointWhat is the procedure for making Cider aware of the javadoc for a non-standard java library? cider-javadoc works out of the box for things like java.util.Date , but not for libraries that I have imported from Maven#2020-03-1313:01dominicmYou need to add the javadoc artifact to your classpath#2020-03-1313:57eval-on-pointthanks, that helps!#2020-03-1608:33FiVoIs there any special setting I need to set if I want dynamic fonts for clj and cljs? When having two repl sessions I either only get font locks for clj or cljs.#2020-03-1620:24mikerodit seems that my cider-repl-history is cleared after I close / re-open a repl connection#2020-03-1620:24mikerodis there a way to prevent this? I don’t see an option about persistence or know of it being stored to any file. I just see it being inserted into a buffer.#2020-03-1620:26mikerodI’ve seen reference to this cider-repl-history-file before - but I’m not seeing this defined anywhere#2020-03-1620:27mikerodok, so found that in cider-repl#2020-03-1620:27mikerodthe plot thickens#2020-03-1620:33mikerodfigured it out - didn’t have it set#2020-03-1707:46bozhidarI keep forgetting to change the defaults for this. 😄 Your question reminded me to do it for the next release.#2020-03-1708:36solfmade me chuckle#2020-03-1709:12bozhidarIt’s time I learned some Clojure myself! 😄#2020-03-1711:11orestisCan Cider (or orchard?) detect if some result will result into an overly long line and do something about it?#2020-03-1711:12orestisActual Problem: doing eval-print-result when the result is just a long long string (e.g. contents of a byte output stream) Emacs will freeze.#2020-03-1712:44jumar+1 I have this problem over and over again, the same when logging a lot of data on standard output.#2020-03-1716:13practicalli-johnEvaluating in the source code file always truncated output by default, so prudent to use that approach if you dont know what the result looks like, I used evaluation in the source code buffer when doing a web scraping project and avoided any Emacs lockups or slow-downs due to very long lines.
Logging into a REPL buffer is always going to be messy. Given there are so many logging tools out there that are easy to add, I never had the need to do this. I dont think its a very effective practice, especially inside Emacs, as you are hitting one of the biggest limitations of Emacs.#2020-03-1808:07yuhanI recently decided to reduce my mental block of refactoring things into let bindings and losing the ability to eval subexpressions - the following command looks backwards within the current defun for any let-bindings and wraps them around the sexp at point to evaluate:
(defun cider--guess-evaluation-context ()
"Returns list of let-binding strings from the inside out, without closing parens
\"(let [...]\""
(save-excursion
(let ((res ()))
(condition-case er
(while t
(backward-up-list)
(when (looking-at (rx "(" (or "when-let" "if-let" "let") (opt "*")
symbol-end (* space)
(group "["))) ;; binding vector
(let ((beg (match-beginning 0))
(end (save-excursion
(goto-char (match-beginning 1))
(forward-sexp 1)
(point))))
(push (buffer-substring-no-properties beg end) res))))
(scan-error res)))))
(defun cider-eval-dwim ()
(interactive)
(let ((ctx (cider--guess-evaluation-context))
(bounds (cider-sexp-at-point 'bounds)))
(cider-interactive-eval (concat (apply #'concat ctx)
(buffer-substring-no-properties (car bounds) (cadr bounds))
(make-string (length ctx) ?\)))
nil bounds
(cider--nrepl-pr-request-map))))#2020-03-1808:10yuhanNot sure if it belongs in Cider core? hopefully someone finds it useful 🙂#2020-03-1809:19bozhidar@qythium This already exists in CIDER. 😄#2020-03-1809:21bozhidarSee cider-eval-defun-upto-point and cider-eval-sexp-upto-point.#2020-03-1809:21bozhidarThere’s also cider-eval-in-context (or something along those lines).#2020-03-1809:22bozhidarI guess you can enhance the existing eval in context with your logic to guess the let-bindings there.#2020-03-1809:37bozhidarBtw, the approach with the context I took was much simpler - I just balance the unbalanced sexp at point and make it evaluatable. This way you don’t have to guess the evaluation context, as you’re using it directly.#2020-03-1809:51yuhanyup, I knew about those functions, but they weren't suited for what I wanted#2020-03-1809:53yuhan(let [a 1]
[:lots
(of unnecessary
:things)
(assert false)
(let [b (inc a)]
(+ a b))
etc
etc])#2020-03-1809:53yuhaneg. I want to place my cursor at the (+ a b) form and eval, and get only the result => 3#2020-03-1809:55yuhancider-eval-in-context was too much friction because it didn't pick up on existing let bindings and requires you to enter a context into the minibuffer#2020-03-1810:14bozhidar> eg. I want to place my cursor at the (+ a b) form and eval, and get only the result => 3#2020-03-1810:14bozhidarWell, that’s exactly what eval-upto-point does. I think I’m not understanding something.#2020-03-1810:17yuhanIn the example above eval-upto-point would throw an assertion error or return all the unnecessary things#2020-03-1810:20yuhanin particular I found this useful as a way to debug an expression which was throwing errors by inspecting sub-expressions independently of others#2020-03-1810:21yuhanSimilar to "temporary defs" method of debugging now I think of it, but without polluting the namespace#2020-03-1812:21bozhidarAh, I finally get it.#2020-03-1812:22bozhidarI didn’t notice the assertion at first. Well, feel free to contribute this to CIDER. I can imagine it’d be useful to some people.#2020-03-1905:49solfIs there a way I can have my source code locally and edit it with emacs/cider, yet starting the java process on a remote machine?#2020-03-1906:06jumar@U7S5E44DB look at https://stackoverflow.com/questions/52459671/clojure-how-to-connect-to-running-repl-process-remotely
You could use this to start lein repl on the remote machine and then cider-connect:
# on remote machine
lein repl :start :port 40000
# on localhost
ssh -NL 40000:localhost:40000 username@host
# THEN: lein repl :connect OR cider-connet
lein repl :connect localhost:40000
#2020-03-1906:07solfIn this case then the source code is in the remote machine, right?#2020-03-1906:12jumarYes, that's right - you need that; but you can reload the code based on local changes#2020-03-1906:12jumarWhat's your use case?#2020-03-1906:13solfDev mostly on my laptop, but when doing some intensive computation spin up a remote instance from scratch and start a java process from there (using CIDER)#2020-03-1906:14jumarHow are you going to "deploy" the program to the remote machine?
Seems like pushing code there could be an option?#2020-03-1906:15solfYes indeed, I think that's the simplest solution to this, in which what you linked will help#2020-03-1906:16solfor an uberjar?#2020-03-1906:16solfI don't know if you can run lein repl using an uberjar instead of source code#2020-03-1908:12orestisIf your remote machine has all the dependencies you need, then you don’t actually need to send your own source code. You can just connect to the remote REPL and start evaluating code.#2020-03-1911:03jumarThat’s of course the whole point of this exercise; but you need the initial version to run Leon repo, I think#2020-03-1911:04jumarYou could also use socket repl with Uber jar but i don’t think cider supports this #2020-03-2615:06aisamuWhen I used to do this, both tramp (source+repl on the remote instance) and hybrid (local source + forwarded ssh port connected to the remote instance running a repl) worked fine.
At the time I had to match the folder structure for "hybrid" to work properly, otherwise cider would try to find the source files using the remote's paths. Now there's a configuration option for that as well.#2020-03-1912:03Eamonn SullivanI have a small project using tools.cli (deps.edn) to manage dependencies and stuff. Running clj -A:test:runner runs all of my unittests, but I can't convince cider that this project has any. In my leiningen projects, I've gotten to like running C-c , ... to run my tests, but when I try that in cider for this project, I get errors about No test namespace. Maybe I've configured something incorrectly? Does this work for someone else? Can you share a snippet of your deps.edn?#2020-03-1912:48practicalli-john@eamonn.sullivan the simplest way is to add test to your paths in deps.edn and you dont need a specific alias, as the test path is always included
:paths ["src" "test" "resources"]#2020-03-1912:51Eamonn SullivanI think I do have that? That's why clj -A:test:runner works, I thought. But my understanding of this is limited. What would I need to add to this?#2020-03-1912:52practicalli-johnCIDER will not use an alias unless you tell it to use it. The test path is only in an alias#2020-03-1912:52Eamonn SullivanOr, sorry, I see your paths bit. I missed that. Thanks!#2020-03-1912:52practicalli-johnJust added it. Ideally, you should add a .dir-locals.el file that defines the alias you want to run#2020-03-1912:53practicalli-johnOr you can use C-u (or SPC u in Spacemacs) to edit the jack-in command when before it runs and add an alias to the start#2020-03-1912:54practicalli-johnsee the bottom of this blog for more examples https://practicalli.github.io/blog/posts/cider-jack-in-to-clojure-cli-projects-from-spacemacs/#2020-03-1912:55Eamonn SullivanWell, just adding the test to the paths worked a treat. I'll look into .dir-locals.el if I need something more complicated. Thanks again!#2020-03-1912:55practicalli-johnyou could just add a .dir-locals.el to the root of your project with this in it
((clojure-mode . ((cider-clojure-cli-global-options . "-A:test"))))
And then all your test code is included via the alias. CIDER uses its own test runner, so you dont need the :runner alias#2020-03-1912:56practicalli-johnAdding tests to paths may include test code in other tasks, eg. like deployment, so probably the preferred solution long term (but a useful quick hack)#2020-03-2009:18jumarI have big issues with cider repl buffer freezing very often.
I suspect that in most cases it's related to larger chunks of output being written in the stdout (e.g. logs).
I know about "clear repl buffer" but although I do that quite often it's not enough and even that doesn't help often.
Can I somehow turn of all the formatting and have it only as a plain text? Or perhaps some other optimization that would help?#2020-03-2013:08bozhidarYou can try disabling font-locking https://docs.cider.mx/cider/repl/configuration.html#_font_locking#2020-03-2020:16jumarThanks, I've only set setq cider-font-lock-dynamically and cider-font-lock-max-length so far so maybe cider-repl-use-clojure-font-lock will help. But it's not clear from docs what it actually does; it seems that setting it to nil is actually worse (old behavior)?#2020-03-2308:10jumar@bozhidar?#2020-03-2010:43practicalli-johnIs it possible to set the default Clojure REPL type for a project in a project that has both a deps.edn and project.clj file? I tried to use a .dir-locals.el file, perhaps I didnt find the right value...
((clojure-mode . ((cider-repl-type . 'clojure-cli))))
I also tried
((clojure-mode . ((cider-jack-in-default . 'clojure-cli))))
I am restarting Emacs each time and it is asking me to load the .dir-locals.el each time. I am assuming either I have the wrong configuration or this feature is not available at present.#2020-03-2011:01yuhanIt might be a syntax error, I don't think the symbol is supposed to be quoted#2020-03-2011:02yuhanAh, it's the variable cider-preferred-build-tool#2020-03-2011:03yuhan(found that out by grepping the source for the prompt "Which command should be used")#2020-03-2011:04yuhanAlso you don't have to restart Emacs to apply dir local variables, just refresh the buffer using M-x normal-mode#2020-03-2011:08practicalli-johnFinally, I found the right syntax... The build tool name is in double quotes
((clojure-mode . ((cider-preferred-build-tool . "clojure-cli"))))
I was only restarting because the darn thing wasn't working (it only takes 3 seconds to restart Spacemac on my machine, so no problem).#2020-03-2011:10yuhanIt's supposed to be a symbol per the docstring -
((clojure-mode . ((cider-preferred-build-tool . clojure-cli))))
#2020-03-2011:10yuhanbut looks like it accepts strings too#2020-03-2011:15practicalli-johnIt wasnt working as a symbol 😞 I see other settings are also using strings, eg. cider-clojure-cli-global-options so I'll stick with strings for now 🙂#2020-03-2011:18practicalli-johnNow to see if I can set the clojure repl type, i.e. to set the project to be a Clojure repl, rather than a ClojureScript or mixed repls... when using Sesman#2020-03-2013:07bozhidarThe preferred build tool is definitely supposed to be a symbol, btw.#2020-03-2015:11practicalli-john@bozhidar the clojure-cli value didnt seem to work when I tried it as a symbol. I will try again and if it definately isnt working I'll raise an issue.
Is there a variable I can use to set a project to use cider-jack-in-clj by default in the same way, for example when calling with sesman-start?#2020-03-2015:50bozhidarI’ve never used sesman-start directly, so I’ll have to check what exactly does it call internally.#2020-03-2017:02Felipe MarquesHi, I'm trying to use cider to navigate to java class definitions, but I'm not able to do it. I saw that I must put the source in the classpath. There is a way to configure cider or clojure-deps to do it automatically or per project.#2020-03-2109:18bozhidarUsually the source code is in different artifacts (e.g. source jars) and you just have to configure this in your build tool.#2020-03-2116:09Felipe MarquesI'm usings clojure cli.tools (deps.edn). Is it possible to have an out-of-the-box solution for every project that uses deps?#2020-03-2116:09Felipe MarquesOh, and thanks for the response#2020-03-2118:29bozhidarI’m afraid I haven’t used it much - I’m a lein person myself.#2020-03-2118:29bozhidarMaybe @U05254DQM is more knowledgable on tools.deps?#2020-03-2122:47practicalli-johnFirst thought is to download the source (where ever that can be downloaded from?), create a symbolic link to it from your project(s). Probably adding a specific :path in the deps.edn file that is the name of the symbolic link.
I've never needed to look at the Java source code when coding, I just search in the browser for docs. I very rarely need to do that either.#2020-03-2313:16eval-on-pointI know that we are talking the clj cli, but it might be worth checking out the lein-ubersource plugin#2020-03-2313:17eval-on-pointit will try to download the source for libraries included in your project.clj, which you would presumably then add to your classpath in the :dev profile or something#2020-03-2313:19eval-on-pointAdditionally, I have the path to the jdk source in my :resource-paths so that I can jump to source in all my projects. I think that this also enables cider-javadoc#2020-03-2123:50practicalli-johnI've noticed that calling cider-doc in a Clojure source code buffer as the first thing after running a Clojure repl (cider-jack-in-clj) fails to work. It prompts with Doc: rather than displaying the function docstring. Entering the name of a function at the prompt fails with the error Symbol ,,, not resolved .
If I evaluate an expression, any expression, then cider-doc works perfectly. I believe I get the same issue for clj-find-var .
I am using CIDER 0.25.0snapshot (package: <tel:202002271414|20200227.1414>), Emacs 26.3 and Java 11. If this is not a known issue, I'll raise a ticket (I didnt see anything relevant on GitHub issues)#2020-03-2201:09dpsuttonI think that’s fundamentally how cider works. It is part of of running image and doesn’t do any static introspection. Until you evaluate forms it only knows about clojure core essentially. #2020-03-2208:38practicalli-john@dpsutton It seems I didn't explain clearly. My test was on the slurp function, so not working on clojure.core functions.
I don't need to evaluate anything specific, but it seems I need to evaluate something before any function will work with clojure-doc.
If it should work on clojure.core, I will do more testing on other core functions.
I understand that my own custom functions should be evaluated before Cider can find them.#2020-03-2211:21practicalli-john@marques.goncalves.fel The following works deps.edn file will jump to Java definitions using the CIDER command clj-find-var .
I have a deps.edn as follows:
{:path
["src" "resources"]
:deps
{org.clojure/clojure {:mvn/version "1.10.1"}
;; Java 11 sources
java-sources {:local/root "/usr/lib/jvm/openjdk-11/lib/src.zip"}}}
The location of your sources.zip file may differ. I installed the sources from an Ubuntu package openjdk-11-source .
I would recommend adding the Java sources as an alias, rather than a main dependency.#2020-03-2211:49practicalli-john@marques.goncalves.fel I've added example aliases for including java sources in my example deps.edn file here: https://github.com/practicalli/deps-edn-examples/blob/master/deps.edn#L81-L93
I would encourage you to use aliases rather than including sources as a main dependency, as the java sources are a development time artifact.
:java-11-source
{:extra-deps
{java-sources {:local/root "/usr/lib/jvm/openjdk-11/lib/src.zip"}}}#2020-03-2219:00Felipe MarquesThanks for the amazing explanation. Normally, I don't have to look the java source code. But recently I have been working with Avro and it is handy to be able to take a look at the library from inside Spacemacs. But now I understand better the internals and how I could make it available. Thanks!#2020-03-2219:41practicalli-johnIts useful stuff for the Spacemacs book I am writing, so I was happy that I managed to figure out how to do it. Occasionally I do a bit of Java Interop, so it is useful to have for those times. Now I know how to do it next time I forget 🙂
https://practicalli.github.io/spacemacs/navigating-code/java-definitions.html#2020-03-2311:25Felipe MarquesCool! Btw, I love you book. I use Spacemacs and it was my go-to reference when I was starting (and it still is!)#2020-03-2211:52practicalli-johnIf you always want to include the java sources when running cider-jack-in then you can add a .dir-locals.el file to the root of your Clojure project. Here is an example that will include the java-11-source and use the clojure-cli buld tool by default (if you have more than one build configuration file)
((nil . ((cider-clojure-cli-global-options . "-A:java-11-source")
(cider-preferred-build-tool . "clojure-cli"))))
#2020-03-2214:12borkdudeIn case there are any nREPL experts in the house, I could use a little help with https://github.com/borkdude/nrepl-server. It doesn't work with lein and boot yet. Somehow the response is not printed#2020-03-2215:35dpsutton@U04V15CAJ just a casual perusal, but I see you're casing on the op code as a keyword. I thought these are always strings. If you don't match anything in the session loop you stop there. Strange to only see a recur in the eval branch#2020-03-2215:36dpsuttonand i see the following in nrepl server:
(defn- normalize-msg
"Normalize messages that are not quite in spec. This comes into effect with
The EDN transport, and other transports that allow more types/data structures
than bencode, as there's more opportunity to be out of specification."
[msg]
(cond-> msg
(keyword? (:op msg)) (update :op name)))#2020-03-2307:09vinnyataidehello, I'm trying to use refactor on my jacked-in project with shadow-cljs but it keeps saying
user-error: The refactor-nrepl middleware isn't available! Did you remember to install it?
#2020-03-2307:10vinnyataidemaybe I'm inside a cljs repl which doesn't have it in it's classpath?#2020-03-2307:10vinnyataidemy commands are jack in (shadow/watch :main) then (shadow/repl :main)#2020-03-2308:08Michaël Salihiyou can add the line :nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]} in shadow-cljs.edn config file.
More info about: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL#2020-03-2308:08Michaël Salihiyou can add the line :nrepl {:middleware [refactor-nrepl.middleware/wrap-refactor]} in shadow-cljs.edn config file.
More info about: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL#2020-03-2308:30bozhidar@vinnyataide I guess you can also remove clj-refactor.el if you don’t need it.#2020-03-2308:30bozhidarAre you using some Emacs distro that bundles it or something like this?#2020-03-2308:58vinnyataideno, pure emacs @bozhidar#2020-03-2308:59bozhidarSo, you’ve installed clj-refactor yourself but it’s injecting its own deps?#2020-03-2309:00vinnyataideI've just removed it I don't know why it was installed#2020-03-2315:57ziltiWhat can I do about error in process filter: Sync nREPL request timed out (op eval code (require 'shadow.cljs.devtools.api) enlighten true) ?#2020-03-2316:02ziltiIt also opens two REPL buffers, with exactly the same names, on the same port. One with ClojureScript REPL init form, one without. Both claim to be ClojureScript REPLs.#2020-03-2316:15dpsuttonwhat kind of project and how are you starting it?#2020-03-2316:37zilti@dpsutton A deps.edn project, and I am starting it with cider-jack-in-clj&cljs#2020-03-2316:41zilticider-jack-in-cljs blows up, too, with the same error#2020-03-2316:47dpsuttoncan you run the commands from a command line?#2020-03-2316:47dpsuttonget better feedback#2020-03-2316:48dpsuttonhow do you start your cljs project? is it a shadow project?#2020-03-2316:48dpsuttonah, you can't do clj&cljs then. surprised that cljs only is breaking#2020-03-2316:48ziltiYes, it is a shadow project#2020-03-2316:49zilticljs uses /usr/bin/clojure -A:dev -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} cider/piggieback {:mvn/version "0.4.2"} cider/cider-nrepl {:mvn/version "0.24.0-SNAPSHOT"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'#2020-03-2316:49zilti"ClojureScript REPL type: shadow-select"#2020-03-2316:50dadairIs it possible for cider-browse-spec to follow aliased specs? e.g., with ::some-alias/foo at point, show the spec for :the.fully.qualified.spec/foo?#2020-03-2406:22yuhanI have a hack around this on my local branch of Cider, by macroexpanding namespace-aliased symbols in cider-symbol-at-point:
(defun cider-symbol-at-point (&optional look-back)
"Return the name of the symbol at point, otherwise nil.
Ignores the REPL prompt. If LOOK-BACK is non-nil, move backwards trying to
find a symbol if there isn't one at point."
(or (when-let* ((str (thing-at-point 'symbol)))
;; resolve ns-aliased keywords
(when (string-match-p "^::.+" str)
(setq str (or (ignore-errors (cider-sync-request:macroexpand "macroexpand-1" str)) "")))
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
;; Remove font-locking and trailing . from constructors like Record.
(string-remove-suffix "." (substring-no-properties str))))
(when look-back
(save-excursion
(ignore-errors
(when (looking-at "(")
(forward-char 1))
(while (not (looking-at "\\sw\\|\\s_\\|\\`"))
(forward-sexp -1)))
(cider-symbol-at-point)))))#2020-03-2406:23yuhanNot sure if that's the best way of doing it#2020-03-2407:28jumarI often find helpful to jump to the definition of the keyword via cider-find-keyword#2020-03-2410:19yuhanHuh, that's the first time I came across that command.. and it makes so many faulty assumptions#2020-03-2410:22yuhan(ns foo
(:require [clojure.spec.alpha :as s]))
(s/def :thing/id string?)
eg. something like this doesn't work#2020-03-2316:50dpsuttonyou need to use shadow-cljs to start not clojure#2020-03-2316:50dpsuttonhave you set the preferred build tool? you should be asked which build tool to use#2020-03-2316:50ziltiI have set that, yes#2020-03-2316:51dpsuttonthat's your problem. you need to use the shadow-cljs build tool, not clojure#2020-03-2316:51ziltiSo what do I do then? It is a mixed project that uses both Clojure and ClojureScript.#2020-03-2316:52dpsuttonstart the clojure project with clj and the cljs project with shadow#2020-03-2316:52dpsuttonuse both build tools#2020-03-2316:52ziltiAnd why does the prompt offer me "shadow" and "shadow-select" when starting a REPL with deps.edn when that is not working anyway#2020-03-2316:52dpsuttonthose are clojurescript repl types not build tool types#2020-03-2316:52ziltiWell, it seems to not be possible to set a separate "preferred build tool" for CLJ and CLJS#2020-03-2408:11bozhidarI’ve decided a long time ago that this a bit excessive as most build tools are not specific to Clojure/ClojureScript, that’s why there’s just one build tool config. I think that shadow-cljs is probably the only one that defies this. It’s easy to configure the build tool on a project basis, which I think covers the use-case of most people pretty well.#2020-03-2517:27ziltiOh and it looks like shadow-cljs can also handle the clj repl, not just the cljs one. So I can just set the preferred build tool to shadow-cljs. Though I currently fail to do that in .dir-locals.el...
((nil . ((cider-preferred-build-tool . 'shadow-cljs))))
at least gives me an error.#2020-03-2316:53dpsuttoncorrect. there's no notion like that#2020-03-2406:22yuhanI have a hack around this on my local branch of Cider, by macroexpanding namespace-aliased symbols in cider-symbol-at-point:
(defun cider-symbol-at-point (&optional look-back)
"Return the name of the symbol at point, otherwise nil.
Ignores the REPL prompt. If LOOK-BACK is non-nil, move backwards trying to
find a symbol if there isn't one at point."
(or (when-let* ((str (thing-at-point 'symbol)))
;; resolve ns-aliased keywords
(when (string-match-p "^::.+" str)
(setq str (or (ignore-errors (cider-sync-request:macroexpand "macroexpand-1" str)) "")))
(unless (text-property-any 0 (length str) 'field 'cider-repl-prompt str)
;; Remove font-locking and trailing . from constructors like Record.
(string-remove-suffix "." (substring-no-properties str))))
(when look-back
(save-excursion
(ignore-errors
(when (looking-at "(")
(forward-char 1))
(while (not (looking-at "\\sw\\|\\s_\\|\\`"))
(forward-sexp -1)))
(cider-symbol-at-point)))))#2020-03-2408:40bozhidar@qythium Looks reasonable to me. I don’t use/like spec, so improving the support for it has never been a priority for me.#2020-03-2412:42tvaughanHow can I set the port for cider-connect-sibling-cljs? I have already run cider-jack-in-clj and need to connect to an already running cljs repl. However, cider-connect-sibling-cljs refuses to use anything other than the same port number as the clj repl. Editing .nrepl-port was no help. And C-u also seems to have no effet#2020-03-2413:01bozhidar@tvaughan The sibling REPL is supposed to be on the same nREPL server by definition. That’s why you can’t specify this manually.#2020-03-2413:02bozhidarKeep in mind that in nREPL a single physical connection can host multiple logical connections (nREPL sessions).#2020-03-2413:02bozhidarFrom the perspective of CIDER the cljs connection is just a different nREPL session.#2020-03-2413:03bozhidarTherefore the sibling terminology - they run side-by-side on the same server.#2020-03-2413:04tvaughanOK. I've misunderstood then. How do I run cider-jack-in-clj and connect to an already running cljs repl? I've tried other approaches and I always seem to lose the clj repl.#2020-03-2413:10dpsuttoni connect to a running cljs project separate from my clj backend like so for work:#2020-03-2413:10dpsutton(defun aclaimant-jack-in-dashboard ()
(interactive)
(cider-connect-cljs (list :host "localhost"
:port 7888
:cljs-repl-type 'figwheel-connected
'project-dir "~/projects/aclaimant/acl")))#2020-03-2413:16dpsuttoni also have a shadow-cljs project here. I threw in a deps.edn file and started a clojure repl. Then shadow-cljs watch app from the command line, m-x cider-connect-cljs selected localhost, then the port for shadow and i'm up and running. I'm not seeing any issue to this workflow? Did i miss something?#2020-03-2413:19tvaughan@U11BV7MTK This is exactly what I did. But after cider connects to the cljs repl I lose the clj repl. I can no longer evaluate clojure expressions/buffers#2020-03-2413:20dpsuttonoh. i didn't test that. sorry. let me check#2020-03-2413:22dpsuttonhmm, i'm not having any such issues#2020-03-2413:22dpsuttonbut need to mention that there is a limitation that CIDER isn't aware of clj versus cljs repls in the same project. its only aware of the last repl#2020-03-2413:22dpsuttonso if you need to evaluate clojure, the last repl to have focus needs to be your clojure repl, and if you need to evaluate cljs, the last repl to have focus needs to be your cljs repl#2020-03-2413:23dpsuttonbasically it asks of all the connections for the latest repl, and if its a clojure one, it thinks you don't have a cljs repl at all so things appear disconnected#2020-03-2413:24bozhidarActually, the problem is that when you do two separate connections you end up with independent sesman sessions, that have just one connection each.#2020-03-2413:24tvaughanHow do you "focus" the clojure repl?#2020-03-2413:24dpsuttonput the point in it#2020-03-2413:25dpsutton@U051BLM8F ah thanks. i've never really gotten deep into sesman. but i think the observed behavior here is the same regardless. That api needs to be opened up for us so we can track the "latest" clj and latest cljs repls#2020-03-2413:25dpsuttonI wonder if any other projects have used sesman?#2020-03-2413:26dpsuttonhttps://grep.app/search?q=%28require%20%27sesman%29#2020-03-2413:26dpsuttonfrom this it seems like just CIDER at the moment#2020-03-2413:33tvaughanHmmm I can't focus the cljs repl. I can evaluate expressions in each repl directly, however, evaluating something like (js/console.log "Hi") in a .cljs file is sent to the clj repl#2020-03-2413:34bozhidarHave you seen https://docs.cider.mx/cider/usage/managing_connections.html?#2020-03-2413:34bozhidarNot our finest writing, but I think it gives a good overview of session/connection management.#2020-03-2413:35tvaughanYes. Especially this The current REPL is the most relevant REPL from the current session. REPL relevance is determined by the type of the current buffer.#2020-03-2413:38tvaughanC-c C-s i only lists the clj repl session#2020-03-2413:41tvaughanC-c C-s w lists two but the cljs session is linked to a directory path that's totally wrong#2020-03-2413:42tvaughanI'll start over... Thanks for everyone's help!#2020-03-2414:10tvaughanOK. It's working now. I don't know why it wasn't working. I think maybe it was because I connected to the cljs repl first using cider and then in a browser. It seems to only work if I connect to the cljs in a browser first and then using cider. I don't have to focus the repl either. Cider chooses the correct repl correctly based on the current buffer type#2020-03-2417:03johnjcurious, why does cider have 3-4 different keybindings for the same command for many commands?#2020-03-2417:04dpsuttonexample?#2020-03-2417:06johnjyou can see them in C-h m - cider-eval-last-sexp has three for example#2020-03-2417:07johnjC-x C-e C-c C-e C-c C-v e#2020-03-2417:07dpsuttoni have
C-c C-e cider-eval-last-sexp
C-c C-f cider-pprint-eval-defun-at-point
C-c C-j cider-insert-commands-map
C-c C-k cider-load-buffer
#2020-03-2417:10johnjyep, if you keep going down you'll see some of those have additional bindings#2020-03-2417:11dpsuttonah i see! missed it#2020-03-2417:17eval-on-pointtriples your chance of guessing right harold#2020-03-2417:19dpsuttonlol#2020-03-2503:16bbssI updated packages in my prelude and my helm stopped working, and I couldn't uninstall/reinstall it so I went for the nuclear option of just re-installing cider from scratch and adding back some personal init.el stuff. But now when using C-x b I can no longer left arrow back a dir and tab to the non-open but in history buffers, any idea what is missing?#2020-03-2508:29bozhidarI’m assuming you’ve encountered some upstream change in Helm. I haven’t been using it for a while, so I don’t track its development anymore (I’m in camp ivy these days).#2020-03-2511:07bbssOkay, thanks. I also noticed that when creating a new clj file it no longer inserts namespaces/checks for dashes in filenames. I'll check out ivy.#2020-03-2515:49bozhidar@bbss I think the namespace magic was coming from clj-refactor.el.#2020-03-2515:50practicalli-john@bbss I believe it was clj-refactor that prompted to auto-rename files with - in the name. I assume the same for adding the namespace. However, I do have a ns snippet that adds the namespace (when the REPL) is running.#2020-03-2515:50bozhidarIt’s not bundled with Prelude, so I assume you had installed it separately in the past.#2020-03-2600:16bbss😅 right, thanks again!#2020-03-2607:01bozhidarYou’re welcome!#2020-03-2609:23FiVoIs there a way to debug code running in a socket server launched via clojure.core.server/socket-server?#2020-03-2609:50bozhidar@finn.volkel I assume this should work just like any other Clojure (assuming you mean start CIDER and run the socket server inside it).#2020-03-2609:51bozhidarThat’s how I debug nREPL for instance - start nREPL and boot a new instance of it from ti.#2020-03-2610:22FiVook, in my case this doesn't seem to work properly#2020-03-2610:24FiVoit's a pretty big application so don't know exactly where stuff goes awry, but I am certain I am passing through functions that are instrumented#2020-03-2610:25FiVoI also have the impression it's not deterministic, in rare cases it works#2020-03-2615:03FiVoThe main app talks with the repl asynchronous, I guess this is the issue.#2020-03-2615:32bozhidarYeah, that could explain it. It won’t be the first time I hear the debugger is misbehaving in async contexts.#2020-03-2813:41SpacemanI installed shadow-cljs as follows:
npm install -g shadow-cljs
Then I created a shadow-cljs.edn file, with the following:
[{:id "app"
:source-paths ["src/cljs" "src/cljc" "dev"]
:figwheel {:on-jsload "myapp.system/reset"}
:compiler {:main cljs.user
:asset-path "js/compiled/out"
:output-to "dev-target/public/js/compiled/myapp.js"
:output-dir "dev-target/public/js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload]
:optimizations :none}}
{:id "test"
:source-paths ["src/cljs" "test/cljs" "src/cljc" "test/cljc"]
:compiler {:output-to "dev-target/public/js/compiled/testable.js"
:main myapp.test-runner
:optimizations :none}}
{:id "min"
:source-paths ["src/cljs" "src/cljc"]
:jar true
:compiler {:main myapp.system
:output-to "resources/public/js/compiled/myapp.js"
:output-dir "target"
:source-map-timestamp true
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:pretty-print false}}
]
Then in the already running clj repl, I do M-x cider-connect-sibling-cljs, and select the shadow repl option. But I get that shadow-cljs Clojurescript REPL is not available. How do I get shadow cljs to work?#2020-03-2813:42thhellerthat is not a valid shadow-cljs config#2020-03-2813:44SpacemanWhat's a valid shadow-cljs config?#2020-03-2813:46thheller{:source-paths
["src/cljs" "src/cljc" "dev"]
:dependencies
[]
:builds
{:app
{:target :browser
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
:modules {:myapp {:entries [myapp.system]}}}}}#2020-03-2813:46thhellersomething like that#2020-03-2813:47SpacemanStill I get the same error after I choose :app#2020-03-2813:47thhellersorry no clue about the cider parts#2020-03-2816:00dpsuttonCan you tell me the steps you are taking? And can we do a very simple, known cljs app that works and build up the complexity from there?#2020-03-2816:02dpsuttonAh. Don’t connect a sibling. Just jack in clojurescript.#2020-03-2817:58SpacemanIt did launch the repl, but the repl launched says user> and not cljs.repl>. How do I make it a cljs repl?#2020-03-2818:04dpsuttonYou ran cider jack in cljs (not sibling) and then you chose shadow repl type and the repl then said “compiling”?#2020-03-2820:48SpacemanNo I had chosen lein. When I choose shadow-cljs, the repl doesn't start at all, and I get the following error:
Caused by: http://java.io.FileNotFoundException: Could not locate myapp/application__init.class, myapp/application.clj or myapp/application.cljc on classpath.#2020-03-2820:50dpsuttonI’m happy to work through this with you. But can we start with a simple shadow cljs app and see if we can get that running?#2020-03-2820:52SpacemanOkay. I have created npx create-cljs-project myapp. By the way, I'm using the chestnut template in the original app.#2020-03-2820:54SpacemanYes
npx shadow-cljs node-repl
works in the one created with create-cljs-project#2020-03-2820:56dpsuttonawesome. so now we probably just need to see what chestnut does differently. does it use some weird lein-shadow plugin?#2020-03-2820:56dpsuttonor are deps managed by deps.edn or lein?#2020-03-2820:59dpsutton@pshar10 can you tell me the lein new command you used to get this created with chestnut?#2020-03-2821:00Spaceman(defproject myapp "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [;; mydeps
]
:plugins [[lein-cljsbuild "1.1.7"]
[lein-environ "1.1.0"]]
:min-lein-version "2.6.1"
:source-paths ["src/clj" "src/cljs" "src/cljc"]
:test-paths ["test/clj" "test/cljc"]
:clean-targets ^{:protect false} [:target-path :compile-path "resources/public/js" "dev-target"]
:uberjar-name "vendo.jar"
;; Use lein run if you just want to start a HTTP server, without figwheel
:main vendo.application
;; nREPL by default starts in the :main namespace, we want to start in user
;; because that's where our development helper functions like (go) and
;; (browser-repl) live.
:repl-options {:init-ns user}
:cljsbuild {:builds
[{:id "app"
:source-paths ["src/cljs" "src/cljc" "dev"]
:figwheel {:on-jsload "vendo.system/reset"}
:compiler {:main cljs.user
:asset-path "js/compiled/out"
:output-to "dev-target/public/js/compiled/vendo.js"
:output-dir "dev-target/public/js/compiled/out"
:source-map-timestamp true
:preloads [devtools.preload]
:optimizations :none}}
{:id "test"
:source-paths ["src/cljs" "test/cljs" "src/cljc" "test/cljc"]
:compiler {:output-to "dev-target/public/js/compiled/testable.js"
:main vendo.test-runner
:optimizations :none}}
{:id "min"
:source-paths ["src/cljs" "src/cljc"]
:jar true
:compiler {:main vendo.system
:output-to "resources/public/js/compiled/vendo.js"
:output-dir "target"
:source-map-timestamp true
:optimizations :advanced
:closure-defines {goog.DEBUG false}
:pretty-print false}}
{:id :devcards
:source-paths ["src/cljs" "src/cljc" "dev"]
:figwheel { :devcards true }
:compiler {
:main cljs.user
:asset-path "js/compiled/out"
:output-to "dev-target/public/js/compiled/vendo.js"
:output-dir "dev-target/public/js/compiled/out_devcards"
}}
]}
;; When running figwheel from nREPL, figwheel will read this configuration
;; stanza, but it will read it without passing through leiningen's profile
;; merging. So don't put a :figwheel section under the :dev profile, it will
;; not be picked up, instead configure figwheel here on the top level.
:figwheel {:http-server-root "public" ;; serve static assets from resources/public/
:server-port 3449 ;; default
:server-ip "127.0.0.1" ;; default
:css-dirs ["resources/public/css"] ;; watch and update CSS
;; Start an nREPL server into the running figwheel process. We
;; don't do this, instead we do the opposite, running figwheel from
;; an nREPL process, see
;;
;; :nrepl-port 7888
;; To be able to open files in your editor from the heads up display
;; you will need to put a script on your path.
;; that script will have to take a file path and a line number
;; ie. in ~/bin/myfile-opener
;; #! /bin/sh
;; emacsclient -n +$2 $1
;;
;; :open-file-command "myfile-opener"
:server-logfile "log/figwheel.log"}
:doo {:build "test"}
:profiles {:dev
{:dependencies [[figwheel "0.5.18"]
[figwheel-sidecar "0.5.18"]
[cider/piggieback "0.4.0"]
[cider/cider-nrepl "0.18.0"]
[lein-doo "0.1.11"]
[reloaded.repl "0.2.4"]
[lambdaisland/kaocha "0.0-590"]
[spyscope "0.1.6"]
[eftest "0.5.9"]
[alembic "0.3.2"]
[binaryage/devtools "1.0.0"]
[devcards "0.2.6"]
]
:plugins [[lein-figwheel "0.5.18"]
[lein-doo "0.1.11"]
]
:source-paths ["dev"]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
:env {
:foo "bar"
}}
:uberjar
{:source-paths ^:replace ["src/clj" "src/cljc"]
:prep-tasks ["compile"
["cljsbuild" "once" "min"]]
:hooks []
:omit-source true
:aot :all}}
;; :injections [(require 'spyscope.core)
;; (require 'kaocha.repl)
;; (require '[cemerick.pomegranate :only (add-dependencies)])
;; ]
:aliases {"kaocha" ["with-profile" "+kaocha" "run" "-m" "kaocha.runner"]}
)#2020-03-2821:01dpsuttonthis isn't a shadow-cljs project#2020-03-2821:01dpsuttonthere's no hope of shadow running this#2020-03-2821:02dpsuttonthis is a figwheel project. choose figwheel when jacking-in cljs and you hopefully will be good to go#2020-03-2821:04SpacemanI wanted to use shadow-cljs to easily use npm libraries in my project. What's the next best way to do it?#2020-03-2821:07dpsuttonread shadow-cljs's extensive user guide and see how to create a new project. i have a nice 5 minute presentation/tutorial here: https://github.com/dpsutton/asg-ignite-presentation#2020-03-2821:14SpacemanThe presentation doesn't say anything about a clojure backend + clojurescript template. Basically there are seperate directories clj, cljc and cljs for the front-end and the backend in chestnut. Run
lein new chestnut myapp
to see what I mean. Then if you will tell me how to create something similar with shadow-cljs#2020-03-2821:20dpsuttonyou can see how the backend is made in the chestnut example and delete all of the front end stuff and use the shadow-cljs stuff instead#2020-03-2821:21dpsuttonyou don't need a template. just a backend which will look like any backend project (you can mimic the chestnut stuff) and a frontend that you can mimic the shadow-cljs stuff i linked#2020-03-2921:57pezThanks for the super cool shout-out to Calva in The REPL podcast, @bozhidar ! #2020-03-3003:47Bardia PourvakilAnyone have any idea why I’m not able to access my namespaces in my CIDER nrepl session into my shadow-cljs project #2020-03-3003:56dpsuttonHow are you trying to access them? Also, browser or node? If browser have you loaded the app in the browser and if node have you started a node process?#2020-03-3003:59Bardia PourvakilI’m targeting my :app #2020-03-3003:59Bardia PourvakilIt’s being watched #2020-03-3004:00Bardia PourvakilAnd hot reloading works #2020-03-3004:00Bardia PourvakilAnd alerts and console logs work #2020-03-3004:00Bardia PourvakilBut for whatever reason I can’t access my namespace to test state etc #2020-03-3004:01dpsuttonIt’s a test namespace? Is it on the class path? Do you have a repl buffer open?#2020-03-3004:02Bardia PourvakilIt’s the main app namespace #2020-03-3004:02Bardia Pourvakilhttps://github.com/bardia95/bardia-pourvakil#2020-03-3004:02Bardia PourvakilYou can check out my code here #2020-03-3004:02Bardia PourvakilThe repl buffer is open #2020-03-3004:04Bardia PourvakilNvm it worked now I was trying to use in-ns and use #2020-03-3004:04Bardia PourvakilBut using just ns worked #2020-03-3004:04Bardia PourvakilDo you know why that would be so ? #2020-03-3004:07dpsuttonwhat command did you try and which actually worked?#2020-03-3004:09dpsuttonjust a heads up. i cloned your repo and you've got symlinks for unsaved files in your src directory https://github.com/Bardia95/bardia-pourvakil/tree/master/src/bardia_pourvakil#2020-03-3004:12Bardia PourvakilI was trying (use ‘bardia-pourvakil.core) and (in-ns ‘bardia-pourvakil.core) and (require :reload ‘bardia-pourvakil.core) #2020-03-3004:12Bardia PourvakilNone work #2020-03-3004:12Bardia PourvakilAhh thanks will remove those #2020-03-3004:12Bardia Pourvakil(ns bardia-pourvakil.core) worked #2020-03-3004:13dpsutton(require 'bardia-pourvakil.core :reload)#2020-03-3004:14dpsuttonthen (in-ns '...)#2020-03-3004:21Bardia PourvakilAhh cool thanks #2020-03-3004:21Bardia PourvakilSorry I’m super noob to clojure #2020-03-3004:28dpsuttonno worries 🙂#2020-03-3116:20Spencer AppleInspiring talk Bozhidar! Thanks for all your work everyone!
https://www.youtube.com/watch?v=dZ4xczP5zDI#2020-03-3117:14bozhidarThanks! :man-bowing:#2020-04-0109:36Setzer22Hi! I'm working on improving the nREPL support in Arcadia (https://github.com/arcadia-unity/Arcadia), which uses clojure CLR. A particular issue I'm facing is that CIDER sometimes wants to know about the classpath, and since Arcadia's nREPL implementation does not have a classpath (it's not even Java), we can't implement the "classpath" op, so CIDER seems to resort to its own workaround (https://github.com/clojure-emacs/cider/blob/4cc4280677e6eeb16cd55d9865c0ea9f9d141af3/cider-client.el#L517).
This ends up making thigs worse. Sometimes emacs will only ask for this once, and when the op fails it will query the minibuffer for a "Lisp Expression: ". However (and this is where things really get bad), sometimes when browsing specific files, emacs will start to spam Arcadia's nREPL server in a seemingly infinite loop asking for the classpath using cider-fallback-eval:classpath#2020-04-0109:36Setzer22This latter case makes emacs freeze completely, loosing all unsaved work and forcing me to restart.#2020-04-0109:40Setzer22In any case, what I'm looking for is a way to workaround this issue. Why does cider need to know about the classpath so badly that if the classpath op is not supported it will try to do its own version? Moreover: How is the classpath used? Even if C#/CLR have no notion of a classpath, perhaps we could return something useful and take this as an opportunity to make cider work even better in CLR. I'm assuming cider is using the classpath op to gather info about the location of files (perhaps to handle jump-to-definition in the doc view? That'd be particularly interesting to have).#2020-04-0109:41Setzer22Finally: Is this cider-fallback-eval:classpath "spam" (sending several queries per second) intended at all? Perhaps there's a bug somewhere in the implementation? I think this can be reproduced by opening a file in clojure mode that does not have an ns declaration on top (for example, an edn config file)#2020-04-0110:34bozhidar@setzer22 Hey there!#2020-04-0110:36bozhidar> This ends up making thigs worse. Sometimes emacs will only ask for this once, and when the op fails it will query the minibuffer for a “Lisp Expression: “. However (and this is where things really get bad), sometimes when browsing specific files, emacs will start to spam Arcadia’s nREPL server in a seemingly infinite loop asking for the classpath using cider-fallback-eval:classpath
Yeah, I’m aware of this problem. That’s going to be easy to fix, provided there’s some way for CIDER to understand its not talking a Clojure endpoint. Is Arcadia’s nREPL server standalone? I recall in the past there was only some middleware that was proxying evaluations outside of nREPL. Has this changed?#2020-04-0110:37bozhidarI was thinking we can add a bit more data to the describe op in this case, and this would make it easy for CIDER to do things conditionally based on the server’s implementation.#2020-04-0110:38bozhidar> In any case, what I’m looking for is a way to workaround this issue. Why does cider need to know about the classpath so badly that if the classpath op is not supported it will try to do its own version? Moreover: How is the classpath used? Even if C#/CLR have no notion of a classpath, perhaps we could return something useful and take this as an opportunity to make cider work even better in CLR. I’m assuming cider is using the classpath op to gather info about the location of files (perhaps to handle jump-to-definition in the doc view? That’d be particularly interesting to have).
The classpath is mostly used to map logical connections in CIDER to projects. Let me dig the relevant code for you.#2020-04-0110:48bozhidarAh, I see we also use it to infer the expected ns, which is probably causing the bigger issue you’ve observed.#2020-04-0110:49bozhidarCheck out https://github.com/clojure-emacs/cider/blob/93ff91a1d79ba3094a50a7b01700b02d720e14b8/cider-connection.el#L463 and https://github.com/clojure-emacs/cider/blob/4cc4280677e6eeb16cd55d9865c0ea9f9d141af3/cider-client.el#L141#2020-04-0110:50bozhidarAt any rate - I don’t think it will be hard to solve this. I’d love for CIDER to support well different nREPL servers/languages. This wasn’t a priority so far mostly because it seemed there was not much interest there.#2020-04-0110:52Setzer22Hi! Thanks for the quick reply 😅#2020-04-0110:55Setzer22> I was thinking we can add a bit more data to the describe op in this case, and this would make it easy for CIDER to do things conditionally based on the server’s implementation.
Adding more data to the describe op would be really simple from our side. What should we add to the describe op that would make sense? I'm not very familiar with the nREPL protocol myself
> Is Arcadia’s nREPL server standalone? I recall in the past there was only some middleware that was proxying evaluations outside of nREPL. Has this changed?
There's currently a (more or less) complete nREPL server implemented in C#: https://github.com/arcadia-unity/Arcadia/blob/268bed0fc9dc5143870259d88a142d60ae8b7f9d/Editor/NRepl.cs#L291#2020-04-0111:10Setzer22> Ah, I see we also use it to infer the expected ns, which is probably causing the bigger issue you’ve observed.
That makes sense. Probably some piece of code needs to know about the expected ns, and since our nrepl server is crashing and returning an error, things get messy...#2020-04-0111:12Setzer22In any case, how should the reply to the "classpath" message look like?#2020-04-0112:20bozhidarIt’s a list of classpath entries as strings.#2020-04-0112:24bozhidar/Users/bozhidar/projects/nrepl/test/clojure
/Users/bozhidar/projects/nrepl/src/clojure
/Users/bozhidar/projects/nrepl/dev-resources
/Users/bozhidar/projects/nrepl/resources
/Users/bozhidar/projects/nrepl/target/classes
/Users/bozhidar/.m2/repository/cider/cider-nrepl/0.24.0/cider-nrepl-0.24.0.jar
/Users/bozhidar/.m2/repository/nrepl/nrepl/0.6.0/nrepl-0.6.0.jar
/Users/bozhidar/.m2/repository/clojure-complete/clojure-complete/0.2.5/clojure-complete-0.2.5.jar
/Users/bozhidar/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar
/Users/bozhidar/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
/Users/bozhidar/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
#2020-04-0112:24bozhidarSomething like this.#2020-04-0112:24bozhidar> Probably some piece of code needs to know about the expected ns, and since our nrepl server is crashing and returning an error, things get messy...
Yep, that’d be my guess.#2020-04-0112:26bozhidarIs there something similar in CLR that you can return?#2020-04-0112:47bozhidarAs you can imagine the expected ns functionality relies mostly on the paths for the source dirs the expected ns can be derived from those.#2020-04-0112:51Setzer22> Is there something similar in CLR that you can return?
There definitely is! I was wondering about the specific format. I'm guessing this should be a string containing an edn-formatted list of strings?#2020-04-0112:53Setzer22Just to confirm I got this right. Let's say I have a namespace called my.great.ns , which is in file "/home/username/Project/src/my/great/ns.clj", the classpath entry should be "/home/username/Project/src/", right?#2020-04-0114:11bozhidarYeah, exactly.#2020-04-0114:12bozhidar> There definitely is! I was wondering about the specific format. I’m guessing this should be a string containing an edn-formatted list of strings?
#2020-04-0114:12bozhidarIt should be a sequence of strings. All sequences are represented as lists in bencode.#2020-04-0115:35pinkfrogI run cider-test-run-project-tests . and the tests failed. I edited the file, rerun cider-test-run-project-tests#2020-04-0115:36pinkfroghowever, cider seems unaware of the change.#2020-04-0115:51dpsuttondid you reevaluate the file?#2020-04-0115:55pinkfrogi saved the file.#2020-04-0115:56pinkfrogcan I achieve the re-run by only saving the file?#2020-04-0116:36practicalli-john@i if you change the code of your tests, then you will need to evaluate the new code for the CIDER test runner. You could evaluate the deftest function as soon as you change it, or evaluate the whole test buffer.
Spacemacs provides wrapper functions around the cider-test-run-* functions which include a call to cider-load-buffer so you could take the same approach.#2020-04-0120:46johnjwhere do I put a custom cider-jack-in for a project?#2020-04-0120:49johnjnm, found this https://docs.cider.mx/cider/config/project_config.html#2020-04-0208:33Setzer22> It should be a sequence of strings. All sequences are represented as lists in bencode.
@bozhidar Ok! I've implemented the "classpath" op and this seems to get rid of the infinite request loop issue 🎉#2020-04-0208:44Setzer22I think it still makes sense nontheless to add a special signal to the describe op. This way you can know this is a CLR repl, just in case you decide to do anything special with it in the future.
For now I'd say things work really well making CIDER believe we're a JVM, But I'm concerned future updates trying to make the experience better for JVM users means things transparently break for Arcadia/CLR users. If you could check some flag before sending JVM-specific code, that'd be really great! 😅 I'm sure it will also help for other even more obscure dialects of clojure wanting to have editor support.
As a side-comment, since you're taking this route of providing fallback functionality when middlewares are missing. When it makes sense to do so, I'd encourage you to try make things as platform-independant as possible (that is, stick to cljc). In the long term that would mean better support not only the small-ish CLR community but the CLJS ecosystem as well!#2020-04-0209:10bozhidar> For now I’d say things work really well making CIDER believe we’re a JVM, But I’m concerned future updates trying to make the experience better for JVM users means things transparently break for Arcadia/CLR users. If you could check some flag before sending JVM-specific code, that’d be really great! #2020-04-0209:11bozhidarWell, it’s good I’m the maintainer for both CIDER and nREPL, so I’ll definitely be mindful of making such changes. Actually when I find myself with a bit of time I plan to make more changes in the opposite direction. 🙂#2020-04-0209:11bozhidar> I think it still makes sense nontheless to add a special signal to the describe op. This way you can know this is a CLR repl, just in case you decide to do anything special with it in the future.
#2020-04-0209:12bozhidarYeah, definitely. I’ll just need to decide where exactly to put it and how to make it.#2020-04-0209:13bozhidarI think the best option would be here:#2020-04-0209:13bozhidarversions (dict
clojure (dict
incremental 0
major 1
minor 10
version-string "1.10.0")
java (dict
incremental "1"
major "10"
minor "0"
version-string "10.0.1")
nrepl (dict
incremental 0
major 0
minor 7
version-string "0.7.0-beta1"))#2020-04-0209:14bozhidarThat’s part of the describe response. It’d be nice if your server returned some CLR version info and we can also added a extra key to the nrepl map - e.g. something like name/implementation/flavour.#2020-04-0209:16bozhidar> As a side-comment, since you’re taking this route of providing fallback functionality when middlewares are missing. When it makes sense to do so, I’d encourage you to try make things as platform-independant as possible (that is, stick to cljc). In the long term that would mean better support not only the small-ish CLR community but the CLJS ecosystem as well!
That’s the dream, but we’ll need some time to get there.#2020-04-0214:45pinkfrogto make cider jump to the definition, I need to manually run cider-eval-ns-form#2020-04-0214:45pinkfroghow to make cider automatically parse the project?#2020-04-0214:52dpsuttonthe first thing i do when i open a buffer is eval the buffer#2020-04-0214:52dpsuttonthen its loaded and good to go#2020-04-0215:03pinkfrogyup. i need to know the workflow of cider. it is somehow different from cursive.#2020-04-0215:04pinkfrog@dpsutton is it possible to load all the project instead of a single buffer/file ?#2020-04-0215:08dpsuttonif you load your main ns that usually loads mostly everything#2020-04-0215:09pinkfrogthat means, when I open project.clj, I have to go to the http://main.cl ns file and open it. cider is basically not that aware of the project level stuff ?#2020-04-0215:10dpsuttonif you've started your app then it has been loaded#2020-04-0215:12dpsuttonand by started i mean not just cider-jack-in but some kind fo start#2020-04-0215:45bozhidarSee also https://docs.cider.mx/cider/usage/interactive_programming.html and https://docs.cider.mx/cider/usage/cider_mode.html#2020-04-0220:50didibusEver considered using the clj-kondo analyses data: https://github.com/borkdude/clj-kondo/tree/master/analysis to add support for auto-completion of var names, macros, fns, namespaces, to show arities and to show doc, as well as for jump to definition, show uses, and add name refactoring?#2020-04-0220:50didibusWhich could all be done without a connected REPL#2020-04-0221:08borkdudeI guess CIDER doesn't want to include clj-kondo in its dependencies, but maybe it can be set up like refactor-nrepl, like some sort of add-on#2020-04-0307:11bozhidarIt’s fine to use it via the middleware, btw. I think we already discussed this in the past. That would have the advantage that users won’t have to install anything and I guess if we don’t have to shell out life on Windows would be easier. 🙂#2020-04-0307:38borkdude^ @U0K064KQV#2020-04-0419:17didibusHum... I think that be a bit beyond what I'm thinking. Since middleware means running REPL no? And I'm thinking of the possibility of adding a REPLless auto-complete. Though I guess middleware clj-kondo would be nice for linting, where users don't need to install it.#2020-04-0221:08borkdudeor maybe it doesn't fit with the philosophy of CIDER which is based on nREPL, which implies a REPL?#2020-04-0307:06bozhidarYeah, that’s true. CIDER is first and foremost REPL-powered tool (like SLIME and most similar Lisp programming environments).#2020-04-0223:27didibusMight be a better fit for clojure-mode itself maybe?#2020-04-0307:09bozhidarI’d be open to something like this (depending on the complexity of the integration). In general I’m wary of adding tool-specific functionality to clojure-mode or increasing a lot the level of complexity there. Alternatively this can be a separate minor “kondo-mode” or something like this. I haven’t played enough with kondo to have a good opinion about the best course of action.#2020-04-0419:20didibusHow does Emacs handle auto-complete for other languages? Is an emacs-lisp parser implemented for them?#2020-04-0419:20didibusDo you know?#2020-04-0223:28didibusThere were refactorings that moved to be handled by clojure-mode or cider itself over time I believe#2020-04-0223:28didibusI can see not wanting to include the binary itself, I was thinking maybe a config, if you set the path to clj-kondo then it can use it for those features#2020-04-0223:29didibusActually, I would probably prefer it in clojure-mode itself, so I could use it with inf-clojure and spiral as well#2020-04-0306:49yuhanJust to be sure I'm not missing anything - does Cider currently offer any way to view the constructor types or arguments for a Java interop form? eg.
(Classname. ,,,)
cider-doc and eldoc don't appear to display any relevant information.#2020-04-0306:56yuhanMore concretely, something like (Integer. 1.0) throws the error "No matching ctor found" without any hint of what ctors it's matching against, and I end up having to leave Emacs and trawl through Javadocs to figure out what what the constructors and argument types are.#2020-04-0307:05bozhidar@qythium This certainly worked at some point - you’d get all the constructors in the eldoc.#2020-04-0307:05bozhidarWhat’s your JDK? Many Java-related things broke after Java 8 because of the modules system.#2020-04-0307:17yuhanI'm using jdk 11#2020-04-0307:23bozhidarCan you check if this works differently with JDK 8?#2020-04-0308:25jumarI'm not sure if that ever worked or not; I guess I'm looking at constructors very infrequently.
@qythium for your particular case it could be better to look at static methods just typing Integer/, pressing TAB for autocomplete and "showing javadoc" via Shift+K (in Spacemacs) works for me (parameters are shown, not actual javadoc).
@bozhidar
It's true that lot of things (like javadoc and source code navigation) broke after switch to JDK >8;
It would be nice to know if there are any future plans to address this soon since JDK 8 has become quite old at this point 🙂#2020-04-0308:35bozhidar@jumar Plans I have plenty, but with so many projects that I’m juggling I’m certainly short on time. 🙂#2020-04-0309:18yuhanNope, doesn't work with JDK 8 either on my end#2020-04-0309:20yuhan@jumar K (cider-doc) -> show javadoc works for certain builtin classes but not external libraries, and it opens in a separate web browser app#2020-04-0310:19jumarMine shows inline docs, it's not the same as standard javadoc function;
That's also why it works for some external libs - they are defined here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/java/javadoc.clj#L29-L41#2020-04-0310:44yuhanDo you know the Emacs command name for that? M-x cider-javadoc?#2020-04-0310:45yuhanor is it that you have URLs set to open within Emacs, using EWW or something?#2020-04-0312:10jumarI think it's just cider-doc#2020-04-0309:21yuhanDoes it work on anyone else's setup? If it's a missing feature I could open an issue in the relevant GH repo (orchard / cider-nrepl)#2020-04-0309:23bozhidarFor external classes you have to have the source jars on your classpath.#2020-04-0309:23bozhidar(regardless of the JDK version)#2020-04-0309:27yuhanMeaning jars that were downloaded from Maven and which I can import from my repl?#2020-04-0309:29yuhanSome external libraries work but not others, I guess not every package has a generated javadocs website (not sure how that works)#2020-04-0309:53pinkfrogwhen I use projectile-toggle-between-implementation-and-test to switch between test and src file. I got: No matching test file found for project type ’generic#2020-04-0309:53pinkfrogany thing I need to configure for that ?#2020-04-0309:58pinkfrogfound this: projectile-register-project-type . maybe I should tweak it.#2020-04-0309:59yuhanAre you in a lein / deps project?#2020-04-0310:06pinkfrogI see. projectile tells the project type on the top level project.clj#2020-04-0310:07pinkfrog.projectile
subfoler/project.clj#2020-04-0310:07pinkfrogthis wont do it.#2020-04-0310:27pinkfrogI am in the middle of (apply |caret| str (reverse “asdf”))#2020-04-0310:27pinkfrogwhat function should I invoke to evaluate the (apply str (reverse “asdf”)) .#2020-04-0310:27pinkfrogcider-eval-sexp-at-point . evaluates “apply”#2020-04-0310:36practicalli-john@i to get projectile to work with a mono-repo (multiple clojure projects within a project) I used the following .dir-locals.el file https://github.com/practicalli/codewars-guides/blob/master/.dir-locals.el This enables projectile to toggle between implementation and test correctly. It should work for both deps and leiningen projects#2020-04-0310:37practicalli-johnYou can change nil to clojure-mode if you want to limit the scope to clojure (something I forgot to do). I dont think it causes any side effects as it is anyway.#2020-04-0310:41practicalli-john@i you wish to evaluate the top level expression, so its cider-eval-defun-at-point or as its on the same line, you could also do cider-eval-sexp-end-of-line but the defn command is generally more useful.#2020-04-0311:46pinkfrog(defn reverse-string [s] ;; <- arglist goes here
;; your code goes here
(apply <caret> str (reverse “asdf”)))#2020-04-0311:47pinkfrogneither of the two functions evaluates the (apply str (reverse “asdfasf”)) stuff#2020-04-0312:13yuhanI made my own wrapper for this purpose - basically (up-list) then (cider-eval-last-sexp)#2020-04-0315:55practicalli-john@i those functions work for the original question you asked. Now you have changed the code by wrapping it in a defn.
I dont understand what you are trying to do now, there is no point wrapping it in a defn if you are not using the argument received by the defn.
Replace the "asdf" with s (a terrible arg name by the way) and then just write an expression to call the defn and evaluate that.
(reverse-string "asdf") . Using eval-defn works with this expression and is what your tests will do (I assume you doing the exercism challenge this comes from)#2020-04-0311:25eval-on-pointand you just put that at the root of the monorepo? much nicer than running touch .projectile on all my subprojects#2020-04-0311:36practicalli-johnYes, having one .dir-locals.el worked more effectively for me than the .projectile files.#2020-04-0314:27eval-on-pointworks like a charm! awesome trick#2020-04-0311:33pinkfrogi put a dummy project.clj at . the top level.#2020-04-0311:33pinkfrog@jr0cket thanks. especially for your website docs.#2020-04-0311:50yuhanafter doing a bit of hacking around in orchard.java I found the following to work in both cider-doc and eldoc:
(in-ns 'cider.nrepl.inlined-deps.orchard.v0v5v7.orchard.java) ;; or replace with your corresponding inlined ns
(reset! cache {})
(defn type-info
"For the class or interface symbol, return Java type info. If the type has
defined contructors, the line and column returned will be for the first of
these for more convenient `jump` navigation."
[class]
(let [info (class-info class)
ctors (vals (get-in info [:members class]))
first-ctor (->> ctors
(sort-by :line)
(filter :line)
(first))]
(-> info
(dissoc :members)
(assoc :arglists
(map #(if (:argnames %)
(mapv (fn [n t] (symbol (str t " " n))) (:argnames %) (:argtypes %))
(:argtypes %)) ctors))
(merge (select-keys first-ctor [:line :column])))))#2020-04-0508:04bozhidar@qythium I think it’s best to submit this as GH ticket/PR, so it’s easier to discuss the code there. Slack is poorly suited for this purpose IMO. 🙂#2020-04-0508:56yuhandone as a draft PR :)#2020-04-0312:01yuhan#2020-04-0312:04yuhanI'm probably doing something questionable by constructing a symbol with a space in it.. I wonder how else to represent both the type and arg name#2020-04-0312:06yuhanWould appreciate if someone could help test this out informally before I package it into a PR for orchard - my JVM knowledge is pretty minimal and I could be missing something#2020-04-0316:05FiVoI think I have asked this question before, but can't remember the answer. I installed a local version of nrepl via lein install and now removed it from ~/.m2/... but when I jack in it still says nREPL 0.7.0-alpha3.#2020-04-0316:36bozhidar@finn.volkel You need to update your CIDER snapshot.#2020-04-0316:36bozhidarCIDER specifies the version of nREPL to use internally if you’re using cider-jack-in.#2020-04-0316:42FiVoWhat exactly do you mean? I upgraded cider today actually, am now on 0.25.0snapshot.#2020-04-0416:31bozhidarSee cider-nrepl-required-version. CIDER plugs this into the command it uses to start the server.#2020-04-0508:52FiVothanks, it's now on the correct version. I don't know what I did, but today it's the correct verison.#2020-04-0321:39practicalli-john@finn.volkel sounds like you have nrepl version set in Leiningen profil#2020-04-0321:59mafcocincoHaving trouble with Spacemacs. Has been working great for the last 2 years or so but today, for some reason, my `*cider-repl*` buffer stopped launching for no reason that I have been able to discover. I've tried multiple launching different projects, thinking maybe there was something in the configuration of a specific project, which did not work. I've tried creating a new project, which also did not work. I moved my previous `.emacs.d` folder to a backup location and create a fresh install of Spacemacs but no luck. Here is the tall end of the `*Messages*` buffer for the fresh install#2020-04-0321:59mafcocincoDone (Total of 1 file compiled, 2 skipped)
(Spacemacs) --> installing package: yasnippet@auto-completion... [155/155]
Auto-evilification could not remap these functions in map 'edebug-mode-map':
- 'edebug-Go-nonstop-mode' originally mapped on 'G'
Auto-evilification could not remap these functions in map 'tar-mode-map':
- 'tar-chgrp-entry' originally mapped on 'G'
(Spacemacs) Warning: tern binary not found!
Loading /Users/marcusoladell/.emacs.d/layers/+distributions/spacemacs-base/keybindings.el (source)...done
Loading /Users/marcusoladell/.emacs.d/layers/+source-control/version-control/keybindings.el (source)...done
Loading /Users/marcusoladell/.emacs.d/.cache/recentf...done
Saving file /Users/marcusoladell/.spacemacs...
Wrote /Users/marcusoladell/.spacemacs [2 times]
Spacemacs is ready.
Open the quickhelp.
Start checking for new version...
Spacemacs is up to date.
[yas] Check your `yas-snippet-dirs': /Users/marcusoladell/.emacs.d/elpa/yasnippet-20200329.1434/snippets is not a directory
[yas] Prepared just-in-time loading of snippets with some errors. Check *Messages*.
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.7.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.0-SNAPSHOT\"\] -- repl :headless :host localhost
Quit
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.7.0\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.0-SNAPSHOT\"\] -- repl :headless :host localhost
<left-fringe> <drag-mouse-1> is undefined
#2020-04-0322:00mafcocincoMany of these warnings or errors I have seen before things went sideways today. Not sure if they are relevant to what is happening. The `nrepl-server` launches successfully. I just don't get any `*cider-nrepl*` buffer connected to it. 😕#2020-04-0508:05bozhidarI don’t see any CIDER-specific errors in the log you’ve posted. You might want to check https://docs.cider.mx/cider/troubleshooting.html#2020-04-0514:30mafcocincothanks.#2020-04-0517:22didibusDoes your code compiles sucessfully?#2020-04-0517:22didibusI've noticed sometimes launching nRepl when your source is broken makes it crash#2020-04-0517:23didibusWell, might not be nRepl, but lein repl#2020-04-0613:22mafcocincoIt does. in the end, it was a versioning issue with various pieces of the middleware.#2020-04-0322:00mafcocinco(originally posted this to #spacemacs but seems more appropriate here)#2020-04-0413:50Jim NewtonHi cider users. What's the correct way to expand a macro in Cider? In slime it is C-c RET#2020-04-0413:58yuhanM-x cider-macroexpand (-1/all), I think it's also bound to C-c RET#2020-04-0414:02Jim Newtondoesn't work for me. it does something bizarre.
for example if I sit my cursor on the opening paren of an
(assert (< 1 (count operands))
(format "traverse-pattern should have already eliminated this case: re=%s count=%s operands=%s" re (count operands) operands))
and press C-c RET, I see the following:
[operands functions]
#2020-04-0414:04yuhanThe cursor has to be placed directly after the sexp (yeah, it's not very ergonomic)#2020-04-0414:05Jim Newtonahh in slime it has to be on the opening paren#2020-04-0416:33bozhidarI guess that might be on me - I almost always navigate to the end of the forms, that’s why this behaviour seems natural to me. 😄#2020-04-0416:37bozhidarProbably we can make the command a bit smarter when it comes to the cursor placement.#2020-04-0417:05genmeblogHey, hey, just updated clj-refactor and got the error about unbalanced parantheses clj-refactor-20200404.907/clj-refactor.el#2020-04-0417:07bozhidar@tsulej Yeah, I made a silly mistake. A patch was just merged to master.#2020-04-0417:07bozhidar(copy-pasting doesn’t work well with Lisps 😄 )#2020-04-0504:43rgmI’m finally trying out emacs/cider (longtime vimmer) and I’m hoping this is a quick question. I think I’ve got everything working, but the temporary overlay is showing with almost no contrast (see last line)#2020-04-0504:44rgmcan someone point me in the direction of either turning off all colours (really I find I can code just fine with only rainbow parens), or how to customize this?#2020-04-0504:50rgmoh, wait … think I found it. I think I set cider-result-overlay-face https://github.com/clojure-emacs/cider/blob/master/cider-overlays.el#L35#2020-04-0508:02bozhidar@rgm Yeah, that’s the one.#2020-04-0509:50FiVo@bozhidar On some of my projects the dynamic syntax highlighting doesn't seem to properly work. Do you have any idea what might be interfering there?#2020-04-0509:51FiVoIt's also rather arbitrary, sometimes I don't have the highlighting from the beginning, sometimes I am loosing the highlighint while I am working.#2020-04-0509:52FiVoBut I could so far not pinpoint the issue. I am just wondering if you have any idea what could be the issue?#2020-04-0509:55FiVocider-refresh-dynamic-font-lock also doesn't help#2020-04-0510:00jumarI think there’s a limit on how lon highlighted string can be although it’s rather large#2020-04-0512:11Jim NewtonI'm using cider packages downloaded with elpa. in particular ~/.emacs.d/elpa/clj-refactor-20200229.1105/clj-refactor.el When bugs get fixed in that package, what is the correct flow for me to get the bug fix? Am I supposed to regularly run some sort of elpa update?#2020-04-0513:51FiVoYes you run the following commands:#2020-04-0513:51FiVoM-x list-packages, U - to mark upgradeable, M-x package-menu-execute#2020-04-0512:11Jim Newtonsorry, not an expert elpa user here.#2020-04-0606:17didibusHow come sequence doesn't font-lock?
(def s
(sequence
(comp printer
(filter odd?))
(range 100)))#2020-04-0606:17didibusEverything else does#2020-04-0607:08bozhidar@didibus Seems you’ve encountered some bug. It’s best to report it over at GitHub.#2020-04-0618:15solfI have an error when I start lein with cider-nrepl:
lein update-in :dependencies conj \[nrepl\ \"0.7.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.0-SNAPSHOT\"\] -- repl
nREPL server started on port 44673 on host 127.0.0.1 -
ERROR: Unhandled REPL handler exception processing message {:code (clojure.core/binding [clojure.core/*ns* (clojure.core/or (clojure.core/find-ns (clojure.core/symbol "reply.eval-modes.nrepl")) clojure.core/*ns*)] (set! *print-length* nil)), :id 718a1369-78d6-44f8-8a6b-287dfe22f04c, :op eval, :session 4230fab0-7377-4f02-9631-0568f585d361}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cider.nrepl$wrap_debug$fn__6381.invoke(nrepl.clj:137)
at nrepl.middleware$wrap_conj_descriptor$fn__5720.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__5923.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__5720.invoke(middleware.clj:16)
at cider.nrepl$wrap_enlighten$fn__6387.invoke(nrepl.clj:163)
at nrepl.middleware$wrap_conj_descriptor$fn__5720.invoke(middleware.clj:16)
at cider.nrepl$wrap_ns$fn__6419.invoke(nrepl.clj:263)
at nrepl.middleware$wrap_conj_descriptor$fn__5720.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__6122.invoke(session.clj:297)
at nrepl.middleware$wrap_conj_descriptor$fn__5720.invoke(middleware.clj:16)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at nrepl.server$handle_STAR_.invoke(server.clj:16)
at nrepl.server$handle$fn__6184.invoke(server.clj:36)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)#2020-04-0618:17solfI also tried with nrepl 0.6.0 + cider-nrepl 0.23.0. This error might have started happening after I tried embedding an nrepl server in my application (adding nrepl and cider-nrepl to :dependencies). I've since rollbacked everything but the error persists.#2020-04-0618:25solfFinally it works! After deleting ./target folder. I don't know yet what exactly that folder contains, but the error is now gone.#2020-04-0618:27solfStill, I would like to embed cider-nrepl in my app. Hopefully the workaround will work (https://docs.cider.mx/cider-nrepl/usage.html#_via_embedding_nrepl_in_your_app), but I'll have to try it tomorrow, it's pretty late in Singapore.#2020-04-0703:24solfSo far the workaround seems to do the job, but then again I could have sweared it also worked at first without the workaround#2020-04-0714:23vemvhttps://docs.cider.mx/cider/usage/misc_features.html#_reloading_code says: cider-ns-refresh wraps clojure.tools.namespace,
While https://github.com/clojure-emacs/cider/blob/f4eebe621231f088afb47cd93884444bfd1f0473/cider-ns.el#L192 says: does not rely on org.clojure/tools.namespace.
So I'm wondering - what's the exact relationship between cider and t.n?#2020-04-0714:24vemvFor extra context, I reload code my own way (without cider's helpers), which works OK, but I need to understand how most emacsers do this#2020-04-0714:49bozhidar@vemv The fancier refresh command uses c.t.n., the basic reload command just does :reload.#2020-04-0714:50vemvGot it, thanks for the explanation.#2020-04-0714:49bozhidarIt really depends on what you need (and whether you’re working with Clojure or ClojureScript).#2020-04-0715:38mikerodIf I add this:
:plugins [[cider/cider-nrepl "0.25.0-SNAPSHOT"]]
to my project and do a lein repl
I keep getting errors like:
Unable to resolve var: cider.nrepl/wrap-apropos in this context
and warnings etc.#2020-04-0715:39mikerodI’ve tried with 0.24.0 and see the same - not even trying to connect cider, just start the repl#2020-04-0715:39mikerodI see only 2019 issues looking like this - so don’t seem to be still around - but do I need to add more dependencies?#2020-04-0716:39mikerodNarrowed it down slightly:
I cannot find a way to start a cider-nrepl loaded repl on a lein plugin project#2020-04-0716:39mikerodincluding leiningen’s project itself#2020-04-0716:39mikerodI’ve tried bumping the nrepl to 0.7.0 there, but doesn’t fix it#2020-04-0716:41mikerodI get this sort of error each time. I’ve tried with cider-jack-in-clj using latest cider, but also I’ve tried starting the lein repl myself with the cider-nrepl (0.24.0 and 0.25.0-SNAPSHOT behave the same for me) explicitly given.#2020-04-0716:41mikerodWhere
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.7.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.0-SNAPSHOT\"\] -- repl :headless :host localhost
is what my version of cider-jack-in-clj is doing
cider-version = CIDER 0.25.0snapshot (package: 20200404.914)#2020-04-0716:44dpsuttonwhat's your lein version @mikerod#2020-04-0716:45dpsuttonthis sounds like an older nrepl maybe? 0.5.6 instead of 0.6 or now 0.7#2020-04-0716:46dpsuttonand i see you tried bumping it but maybe check some lein deps :tree and lein deps :plugin-tree to see what nrepl version is actually resolved?#2020-04-0716:54mikerod@dpsutton the lein version I have in this was 2.8.3 - so maybe that’s the cause#2020-04-0716:54mikerodbut wonder why this only happens when trying to start a repl with cider-repl middleware in a plugin#2020-04-0716:55mikerodas in :eval-in :leiningen has to be in the project.clj that I’m working on#2020-04-0716:55mikerodfor the problem to occur#2020-04-0716:55mikerodconfuses me quite a bit#2020-04-0716:56dpsuttonbeen a bit but i think that lein 2.8.3 is nrepl < 0.6 which would explain the failure on nrepl.middleware.print. Why that happens only as a plugin I haven't a clue, unless maybe as a proper dep it affects the dep version resolution better?#2020-04-0716:56dpsuttonie, if a proper dep it gets to override lein's nrepl version. as a plugin it doesn't?#2020-04-0716:58mikerodso when you try to load a “plugin project” I guess it puts your current lein version deps on the same classpath#2020-04-0716:58mikerodso that’s probably where we get this mismatch#2020-04-0716:58mikerodso perhaps newer cider now requires newer nrepl - and I can’t have old lein running things in these projects#2020-04-0716:59mikerodbecause it means 2.8.3 lein is trying to share classpath with these newer cider deps and they clash on nrepl#2020-04-0716:59mikerodthis sounds plausible. I will tryin a few to bump my lein version to see if it it clears it up#2020-04-0717:00mikerod> ie, if a proper dep it gets to override lein’s nrepl version. as a plugin it doesn’t?
yes, probably the issue indeed#2020-04-0717:03bozhidar@mikerod When using cider-jack-in CIDER will override the nREPL bundled with Lein, but I think if you just use cider-nrepl as a plugin you’ll end up using whatever nREPL is shipped with Lein.#2020-04-0717:04bozhidarProbably that’s causing the problem.#2020-04-0717:05mikerodI bumped my actual local lein version and I can now start repls in plugin projects#2020-04-0717:06mikerodSo yes, the take away is that if you have :eval-in :leiningen in your project.clj (it’s a plugin project), then your lein version has to be compatible with cider deps since they are all on same classpath#2020-04-0717:06dpsutton2.9.3 is current?#2020-04-0717:06mikerodcan’t override#2020-04-0717:06mikerod2.9.3 is current yeah#2020-04-0717:07dpsuttoni suppose a new one will come soon depending on nrepl 0.7.0#2020-04-0717:07mikerodwhen I was using 2.8.3 I was getting [nrepl "0.5.3"] on my classpath I think#2020-04-0717:08mikerodwhich was too far below the min threshold for recent cider middleware I’d think - so was getting the missing var stuff#2020-04-0717:08dpsutton@bozhidar thanks for your work on this stuff! its so important for the community at large#2020-04-0717:08mikerodthanks to both of you for talking through this here - problem solved#2020-04-0717:09bozhidar@dpsutton You’re welcome! :man-bowing:#2020-04-0717:10bozhidar> i suppose a new one will come soon depending on nrepl 0.7.0
I’ve been planning to send a PR about this for a week now. I’ll do it soon.#2020-04-0717:10bozhidarI doubt there’ll be a new Lein release soon, as Phil just cut the latest one, so I’m taking my time. 🙂#2020-04-0719:03emReally beginner question here, but how do I send the entire code buffer to the REPL? My separate-window REPL throws errors about undefined symbols even after cider-load-buffer, but evaluation inside the code buffer (with C-c C-c , C-c C-e for example) works fine. This works perfectly fine for me but makes the separate repl buffer kinda useless. For context, I'm on a fresh install of Doom Emacs using their packaged defaults; not sure if that's the issue. Couldn't find anything inside the documentation about a command like cider-load-buffer-in-repl#2020-04-0719:04dpsuttonSounds like namespace fundamentals. You evaluated a buffer that puts functions into a namespace. Then in the repl (by default in the user namespace) you reference a function defined in a different ns#2020-04-0720:43em@dpsutton Whoops, you're absolutely right, just assumed that the repl would ns to my current file for some reason, even though now I think about it it'd be kinda hard/not make sense across multiple buffers. Thanks a ton for the sanity check!#2020-04-0720:44dpsuttonyeah. when you eval things in the buffer it looks to see that ns. you're in charge of the ns in your repl#2020-04-0721:15Treyis there is cider-inspector type thing for elisp values?#2020-04-0813:11aisamuAha, found it!
It's darn simple but it worked last time I tried:
https://www.emacswiki.org/emacs/DataDebug#2020-04-0821:31TreyNice! I threw together a usable (for me) setup:
(use-package emacs-lisp-mode
:ensure nil
:bind (("C-c M-i" . elisp-inspect))
:config
(defun elisp-inspect ()
(interactive)
(data-debug-eval-expression (elisp--preceding-sexp))))#2020-04-0813:11aisamuAha, found it!
It's darn simple but it worked last time I tried:
https://www.emacswiki.org/emacs/DataDebug#2020-04-0806:16bozhidarI haven’t seen one so far.#2020-04-0813:07aisamuUgh, I'm positive there is a simple one (I've used it last year), but I really can't recall the name 😞#2020-04-0806:17bozhidarCIDER borrowed the inspector idea from SLIME.#2020-04-0809:39bozhidarBtw, that Lein PR I mentioned is live https://github.com/technomancy/leiningen/pull/2673#2020-04-0811:36HachmaninowG'day 🙂! I'm using Cider with Spacemacs and I'm loving it more and more.
Though, I have two questions around running tests with cider-test-run-focused-test.
1. Is there a way to automatically save the current buffer in this situation?
2. Is there a way to prevent jumping to the cider-test-report window automatically in case of test failures?#2020-04-0811:53ViktorHi there,
I have a test:
(deftest test-1
(is (= 1 (inc 1))))
When I run lein test, then I get the output:
FAIL in (test-1) (test_lab.clj:19)
expected: (= 1 (inc 1))
actual: (not (= 1 2))
but inside Cider I get:
Fail in test-1
expected: 1
actual: 2
diff: - 1
+ 2
So it evaluates forms.
Can I change this behavior?#2020-04-0813:07aisamuUgh, I'm positive there is a simple one (I've used it last year), but I really can't recall the name 😞#2020-04-0813:11aisamu(and comes with emacs 23+)#2020-04-0822:19eval-on-pointis there a way to eval a sexp with any parenting let bindings? for example, I have
(let [x 1] (= 2 (+ x x)))
and I want to eval (+ x x) without having to eval the parent sexp#2020-04-0822:21rymndhng@mitchell_clojure yes, move your cursor to the position after the closing ) and use cider-eval-last-sexp, which by default is bound to C-c C-e#2020-04-0822:24eval-on-pointI get an unable to resolve symbol error there, since it does not know what x is bound to#2020-04-0822:24eval-on-pointI'm looking for something more like cider-eval-last-sexp-in-context , but which can infer the context of the defun#2020-04-0822:47rymndhngright, so when you want to test the inside scope, you need to bind x. What some folks recommend is to execute (def x ...) so that at he global scope you have a x defined.
See this post which does a better job of explaining this process: https://blog.cognitect.com/blog/2017/6/5/repl-debugging-no-stacktrace-required#2020-04-0822:51eval-on-pointyeah, what I am saying is that our eval function could bind the vars if they are declared in parent lets just by walking up the defun#2020-04-0822:52eval-on-pointbut maybe that is more difficult to do than it appears on my first glance#2020-04-0907:18bozhidar@mitchell_clojure I think @qythium had some version of eval-in-context which would infer the local bindings.#2020-04-0907:18bozhidarThere’s nothing built-in in CIDER yet.#2020-04-0913:21eval-on-pointcool, thanks all. Might be a good way to learn elisp#2020-04-1115:10yuhan@mitchell_clojure Hey I just saw the mention, here's my custom fn:
(defun cider--guess-evaluation-context ()
"returns list of let-binding strings from the inside out, without closing parens
\"(let [...]\""
(save-excursion
(let ((res ()))
(condition-case er
(while t
(backward-up-list)
(when (looking-at (rx "(" (or "when-let" "if-let" "let") (opt "*")
symbol-end (* space)
(group "["))) ;; binding vector
(let ((beg (match-beginning 0))
(end (save-excursion
(goto-char (match-beginning 1))
(forward-sexp 1)
(point))))
(push (buffer-substring-no-properties beg end) res))))
(scan-error res)))))
(defun cider-eval-dwim ()
(interactive)
(let ((ctx (cider--guess-evaluation-context))
(bounds (cider-sexp-at-point 'bounds)))
(cider-interactive-eval (concat (apply #'concat ctx)
(buffer-substring-no-properties (car bounds) (cadr bounds))
(make-string (length ctx) ?\)))
nil bounds
(cider--nrepl-pr-request-map))))
#2020-04-1115:12yuhancider-eval-dwim is the interactive command, bind it to something convenient and it'll automatically splice the form you're evaluating with all its enclosing let forms#2020-04-1115:13yuhanit's still in a somewhat rough state, I'll use it myself for a while more before deciding whether to contribute it upstream (maybe as part of cider-eval-in-context)#2020-04-1115:20eval-on-pointwoah, sick! thank you very much. I'll incorporate this in my workflow and let you know if I come up with any interesting tweaks#2020-04-0917:27bozhidarThat’s a pretty cool news - our sibling project Calva has implemented cider-nrepl’s debugger https://clojureverse.org/t/calva-gets-a-debugger/5751 Now we know for sure that CIDER’s debugger is editor agnostic! 😄#2020-04-0918:35pezCalva is distilled from cider, as all civilized people know. 😎#2020-04-0918:37didibusWhat's the recommended way to have all the necessary cider deps in a REPL when the REPL is started remotely or outside cider?#2020-04-0918:37didibusI always struggle to find all the right combo of packages and versions#2020-04-0918:38didibusTo match the version of Cider I also use#2020-04-0918:43pezJack in to a similar project and see what cider injects.#2020-04-0918:48didibusYa, but that's annoying 😛#2020-04-0918:48didibusI have to jack in to some local project, see what it injects, it injects multiple things,then I have to modify my project.clj with all of it, and I have to keep up with this as I update cider#2020-04-0918:52eval-on-pointIs this the usecase for nrepl's sideloading feature?#2020-04-0918:53didibusOuuu! Hope so! I think it might, you'd just depend on nrepl and everything else can be side loaded#2020-04-0918:59bozhidar@didibus Yeah, that’s the plan. Haven’t had time to implement support for the sideloader in CIDER, though.#2020-04-0918:59bozhidarGenerally, CIDER works even without cider-nrepl, at least the core functionality works.#2020-04-1006:40didibusI'm patient 😏#2020-04-1202:27didibus@bozhidar Question about Emacs, what's the standard way to extend the auto-complete?#2020-04-1208:02bozhidarDo you mean company mode or completion-at-point?#2020-04-1208:03bozhidarAssuming it’s company - see https://github.com/company-mode/company-mode/wiki/Writing-backends#2020-04-1217:21didibusI think I was asking a bit about that choice. Do I have to pick a backend, like go with company, auto-complete or completion.el. There's not a way to create generic completion that all of them would be able to leverage?#2020-04-1202:58Gleb PosobinHow do you deal with environmental variables? Some of my code uses them, and I want them to be available in repl. I can set them in my .zshenv file, it gets picked up by the repl, but it's not the best solution since I want to save the environmental variables per project. Also I don't want some of them (like api keys) to get under source control.#2020-04-1208:54bozhidarIt was discussed a few times to add provisions to CIDER about them, but we never got to doing so. I’m guessing one simple solution to prepend them to the jack-in command.#2020-04-1208:56bozhidarSee https://github.com/clojure-emacs/cider/issues/2666#2020-04-1208:57bozhidarAnd also https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html I’m guessing you can just set process-environment via .dir-locals.el.#2020-04-1208:55Jim NewtonCan someone describe the refactoring process using cider? I have a project which I originally created with lein. Even though I'm not ready to announce it publically I would appreciate if someone could explain how to perform the refactoring. Currently all the functions are defined in one file, and I'd like to split them among different files, grouping functions together which work together.#2020-04-1208:56Jim NewtonFor example, suppose all the functions have been loaded into VM, and I can run the tests at the cider repl. What do I need to do to move a function from one file to another?#2020-04-1209:05Jim NewtonOne error that I get when i try this is the following:#2020-04-1209:07jumarThat looks like an aliasing issue in the test ns. You need either unalias, refresh (tools.namespace) or restart repl
#2020-04-1209:08jumarclj-refactor has some tools to move symbols but I’m not sure if it helps with this#2020-04-1209:09Jim Newtonclj-refactor unfortunatly does not help. Those functions are broken. I've created an issue in github, and they're working on the issues.#2020-04-1209:09Jim NewtonAre you suggesting that to move a function from one file to another I need to restart the repl?#2020-04-1209:10Jim NewtonPlease tell me what you mean by unalias. I don't know what that is nor how to use it.#2020-04-1209:11Jim NewtonIs there a cider way to do the unalias? e.g. point to the offending symbol in the stacktrace and exec an emacs function ???#2020-04-1209:12Jim NewtonBTW, how should I restart the repl? In slime, there is the emacs function slime-restart-inferior-lisp ...#2020-04-1209:13Jim NewtonI don't find the function cider-jack-out which one might guess generalizing from cider-jack-in#2020-04-1213:10jumarns-unalias function#2020-04-1209:07Jim NewtonI get this error when trying to move several function definitions from file core.clj whose namespace is
(ns clojure-rte.core
(:require [clojure.set :refer [union intersection]]
[clojure.pprint :refer [cl-format]]
[clojure-rte.cl-compat :refer [cl-cond cl-prog1 cl-prog2 cl-progn]]
)
(:gen-class))
to file rte_tester.clj whose name space is
(ns clojure-rte.rte-tester
(:require [clojure-rte.tester :refer [simplify random-test]]
[clojure-rte.core :refer []]
))#2020-04-1209:23Jim NewtonHow should I restart the repl? In slime, there is the emacs function `slime-restart-inferior-lisp` ...#2020-04-1209:23Jim NewtonI don't find the function `cider-jack-out` which one might guess generalizing from `cider-jack-in`#2020-04-1209:44practicalli-john@jimka.issy I find most cider commands easily discoverable with M-x cider if you have a completion framework like helm or ivy (`SPC SPC cider` in Spacemacs)
• To unevaluate a function, cider-undef
• To refresh the namespace, cider-ns-refresh
• To restart the repl, cider-restat or cider-quit followed by ckder-jack-in
I use comment sections when I am developing code that groups my code logically, making it quite obvious when to split code off to another namespace. If doing just one function I will use cider-undef , if multiple functions I'll just restart my repl and evaluate the main namespace cider-eval-buffer , as this then helps check I have put all the definitions in order (as Clojure is a one pass parser, so def, defn should be used before using those names)#2020-04-1209:55practicalli-johnI am more used to using the Emacs tools to refactor code now, https://practicalli.github.io/spacemacs/refactor/ as I can use them across multiple languages#2020-04-1209:56Jim NewtonI don't find cider-def when I type that in the M-x minibuffer I see the following.#2020-04-1209:57practicalli-johnsorry, typo. updated the original post#2020-04-1210:05Jim Newtonthat helps. thanks.#2020-04-1210:05Jim Newtonouch! it's painful#2020-04-1210:17Jim NewtonIs there an idiomatic name to name a local function whose purpose it is to do a recursion similar to loop/recur ?#2020-04-1210:17practicalli-johnseems like a question best asked in the #beginners channel 🙂#2020-04-1210:18Jim Newtonoops sorry.. yes I clicked the wrong channel.... 100x excuse#2020-04-1314:46RisqueI have the following build.boot file,
(set-env!
:resource-paths #{"src"}
:dependencies '[[me.raynes/conch "0.8.0"]
[boot.core :as boot]])
(task-options!
pom {:project 'myapp
:version "0.1.0"}
jar {:manifest {"Foo" "bar"}})
following this documentation: https://github.com/boot-clj/boot/wiki/Cider-REPL
However, upon doing cider-jack-in I get the error "refusing to run as root. set BOOT_AS_ROOT=yes to force.", and yet after doing export BOOT_AS_ROOT=yes, I get the same error. What's wrong?#2020-04-1315:43bozhidar@prikshet21 Not sure about the boot error, but I can tell you really have to update nREPL and the CIDER related deps in build.boot.#2020-04-1315:45bozhidarAlso, make sure you’re using the latest stable Boot release.#2020-04-1316:30RisqueYes, boot is 2.8.3. Well can you help with setting the environment variable that cider detects?#2020-04-1316:46bozhidar@prikshet21 CIDER simply shells out to boot - it doesn’t do anything to modify the process’s environment.#2020-04-1316:47bozhidarIf you want to set some env variables from Emacs take a look here https://www.gnu.org/software/emacs/manual/html_node/elisp/System-Environment.html#2020-04-1316:48ennCIDER now seems to want to resolve .URIs and print the body when evaluating them at the REPL. Can this behavior be disabled?#2020-04-1316:49dpsutton(setq cider-repl-use-content-types nil) i believe#2020-04-1316:50dpsuttonm-x cider-repl-toggle-content-types seems to be an interactive function to turn off#2020-04-1316:50ennthank you#2020-04-1316:52ennThat fixed it. I'd lobby for this to be off by default ... it's really disruptive when testing any kind of URL-generating code#2020-04-1316:52dpsuttoni agree and have made the same argument#2020-04-1317:13bozhidarDone. I just disabled this.#2020-04-1317:13dpsuttoni think its such a cool feature but comes with some security holes when not expecting it#2020-04-1316:57Risque@bozhidar I was able to M-x setenv and I stopped getting that error. But now I get this error: java.lang.IllegalArgumentException: No value supplied for key: boot
clojure.lang.ExceptionInfo: No value supplied for key: boot
line: 5#2020-04-1317:01Risque@bozhidar Attached is the full error.#2020-04-1317:03RisqueCould the error be because I changed the cider-boot-parameters according to that very old documentation?#2020-04-1317:03RisqueIf that's the case, then I don't know how to get the default value back.#2020-04-1317:04bozhidarMaybe. Not sure what you changed exactly.#2020-04-1317:04RisqueI did M-x customize-variable cider-boot-parameters#2020-04-1317:05Risqueand changed whatever the default value was to cider repl -s wait. I don't know what the default value was. Do you know what the default value of this variable is?#2020-04-1317:07dpsutton"repl -s -b localhost wait"#2020-04-1317:07dpsuttonC-h v cider-boot-parameters should show current and original values#2020-04-1317:08RisqueOkay, so changing it to this still gives me the same error#2020-04-1317:08dpsuttoni'm not suggesting a fix. only pointing out the var's value#2020-04-1317:09dpsuttoni don't know how boot works but i see you have 4 year old cider and nrepl deps#2020-04-1317:10RisqueNo I don't. I don't need that deftask cider to run the cider repl. It can be deleted and the repl should still run.#2020-04-1317:10dpsuttoncan you start the repl from the command line without CIDER?#2020-04-1317:12Risqueactually that doesn't work either, i.e., boot repl, gives the same error#2020-04-1317:13dpsuttonthen CIDER can't bandaid over that#2020-04-1317:14Risquethat boot.core :as boot dependency was causing this issue#2020-04-1317:18RisqueIs there a way I can change the init-ns in the boot repl like one does in lein with :repl-options {:init-ns foobar}?#2020-04-1317:20RisqueLike for example, I have this user.clj file that has a nice function (def go reloaded.repl/go) that starts the server#2020-04-1317:20dpsuttoni believe the others work because lein allows you to specify this. CIDER just invokes the build tooling for you. so if boot allows this then it should work#2020-04-1317:21dpsuttonuser.clj should be loaded when you start#2020-04-1317:21dpsuttonso you you should be able to just call (go)#2020-04-1317:21RisqueNo, it boot.user is loaded#2020-04-1317:21Risqueeven when I change the repl's namespace, I still can't call (go)#2020-04-1317:21Risquejava.lang.RuntimeException: No such var: user/go#2020-04-1317:22dpsuttonoh. boot is cray cray.#2020-04-1317:22dpsuttonis user.clj on the classpath?#2020-04-1317:24Risqueuser.clj is in dev/ . Does that mean that it should be in the :resource-paths #{"src" "dev"} in the boot config?#2020-04-1317:24Risquethat didn't work though#2020-04-1317:26dpsuttoni think you're just in a spot where you need boot help. try #boot? I've used boot twice 😕#2020-04-1317:27RisqueSeems pretty empty in there#2020-04-1317:28dpsuttonyou could try #clojure then. but it seems to be just me in here and i have no idea how to help on this part of the problem#2020-04-1413:11practicalli-johnIs the negative prefix argument for Emacs C-- ? In the docstring for cider-ns-refresh it states using the negative prefix argument to prevent calling the cider-ns-refresh-before-fn functions. I didn't find anything in https://docs.cider.mx/cider/0.24/usage/misc_features.html#_reloading_code
I understand the prefix argument is C-u and the double prefix argument is C-u C-u . Is the negative prefix C-- or something similar ? This pages suggests that is the case https://www.emacswiki.org/emacs/PrefixArgument, can someone confirm I understand this correctly. Thanks.#2020-04-1413:22yuhanyup, you can confirm it by calling describe-key#2020-04-1413:22yuhanC-h k C--#2020-04-1413:24yuhanit's also equivalent to typing C-u followed by a negative number#2020-04-1415:33practicalli-johnI was trying to use the Spacemacs equivalent, SPC - as universal argument is SPC u. It seems tha only the universal argument is remapped as C-- works. Thanks#2020-04-1505:42David PhamIs there an easy way to rename a namespace in a whole codebase? Say I had namespace foo.baz required everywhere and I want to rename it foo.baz2#2020-04-1505:51yuhanclj-refactor has a command for that but it requires your entire project to be analyzed and loadable, usually I just go with something like ivy-occur and do a text-based search and replace#2020-04-1506:11bozhidarI just use projectile’s replace in project functionality.#2020-04-1508:23David PhamThanks!#2020-04-1511:57practicalli-johnI use the Emacs tools, helm-ag and iedit https://practicalli.github.io/spacemacs/refactor/within-a-project.html#2020-04-1515:51eval-on-pointslightly related: I think it would be nice to have a refactor to toggle between usage of a namespace alias and a refer#2020-04-1515:57bozhidarI’m not sure exactly what you mean, but you can file a ticket on clojure-mode issue tracker.#2020-04-1516:02eval-on-pointSay I have
(ns foo.core (:require [clojure.string :as str]))
(str/join ", " [1 2 3])
Calling "`cljr-toggle-refer`" or whatever its name would be with the mark on str/join would change our buffer to
(ns foo.core (:require [clojure.string :refer [join]]))
(join ", " [1 2 3])
#2020-04-1518:51bozhidarGot it. Well, file a ticket please, and we’ll see if we’ll get to implementing this.#2020-04-1609:12FiVoWhat is the easiest way to turn off sending stuff to the clojurescript repl if I am in a cljc file?#2020-04-1613:20eval-on-pointdoes cider-repl-switch-to-other not work?#2020-04-1710:30FiVo@UF9E03ZEX that only switches between repl buffers, I want to only send expressions to the clj repl when I am in a cljc file. I have always both repls open.#2020-04-1609:19pinkfrogin the cider-error buffer, is it possible to control whether to open a new buffer in the current or other window?#2020-04-1619:28jrwdunhamAnybody here know what this error is about?
ERROR: Unhandled REPL handler exception processing message {:ns user, :file *cider-repl workspace/vbit:localhost:8050(clj)*, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :op eval, :column 7, :line 46, :id 9, :code (* 8 8 :content-type true, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/options {:right-margin 80}, :session 51b7d6f7-1e98-454a-b735-c681a118b613}
Syntax error macroexpanding at (track_state.clj:156:8).
...
Caused by: java.nio.file.NoSuchFileException:
...
/root/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
at cider.nrepl.middleware.track_state$fn__5428.invokeStatic(track_state.clj:155)
at cider.nrepl.middleware.track_state$fn__5428.invoke(track_state.clj:155)
Here are the relevant parts of my deps.edn:
{:deps
{nrepl/nrepl {:mvn/version "0.6.0"}
cider/cider-nrepl {:mvn/version "0.22.0"}
:aliases
{:repl
{:main-opts
["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--port" "8050"
"--bind" "0.0.0.0"]}}}}
I see this error when I attempt to evaluate an expression at the repl#2020-04-1619:55jrwdunhamOdd, seems adding javax.inject {:mvn/version "1"} to my deps.edn fixed this issue for me. Maybe this is related to the fact that I'm running clojure in a docker container using image FROM clojure:openjdk-14-tools-deps-1.10.1.502-alpine ...#2020-04-1622:03preExisting Cider user here. I'm reinstalling all packages on my emacs 26.1 on Ubuntu 18.04. I use cask as a dependency manager and ran cask install to encounter the following error:
Dependency cider failed to install: Package 'queue-0.2' is unavailable
I saw this post from six years ago and the fix suggested by author doesn't work. In particular, I can't find 'queue" in M-x package-list or the listing of MElpa packages.
https://github.com/melpa/melpa/issues/2005
Anyone else facing cider installati_on_ issues with a fresh install of cider from melpa or melpa-stable?#2020-04-1622:06dpsuttoni'm guessing you can't install anything from melpa?#2020-04-1622:07dpsuttonthis is possibly the old key. if you use 26.3 it will work#2020-04-1622:16preOk, Thanks. Do you know the quickest way to upgrade from 26.1 to 26.3? The software update center on Ubuntu seems stuck at 26.1.#2020-04-1622:19dpsuttonno i don't i'm sorry. there is a way to patch the keys. i think someone made a helpful package to do so#2020-04-1623:11justinbarclayhttps://elpa.gnu.org/packages/gnu-elpa-keyring-update.html
I think this is the one#2020-04-1700:30preI got this error when I try to install gnu-elpa-keyring update.
gpg: Can't check signature: No public key#2020-04-1702:01preI managed to uninstall all versions of emacs on ubuntu, install 26.3 from snap, restored my emacs.d with Cask. and got the latest cider installed and working again.#2020-04-1707:09sofraHi all, anyone had any luck getting `shadow-cljs`, `deps.edn` and `cider` working nicely together?
Things work perfectly just using `shadow-cljs` and `cider` but when I try to use `deps.edn` as well the `cider-jack-in-cljs` stops working.
I select `cider-jack-in-cljs` -> `clojure-cli` and then my build and I get the following error.
error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details
looks related to this https://github.com/clojure-emacs/cider/issues/2812?#2020-04-1707:21FiVoDid you try the solution I posted at the end of that thread?#2020-04-1707:22FiVoCurrently there is no way to get the cljs repl with shadow out of the box if you you use deps.edn or lein. You need to launch it yourself.#2020-04-1707:24FiVoBut the error you are getting looks like there is already something in your setup that is amiss.#2020-04-1712:58dpsuttondoes this work from the command line? its complaining that shadow isn't on the classpath which sounds like what you are attempting won't be able to work. are you missing shadow as a dependency in deps.edn?#2020-04-1713:05sofrait does work from the command line, I had it in my deps.edn but under an alias as was shown in the shadow docs, but yeah that was that problem
I will try your solution @UL638RXE2#2020-04-1713:05sofrathanks for the help!#2020-04-1707:12David PhamHello, did you try to launch a shadow-CLJS watch app, and then cider-connect-cljs,#2020-04-1707:12David Pham?#2020-04-1707:12David PhamIt works fine for me.#2020-04-1710:19erwinrooijakkersWhen running tests from Cider, Cider is not aware of Leiningen :test profile resource-paths , is there a workaround?#2020-04-1710:20erwinrooijakkersMaybe best to put the resources under dev and test profiles, and not in uberjar’s resources#2020-04-1710:48bozhidar@erwinrooijakkers You can adjust the command CIDER uses to run leiningen to include the :test profile as well.#2020-04-1710:48erwinrooijakkersThanks#2020-04-1710:49bozhidarSee https://metaredux.com/posts/2019/11/02/hard-cider-understanding-the-jack-in-process.html#2020-04-1712:52eval-on-pointI think best practice is to put the resources under :dev#2020-04-1712:52eval-on-pointhttps://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#task-specific-profiles#2020-04-1720:25rschmuklerHey @bozhidar would you be open to a PR that adds babashka support as a project type? Now that babashka ships with an nRepl server, it'd be awesome to be able to quickly get into a babashka compatable scripting environment via cider-jack-in. If you think it's too specific, happy to keep using cider-connect, but I think it could be really cool!#2020-04-1720:26borkdude( @rschmukler there are some docs here, including a script to write a .nrepl-port file on startup, which may help: https://github.com/borkdude/babashka/blob/master/doc/repl.md#nrepl )#2020-04-1720:29rschmukler@borkdude amazing! I've had good success with cider + bb. But it'd be awesome to be able to do cider-jack-in anywhere and get prompted to automatically start a new babashka process w/ --nrepl-server so that I can just hop into scripting. It's definitely not a huge pain as is, but figured it could be convenient for others#2020-04-1817:26bozhidarI’ve been thinking about adding something like this to CIDER myself. File some ticket and we’ll make it happen.#2020-04-1721:23dpsuttonwhat file does bb use as a project root?#2020-04-1817:23bozhidar@borkdude ^^#2020-04-1721:42dpsuttonbut if you do a prefix with cider jack in, you can edit the command string and just replace bb at the beginning#2020-04-1810:14FiVoIf I have custom jack-in-cljs process, how do I make cider pick up that the cljs repl has finished loading. Currently it gets stuck in `pending-cljs. I can type into the repl, but can't send stuff to it.#2020-04-1817:25bozhidarI guess something blew up on init if the REPL remained in pending state. You might try to evaluate the upgrade code manually and see what happens.#2020-04-1820:21FiVoIt was only a temporary problem. Restarted emacs again and it worked out fine.#2020-04-1812:40jonpitherHi - if you edit a Java file on the classpath, then do a `lein javac`, is there anyway to get Cider to reload/refresh the Java class without having to bounce the repl?#2020-04-1815:10dpsutton@jonpither what would you do in a regular clj repl?#2020-04-1815:11dpsuttoni'm not aware of anything special. i wonder if one of CIDER's existing features accomplishes this goal however#2020-04-1817:23bozhidarI seem to recall lein vigil was working well with CIDER.#2020-04-1817:50jonpithergiving it a whirl. Looks like it will work (my java and clj files in the same dir, so it reloads all of that when I touch a clj file)#2020-04-1906:07EmmanuelOgasup, I notice cider adds imports for some of my stuff sometimes. I wonder if there's a way to import arbitrary symbols. I imagine if I have a class name there may be something that looks for that class name on my classpath and adds the import#2020-04-1906:09dpsuttoncan you give an example of what you mean?#2020-04-1906:09EmmanuelOgathis is saves me one step but I still need to know where the class is coming from: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-import-to-ns#2020-04-1906:10EmmanuelOgaI'd like to not have to type the whole package name (many times because I don;t know and I need to google the package name)#2020-04-1906:11EmmanuelOgaon the cljr-auto-clean-ns the user knew that they had to type java.util.Date#2020-04-1906:11EmmanuelOgabut I'm guessing it could be possible to get all the different classes named "Date" from the classpath and offer a popup or something#2020-04-1906:11EmmanuelOgaI wonder if someone already did something like that#2020-04-1906:27dpsuttonTry cider-javadoc. I think it can look at all of the classes for you#2020-04-1906:27dpsuttonMight help in doscoverability#2020-04-1906:40EmmanuelOgagotcha#2020-04-1906:44EmmanuelOgaapparently there's a library to scan resources in the classpath, including classes and files under teh resources folder#2020-04-1906:44EmmanuelOgahttps://github.com/ronmamo/reflections/blob/gh-pages/UseCases.md#find-resources-in-your-classpath#2020-04-1906:45EmmanuelOgatempted to embark on a big yak shaving trip, but I better go back to my code at hand 🙂#2020-04-2203:18pinkfrogsay I add a new dependency to the project.clj. Should I restart emacs to activate that package ?#2020-04-2203:19dpsuttonnot emacs. just CIDER#2020-04-2203:19dpsuttoncider-quit and then jack-in again#2020-04-2203:20dpsuttonemacs is just running clj/lein/shadow/boot underneath. just have to restart that process#2020-04-2203:21dpsuttoni think sesman-restart might accomplish this?#2020-04-2203:22pinkfrogcool. thanks.#2020-04-2203:27pinkfrogI found clj-refactor has a hot load dependency option.#2020-04-2205:34bozhidarIt had it, not anymore. Now you’ll just see a warning if you try to use it. We’ll implement hotloading in CIDER one of those days, but it’s not a high priority right now.#2020-04-2203:27pinkfrogI kinda feel things are quite separated. why isn’t such functionalities being incorporated into cider itself?#2020-04-2203:30dpsuttondo you use clj-refactor?#2020-04-2203:31dpsuttonit seems like the ask is for one jar instead of two jars? not sure what you gain. its nice that its optional i think. i don't actually use it#2020-04-2203:32pinkfrogcider-quit seems not make it. it restarts the repl connection, not the repl server itself.#2020-04-2203:33dpsuttondid you cider-connect or cider-jack-in?#2020-04-2203:36dpsuttoncider-quit should kill the subprocess if you started one#2020-04-2204:08pinkfrognever mind. i copy-pasted something wrong.#2020-04-2212:21Spacemanhow do I refresh a cljs repl in cider#2020-04-2212:21Spaceman?#2020-04-2212:21SpacemanWhen I use M-x cider-refresh, it says that no clojure repl found in the current buffer#2020-04-2212:29dominicmThere's no equivalent function in cljs.#2020-04-2212:47dpsuttonIf you’re browser based just reload the page#2020-04-2213:00dominicmYeah, most likely you have hot refresh and you need to run code to do something with that new code. Eg Re-run a function#2020-04-2214:08SpacemanHow to run cljs tests in cider?#2020-04-2214:08SpacemanC-c C-t n doesn't work. I get clojure only operation requested in clojurescript buffer#2020-04-2223:24Felipe MarquesI haven't take a look yet. But I saved this link to do some keybinding that would run tests in cljs: http://adereth.github.io/blog/2014/05/29/custom-clojure-evaluation-keybindings-in-emacs/#2020-04-2613:31Felipe Marques(defun run-cljs-test-in-ns ()
(interactive)
(cider-interactive-eval "(cljs.test/run-tests)"))
(spacemacs/set-leader-keys-for-major-mode 'clojurescript-mode "o t n" 'run-cljs-test-in-ns)#2020-04-2613:32Felipe MarquesThis allow me to run the tests in the buffer using key-bindings, but it does not do any formatting or reporting, you must have the repl open to see the results.#2020-04-2719:10SpacemanIs there a plugin to do the formatting or reporting? If not, then how can I write one? Surely it can't be that hard, right? Just highlight every thing that's PASS as green and FAIL as RED etc., only I need help on where to start. And then to display everything in a new buffer, like cider test-runner does.
Well, to start with, suppose I want the display the results of (cljs.test/run-tests) to output to a new buffer in cider mode, and that I can use "q" to quit that buffer, that would be a good start...#2020-04-2812:43Felipe MarquesI imagine there are commands for highlighting and formatting the buffer. You will probably have to parse the output of the cljs.tests/run-tests to do it. But I don't know this commands.#2020-04-2812:43Felipe MarquesI'm new to hacking Emacs, so I can't help much, sorry.#2020-04-2220:37dominicmClojurescript tests aren't supported#2020-04-2220:39Spacemanis there a good third-party solution that can be integrated within cider?#2020-04-2220:40dpsuttonfor testing?#2020-04-2220:44dominicmIsn't there a kaocha.el#2020-04-2220:48Spacemanyes for testing. kaocha? Should I use that?#2020-04-2220:50dpsuttonread into it#2020-04-2220:50dpsuttonmight be up your alley#2020-04-2220:51dpsuttoni don't know of a good cljs testing strategy integrated with cider though#2020-04-2221:00zaneOne could use cider to run kaocha.repl/run.#2020-04-2221:00zaneNot sure if that qualifies as “integrated”.#2020-04-2221:03zaneOh.#2020-04-2221:03zaneThere’s actually https://cljdoc.org/d/lambdaisland/kaocha/1.0-612/doc/5-running-kaocha-from-the-repl#in-buffer-eval in Kaocha’s docs.#2020-04-2307:44bozhidarWell, the simplest approach would be to just run the tests via the eval op and parse the output of the report. It’s not complex, but no one expressed much interest to work on this.#2020-04-2307:45bozhidarWith Clojure the integration was much simpler - as we could simply tweak the test runner directly and run whatever we wanted server-side, but we can’t do the same for ClojureScript.#2020-04-2221:03zaneThere’s actually https://cljdoc.org/d/lambdaisland/kaocha/1.0-612/doc/5-running-kaocha-from-the-repl#in-buffer-eval in Kaocha’s docs.#2020-04-2310:22Christian JohansenWhen doing jack-in-cljs, I frequently run into problems where the nrepl connection is established, but the process times out waiting for figwheel (i.e., before I'm prompted for the figwheel build to start). Is there a way to increase the timeout here? It seems to trigger when my laptop is generally busy. I would rather wait a few more seconds than having to keep restarting cider, hoping it won't time out.#2020-04-2311:31plexusbeen getting a lot of these since upgrading yesterday
1. Unhandled java.lang.Exception
Either "symbol", or ("class", "member") must be supplied
#2020-04-2311:31plexusmostly when it tries to do an eldoc lookup, but also on other operations. Known issue?#2020-04-2311:37mgrbytehttps://github.com/clojure-emacs/cider/issues/2835#2020-04-2512:11Ahmed HassanCan we run cider-connect or `cider-connect-cljs` at the same time?#2020-04-2512:15Ahmed HassanLike run cider-connect and then run cider-connect-cljs after it.#2020-04-2512:15Ahmed HassanSo, both clj and cljs repl sessions are started.#2020-04-2513:01aisamuWorth noting that cider-connect-clj&cljs exists!#2020-04-2512:17friczeyou mean open two REPLs? sure, no problem with that#2020-04-2512:18friczeyou can have as many REPLs as your computer will handle. do you have any problems with running them?#2020-04-2513:01aisamuWorth noting that cider-connect-clj&cljs exists!#2020-04-2515:29fmnoiseHi everyone, is there any way to configure default figwheel-main build instead of specifying :dev manually?#2020-04-2515:37FiVohttps://github.com/clojure-emacs/cider/blob/master/cider.el#L762#2020-04-2519:59fmnoisethanks!#2020-04-2517:10dpsutton@bozhidar can you grant me some permissions on the inf-clojure repo?#2020-04-2517:21SpacemanGiven that cider doesn't support the clojurescript test-runner, what good third-party alternatives are there to use as a clojurescript test-runner with cider?#2020-04-2517:22dpsuttoni'm not sure there's a good solution for that at the moment. Probably best to take a proven tool that runs in the terminal#2020-04-2517:23SpacemanIs there a proven tool for testing that does highlighting and formatting?#2020-04-2517:28dpsuttoni'm not sure how testing could do formatting and highlighting#2020-04-2517:28SpacemanI meant a test-runner that highlights and formats the tests based on pass/fail#2020-04-2517:29dpsuttoncheck out https://github.com/bhauman/cljs-test-display#2020-04-2517:29dpsuttonits quite nice#2020-04-2517:29dpsuttonits in the browser not emacs but is pretty spiffy#2020-04-2605:31vigilancetechwhy am I getting this:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!
More information.WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0 and n/a, respectively.
when I have [cider/cider-nrepl "0.25.0-alpha1"] in my dependencies?#2020-04-2607:34Ahmed Hassancider-nrepl needs to be on classpath#2020-04-2607:35Ahmed Hassanhow are you inlcuding cider-nrepl ?#2020-04-2607:41Ahmed HassanWARNING: CIDER 0.24.0-snapshot requires cider-nrepl 0.23.0-SNAPSHOT, but you're currently using cider-nrepl 0.25.0-alpha1. The version mismatch might break some functionality!
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT and n/a, respectively.
I'm getting similar errors on Doom Emacs.#2020-04-2608:32bozhidarWarnings. 🙂 How exactly did you start CIDER? Looking at the warnings they imply you started nREPL outside using newer cider-nrepl than the one your client expects.#2020-04-2608:35bozhidar@U2BL1A092 I’m assuming you didn’t use cider-jack-in, right?#2020-04-2608:36bozhidarIf so - please take a look at https://docs.cider.mx/cider/basics/middleware_setup.html#2020-04-2608:37Ahmed Hassan@U051BLM8F I used cider-connect-cljs wth shadow-cljs#2020-04-2608:39bozhidarWell, then just upgrade your CIDER snapshot and the first warning will disappear. You can remove clj-refactor if you don’t need it and the second warning will disappear as well, otherwise you’ll have to add its middleware as well.#2020-04-2608:43vigilancetechhmmm.. my problem appears to have gone away. Not sure exactly what I did. I was using connect. Haven't been able to get jack-in running yet.#2020-04-2607:41Ahmed HassanWARNING: CIDER 0.24.0-snapshot requires cider-nrepl 0.23.0-SNAPSHOT, but you're currently using cider-nrepl 0.25.0-alpha1. The version mismatch might break some functionality!
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0-SNAPSHOT and n/a, respectively.
I'm getting similar errors on Doom Emacs.#2020-04-2617:20Drew VerleeI want to programmatically start a Cider connections created via" jack in" and "connect to clj/cljs". Where would I look to learn how to do this?
My goal is to make it easier to switch between different setups, each typically with two projects/repls needed. E.g a frontend and backend.
I'm reading through https://docs.cider.mx/cider/usage/managing_connections.html
Currently.#2020-04-2617:23dpsutton@drewverlee https://github.com/dpsutton/tangled/blob/master/init.org#connect-to-running-services is how i do it at work#2020-04-2617:27Drew VerleeThis is probably exactly what I need to mimic. I'll give this a try. Thanks a lot.#2020-04-2720:32SpacemanI see that there's a cider-test.el for running tests in clj. Is there a good reason why there isn't a cljs analogue to it? What modifications would be needed to create one?#2020-04-2720:32Spacemanhttps://github.com/clojure-emacs/cider/blob/052290d080f58edc814dd7aa00b014d639c62974/cider-test.el#2020-04-2720:33Spacemansay I'm running tests with shadow-cljs#2020-04-2721:35dominicmYou'd need to hook into piggyback to run evaluations and capture the test results, and then serialize them into the same format used by the clj tests.
It's not infinitely difficult, someone just needs to pick it up#2020-04-2722:08eccentric JI've been getting a lot of these kinds of errors working with cider in a shadow-cljs project lately. I don't recall encountering these on other shadow-cljs I've worked on. Anyone experience these and know the cause?#2020-04-2722:11dpsuttonwhat's the stacktrace @jayzawrotny?#2020-04-2722:13eccentric Jcomplete_for_nrepl.clj: 119 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/node-env?
complete_for_nrepl.clj: 106 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/node-env?
complete_for_nrepl.clj: 126 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 1973 clojure.core/with-bindings*
core.clj: 1973 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
complete_for_nrepl.clj: 123 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded
complete_for_nrepl.clj: 121 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/ensure-suitable-cljs-is-loaded
complete_for_nrepl.clj: 181 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/handle-completion-msg!
complete_for_nrepl.clj: 164 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/handle-completion-msg!
complete_for_nrepl.clj: 202 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-default-cljs-env
complete_for_nrepl.clj: 195 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-default-cljs-env
complete_for_nrepl.clj: 232 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-nrepl
complete_for_nrepl.clj: 227 cider.nrepl.inlined-deps.suitable.v0v3v5.suitable.complete-for-nrepl/complete-for-nrepl
complete.clj: 40 cider.nrepl.middleware.complete/complete
complete.clj: 30 cider.nrepl.middleware.complete/complete
complete.clj: 54 cider.nrepl.middleware.complete/complete-reply
complete.clj: 53 cider.nrepl.middleware.complete/complete-reply
error_handling.clj: 160 cider.nrepl.middleware.util.error-handling/eval24668/fn
MultiFn.java: 234 clojure.lang.MultiFn/invoke
complete.clj: 66 cider.nrepl.middleware.complete/handle-complete
complete.clj: 65 cider.nrepl.middleware.complete/handle-complete
Var.java: 388 clojure.lang.Var/invoke
nrepl.clj: 132 cider.nrepl/wrap-complete/fn
middleware.clj: 16 nrepl.middleware/wrap-conj-descriptor/fn
nrepl.clj: 321 cider.nrepl/wrap-profile/fn
middleware.clj: 16 nrepl.middleware/wrap-conj-descriptor/fn
nrepl04.clj: 232 shadow.cljs.devtools.server.nrepl04/cljs-load-file/fn
middleware.clj: 16 nrepl.middleware/wrap-conj-descriptor/fn
nrepl04.clj: 193 shadow.cljs.devtools.server.nrepl04/cljs-select/fn
middleware.clj: 16 nrepl.middleware/wrap-conj-descriptor/fn
session.clj: 272 nrepl.middleware.session/session/fn
middleware.clj: 16 nrepl.middleware/wrap-conj-descriptor/fn
nrepl04.clj: 359 shadow.cljs.devtools.server.nrepl04/start/fn
server.clj: 18 nrepl.server/handle*
server.clj: 15 nrepl.server/handle*
server.clj: 27 nrepl.server/handle/fn
core.clj: 2030 clojure.core/binding-conveyor-fn/fn
AFn.java: 18 clojure.lang.AFn/call
FutureTask.java: 266 java.util.concurrent.FutureTask/run
ThreadPoolExecutor.java: 1149 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 624 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 748 java.lang.Thread/run#2020-04-2804:51bozhidarThe improved cljs completion still doesn’t work very well with shadow-cljs it seems. //cc @U08LZDL1H Use (setq cider-enhanced-cljs-completion-p nil) to disable it.#2020-04-2805:08bozhidarIt will generally be good to file an issue with clj-suitable as well, so that the underlying problem is identified and fixed.#2020-04-2813:41eccentric JWas just about to paste a link to the issue you replied to here. I will create the issue now.#2020-04-2813:58eccentric Jhttps://github.com/rksm/clj-suitable/issues/14#2020-04-2723:27dpsuttonThat’s the suitable stuff. I leave that turned off I believe#2020-04-2723:28dpsuttonI’ve hit so many cases that don’t work #2020-04-2802:32Ahmed HassanWhat is best way to create Evil Mode bindings of Cider keys?#2020-04-2813:56Lone Rangerso I'm doing an annoyingly complex dual build equivalent to
clj -m figwheel.main -bb serviceworker -b view
and the only way I can figure out how to do that in CIDER is cider-jack-in then inject
(do (use 'figwheel.main.api)
(start {} "view" "serviceworker")
(cljs-repl "view"))
is there away to avoid typing that do block into the REPL every time?#2020-04-2814:13jkxyzI think this is what you’re looking for:
https://docs.cider.mx/cider/0.24/cljs/configuration.html#_defining_custom_clojurescript_repl_types#2020-04-2816:22Lone Rangerthose are indeed the droids I'm looking for, thank you my good sir 🎩#2020-04-2817:46plinsI have two lein profiles that I use often while connecting to the repl using this function
(defun cider-jack-in-with-profile ()
(interactive)
(letrec ((profile (read-string "Enter profile name: "))
(lein-params (concat "with-profile +" profile " repl :headless")))
(message "lein-params set to: %s" lein-params)
(set-variable 'cider-lein-parameters lein-params)
(cider-jack-in '())))
lets say Im using profile X, and now I want to connect with profile Y, whats the best way to the switch?
is there a cider-jack-out where I can jack-in again with a new profile?#2020-04-2818:25nickWhat's the proper workflow in cases when you have an error after you restart/reload your app using mount?
An example:
user> (restart)
#error {
:cause "Unable to resolve symbol: account-database in this context"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (app/model/session.clj:55:39)."
:data #:clojure.error{:phase :compile-syntax-check, :line 55, :column 39, :source "app/model/session.clj"}
:at [clojure.lang.Compiler analyze "Compiler.java" 6808]}
{:type java.lang.RuntimeException
:message "Unable to resolve symbol: account-database in this context"
:at [clojure.lang.Util runtimeException "Util.java" 221]}]
:trace
[[clojure.lang.Util runtimeException "Util.java" 221]
Reloadable Clojure REPL
user> (restart)
Syntax error compiling at (*cider-repl Projects/pollcro:localhost:43993(clj)*:597:7).
Unable to resolve symbol: restart in this context
user> (start)
Syntax error compiling at (*cider-repl Projects/pollcro:localhost:43993(clj)*:600:7).
Unable to resolve symbol: start in this context
#2020-04-2818:25nickAfter fixing an error, I can not (restart) this reply anymore due to the following error:
> Unable to resolve symbol: restart in this context
Is it always like this or am I doing something wrong with my REPL workflow?
As a workaround, I cider-quit my REPL session and start it again but that's very annoying.
It seems I can use mount/start after fixing an error:
user> (mount/start)
{:started
["#'app.server-components.config/config"
"#'app.model.database/pool"
"#'app.model.mock-database/conn"]}
But it completely loses my user namespace scope, REPL doesn't see any of its methods + I can't send user namespace to repl because of the following error:
Syntax error compiling at (app/server_components/pathom.clj:1:1).
namespace 'app.model.session' not found
("src/main" "src/dev" "src/test")#function[expound.alpha/printer]nil#'user/start#'user/stop#'user/restartnil
That's what my https://github.com/fulcrologic/fulcro-template/blob/master/src/dev/user.clj looks like:
(ns user
(:require
[clojure.tools.namespace.repl :as tools-ns :refer [set-refresh-dirs]]
[expound.alpha :as expound]
[clojure.spec.alpha :as s]
[mount.core :as mount]
;; this is the top-level dependent component...mount will find the rest via ns requires
[app.server-components.http-server :refer [http-server]]))
;; ==================== SERVER ====================
(set-refresh-dirs "src/main" "src/dev" "src/test")
;; Change the default output of spec to be more readable
(alter-var-root #'s/*explain-out* (constantly expound/printer))
(defn start
"Start the web server"
[] (mount/start))
(defn stop
"Stop the web server"
[] (mount/stop))
(defn restart
"Stop, reload code, and restart the server. If there is a compile error, use:
(tools-ns/refresh)
to recompile, and then use `start` once things are good."
[]
(stop)
(tools-ns/refresh :after 'user/start))
#2020-04-2819:29dpsuttoncan you recreate this with just clj or lein and see what happens?#2020-04-2904:18nickjust checked it - yes it works the same way if I just run it as standalone repl via clojure -A:dev -J-Dtrace -J-Dghostwheel.enabled=true#2020-04-2904:20dpsuttonah ok. so i'm not sure there's much CIDER can do here. seems your code is nuking vars so CIDER can't really rescue you#2020-04-2909:11nickThanks Dan. I'll keep on looking#2020-04-2912:57tvaughanI have to re-evaluate the broken file, then restart#2020-04-2916:43nick@U0P7ZBZCK thank you so much! It worked!#2020-04-2822:31SpacemanIs there a way to define a custom function in the shadow.repl namespace to run automatically, i.e., shadow/watch for a couple of profiles + shadow/repl for a profile? Right now, in my Luminus template, when I start the repl, the following command is run:
/usr/local/bin/npx shadow-cljs -d nrepl:0.6.0 -d refactor-nrepl:2.5.0-SNAPSHOT -d cider/cider-nrepl:0.23.0 server
Given this, where do I specify a function to run automatically when the repl starts?
I want to automate this behavior:
1. I connect to the shadow repl using cider-jack-in.
2. This shows the shadow.user> repl.
3. At the prompt I run: (do (shadow/watch :app) (shadow/watch :workspaces) (shadow/repl :workspaces)) to watch these two profiles and run the repl for one of them.
How do I run this do automatically every time I connect with shadow?#2020-04-2823:31dpsuttonThat happens almost exactly if you cider jack in clojurescript and select shadow cljs#2020-04-2823:32dpsuttonAh you have two different watches. You could create a custom repl type#2020-04-2823:49Spacemanand then want to start a repl too on the workspace watch. Okay, how to create a custom repl type? @dpsutton#2020-04-2905:46Andres MorenoHope someone can help me: if I try to cider-jack-in-cljs, Emacs gives me The npx shadow-cljs executable isn't on your 'exec-path and there is no repl launched.
My Emacs exec path has "/home/afmoreno/.nvm/versions/node/v12.7.0/bin" and I see npx and shadow-cljs both there.
My cider-shadow-cljs-command is npx shadow-cljs and my cider-shadow-cljs-parameters is server
My hypothesis was that somehow Emacs is not connecting exec-path and the commands above. And it is true: all I had to do was to run exec-path-from-shell-copy-env and now I can jack-in in CLJS.
Does anyone know why this happened? What is the right fix?
Thanks!
PS Hacky solution: install exec-path-from-shel and then I put this at the end of my init.el file: (exec-path-from-shell-copy-env "PATH". Would love more nuanced approach but posted this so that other lost souls will be able to get on with their lives...#2020-04-2913:36eval-on-pointI think that exec-path uses your current shell path at emacs startup, so it might have something to do with the time at which your full path gets built. For example, if you start an emacs daemon before your .bashrc gets sourced, then changes to the PATH won't make it#2020-04-2919:12Drew VerleeWhen i start a nrepl on my current project it fails with an error that goes in a popup. I can't seem to retrive the error after that. i used to be able to look at the cider error buffer and it would show, but the buffer doesn't come up or doesn't have anything. This is on emacs.#2020-04-2919:23dpsutton@drewverlee check *Messages*#2020-04-2919:47Drew Verleethanks. I dont believe that was showing it either.#2020-04-2919:49dpsuttonthen it died before it got there#2020-04-2919:54Ian Fernandezhello, I'm having a problem with cider these days =(#2020-04-2919:54Ian Fernandezerror in process filter: Wrong type argument: characterp, nil
when I eval something that returns nil#2020-04-3014:45Ian Fernandezsomeone know this problem?#2020-04-2919:54Ian Fernandezdunno why#2020-04-2921:48SpacemanWhen I load a cljs namespace, I get this in the mini-buffer:
Clojure only operation requested in ClojureScript buffer.
Where does this error come from?#2020-04-3013:53eval-on-pointare you trying to :refer :all ?#2020-04-3019:45Spacemannope#2020-04-3014:45Ian Fernandezsomeone know this problem?#2020-04-3008:23cartesian-theatricsHas anyone dealt with cider slowing down over time? I've been profiling and trying to bisect my minor modes, but haven't come to much of a theory yet.#2020-04-3013:51eval-on-point@cartesian-theatrics just a shot in the dark, but if your program is printing a lot, then the size of the repl buffer can slow things down. try running cider-repl-clear-buffer and see if that helps#2020-04-3013:52eval-on-pointthere might be a way to tell emacs to treat the buffer like a queue to keep it under a certain size#2020-04-3017:52aptHi people. I’d like to pass the -Sforce flag when injecting into a clojure deps project. I’d like to debug if that’s why cider is getting a different version from some library compared to clj -Sforce -Stree.
Is there any way to make cider pass this flag?#2020-04-3017:59dpsuttonsure. when you cider-jack-in give a prefix argument. C-u M-x cider-jack-in or C-u C-c M-j and it should let you edit the command it will use#2020-04-3018:03aptCool, thanks. By the way, removing the cpcache folder, which holds the cache for deps.edn, solved the issue 😕#2020-04-3018:05dpsuttonyeah. i've heard there can be issues with that cache but don't remember what can cause it. I wonder if alex might have some pointers. wonder if we could touch some file or something#2020-05-0316:38myguidingstarIs there any command in cider to forcefully stop an eval that takes too long (or an infinite loop)?#2020-05-0316:41dpsuttonC-c C-c is bound to cider-interrupt#2020-05-0316:42myguidingstarJust found it. Thanks. It's bound to C-c C-b in Doom Emacs#2020-05-0406:06bozhidarIt’s C-c C-c in a REPL and C-c C-b in a source buffer.#2020-05-0316:44dpsuttonpossibly both. i saw that one in CIDER as well#2020-05-0318:43ghosttoasterdoes anyone know how to get specify to cider which JVM to use? Everything on my system is using java 11 except for cider which is using java 13. Don't know how to tell it not to do that.#2020-05-0318:44dpsuttonM-: (shell-command-to-string "which java")#2020-05-0318:44dpsuttonCIDER is just gonna call clj ... or lein ... so its really finding out which java is visible to emacs#2020-05-0318:46ghosttoasterso it says its using "/usr/bin/java' but I checked "/usr/bin/java" and its version is 11 in the terminal#2020-05-0318:47ghosttoasterI used (shell-command-to-string "java -version") and it says 11#2020-05-0318:47ghosttoastercider-jack-in says its using java 13 tho#2020-05-0318:49dpsuttonis this a clj deps project?#2020-05-0318:50ghosttoasterI noticed this while working in a project, but this happens even without a project.#2020-05-0318:50ghosttoasterit was a clj deps project tho#2020-05-0318:51dpsuttonsame issue when using lein?#2020-05-0318:51dpsuttonie without a project#2020-05-0318:52ghosttoasterNope. lein repl without a project is Java 11#2020-05-0318:53dpsuttonok. i wonder if its this from clojure:
# Find java executable
set +e
JAVA_CMD=$(type -p java)
set -e
if [[ ! -n "$JAVA_CMD" ]]; then
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
JAVA_CMD="$JAVA_HOME/bin/java"
else
>&2 echo "Couldn't find 'java'. Please set JAVA_HOME."
exit 1
fi
fi#2020-05-0318:53dpsuttonit can fall back to java_home.#2020-05-0318:54dpsuttonthat's the only thing i can think of right now. you can test it by running eshell and trying clojure#2020-05-0318:54ghosttoasterooh that's a good lead. Thank you!#2020-05-0513:17plinshey, Im trying to use cider-find-var on a spec, ::my-ns/my-spec , but Instead of jumping to the definition, it askes me to input a Symbol#2020-05-0515:18practicalli-johnTry cider-browse-spec`` instead, it seems closer to what you are looking for#2020-05-0520:05plinsthanks 🙂#2020-05-0513:17plinsis this the expected behaviour?#2020-05-0516:35dpsuttoncider-find-var is an interactive autoloaded Lisp closure in
'cider-find.el'.
It is bound to M-., <menu-bar> <CIDER Interactions> <Find (jump to)>
<Find definition>.
(cider-find-var &optional ARG VAR LINE)
Find definition for VAR at LINE.
Prompt according to prefix ARG and 'cider-prompt-for-symbol'.
A single or double prefix argument inverts the meaning of
'cider-prompt-for-symbol'. A prefix of '-' or a double prefix argument causes
the results to be displayed in a different window. The default value is
thing at point.
from C-h f cider-find-var. note the cider-prompt-for-symbol which can be set to nil#2020-05-0520:36baptiste-from-parisHello friends, does anyone have successfully launched a cider REPL with the new clojurescript bundle options ? Can’t get to make it work 😭#2020-05-0520:36baptiste-from-paris*browser repl#2020-05-0520:38dominicmI don't think Figwheel works with it#2020-05-0520:38practicalli-john@baptiste-from-paris if you are using figwheel then this does not work with bundle at the moment (see the #figwheel-main channel). I dont know if shadow works with it, there is a #shadow-cljs for that. Once those tools work with bundle, then so should cider.#2020-05-0520:42baptiste-from-parisThanks a lot for your help :-)#2020-05-0520:40baptiste-from-parisI am not using these tools, I’ve read their announcements. I am just trying not to work in my terminal 😂#2020-05-0521:06dominicm@baptiste-from-paris are you trying to use piggieback with the built-in cljs repl?#2020-05-0521:10baptiste-from-parisYes indeed, with webpack as a bundler. I think i am going to try inferior mode like I am used to with Clojure CLR 🥳#2020-05-0521:30dpsuttoni updated inf-clojure so it would work with the command line tools seemlessly#2020-05-0610:23slipsetInteresting, unexcpected, but somewhat understandable:
user> (.URI. "")
;; => #object[.URI 0x5c756f85 ""]ERROR: Unhandled REPL handler exception processing message {:op slurp, :url , :session 338ec46a-a3e8-40e6-be4d-4a49fe59a50f, :id 8942}
java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.<init>(Matcher.java:229)
at java.util.regex.Pattern.matcher(Pattern.java:1093)
at clojure.core$re_matcher.invokeStatic(core.clj:4856)
at clojure.core$re_find.invokeStatic(core.clj:4898)
at clojure.core$re_find.invoke(core.clj:4898)
at cider.nrepl.middleware.slurp$normalize_content_type.invokeStatic(slurp.clj:46)
at cider.nrepl.middleware.slurp$normalize_content_type.invoke(slurp.clj:41)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invokeStatic(slurp.clj:95)
at cider.nrepl.middleware.slurp$slurp_url_to_content_PLUS_body.invoke(slurp.clj:82)
at cider.nrepl.middleware.slurp$handle_slurp.invokeStatic(slurp.clj:116)
at cider.nrepl.middleware.slurp$handle_slurp.invoke(slurp.clj:108)
at clojure.lang.Var.invoke(Var.java:388)
at cider.nrepl$wrap_slurp$fn__94216.invoke(nrepl.clj:95)
at nrepl.middleware$wrap_conj_descriptor$fn__83937.invoke(middleware.clj:16)
at refactor_nrepl.middleware$wrap_refactor$fn__98849.invoke(middleware.clj:207)
#2020-05-0610:31pmooserIf I c-u c-M-x a function, it gets marked for debugging.#2020-05-0610:31pmooserHow do I undo this?#2020-05-0611:02practicalli-john@pmooser evaluate the function definition to remove the debugging brakepoints#2020-05-0611:08pmooser@jr0cket It is so obvious in retrospect. Thank you so much!#2020-05-0613:05practicalli-johnObvious when you know how, it has caught many people out 😁#2020-05-0613:20dpsutton@slipset do you know how to prevent that? Not sure if you are asking for help or pointing it out :)#2020-05-0613:21slipsetJust pointing out.#2020-05-0613:21slipsetin case someone found it amusing 🙂#2020-05-0613:25dpsuttoni've seen lots of tickets and questions about that one so just making sure#2020-05-0613:28slipsetok. I just stumbled upon it by happenstance.#2020-05-0613:35mikerod@slipset @dpsutton I thought in recent releases that middleware was turned off or fixed to not NPE#2020-05-0613:36dpsuttonthere have been some fixes to not NPE and i think bozhidar has finally set it as not enabled by default#2020-05-0613:36dpsuttonits not totally fixed to not NPE as there are lots of reasons it could still fail. There's nothing about permissions for example#2020-05-0613:37slipsetI think I'm somewhat recent. C-h-v cider-version reports 0.24.0-snapshot#2020-05-0613:38dpsutton"0.25.0-snapshot" is the latest i believe#2020-05-0618:15mikerodAh I see. #2020-05-0618:16mikerodI haven’t tried. Just saw this in some changelog or blog from bozhidar #2020-05-0708:47bozhidarBoth the content-type bugfixes and the new default are only the snapshot.#2020-05-0716:55dpsuttoni see two candidates for cider-nrepl. which is supposed to be used right now?
0.25.0-SNAPSHOT
0.25.0-alpha1
#2020-05-0804:57bozhidarBoth will work - in CIDER the required version is alpha1, but I updated the snapshot as well, because I noticed many people using cider-connect still believe they have to use the same cider-nrepl version as CIDER’s version.#2020-05-0716:56dpsuttoni'm getting lots of errors from the middleware and just want to make sure i'm using the most recent. also is nrepl 0.7 a hard dependency or optional?#2020-05-0804:58bozhidarWhat kind of errors? nREPL 0.7 is not a hard dependency - I bumped it mostly to verify it’s working well for everyone.#2020-05-0721:53ParenoidM-x cider-clojuredocs in terminal emacs is throwing
Wrong type argument: char-or-string-p, nil
with the following debug statement
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
cider-clojuredocs--content(nil)
cider-clojuredocs-lookup("get")
cider-read-symbol-name("ClojureDocs doc for" cider-clojuredocs-lookup)
cider-clojuredocs(nil)
funcall-interactively(cider-clojuredocs nil)
#<subr call-interactively>(cider-clojuredocs record nil)
apply(#<subr call-interactively> cider-clojuredocs (record nil))
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> cider-clojuredocs record nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (cider-clojuredocs record nil))
call-interactively(cider-clojuredocs record nil)
command-execute(cider-clojuredocs record)
execute-extended-command(nil "cider-clojuredocs")
(with-no-warnings (execute-extended-command current-prefix-arg chosen-item-name))
(unwind-protect (with-no-warnings (execute-extended-command current-prefix-arg chosen-item-name)) (smex-rank chosen-item))
(if smex-custom-action (let ((action smex-custom-action)) (setq smex-custom-action nil) (funcall action chosen-item)) (unwind-protect (with-no-warni$
(let* ((chosen-item-name (smex-completing-read commands initial-input)) (chosen-item (intern chosen-item-name))) (if smex-custom-action (let ((actio$
smex-read-and-run(("list-buffers" "cider-clojuredocs" "cider-scratch" "toggle-debug-on-error" "cider-connect" "linum-mode" "cider-version" "indent-r$
(if (smex-already-running) (smex-update-and-rerun) (and smex-auto-update (smex-detect-new-commands) (smex-update)) (smex-read-and-run smex-ido-cache$
smex()
funcall-interactively(smex)
#<subr call-interactively>(smex nil nil)
apply(#<subr call-interactively> smex (nil nil))
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> smex nil nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (smex nil nil))
call-interactively(smex nil nil)
command-execute(smex)
any thoughts on how to figure this out?#2020-05-0721:55Parenoidusing CIDER 0.24.0 (India)#2020-05-0722:03ParenoidI've been staring at https://github.com/clojure-emacs/cider/blob/master/cider-clojuredocs.el but it's a bit hard for me to figure out.#2020-05-0722:12Parenoidsince I'm in emacs -nw terminal, I wonder if pop-to-buffer in cider-clojuredocs--content, the last call in the stack.#2020-05-0722:21Parenoidthe problem seems to be in
(let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
and that is pretty hard for me to figure out.#2020-05-0801:58yuhanIs your cider-nrepl version in sync? Try evaluating (cider-nrepl-op-supported-p "clojuredocs-lookup")#2020-05-0805:00bozhidarMy guess would be that something’s wrong with the local copy of the clojuredocs database or something along those lines. Still, it seems we should have also added a nil check for missing content.#2020-05-0805:08Parenoidaha ok I didn't realize it was going to a local copy of the clojure database...#2020-05-0805:11Parenoidwondering where/how should I evaluate
(cider-nrepl-op-supported-p "clojuredocs-lookup")
I was just reading the code in the github repo and that's where I studied the line of code the debugger revealed... evaluating your suggestion in cider-scratch gives me an
Unable to resolve symbol: cider-nrepl-op-supported-p in this
context
#2020-05-0805:11Parenoidprobably because that's not I should do that.#2020-05-0805:14Parenoid@U051BLM8F is there a way for me to troubleshoot the possibility off an issue with my local database (or maybe just reinstall or whatever)?#2020-05-0805:18Parenoid@UCPS050BV I also tried
(cider-nrepl-op-supported-p "clojuredocs-lookup")
in the minibuffer and it returned nil... not sure if there was an error as I don't know where to look.#2020-05-0805:20ParenoidI did that with M-x eval-expression.#2020-05-0805:25yuhanIt might be a cider-nrepl mismatch in that case - check the first few lines of your cider-repl buffer which should state the version#2020-05-0805:32ParenoidREPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
#2020-05-0805:32Parenoidare they supposed to be the same version number... or?#2020-05-0805:44bozhidarWe need info from CIDER’s REPL buffer. I think what you shared is from lein repl.#2020-05-0805:44bozhidar> are they supposed to be the same version number... or?
Not necessarily - in CIDER there’s a variable cider-required-middleware-version that specifies the required cider-nrepl version.#2020-05-0805:52ParenoidI'm so dense... where do I evaluate that?#2020-05-0805:53Parenoidgetting unable to resolve symbol.#2020-05-0805:58Parenoidor is it something in configuration?#2020-05-0806:10Parenoidoh... doh. I finally just understood what you meant @U051BLM8F about looking at CIDER's REPL buffer.#2020-05-0806:14ParenoidYAAAAAY! I have clojuredocs. Thank you all so much for the help, and thanks for the patience.#2020-05-0812:07bozhidarSo, what was causing the problem for you?#2020-05-0816:02KamuelaI've installed cider from scratch, just installed a brand new emacs for OSX, I do M-x package-install <RET> cider, and I get package not found. I think I've added melpa to .emacs. I'm very unfamiliar with the ecosystem, so I'm not sure how to troubleshoot from here EDIT: Solved, just needed to do a M-x package-refresh-contents#2020-05-1122:34neilyioI'm very new to Clojure, so this question might be specific to the library I'm playing with (Quil), but I'm finding that some of my Clojure errors are popping up in a new Emacs buffer, and some are being printed in the Cider repl without the new buffer. Could anyone explain this to me?#2020-05-1203:51fiddlerwoaroof@neil.hansen.31 I think the ones that print in the repl are ones that get thrown on a background thread. #2020-05-1203:51fiddlerwoaroofThe ones that create a new buffer are the errors that are thrown in the repl thread. #2020-05-1203:52fiddlerwoaroof(At leaset, this explains the pattern I’ve seen)#2020-05-1205:55neilyio@fiddlerwoaroof Oh, that makes a lot of sense, thanks for the clear explanation. It has indeed been the Quil-specific drawing functions that draw those errors, of course those would be on another thread.
How does everyone else normally deal with this? There must be another solution to analyzing background thread errors. Looking at the REPL printouts is too painful for error messages as verbose as Clojure's.#2020-05-1302:56didibuscider-eval-buffer doesn't seem to work for cljs figwheel-main repl?#2020-05-1302:57didibusIf I add a new function, then eval buffer and try to call it it can't be found, I have to explicitly eval it#2020-05-1303:17dpsuttonI think that’s a limitation of piggieback. It can only eval one form when given several forms#2020-05-1303:20dpsuttonabandoned pr here: https://github.com/nrepl/piggieback/pull/98#2020-05-1506:49bozhidarIt’s not abandoned. It’s just brewing. 😉#2020-05-1304:01tianshuCan I launch a remote cider-connect with lein on that machine? I tried use cd /ssh:user@host: in Eshell, but cider-connect will hang.#2020-05-1415:02David Pham@bozhidar Do I need to write any special setup to activate pretty print on CIDER with ClojureScript and Shadow-cljs?#2020-05-1506:47bozhidarshadow-cljs doesn’t use Piggieback, so it doesn’t support pretty-printing currently. It uses it’s own evaluation middleware that has to be updated independently.#2020-05-1415:02David Phamregarding the new update on piggieback#2020-05-1415:06donavanApologies as this is not really a cider question but maybe someone here knows of a solution
When I activate a hydra while having a cider repl buffer open the repl prompt is moved upwards (as the buffer is now smaller) but when the hydra closes the prompt is left further up in the buffer (i.e. now no longer at the bottom). This now prevents the cider buffer from scrolling with new output until I at least move focus to the repl. I can’t figure out how to turn off emacs’s overscroll feature for a buffer.#2020-05-1415:09donavanJust thinking… if there is a cider function to reset the prompt I could call it on a ‘close hydra’ hook…#2020-05-1423:39zaneYou could also consider asking in #spacemacs, which makes heavy use of hydra.#2020-05-1418:27fappyclojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag dbg
I’ve been getting this (above) recently when trying to debug with cider-eval-defun-at-point … has anyone else? https://github.com/clojure-emacs/cider/issues/1359with the same message is from 2 015, not sure what parts of it might still be relevant.
I was able to debug just fine last week. I tried to add clj-kondo and lsp to my spacemacs. Started seeing this. Reverted my spacemacs changes but still have the problem.
$ lein version
Leiningen 2.9.1 on Java 1.8.0_221 Java HotSpot(TM) 64-Bit Server VM
;; Connected to nREPL server -
;; CIDER 0.24.0snapshot (package:
#2020-05-1418:31fappy~hm. I don’t get the same error message in a different project~ Actually I’m able to debug only if the repl is started from within emacs …. If I start the repl in a terminal and then connect to it from emacs it complains#2020-05-1418:40fappy… But I am reluctant to start the repl from within emacs because some of the lines this app outputs are super long and it slows down emacs a lot#2020-05-1418:54dpsuttonCider nrepl provides nrepl middleware and also the reader tag for #dbg. You need this middleware regardless of how you start your app#2020-05-1419:22fappyHow does starting the repl within emacs include nrepl while running lein repl from the terminal not? (should I ask in #leiningen ?)#2020-05-1419:22fappymy project.clj does not mention nrepl#2020-05-1419:28dpsuttonstart your project up from within emacs and then check out the *Messages* buffer. it will show you exactly how CIDER is starting your project#2020-05-1420:05fappythank you kind sir!#2020-05-1511:32kirill.salykingoodday,
when i jack-in-cljs with shadow-cljs there is a shadow-select option
what is this and why would I need it? if I pick just shadow I can select the build-id as well.
thanks!#2020-05-1511:45EmmanuelOgasup, cider was working fine and dandy on my win10 emacs until recently (a week ago?) Not sure what changed but now I get user-error: The powershell executable isn't on your 'exec-path', but powershell is definitely installed on my system so not sure what could be wrong. Searching for recent changes around the code that triggers powershell I could only find https://github.com/clojure-emacs/cider/pull/2833 but doesn't seem to be related. Any ideas?#2020-05-1512:27EmmanuelOganot sure why but manually adding C:\Windows\System32\WindowsPowerShell\v1.0\ to my PATH fixed the problem#2020-05-1512:28EmmanuelOganot sure why it broke from one week to the other though, initially cider (emacs) did not need that#2020-05-1512:15Michaël Salihi@kirill.salykin "If you already have a running server watching a build (for instance you have already run npx shadow-cljs watch :dev), you can use the shadow-select CLJS REPL and specify :dev when prompted."
https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/cljs/shadow-cljs.adoc#using-cider-connect-cljs#2020-05-1512:16kirill.salykininteresting, thanks!#2020-05-1512:22kirill.salykinActually, it seems not working…
it complaints that shadow already running…#2020-05-1515:10Michaël SalihiMaybe do you already have a cider-jack-in nrepl session ?#2020-05-1515:22kirill.salykinnope, it is complaings abour shadow cljs server#2020-05-1610:38David PhamUse cider-cljs-connect then#2020-05-1512:22kirill.salykinserver already running#2020-05-1720:38neilyioI'm an issue with debugging in Cider/Spacemacs. The Normal Mode keybindings seem to be overriding the Cider Debugger keybindings (n, i, e, etc.), exactly as described in https://github.com/syl20bnr/spacemacs/issues/2356. Anyone else have this problem?#2020-05-1721:22practicalli-john@neil.hansen.31 Yes it seems the debugging menu wrapper function is not working completely in Evil state (not sure why the related commit doesnt work, needs some investigation).
One approach is to switch to Emacs state using C-z and then the key presses will be that of the debug menu rather than Evil normal state. C-z will toggle back to Evil when you are done.
Or use \ key (in Spacemacs develop) which runs evil-execute-as-emacs-state for the next key press, so if you just want to inspect a value, \p .#2020-05-1721:43neilyio@jr0cket Thanks so much, those are great suggestions. I didn't know those bindings existed at all. That gets me back to work for today. What's the best protocol to follow to report this to CIDER/Spacemacs? Should I comment on the issue I posted above, or re-open a new one?#2020-05-1721:43dpsuttonif its configuring spacemacs layers it seems it would have to go there#2020-05-1721:46practicalli-john@neil.hansen.31 Use SPC h I to report a bug from Spacemacs directly. This creates a new issue in the GitHub repository for Spacemacs. Then reference the original issue you posted in the GitHub description. It will be good to specify a reproduction guide as not all Spacemacs maintainers use Clojure (yet).
Its a strange bug as I find that keys n o h l j t q correctly call the cider debug menu, however, i p e s call the Evil normal state commands instead.#2020-05-1721:49practicalli-johnI wrote a basic troubleshooting and reporting guide for Spacemacs - https://practicalli.github.io/spacemacs/install-spacemacs/troubleshooting.html#2020-05-1721:50practicalli-johnThere is also a #spacemacs specific channel as well, although sometimes is not immediately clear if an issue is CIDER or Spacemacs.#2020-05-1722:03neilyioSubmitted the report, SPC h I is a pretty slick way to file an issue.#2020-05-1722:04neilyioI've read through pieces of your book @jr0cket, looks like I'll be going through page by page now to make sure I understand the fundamentals. It's an amazing resource, thanks for your work on it.#2020-05-1722:17practicalli-johnI've added some of my own feedback as a comment to the GitHub issue you raised, thanks for that.
Thanks for the comments about the book. I am doing a lot of updates to the Clojure book next and still keep finding interesting things to add to the Spacemacs book.#2020-05-1808:14g7sI am changing the :style/indent metadata on a macro defined in a .cljc file and cider is not picking it up. Is it caching it somewhere? I can't find out why is not seeing my updated metadata.. The var has the correct metadata (checked on REPL). Does anyone has any clue?#2020-05-1809:06bozhidarCIDER’s generating some indentation rules for clojure-mode from that metadata, so I’m guessing something there is not getting properly updated. I don’t recall any caching, but I also don’t remember that part of the code well, as it has stayed more or less the same for years.#2020-05-1809:19g7sThanks @bozhidar I remember having this issue again in the past but somehow got fixed and I didn't bother finding out why. Maybe I will try turning it off and on again 😂#2020-05-1812:06Karol WójcikHi guys. I would like to bind some Emacs key to a clojure function:
(defn some-function-called-by-keybinding
[])
on keybidings pressed I would like the evaluation of the function be sent to repl (some-function-called-by-keybinding). Can someone please guide me how should I do it?#2020-05-1813:02friczeyou can start with something like:
(defun clj-cmd ()
(interactive)
(with-current-buffer (cider-current-repl-buffer)
(insert "(println {:clojure :data})")
(execute-kbd-macro (kbd "<return>"))))#2020-05-1813:02friczeit should insert Clojure code into cider buffer#2020-05-1813:11Karol WójcikGreat!#2020-05-1813:11Karol WójcikThanks!#2020-05-1813:16fricze:thumbsup:#2020-05-1817:03Cameronand this is why I love emacs 👀 #2020-05-1818:26Eric IhliI can't get Cider to evaluate forms in my REPL. I'm running (cider-connect-cljs (:host "localhost" :port 9000 :cljs-repl-type shadow))` and it's creating a session with a clj object instead of a cljs object. I think this is the cause because I think Cider searches for CLJS repls from (cider-repls :cljs) and that expression is returning "No :cljs REPLs in current session", but I'm stuck at what to do next. Any thoughts?
CIDER Sessions:
1: code/video-series:localhost:9000
linked-to: proj(~/code/video-series/)
objects: *cider-repl %s(clj)* #2020-05-1819:13Eric IhliI still don't know what was causing this, but I bumped clojurescript from 1.10.520 to 1.10.742 and shadow-cljs from 2.8.52 to 2.8.107 and now cider-connect is working.#2020-05-1818:42frozenlockI'm connecting to a NREPL running on a Windows machine via Vagrant.
It kinda works, but CIDER keeps throwing errors related to string-prefix-p
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
compare-strings(nil 0 0 "/home/frozenlock/Docsolver/master/apps/basil/agent/" 0 0 nil)
string-prefix-p(nil "/home/frozenlock/Docsolver/master/apps/basil/agent/")
#f(compiled-function (path) #<bytecode 0x1136b4d>)(nil)
#f(compiled-function (elt) #<bytecode 0x1136b65>)(nil)
mapc(#f(compiled-function (elt) #<bytecode 0x1136b65>) (nil nil nil nil nil))
seq-do(#f(compiled-function (elt) #<bytecode 0x1136b65>) (nil nil nil nil nil))
seq-find(#f(compiled-function (path) #<bytecode 0x1136b4d>) (nil nil nil nil nil))
#f(compiled-function (system session) #<bytecode 0x1bdf7d5>)(CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
apply(#f(compiled-function (system session) #<bytecode 0x1bdf7d5>) CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
sesman-friendly-session-p(CIDER ("libs/bundle:vagrant-machine:6666" #<buffer *cider-repl libs/bundle:vagrant-machine:6666(clj)*>))
I think it's related to this part of the code https://github.com/clojure-emacs/cider/blob/93ff91a1d79ba3094a50a7b01700b02d720e14b8/cider-connection.el#L472
Does it ring any bell?#2020-05-1819:04bozhidar@frozenlock Yeah, seems that path is not something CIDER expects. It’s best to file some ticket for this.#2020-05-1819:04bozhidarI’m happy to report that I finally came up with a simple fix for https://github.com/clojure-emacs/cider/issues/1971 and https://github.com/clojure-emacs/cider/issues/2628. It took me a while, but it gets the job done and adds almost no complexity.#2020-05-1819:32frozenlock@bozhidar Ok, thank you#2020-05-1916:48Eric IhliI've got a problem where cider-connect-cljs from a .cljs file is creating a repl buffer with type clj and I'm not able to evaluate anything from the clojurescript buffer. There's no error. Just, nothing happens.#2020-05-1917:10Eric IhliIt's happening here. I found this with a debug-on-entry on cider-set-repl-type
(defun cider-repl--state-handler (response)
"Handle server state contained in RESPONSE."
(with-demoted-errors "Error in `cider-repl--state-handler': %s"
(when (member "state" (nrepl-dict-get response "status"))
(nrepl-dbind-response response (repl-type changed-namespaces)
(when (and repl-type cider-repl-auto-detect-type)
(cider-set-repl-type repl-type))
(unless (nrepl-dict-empty-p changed-namespaces)
(setq cider-repl-ns-cache (nrepl-dict-merge cider-repl-ns-cache changed-namespaces))
(dolist (b (buffer-list))
(with-current-buffer b
;; Metadata changed, so signatures may have changed too.
(setq cider-eldoc-last-symbol nil)
(when (or cider-mode (derived-mode-p 'cider-repl-mode))
(when-let* ((ns-dict (or (nrepl-dict-get changed-namespaces (cider-current-ns))
(let ((ns-dict (cider-resolve--get-in (cider-current-ns))))
(when (seq-find (lambda (ns) (nrepl-dict-get changed-namespaces ns))
(nrepl-dict-get ns-dict "aliases"))
ns-dict)))))
(cider-refresh-dynamic-font-lock ns-dict))))))))))#2020-05-1916:50Eric IhliFrom what I can gather, cider-connect-cljs gives the newly created REPL buffer a temporary type, pending-cljs, does some work, then adjusts the buffer's name/type based on something it figures out from the repl command? For some reason, even though I'm starting with the cider-connect-cljs command and giving it a shadow type, it's still resulting in a clj buffer.
Debugger entered--entering a function:
* cider-set-repl-type("clj")
* cider-repl--state-handler((dict ... ;;**** This response has :repl-type clj
* nrepl-client-filter(#<process nrepl-connection> "ender for Clojure.\"2:fn4:truee3:spyd8:arglists64:(...")
accept-process-output(nil 0.01)
nrepl-send-sync-request(("op" "eval" "code" "(require 'cljs.core)") #
...
cider-library-present-p("cljs.core")
cider-verify-clojurescript-is-present()
cider--check-cljs(shadow)#2020-05-1917:31Eric IhliSo cider is setting my repl type to clj because my repl is including :repl-type clj in its response when nrepl-send-sync-request is called?#2020-05-1917:32Eric IhliThe repl was started with npx shadow-cljs server...#2020-05-1917:42Eric IhliI manually change the repl type to cljs with (cider-set-repl-type 'cljs) and then evaluate a form in a cljs buffer and the debug-on-entry on cider-set-repl-type gets hit again and it changes the repl buffer back to clj because the nrepl response includes :repl-type clj.#2020-05-1919:11bozhidarThe REPL type is set automatically after each request, so there’s little point in trying to force it manually. Most likely something’s not properly setup with the project. For starters - make sure you’re using the most recent shadow-cljs and CIDER.#2020-05-1921:05Eric IhliAny idea on a next step after that? I'm using shadow-cljs 2.8.107 and cider 0.25.0-alpha1, which are the latest from what I can tell.#2020-05-2006:59bozhidarYou can take a look at the nREPL message exchange and see if there’s something weird there.#2020-05-2007:00bozhidarhttps://docs.cider.mx/cider/troubleshooting.html#_debugging_the_communication_with_nrepl#2020-05-1921:17Michaël SalihiHi! Is there a way to force clj-refactor to use for eg. deps.edn over project.clj if both exist at project root ?
Maybe in dirs-local.el ?
When I use for eg. cljr-add-project-dependency , I get cljr--insert-into-leiningen-dependencies: Search failed: ":dependencies" error because as I understand project.clj takes priority over deps.edn.
https://github.com/clojure-emacs/clj-refactor.el/blob/8259791e054382457b87d1f78061b5e3ce948907/clj-refactor.el#L818#2020-05-1922:44practicalli-john@admin055 If you have more than one project configuration file (project.clj, deps.edn, build.boot) then cider-jack-in commands should display a prompt allowing you to choose which configuration to use. To specify the default project configuration for CIDER, create a dir-locals.el file in the root of your project directory containing the following
((clojure-mode . ((cider-preferred-build-tool . "clojure-cli"))))
I have not tested this with clj-refactor as I stopped using that library a long while ago. If it doesnt work wth clj-refactor, then consider raising an issue or better yet a PR.#2020-05-1922:45practicalli-johnIf using Clojure CLI tools you can also set default aliases too, for example
((clojure-mode . ((cider-clojure-cli-global-options . "-A:fig"))))
https://practicalli.github.io/blog/posts/cider-jack-in-to-clojure-cli-projects-from-spacemacs/#2020-05-1922:47practicalli-johnAnd if you have multiple clojure projects under one git repository, you can tell projectile to treat them all as Clojure projects using
((nil . ((projectile-project-type . clojure-cli))))
https://practicalli.github.io/spacemacs/clojure-projects/monorepo-nested-projects.html#2020-05-2008:40Michaël Salihi@jr0cket
> If you have more than one project configuration file (project.clj, deps.edn, build.boot) then cider-jack-in commands should display a prompt allowing you to choose which configuration to use.
Yes it's what I already do, when I jack-in I choose clojure-cli and it works perfectly.
However as I say above, when I use the command cljr-add-project-dependency`` , clj-refactor see the project.clj file and try to add the dependency in there.
I anayse the code and I think it's because the order of filenames in this list:
https://github.com/clojure-emacs/clj-refactor.el/blob/8259791e054382457b87d1f78061b5e3ce948907/clj-refactor.el#L818
In the clj-refactor code I don't see any variable to force the project file which I can overwrite in .dirs-locals.el for eg.
I will try to implement that and do an PR.
BTW, thank for the useful information that we can find on your website too, it help me a lot, particully for the -A:fig a while ago when I first tested figwheel-main. 😉#2020-05-2015:46tomdhello 👋 when I cause stack traces by eval-ing in the repl, I get a *cider-error* buffer which is great. but when a stacktrace appears in the repl otherwise (i.e. not from me eval-ing in emacs) the *cider-error* buffer seems unaware of it, and I can't find a way to get it to inspect it. am I missing something, or is this not possible in cider? thanks#2020-05-2016:19Drew VerleeDoes cider help see what methods are available on a java class? Or should i be looking elsewhere?#2020-05-2108:59bozhidarI guess we can also add some command to just show all the#2020-05-2016:19dpsuttonthere's javadoc#2020-05-2016:21dpsuttonand if you're on a version greater than 11 check the comments on https://github.com/clojure-emacs/orchard/pull/84 to load up the recent changes to make it work#2020-05-2016:57papachanHello just a small question regarding shadow-cljs and cider#2020-05-2016:57papachanIs there a way to automatically start my app and directly tell `cider-connect-sibling-cljs` to use my unique `:app` alias ? I have my `dir-locals.el` on this project with the basic settings:
((nil . ((cider-default-cljs-repl . shadow)
(cider-shadow-cljs-default-options . "app"))))
#2020-05-2016:58papachanbut when i launch cider-jack-in-clj&cljs emacs ask me always for app .#2020-05-2017:00dpsuttoni don't think jack-in-clj&cljs works well with shadow#2020-05-2017:00dpsuttoni believe when it does it together it uses the same startup program but that's not helpful here since presumably you want lein/clj on the backend and shadow on the frontend#2020-05-2017:01dpsuttoni'm surprised that works to be honest#2020-05-2017:15papachanah. i never had problem to launch shadow-cljs through jack-in-clj&cljs#2020-05-2017:16papachanwhich launcher are you using? cider-jack-in-cljs ?#2020-05-2020:56Eric Ihlihttps://docs.cider.mx/cider/basics/clojurescript.html
Haven't tested this, but would something like this work?
;; modify the list of known REPLs and set some default
((nil
(cider-custom-cljs-repl-init-form . "(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))"
(cider-default-cljs-repl . custom)))
#2020-05-2101:32papachanThank you i will try it.#2020-05-2121:37papachanSeems i get it worked with another config
((nil . ((cider-preferred-build-tool . shadow-cljs)
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . ":app")
(cider-shadow-cljs-global-options . "-A:shadow-cljs"))))
#2020-05-2023:06Drew VerleeI just noticed cider inspect last value now upstates everytime i re eval. This is awesome!#2020-05-2110:38practicalli-johnYes, this is fantastic. I will need to update that in my Spacemacs book now. Thanks for the heads up#2020-05-2105:58bozhidarGlad to hear you like the recent changes!#2020-05-2113:43Drew VerleeFor the cider debugger, the "I" or in command, doesn't seem to take me into a function i have defined in my namespace that my breakpoint is on.#2020-05-2119:36Eric IhliTrying to debug why cider-find-var isn't working in a cljs file linked to a cljs repl. It's working in clj files linked to a clj repl.
(cider-find-var "defsc") results in an error: "wrong type argument: hash-table-p, nil"
I see cider-find-var eventually calls (cider-sync-tooling-eval (format cider-info-form var)) where var is the symbol your trying to find. When var is defn that function returns what looks like a json string. When var is the symbol that doesn't work, that function returns a list... (dict "status" ("done") "id" "145" "ns" "shadow.user" ... "value" "nil") . That's as far as I've been able to debug. Don't know where to go from here.#2020-05-2216:20Drew Verleei think find-var is part of clj-refactor and so only works on clj.#2020-05-2304:18Parenoidcan someone tell me what command is being run to start cider in this video at this point? https://youtu.be/9sVGy0IovH8?t=1471#2020-05-2305:26dpsuttonlooks like a standard cider-jack-in#2020-05-2305:36Parenoidthank you!#2020-05-2305:36Parenoidyou rock.#2020-05-2305:36dpsuttonyou're welcome 🙂#2020-05-2307:22David PhamIs there a guide on how making a nrepl connection in a production nodejs/java server?#2020-05-2307:28solfMaybe this would be helpful, it's a rather concise implementation of a nrepl server made for babashka: https://github.com/babashka/babashka.nrepl @neo2551#2020-05-2308:05David PhamThanks!#2020-05-2318:52borkdudeI just upgraded from CIDER 22 to 25. When I cider connect to a an nREPL server (in my case a babashka nREPL server) from within a script file, it used to "just work" but now I first have to sesman-link-with-buffer. Does that sound familiar?#2020-05-2319:07dpsuttonyeah. that was the fix for the way that things were linked in the past. they just kinda used the last repl regardless of projects. so the fix was to have things linked but this is at the detriment to non-project files#2020-05-2319:09dpsuttoni think if you make your own elisp function to do (cider-jack-in (list :project-dir (file-name-directory (buffer-file-name))) it should work?#2020-05-2319:10dpsuttoni'm guessing its not finding the root directory of the project so it doesn't know how to set up the scoping#2020-05-2319:17dpsutton@borkdude i actually can't repro.#2020-05-2319:18dpsuttonit works out just fine for me. i can load files, send forms to the repl, etc#2020-05-2319:20borkdudehmm, I must have done something wrong here locally then. now it also works here#2020-05-2319:20borkdudethanks for double checking#2020-05-2319:28dpsutton👍#2020-05-2404:21mister_mI'm finding that I am getting different test results when running the suite from inside CIDER through C-c C-t p than when I run them on the terminal through lein test . Has anyone run into this before? I think I'm missing some context on how tests work within CIDER possibly. Is C-c C-t p doing something wildly different than lein test?#2020-05-2404:21dpsuttoni don't believe so#2020-05-2404:22dpsuttonyou mentioned that your tests were profile dependent. is it possible that you are running with different profiles? If not, is it possible that you are not reevaluating the code you need so lein test sees your updated code but your repl doesn't have new definitions re-evaled?#2020-05-2404:31mister_mThat's right, I am providing with-profile +my-profile to the cider-jack-in command that I am customizing through the C-u M-x cider-jack-in RET method here https://docs.cider.mx/cider/0.24/basics/up_and_running.html#_customizing_the_jack_in_command_behaviour.
However, what is curious is that if I jack-in without the profile I will see the error I expect to see (and that I will get on ther terminal) if that profile is omitted. I'm seeing a new and diferent error in cider when I jack-in with the profile present.#2020-05-2404:32dpsuttoninteresting. nothing springs to mind but i'm interested in what you track down#2020-05-2404:33dpsuttonand all files are saved and lein with-profile +my-profile test reports differently?#2020-05-2404:33dpsuttonand there's no test selectors involved? and doing this from a fresh cider-jack-in shows a different error?#2020-05-2404:34mister_myep, fresh nREPL - the terminal will run alltests successfully when that profile is provided. I'm wondering if the project itself is doing something profoundly strange that might be affecting the test runner (this is a project I am new to)#2020-05-2404:34dpsuttonwhat error are you getting by the way#2020-05-2404:35dpsuttonCIDER introduces a thing that throws if you accidentally do (is (= 1)) saying equality should need multiple arguments#2020-05-2404:36dpsuttonand i think there are some other libs that do that too. many humane-test-output or something similar#2020-05-2404:43mister_mI am seeing some tests fail with an java.lang.IndexOutOfBoundsException error in weird looking situations, hm#2020-05-2404:43mister_mactually in several (is (= x y)) type assertions#2020-05-2404:44dpsuttonsounds unrelated to what i was thinking#2020-05-2404:45dpsuttoncan you poke those functions in the repl? maybe see what's going on?#2020-05-2404:45mister_msome breakpoints might be illuminating, yeah - I'll dig into it#2020-05-2404:46mister_m@U11BV7MTKif you're extremely bored you can clone https://github.com/cloverage/cloverage and run tests in CIDER with the +sample profile#2020-05-2404:46dpsuttonoh are you testing cloverage itself?#2020-05-2404:47mister_mI am. Or, trying to do so within my emacs setup.#2020-05-2404:47dpsuttongotcha#2020-05-2404:49dpsuttonso i cloned it and then lein test in cloverage/cloverage i got failures#2020-05-2404:50mister_myou'll have to run with the lein with-profile +sample test - the sample profile for reasons lost to time is required#2020-05-2404:50dpsuttonwhat profile should i be using?#2020-05-2404:52dpsuttoninteresting. i can repro but no idea why#2020-05-2404:53dpsuttoninterestingly, from lein repl i get#2020-05-2404:53dpsuttonRan 58 tests containing 175 assertions.#2020-05-2404:53dpsuttonbut in cider test project i get#2020-05-2404:53dpsuttonTested 9 namespaces
Ran 188 assertions, in 67 test functions
#2020-05-2404:53mister_moh wow#2020-05-2404:53mister_mthat's unsettling#2020-05-2404:54dpsuttonand
lein test cloverage.kahn-test
lein test cloverage.report-test
lein test cloverage.report.console-test
lein test cloverage.sample.dummy-sample
lein test cloverage.sample.multibyte-sample
lein test cloverage.sample.read-eval-sample
lein test cloverage.source-test
vs
cloverage.args-test
cloverage.coverage-test
cloverage.dependency-test
cloverage.instrument-test
cloverage.kahn-test
cloverage.report-test
cloverage.report.console-test
cloverage.sample.exercise-instrumentation
cloverage.source-test
#2020-05-2404:59mister_mso I just had tests succeed when being run from cider, but then fail on the next run; so clearly something very weird is happening here#2020-05-2404:59mister_mnotably what you mention, that it looks like there's a different set of namespaces being run#2020-05-2405:03mister_mit's midnight and time to close the laptop - @U11BV7MTK thanks for having a look#2020-05-2422:35aptHi people. It seems that clojurescript won’t jack in properly if there’s some namespace it an invalid ns (like (ns ).
That’s because of https://github.com/clojure-emacs/cider/blob/master/cider-connection.el#L264, (cider-util--clojure-buffers) ends up finding a file with this ns and it fails trying to get the ns name or something like that.
Is this considered a bug? If so, I can open an issue with the stacktrace or even try to fix it (by ignoring the error, perhaps? Or printing a friendlier error message instead of letting it fail later with forward-sexp)
(you might wonder how I end up having this wrong ns declaration. The reason is that I created a clj file with spacemacs/open-junk-file. As I used the clj extension, it automatically added (ns ) for me. This file was not part of any project, I only created it for pasting some clojure code that I intended to format. 🤷)#2020-05-2422:39dpsuttonfor sure open an issue. it seems strange to me that this would prevent jacking in. But this seemingly would prevent compiling and if you can't compile you usually can't load the output in a page so you don't connect your application. what is the repro here? figwheel/figwheel-main/-m cljs.main/shadow?#2020-05-2422:41aptOh, sorry, it did jack in, actually. It created a repl buffer in a pending state or something like that (I could tell this from the buffer name). But I was unable to evaluate stuff.#2020-05-2422:41aptIt’s a shadow-cljs project#2020-05-2422:43dpsuttonok. the pending state means it hasn't connected to the application yet. and that's because there isn't a compilation output since its invalid code#2020-05-2422:44dpsuttonwhen you tried to evaluate stuff i imagine you got an error like "no connected application" or something similar?#2020-05-2422:45aptLet me see, I’ll reproduce it again#2020-05-2422:51aptThis is the stacktrace:
Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 5 6)
scan-sexps(5 1)
forward-sexp(1)
clojure-forward-logical-sexp()
clojure--find-ns-in-direction(backward)
clojure-find-ns()
cider-current-ns()
cider-refresh-dynamic-font-lock()
cider-mode(1)
cider-enable-on-existing-clojure-buffers()
#f(compiled-function () #<bytecode 0x477bb459>)()
#f(compiled-function (buffer) #<bytecode 0x4770c08d>)(#<buffer *cider-repl nu/timeline:localhost:63972(pending-cljs)*>)
#f(compiled-function (response) #<bytecode 0x4770c109>)((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done")))
#f(compiled-function (response) #<bytecode 0x4770c151>)((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done")))
nrepl--dispatch-response((dict "id" "4" "session" "f0733cfc-31b2-4759-bb10-2416c787fa6f" "status" ("done")))
nrepl-client-filter(#<process nrepl-connection> "d2:id1:47:session36:f0733cfc-31b2-4759-bb10-2416c787fa6f5:value3:niled2:id1:42:ns11:shadow.user7:session36:f0733cfc-31b2-4759-bb10-2416c787fa6fed2:id1:47:session36:f0733cfc-31b2-4759-bb10-2416c787fa6f6:statusl4:doneee")
When I try to evaluate something, there’s no error. But nothing happens.
When I try to use cider-switch-to-repl-buffer , it says user-error: No cljs REPLs in current session "<my-project-name>:localhost:64265"#2020-05-2422:52dpsuttonthere are no cljs repls so that seems find. how did you find the stacktrace?#2020-05-2422:52dpsuttonwhat did you do to trigger an error?#2020-05-2422:52dpsuttonoh. i'm following now#2020-05-2422:52dpsuttonand do you have unbalanced parens in a buffer?#2020-05-2422:53dpsuttonbut either way that function needs to catch errors#2020-05-2422:53aptI’m using toggle-debug-on-error
> what did you do to trigger an error?
It is thown just after cider-jack-in -> cljs -> shadow -> <profile>#2020-05-2422:53dpsuttonhow badly broken is the file?#2020-05-2422:53apt> and do you have unbalanced parens in a buffer?
The minimal file for reproducing it is (ns )#2020-05-2422:54dpsuttoninteresting. i wouldn't expect that to throw a scan error#2020-05-2422:55aptYeah
Perhaps it assumes there’s a second form in ns :thinking_face:
Well, I’ll open the issue then, as it looks legit#2020-05-2422:57dpsuttoni think this is a bug in clojure-mode#2020-05-2422:58dpsuttonclojure-find-ns() should never throw an error#2020-05-2422:59dpsuttonand clojure--find-ns-in-direction needs a (condition-case nil ... (scan-error nil))#2020-05-2423:02aptHummm, yeah, agreed. Perhaps clojure-find-ns() should make it explicit that if there’s no ns, it would return nil. It’s not clear what’s the expected behaviour just by looking at the current docstring.#2020-05-2423:03dpsuttonI think that’s the thought. There’s lots of when’s and unless in there I think#2020-05-2423:04dpsuttonCheck the cider find ns version as well. It was a big or statement#2020-05-2423:12aptYeap
Well, I just opened the issue here, since I’m not sure who should handle this: https://github.com/clojure-emacs/cider/issues/2849
Thanks for helping me, dpsutton#2020-05-2423:14dpsuttonYou are welcome!#2020-05-2514:39Drew VerleeIs there a way to get the clojure function examples from clojuredocs into the docs for emacs?#2020-05-2514:57solfCider has them already, since an update a few months ago#2020-05-2514:58solf#2020-05-2519:18nickTrying to test it
cider-clojuredocs
> ClojureDocs doc for:
typing - "conj"
and got an error "helm-M-x-execute-command: Wrong type argument: char-or-string-p, nil".
@U7S5E44DB Do you know if I using it right?
upd. cider is up and running. cider-clojuredocs-refresh-cache worked fine.#2020-05-2519:22nickOH, sorry I think I got it.#2020-05-2519:23nickIt has to be called from within repl(not from your file with clj code). Looks pretty good.
Thanks for your answer!#2020-05-2600:34solfIt sounds like there's an issue with helm-M-x? M-x cider-clojuredocs (or C-c C-d C-c by default) works on clj files#2020-05-2514:58solf@drewverlee ^#2020-05-2515:02Drew Verleedamnt. how did i miss that#2020-05-2515:02Drew Verleesuper cool#2020-05-2606:01bozhidar@drewverlee You can also trigger ClojureDocs from a doc buffer using g/G. We should probably update those keybindings, as they are remnant from the time we used Grimoire instead.#2020-05-2606:01bozhidarAlso - the “see alsos” you’re seeing in doc buffers are coming from ClojureDocs.#2020-05-2609:14ziltiI can't do a cider-jack-in-clj&cljs. The clj REPL starts fine, but the cljs one gives me an Execution error with "missing instance".#2020-05-2609:50bozhidarCan you share the entire backtrace here?#2020-05-2610:50zilti1. Unhandled clojure.lang.ExceptionInfo
missing instance
{}
runtime.clj: 11 shadow.cljs.devtools.server.runtime/get-instance!
runtime.clj: 8 shadow.cljs.devtools.server.runtime/get-instance!
api.clj: 125 shadow.cljs.devtools.api/worker-running?
api.clj: 123 shadow.cljs.devtools.api/worker-running?
api.clj: 225 shadow.cljs.devtools.api/watch
api.clj: 219 shadow.cljs.devtools.api/watch
api.clj: 223 shadow.cljs.devtools.api/watch
api.clj: 219 shadow.cljs.devtools.api/watch
REPL: 1 user/eval27313
REPL: 1 user/eval27313
Compiler.java: 7177 clojure.lang.Compiler/eval
Compiler.java: 7166 clojure.lang.Compiler/eval
Compiler.java: 7132 clojure.lang.Compiler/eval
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
interruptible_eval.clj: 91 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 155 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 190 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 189 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 834 java.lang.Thread/run#2020-05-2610:50ziltiYes, here:#2020-05-2612:18bozhidarSeems like some issue in that particular version of shadow-cljs. Did you check with say the previous version or something like this?#2020-05-2612:19bozhidarI can’t think of any CIDER changes that could cause this.#2020-05-2612:24ziltiHmm, no, I didn't check with other versions. I only checked if it works in VSCodium using Calva, and that worked fine, so my conclusion was "must be a CIDER issue then"#2020-05-2609:37Matheus Moreirahello. maybe i use cider-test-run-ns-tests to run my tests and i noticed a strange behaviour… it seems that the tests are somehow cached and if i delete some of the test code and write a new one, the old test code is executed too. has someone noticed it too?#2020-05-2609:49bozhidarTests are just regular vars and they’ll be in scope until you explicitly remove them - e.g. using undef or cider-refresh.#2020-05-2614:48Matheus Moreiraah, ok. thanks! 🙂#2020-05-2618:58papachani've upgraded cider this morning. and now i see this when i open a shadow-cljs project with cider-jack-in-cljs
Error in 'cider-repl--state-handler': (scan-error Containing expression ends prematurely 5 6)
#2020-05-2618:59papachannever seen this error before.#2020-05-2620:13papachanI finally found it. it was caused with a wrong expression within .dir-locals.el i think#2020-05-2620:13papachannow running fine#2020-05-2701:36frozenlocknREPL has a sideloader since 7.0.0 (https://github.com/nrepl/nrepl/issues/97). Is it possible to use it to load Cider-nrepl?#2020-05-2708:28bozhidar@frozenlock It’s not possible in 0.7, but it’s possible in 0.8 (the version currently in development).#2020-05-2708:29bozhidarIn 0.8 you can load middleware dynamically via the sideloader, before this you were limitted only to regular libraries.#2020-05-2708:30bozhidarI mean - you could load cider-nrepl even then, but you wouldn’t be able to tell nREPL to actually load the middleware from it and update its middleware vector.#2020-05-2708:31bozhidarhttps://nrepl.org/nrepl/design/middleware.html#_dynamic_middleware_loading#2020-05-2709:24erwinrooijakkersHi all, is there a way to limit the length of error messages printed to cider-error buffer? 🙂#2020-05-2715:43bozhidarI don’t think we added provisions for this.#2020-05-2809:55erwinrooijakkersThanks. I did see a suggestion in an issue.#2020-05-2809:55erwinrooijakkershttps://github.com/clojure-emacs/cider/issues/1934#2020-05-2715:10frozenlockNoted. Thank you very much for the detailed answer.#2020-05-2715:44bozhidarYou’re welcome!#2020-05-2716:01mikerodI have observed that cider-jump-to which is called from cider-find-var seems to now always put the cursor/point on the last line of the buffer it navigates into. The line is not centered. So it means my point is really low in the buffer and I always forget and can’t find it.#2020-05-2716:02mikerodI do not remember this being the case in the past. It used to be I believe centered on the line that was navigated to.#2020-05-2716:02mikerodI’m on 0.25.0snapshot of cider#2020-05-2716:02mikerodI’m wondering if my observation here is correct; or if anyone else has thoughts on it.#2020-05-2716:03mikerodI basically always end up needing to call recenter-top-bottom#2020-05-2720:02bozhidarWe haven’t touched this in a very long time, so I guess this has been the behaviour for a while. Adding some (optional) recentering would be trivial. You can file a ticket for this.#2020-05-2721:52mikerodThanks @bozhidar I’ll see what I can do there then#2020-05-2915:57mikerodhttps://github.com/clojure-emacs/cider/issues/2850 gave it a shot here#2020-05-2805:44bozhidar:thumbsup:#2020-05-2809:42dev-hartmannHey fellow clojurians, not sure if this is the right place to ask, but I'm having a repl issue and since I use emacs + cider thought this might be the right place#2020-05-2810:23practicalli-johnThe question is arguably better suited for #beginners channel as its not Cider specific.#2020-05-2812:51dev-hartmannsure, thanks for replying anyways thumbsup_all just wasn't sure if it was an issue with the classpath that maybe wasn't available from a cider repl.#2020-05-2814:45practicalli-johnThe root cause is not always obvious 😁#2020-05-2809:42dev-hartmannfrom within the repl I'm not able to read files from the resoures folder with http://clojure.java.io/resource#2020-05-2809:44dev-hartmannI'm using deps.edn and have added resources to the paths vector#2020-05-2809:44dev-hartmanninterestingly io/file works#2020-05-2810:12practicalli-john@dev-hartmann file and resource functions read from different starting paths in the project. I believe file is from the root of the project and resource is from resources/ so you will need to adjust the file path accordingly.
The following has an example, with the data files saved to the file space in /resources/data-sets/ so the path for resource starts at data-sets/ https://github.com/practicalli/covid19-dashboard/blob/master/src/practicalli/data_gov_uk.clj#2020-05-2812:56dev-hartmannthanks for the pointer! I'm actually doing it exactly like that#2020-05-2812:57dev-hartmann(defn load-config [resource profile]
(-> resource
()
(read-config)
(get profile)))#2020-05-2812:57dev-hartmannread-config coming from juxt/aero#2020-05-2812:58dev-hartmannio/resource always returning null#2020-05-2812:58dev-hartmannso I guess I have something misconfigured#2020-05-2813:00dev-hartmannI'll post this to #beginners though, to not clutter up this thread#2020-05-2814:25dominicmJust to expand further. io/resource is relative to any folders setup as class paths.
Eg src, resources, test, clojure.jar, etc#2020-05-2814:44practicalli-johnAh, I did think that might be the case, thanks for confirming.#2020-05-2811:54Ian Fernandezheey guys, how I can configure cider to use .nrepl.edn to shadow-cljs nrepl middleware?#2020-05-2816:02bozhidarI haven’t seen any instructions how to use it standalone (without shadow kicking off the nREPL server), so you might have to ask at their issue tracker.#2020-05-2818:00thhellerthe question is how do you add custom middleware to the nrepl server cider starts?#2020-05-2818:01thhellerNOT the one shadow-cljs starts.#2020-05-2906:07bozhidarYeah, I think that’s the question. Normally you’d do this either via your project config (e.g. project.clj or nrepl.edn).#2020-05-2914:17Ian Fernandezbut how I can jack-in shadow.api/repl from mine cider repl, without jacking in first with shadow-cljs but with clj?#2020-05-2814:49adamfreyhas anyone ever tried to get the *cider-test-report* buffer to open in a new emacs frame instead of the current behavior (for me, splitting the current emacs buffer in two)?
I imagine you would have to do some overwriting of the functionality here: https://github.com/clojure-emacs/cider/blob/master/cider-test.el#L686#2020-05-2816:45johanatanthis is a pretty unfortunate bug: https://github.com/bbatsov/projectile/issues/1534
the only workaround is to switch to native mode (which then takes a long while to index and doesn't ignore .gitignore files, requiring repeating them in .projectile).#2020-05-2816:45johanatan@bozhidar ^^#2020-05-2818:39bozhidar@johanatan I think I’ve commented on this many times, as the ticket has been duplicated through the years - it’s not really a bug, it’s a limitation. If we apply postprocessing to the files returned by an external command (alien mode) we’re killing most of the benefits of using it, as this filtering is very expensive in Emacs Lisp.#2020-05-2818:41bozhidarThe native indexing is already slow, so the filtering isn’t that big a deal with it.#2020-05-2818:43bozhidarBtw, did you try hybrid mode as well? I think it was somewhere in the middle. I haven’t had much time for Projectile lately, so I’m starting to forget what i’ve done there.#2020-05-2818:43bozhidar🙂#2020-05-2818:43johanatanAnd what about native mode failing to respect gitignore?#2020-05-2818:43johanatanYep I tried hybrid and also see the failure to respect gitignore #2020-05-2818:43bozhidarWell, I can’t see how this can happen - after all it’s simply shelling out to git. 🙂#2020-05-2818:44johanatanWhat exactly is “alien mode” btw? What’s it shelling out to?#2020-05-2818:45bozhidarAlien mode is shelling out the vcs or to find if the project is not VCS controlled.#2020-05-2818:45bozhidarYou can see in the defcustoms what exactly is invoking for each supported VCS.#2020-05-2818:45johanatanSo native mode also “shells out to git”?#2020-05-2818:45bozhidarHybrid is doing the same + some some file post-processing.#2020-05-2818:45bozhidarNo, native mode just indexes the project in Emacs Lisp. That’s why it’s native (to Emacs).#2020-05-2818:46johanatanOk but that’s where I see it fail to respect gitignore. So what did you mean by “I can’t see how that could happen since it just shells out to git”#2020-05-2818:46johanatan?#2020-05-2818:48johanatanI actually reject the premise that post processing on alien would be untenable. Alien presumably returns a short, relevant list and then to apply some additional pruning based on .projectile should be very fast. #2020-05-2818:49johanatanBut I guess that’s what “hybrid” is supposed to be. However hybrid isn’t respecting gitignore for me #2020-05-2818:52bozhidar> Ok but that’s where I see it fail to respect gitignore. So what did you mean by “I can’t see how that could happen since it just shells out to git”
That’s how the list of files is obtained https://github.com/bbatsov/projectile/blob/master/projectile.el#L624#2020-05-2818:54bozhidar> I actually reject the premise that post processing on alien would be untenable. Alien presumably returns a short, relevant list and then to apply some additional pruning based on .projectile should be very fast.
In a small project - sure, in a huge project you might have to check thousands of files against the ignored patterns. In Emacs Lisp that’s anything but fast. 🙂#2020-05-2820:58johanatani think if you're in the situation where the alien search didn't trim down the result set to something manageable, you're not in a situation to pick the final result yet and are most likely going to hit another key immediately thereafter, killing the first search and kicking off a new one. this process is going to repeat until you actually enter enough characters to begin to actually trim down the list to something manageable at which point a final post-process pass would not be burdensome at all.#2020-05-2820:59johanatanall that you need for this to "feel" fast is the ability to kick off each search asynchronously and to kill earlier searches if keypresses are entered before they complete#2020-05-2820:59johanatanit's an "interplay" between user and machine#2020-05-2821:00johanatana symbiosis / synergetic emergent phenomenon#2020-05-2821:00johanatanand it would be awesome#2020-05-2821:01johanatan@bozhidar ^#2020-05-2821:07johanatanand, sorry, i misspoke earlier, native does not exhibit any bugs (it's just really slow). hybrid and alien both have the same problem of .projectile ignores being ignored.#2020-05-2821:07johanatani.e., there appears to be no discernible difference between hybrid and alien#2020-05-2821:12johanatanalso, btw, SPC / (which uses ag) to search inside every single file is faster than projectile's filename only searching. how is this even possible? with my 100s of MBs of node_modules, we can search inside them faster than searching merely for their names?#2020-05-2821:13johanatanunfortunately for me, there is a much higher chance of collision between filenames in node_modules/ that I don't care about and filenames in my codebase than there is for content in node_modules and content in my codebase.#2020-05-2821:14johanatanand thus SPC / is imminently more usable than my current situation than SPC p f#2020-05-2821:32johanatanand btw yet another bug is making this entire ordeal more painful that one would hope:
https://github.com/bbatsov/projectile/issues/1541#2020-05-2901:40johanatanFor anyone following along, I was able to get hybrid mode to be sufficient. It was actually the .projectile ignores that I struggled to get working (rather than gitignore as mentioned above). Turns out that projectile (weirdly, against standard UNIX convention) wants paths to begin with “/“. So the following works:
-/node_modules/#2020-05-2901:41johanatanBut -node_modules/ does not #2020-05-2901:42johanatan(In the UNIX world, the former would refer to a top level path from the filesystem root itself, not a subdirectory of the current dir).#2020-05-2902:39Michaël Salihi@johanatan You can also use .gitignore file instead.#2020-05-2902:50johanatan@admin055 you’re a bit out of the loop here. These files can’t be git ignored hence the whole dilemma 😀#2020-05-2902:51johanatanRead the linked GitHub issues on projectile for the details #2020-05-2902:51johanatanIn short, because our company’s artifactory sucks, we have node_modules not git ignored #2020-05-2906:22bozhidar@johanatan It’s best to keep this discussion in the tickets, so we won’t lose it.#2020-05-2919:01frozenlockIs there a function to connect to a repl from whithin another repl?
Something like (connect-to-repl-2)
And then come back to my main repl :my-repl/exit#2020-05-2919:58frozenlockI think I would need to replace the nrepl middlewares by one that redirrect all communication to the second nREPL server and check for a magic keyword to restore all the middlewares.#2020-05-2919:58frozenlockSo perhaps only doable in the upcoming 0.8.0?#2020-05-3104:15TetraktysIs there a good source of additional documentation on displaying inline images for various content-types in Cider? https://github.com/clojure-emacs/cider/issues/1510#2020-06-0113:27bozhidarI’m afraid we don’t have much - https://docs.cider.mx/cider/repl/configuration.html#displaying-images-in-the-repl#2020-06-0113:28bozhidarYou can also check out the code for the content-type and slurp middleware in cider-nrepl. I think the code is relatively easy to follow.#2020-06-0104:48PiotrHi, just wondering how can I get it to work: I would like to run tests for current buffer but it complains that it does not see any tests. That is actually correct, the tests are in other directory, on the same level as /src I have found this setting
cider-test-infer-test-ns
but I am not sure how to use it. Can anyone point me in in the right direction?#2020-06-0108:33practicalli-johnDo test work if you run them on the command line? If not, they won't work in CIDER#2020-06-0205:43PiotrIt was caused by the fact that I have failed to evaluate test buffer. It works now. Thank you.#2020-06-0108:25bozhidar@piotr.kurnik You’ve evaluated the test namespace, right?#2020-06-0205:42PiotrNo I haven’t and that was the root cause. It was easier than I expected…
Thank you @U051BLM8F#2020-06-0206:21bozhidarYou’re welcome!#2020-06-0109:49donavanI’m getting a lot of java.lang.IllegalArgumentException: Cannot write value of type class java.lang.Double in bencode.clj. I understand this may be a part of my project and so others may not be able to actually help me but any pointers as to what I should be looking for when debugging this?#2020-06-0109:52dominicmBencode can't handle doubles, it has no way to send them#2020-06-0109:52dominicmSo you need to covert them to something else before giving them to bencode#2020-06-0109:54donavanRight, so does that mean any value that I may be evaluating in my cider session cannot return doubles?#2020-06-0109:56bozhidarNope, results are simply returned as strings by nREPL.#2020-06-0109:57bozhidar(meaning the server converts the double to a string and sends it back to CIDER as a string)#2020-06-0109:58bozhidarWhat exactly are you doing to be getting those errors?#2020-06-0110:02donavanI’m not 100% sure TBH. I have a boot backed yada server and I’m trying to eval fns and run a test interactively… I haven’t yet started peeling away the layers of the project to see what causes the issue#2020-06-0110:03donavanI’m heading into a meeting now, will come back to this later. Thanks for the help regardless#2020-06-0113:00bozhidar:thumbsup:#2020-06-0120:37Ian Fernandezhey guys, there's some way to connect cider on bb? (Babashka)#2020-06-0120:38dpsuttoni believe so. bb can run with an nrepl server#2020-06-0120:39dpsuttonbb --nrepl-server 12345#2020-06-0120:39dpsuttonand then just cider connect#2020-06-0120:42Ian Fernandezthanks!#2020-06-0318:39grzmSay I have a cider connection to a bb nrepl server, and I also have a clj repl (via cider-jack-in) in the same project/set of files. How do I switch the association between a buffer and the Cider connection it’s using?#2020-06-0319:11aisamuI'd look into sesman-* commands! (`sesman-link/unlink` or something like this)#2020-06-0319:12dpsuttonI believe it’s down to the last focused repl buffer#2020-06-0320:45grzmThat does seem to be the case. Thanks, @dpsutton! I wonder if I’d use a feature that pinned a buffer to a specific connection.#2020-06-0413:47practicalli-johnIs it correct that a Cider test report is only created if tests fail?
It seems a test report is never generated if tests always pass (not exactly a TDD approach, I appreciate that). Once there has been a failing test, then a test report is updated even if all tests pass successful.
I found the auto-completion-enable-sort-by-usage custom variable and this will create and show the report even if tests never fail.
https://docs.cider.mx/cider/testing/running_tests.html#display-test-report-on-success
Just curious as to if this is the intended way the test report works or if I missed something. Thank you.#2020-06-0414:02plinsthis is something that annoys me a bit as well#2020-06-0414:17practicalli-johnSetting the custom variable, that works for what I am doing.
It does seem to make more sense to generate a test report when ever tests are run but only shown the test report buffer on failure.#2020-06-0416:58bozhidarCIDER 0.25 (“Bergamo”) is out! It’s a relatively small release that introduces a couple of improvements and fixes a several long-standing and quite annoying bugs. Check out the release notes for details https://github.com/clojure-emacs/cider/releases/tag/v0.25.0 Cheers! cider#2020-06-0417:16dpsuttoncider !#2020-06-0421:06Phil JacksonHey, I'm a bit behind on cljr, is there cljs support yet?#2020-06-0421:06Phil JacksonI'm interested in renaming symbols at the mo.#2020-06-0421:16dpsuttoni don't believe so#2020-06-0421:24Phil JacksonIt'll teach me for naming them poorly in the first place.#2020-06-0509:25David PhamDoes anyone has issue with autocompletion with the newest cider, clojurescript and shadow-cljs? I get a null pointer exception.#2020-06-0514:47Brandon OlivierI can't get the refactoring tools or company mode to work, but I haven't looked into it much.#2020-06-0511:26gigal00pHi all. How to create new file/namespace from within cider?#2020-06-0511:31yuhanYou can create new .clj files the normal Emacs way with find-file , and if you have clj-refactor it will automatically add the ns form#2020-06-0511:31yuhansee the variable cljr-add-ns-to-blank-clj-files#2020-06-0511:33gigal00pThanks @UCPS050BV, I'll check this out#2020-06-0511:37gigal00pWorks nicely. Thanks again @UCPS050BV!#2020-06-0515:42Phil JacksonHey. Shadow-cljs, latest cider - when I cider-connect to an nrepl port, all seems well and I get a repl in Emacs, however, all commands from a src buffer give me: user-error: No cljs REPLs in current session...#2020-06-0515:42Phil JacksonDoing a jack-in works fine.#2020-06-0515:49bozhidar@phil638 Are you using shadow-cljs 2.10? There were some big changes to its internals, so it might be something related to that. There hasn’t been any recent changes on CIDER’s end with respect to shadow and cljs in general.#2020-06-0515:53Phil JacksonAh, I'm only on 2.8.110 - would you recommend 2.10 instead?#2020-06-0515:53Phil JacksonFrom a cider point of view, I mean.#2020-06-0515:54bozhidarWell, it shouldn’t make much of a difference but you can always try.#2020-06-0515:55bozhidarThe error you got seems to indicate something went wrong in the REPL init process, which might be related to something wrong in shadow. Not sure.#2020-06-0515:56Phil JacksonCool - I'll do some poking around. Thanks for the input.#2020-06-0516:16Phil Jackson@bozhidar I'm finding cider--match-repl-type is seeing pending-cljs when it's looking for cljs.#2020-06-0516:17Phil JacksonSo that buffer gets filtered out in cider-repls.#2020-06-0516:17dpsuttonthe buffer should be set to cljs when it connects to a running app, either node or the browser. has this happened yet?#2020-06-0516:17Phil JacksonIt has, yea.#2020-06-0516:18Phil JacksonI can js/alert from the cider repl itself.#2020-06-0516:18Phil JacksonWith no issues.#2020-06-0516:20dpsuttonand what is cider-repl-type in that buffer?#2020-06-0516:20dpsuttonthe repl buffer i mean#2020-06-0516:21Phil Jacksonpending-cljs#2020-06-0516:22dpsuttonit never got set then i guess. there's a bit of a complicated state tracker in there#2020-06-0516:22Phil JacksonIn elisp?#2020-06-0516:22bozhidarIn Clojure. 🙂 cider-nrepl#2020-06-0516:23bozhidarBut it’s not complicated actually - all it checks for is the presence of a piggieback session, nothing more.#2020-06-0516:23dpsuttoni would probably toggle nrepl message logging and then restart the repl. then watch the messages in startup and watch for the repl-type keyword#2020-06-0516:24dpsuttonnrepl-toggle-message-logging and see if this message comes:
(<--
id "10"
session "f042944b-6101-46a7-a80f-653115475bfb"
time-stamp "2020-06-05 11:23:59.380273000"
changed-namespaces (dict ...)
repl-type "cljs"
status ("state")
)#2020-06-0516:24dpsuttonthat's how the pending gets upgraded to cljs#2020-06-0516:24bozhidarhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/track_state.clj#L185#2020-06-0516:26bozhidarAlmost every time someone experienced this problem it turned out that this cljs check wasn’t working.#2020-06-0516:32Phil JacksonI see this in the messages, could it be relevant?:#2020-06-0516:32Phil Jackson(<--
id "10"
op "version"
session "e51ed50e-32bb-4ec6-8951-d3600453a82e"
time-stamp "2020-06-05 17:31:05.659201954"
status ("done" "unknown-op" "error")
)#2020-06-0516:34Phil Jackson(I never see the "state" message, btw)#2020-06-0516:34dpsuttonsounds like a bad nrepl server then. i think everyone should be able to respond to version?#2020-06-0516:36Phil JacksonOk, what's the helpful thing for me to do, raise a bug with all of this information?#2020-06-0516:37Phil JacksonLike I said, jack-in works fine.#2020-06-0516:39dpsuttonwhy does jack-in work in a cljs project?#2020-06-0516:39dpsuttonhow are you starting your project?#2020-06-0516:40Phil Jacksoncider-jack-in-cljs specifically.#2020-06-0516:41dpsuttonok. that ensures that cider-nrepl is present. how are you starting up your app?#2020-06-0516:41Phil JacksonThe thing that's not working is cider-connect-cljs to a shadow-cljs watch dev.#2020-06-0516:41dpsuttonunderstood#2020-06-0516:42dpsuttonit sounds like you are missing the cider-nrepl middleware from your classpath#2020-06-0516:43dpsuttonlook in your *Messages* buffer for how CIDER starts up the shadow-cljs server#2020-06-0516:43dpsuttonit will include the cider-nrepl middleware#2020-06-0516:47Phil JacksonYep, you nailed it. If I include cider-nrepl in my deps it works.#2020-06-0516:47Phil JacksonThanks for helping me debug that!#2020-06-0516:49dpsuttonbut this should probably be a ticket/issue. CIDER should handle the lack of cider-nrepl gracefully if missing features#2020-06-0520:03bozhidarGood point. It seems it used to handle it just fine before the pending state was added, as I see in the state handler that it does nothing in the absence of the middleware. I assume before we added pending the state started as cljs and probably we need to do something similar.#2020-06-0516:51Phil JacksonI'll update the docs as a starter.#2020-06-0517:02Phil JacksonRaised a PR.#2020-06-0601:13ro6[nREPL] Starting server via "c:/Program Files/nodejs/npx.cmd" shadow-cljs -d nrepl:0.4.5 -d cider/piggieback:0.3.10 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.19.0-SNAPSHOT server...
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: shadow-cljs - config: c:\Users\my\project\path\shadow-cljs.edn
shadow-cljs - starting via "clojure"
=============================================================================
WARNING: The configured :dependencies in shadow-cljs.edn were ignored!
When using :deps they must be configured in deps.edn
==============================================================================
clojure : Couldn't find 'java'. Please set JAVA_HOME.
At line:1 char:1
+ clojure -Sdeps `{:aliases` `{:shadow-cljs-inject` `{:extra-deps` `{nr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Clojure
Trying to cider-jack-in-cljs on Windows from Spacemacs.
clojure CLI is installed and working when run directly from PowerShell. Also, $env:JAVA_HOME is correctly set. Any ideas or debugging tips?#2020-06-0601:23dpsuttonI see lots of ancient versions. You’re six versions back on cider and a major version back on piggieback and 3 major versions back on nrepl#2020-06-0601:24dpsuttonBut also I’m seeing issues with deps.edn and shadow-cljs.edn fighting over who is in control#2020-06-0619:17David Pham@robert.mather.rmm Can you start shadow-cljs watch app?#2020-06-0619:18David PhamMy experience with shadow-cljs is that is much better start the process in the terminal and connect to it from cider without C-c M-C#2020-06-0619:19David PhamMaybe remove your deps as well.#2020-06-0620:26ro6@neo2551 Thanks, that's working much better. I'm used to Cursive, where I can stash one-off sexpers I want to eval inside a (comment ...) and send the "top-level" (not including the comment block) form to the REPL with a single command. Is there something similar in CIDER?#2020-06-0620:28ro6I'm talking about nothing more than having the cursor/point somewhere within the form I want to eval, not highlighting it, or being right at the end or something. Being able to eval either the topmost containing form, or the immediately containing form would be nice.#2020-06-0620:29dpsuttonthere is. check (setq clojure-toplevel-inside-comment-form t)#2020-06-0620:30dpsuttoni'm also a fan of
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
#2020-06-0620:30dpsuttonthese should be similar to the way that cursive evals things in the repl buffer#2020-06-0620:30dpsuttoni like being able to choose to eval things without leaving a trace, and optionally, to send forms to the repl so see the input and output in the repl buffer#2020-06-0620:54ro6Here's a fun one, what if I want to eval a form in the ns of the current buffer, but without switching the REPL ns. Let's say I want to stay in the 'user' ns because I have some utilities there, and want to eval something without polluting the 'user' ns#2020-06-0620:55ro6So equivalent behavior to 'in-ns' into the buffer ns, eval the form, then 'in-ns' back.#2020-06-0620:59ro6https://github.com/clojure-emacs/cider/raw/master/doc/cider-refcard.pdf
Is a 404#2020-06-0621:03David Phamhttps://github.com/clojure-emacs/cider/blob/master/refcard/cider-refcard.pdf#2020-06-0621:04David PhamI usually go to the end of the sexp and eval it with C-x C-e#2020-06-0621:13ro6Maybe this is something specific to Shadow-CLJS interaction, but I can't eval forms containing functions defined in the buffer. I get undeclared-var warnings that make it look like it's trying to eval under the 'cljs.user' ns even though the REPL buffer shows the correct ns.#2020-06-0621:15thheller@robert.mather.rmm which version do you use?#2020-06-0621:16ro6@thheller 'npm -g' installed 2.9.10 on Windows, calling from PowerShell#2020-06-0621:17thhellerdo you use deps.edn? then only the version included there matters. the npm version is less relevant.#2020-06-0621:20ro6I do, 2.10.0 in deps.edn#2020-06-0622:02thhellerdont use 2.10.0, it has a couple issues with cider. stick with 2.9.10#2020-06-0622:42ro6Ok, I'll try that. Thanks#2020-06-0621:22dpsuttonCider inline sends along the current namespace and it should be evaled there. Insert into repl will not silently adjust the repl like cursive does#2020-06-0621:30ro6Ok. What I'm experiencing though:
1. Start 'shadow watch <build>' from CLI
2. Connect to nREPL from Cider with 'shadow-select' type
3. C-c C-k to load buffer (still see 'cljs.user', not file/buffer ns in REPL buffer)
4. C-c C-c doesn't work due to "Use of undeclared Var" from Shadow
5. C-c M-n n to set the REPL ns to match the buffer (seems to work, the REPL buffer changes to match the file ns)
6. C-c C-c still doesn't work with the same error#2020-06-0621:31ro6So even though the Cider REPL buffer shows the correct ns in the prompt, the warnings coming back from Shadow show everything ns-qualified with 'cljs.user'#2020-06-0621:31dpsuttoni think there's a bug where CIDER needs its middleware on the classpath#2020-06-0621:32ro6cider/cider-nrepl {:mvn/version "0.25.1"}#2020-06-0621:32ro6Something other than that?#2020-06-0621:33dpsuttonwhere is that? in deps.edn?#2020-06-0621:33ro6Yes#2020-06-0621:34dpsuttonok. let me keep looking then#2020-06-0621:35ro6Thanks for the support#2020-06-0621:35dpsuttonmy pleasure#2020-06-0621:35ro6Shadow is configured to use deps.edn, just FYI#2020-06-0621:35dpsutton#2020-06-0621:35ro6This setup works for me from Cursive#2020-06-0621:35dpsuttoni'm able to C-c C-c and get eval inline#2020-06-0621:36dpsutton#2020-06-0621:36dpsuttonand no errors in the repl about unbound vars#2020-06-0621:37dpsuttoni did diverge a bit from your steps. i'm not using deps.edn, and i did shadow-cljs -d cider/cider-nrepl:0.25.1 server and then issued the watch from the repl#2020-06-0621:37dpsuttonbut i think this should more or less be equivalent#2020-06-0621:38ro6#2020-06-0621:38dpsuttonwhat is your CIDER version? i thought i remember it being quite old#2020-06-0621:38ro6=> nil
So we diverge right there.#2020-06-0621:38dpsuttonagreed.#2020-06-0621:39ro6CIDER 0.19.0snapshot (package: 20181021.830), nREPL 0.7.0#2020-06-0621:39dpsuttoncan you try m-x nrepl-toggle-message-logging and try that again#2020-06-0621:39ro6Wow, that is old.#2020-06-0621:39dpsuttonare you opposed to upgrading? i think we might be diagnosing a bug from over two years ago#2020-06-0621:40ro6I'm using Spacemacs (new to Emacs), just followed their Clojure layer instructions. I'm surprised it's that far back by default.#2020-06-0621:40ro6Not at all opposed, just not sure how.#2020-06-0621:41dpsuttoni think there is a #spacemacs channel. I don't use it so can't help you with that#2020-06-0621:41ro6Ok, thanks. Sorry, didn't realize it was that far back.#2020-06-0621:42dpsuttonno worries at all#2020-06-0621:42dpsuttonbut once you're up to date i'll work with you until you've got a happy repl experience#2020-06-0622:42ro6Ok, I'll try that. Thanks#2020-06-0622:58ro6@thheller @dpsutton Downgrading Shadow helped. Now I can get to a usable REPL, but there's still some disconnect in the state of the systems. For example, before explicitly loading the buffer (C-c C-k), I'm able to eval a pure function with C-c C-c and get the right result inline, but Shadow still warns "undeclared var". After loading, the warnings go away and things work cleanly.#2020-06-0622:58ro6It's as though different systems are relying on different sources to determine the runtime state.#2020-06-0622:59ro6Fortunately, this is good enough for me to get to work, so thank you both!#2020-06-0623:01dpsuttondo you have a repo that's very bare and can reproduce in?#2020-06-0623:01dpsuttoni'd like to run exactly what you are running#2020-06-0623:12dpsuttonok. i can recreate in 2.10.4 when running with deps. no idea why this is different but at least i can reproduce now#2020-06-0623:14dpsutton(-->
id "14"
op "eval"
session "1fee8a75-f0c8-4546-8195-edba9b2588b0"
time-stamp "2020-06-06 18:11:35.918714000"
code "(defn ^:dev/after-load start []
(r/render [app]
..."
column 1
file "/Users/dan/projects/clojure/shadow/src/app/main.cljs"
line 11
nrepl.middleware.print/print "cider.nrepl.pprint/pr"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? nil
ns #("app.main" 0 8 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
)
that seems like a valid nrepl message.#2020-06-0623:18dpsuttoni think shadow maybe used to load the namespaces when compiling. it seems like it now until the namespace has been created, evaluating in that is throwing an error. seems much closer to clojure and correct now i think#2020-06-0702:43stardivinerI'm newbie using Luminus lein new luminus myshadow +cljs +shadow-cljs But I got problem to get a browser-repl code compltion like (js/alert ..) in Emacs CIDER. Does any one have a complete steps how to do this? This problem really troubled me a long time.#2020-06-0702:44dpsuttonYou are wanting completion for things like js/document and js/alert?#2020-06-0702:47stardivinerYes#2020-06-0702:47dpsuttonthere's some experimental support for that but its quite fragile in my experience#2020-06-0702:48dpsuttonhttps://docs.cider.mx/cider/cljs/configuration.html#enhanced-completion#2020-06-0702:48dpsuttonI've usually kept it turned off to be honest#2020-06-0702:50stardiviner@dpsutton Usually how do you setup the CIDER connection to shadow-cljs? I'm now confused what's the simple and correct way, I check many differnet steps.#2020-06-0702:51dpsuttoni usually just do cider-jack-in-cljs#2020-06-0702:51dpsuttonand then choose the options. its probably better to start up shadow's server on the command line though#2020-06-0702:52dpsuttonshadow-cljs -d cider/cider-nrepl:0.25.1 server and then cider-connect-cljs choose shadow-select. then (shadow/nrepl-watch :app) and then (shadow/nrepl-select :app)#2020-06-0702:53stardivinerNew method learned, Hope get luck.#2020-06-0702:58stardivinerAfter shadow-cljs -d ... server I use cider-connect-cljs command, In CIDER prompt, it seems did not detect the correct port. which port should I use?#2020-06-0823:22ro6You can pin the Shadow-CLJS port via the {:nrepl {:port <PORT>}} config option. I'm not sure they set the .nrepl-port file like Lein does.#2020-06-0907:58thhellershadow-cljs creates .shadow-cljs/nrepl.port#2020-06-0703:03dpsuttoni don't know#2020-06-0703:03dpsuttonit seems to work for me#2020-06-0703:03dpsutton#2020-06-0703:03dpsuttonyou can just type in the port and it should work though#2020-06-0703:03dpsuttonthat's just a convenience i believe#2020-06-0703:04stardivinerI choose the 7002 port from command-line, then (shadow/watch :app) then (shadow/nrepl-select :app) . All works fine. But browser code completion still not available. Should I choose :browser-repl target instead?#2020-06-0703:07dpsuttonNo. Are you talking about completion of cljs vars or things like js/alert?#2020-06-0703:08stardivinerBoth, I want to get both code completions.#2020-06-0703:08stardivinerOr just only one of them can be archived?#2020-06-0703:15stardivinerI tried the :browser-repl after cider-connect-cljs and shadow-cljs, At first time, it does not get code completion, Now it works fine now.#2020-06-0703:15stardivinerdpsutton, thanks for your help. Really solved my big problem.#2020-06-0707:57David Pham@robert.mather.rmm If you are totally new to Emacs, I would recommend prelude Emacs also from Bugs (the creator of Cider). It is smoother and lighter than spacemacs. As for spacemacs, did you download the master or develop branch? Master is outdated last time I checked.#2020-06-0823:26ro6Thanks. I did Spacemacs master. The #spacemacs folks suggested trying develop as well. I'm a Vim user, so Evil mode is helpful for me. I'm guessing prelude is normal Emacs keybinding?#2020-06-0823:22ro6You can pin the Shadow-CLJS port via the {:nrepl {:port <PORT>}} config option. I'm not sure they set the .nrepl-port file like Lein does.#2020-06-0811:02jumar#2020-06-0813:35bozhidarI don’t there’s a great approach today, as adding an advise won’t work reliably due to the async nature of eval. It’d be best to add some load-file-hook that gets triggered once load-file completes.#2020-06-0813:38bozhidarActually I see that you can provide a custom done handler even today:
(defun cider-load-file-handler (&optional buffer done-handler)
"Make a load file handler for BUFFER.
Optional argument DONE-HANDLER lambda will be run once load is complete."
(let ((eval-buffer (current-buffer)))
(nrepl-make-response-handler (or buffer eval-buffer)
(lambda (buffer value)
(cider--display-interactive-eval-result value)
(when (buffer-live-p buffer)
(with-current-buffer buffer
(cider--make-fringe-overlays-for-region (point-min) (point-max))
(run-hooks 'cider-file-loaded-hook))))
(lambda (_buffer value)
(cider-emit-interactive-eval-output value))
(lambda (_buffer err)
(cider-emit-interactive-eval-err-output err)
(cider-handle-compilation-errors err eval-buffer))
(or done-handler '())
(lambda ()
(funcall nrepl-err-handler)))))#2020-06-0813:38jumarHmm, that's too bad. So if I define my own function that calls cider-load-buffer and then instrument it won't work properly, right?#2020-06-0813:39bozhidarYep. Although a bit of sleep is probably going be enough for most instances. You can define your own wrapper around cider-load-file that provides a custom load-file-handler and this would work.#2020-06-0818:45Joshua SuskaloI'm currently trying to make a version of promise-chan which is derefable in order to allow parking to be used to dereference some promises returned from my api, without causing a breaking change or requiring a duplicate namespace to be created, but I'm running into an issue. I've got a print-method defined and preferred for my new deftype which contains a promise-chan, but because it implements clojure.lang.IDeref, cider seems to be blocking on it to try to print it if I ever return one on the repl, even if cider.nrepl.print-method/*pretty-objects* is set to nil.#2020-06-0818:46Joshua SuskaloIs there any way I can change that behavior without my library depending on nrepl or cider itself?#2020-06-0818:46Joshua Suskalo(for example having a metadata-defined protocol implementation which fixes it or something)#2020-06-0819:08Jim Newtoncan someone remind me how to tell cider to restart lisp ? as opposed to restart the repl but keep the same lisp image?#2020-06-0819:15David Pham@bozhidar I know you have other things on your plate, but do you know if clj-suitable is still maintained? Because shadow-cljs and Cider are incompatible for the new version of shadow-CLJS.#2020-06-0819:57bozhidarYeah, I’m aware of the problem. I think @U08LZDL1H still maintains clj-suitable.#2020-06-0819:58robertkrahnI do, i’ll have look#2020-06-0901:02robertkrahnHi @bozhidar! Can we default to (setq cider-enhanced-cljs-completion-p nil) for shadow cljs repls for now? It’ll probably take me a while to adapt @U05224H0W changes. Tested with suitable disabled and static completion continues to work fine. Will let you know when I have a new version. Thanks!#2020-06-0905:53bozhidar@U08LZDL1H We can, but the problem is that won’t help. As some functions are now missing suitable blows up when you require it. At least this is what some users of Calva had observed. Haven’t had much time to investigate the details though.#2020-06-0908:00thheller@U08LZDL1H did you see https://github.com/rksm/clj-suitable/issues/15? I'd assume adopting that should be fairly straightforward? I added the cljs-eval so it is in 2.10.4#2020-06-0921:42robertkrahnHi Thomas, yep I’ve seen that and it is very helpful, thank you! I don’t think that we need anything other than an eval function. The only issue is that I’ve currently trouble allocating time for working on that, but I’ll try to make progress.#2020-06-0819:19dpsutton@jimka.issy sesman-restart-session is what you're looking for#2020-06-0819:21Jim NewtonThanks, but I'll never remember that. Isn't that a pretty obscure name?#2020-06-0819:23Jim NewtonLooks like sesman-restart-session needs two arguments. Which arguments can I give it?#2020-06-0819:26dpsuttonits an interactive command for me. so just m-x sesman-restart#2020-06-0819:26dpsuttonoh. not the session version. just sesman-restart sorry about that#2020-06-0819:26dpsuttonC-c C-s r for me#2020-06-0900:46Joshua Suskalo@bozhidar you have any suggestions for my problem, where I'd like to prevent a value which implements IDeref from being derefed when it's pretty printed as a return value in cider?#2020-06-0900:54dpsuttonI can look in a bit but I’m guessing it’s an extend method we added to the print mechanism. Should be overridqble back and that is a bug in my view#2020-06-0900:59dpsuttonHmm. This sounds weirder and weirder. Since derefing can trigger blocking and on delays can trigger computation prematurely. #2020-06-0901:07Joshua SuskaloYeah, I also implement IBlockingDeref and that impl isn't used ever#2020-06-0901:08Joshua SuskaloThe problem is I'm trying to implement custom promises in order to prevent a breaking change to my api, but I don't want to have to require my users have cider or nrepl on their classpath to run the application, but I also don't want it to hang if they try something out on the repl#2020-06-0901:14dpsuttonYeah agreed#2020-06-0901:14dpsuttonHopefully there’s a way to fix up in code without waiting on a release#2020-06-0901:29dpsutton(def ^:dynamic pretty-objects
"If true, cider prettifies some object descriptions.
For instance, instead of printing functions as
#object[clojure.core$PLUS 0x4e648e99 \"clojure.core$PLUS@4e648e99\"]
they are printed as
#function[clojure.core/+]
To disable this feature, do
(alter-var-root #'cider.nrepl.print-method/pretty-objects not)"
true)#2020-06-0901:30dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/print_method.clj#2020-06-0901:31dpsuttonYou can turn it off with that dynamic var. can probably easily redef the print-method for ideref in your repl and that should be removed I think#2020-06-0904:46dpsutton@suskeyhose i'm looking into this some more. I see that the printer for the c.l.IDeref checks to see if a) its also IPending and b) if so, if its realized. (https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_print.clj#L436-L457). Is it possible for you to also add IPending to your custom promise types such that the printer works better? I still think this is a bug in cider-nrepl but this also might allow you to add a bit more onto your type to make it a bit better as well#2020-06-0904:50dpsuttonI'm actually less convinced this is a bug. in a bare clj repl:
~/p/d/cider-nrepl ❯❯❯ clj
Clojure 1.10.1
user=> (reify clojure.lang.IDeref (deref [_] (do (prn "i'm gonna sleep a while") (Thread/sleep 3000) :slept/value)))
"i'm gonna sleep a while"
#object[user$eval136$reify__137 0x29182679 {:status :ready, :val :slept/value}]
user=>
just printing the reify will cause it to deref. the printer side-effects that. You need to add the IPending instead#2020-06-0905:58bozhidarSeems I’m late to this conversation and you’ve made plenty of progress without me. Might be a good idea to move this to some issue, so that the important points won’t get lost with the Slack history.#2020-06-0908:35Parenoidcross post alert! posted in #clojurescript, too...#2020-06-0908:35Parenoidto try the code at https://www.learn-clojurescript.com/section-1/lesson-8-capstone-weather-forecasting-app/ I created the project with
lein new figwheel cljs-weather -- --reagent
added the code and dependencies, and then ran
yarn
then opened the project in emacs, where I ran
cider-jack-in-clj&cljs
and the project opened in my browser. I can evaluate simple forms in core.cljs like (+ 1 1) with cider-eval-defun-at-point but trying to evaluate the ns form or, trying to get data from the web with (GET <some url>) causes me to get
Caused by java.lang.RuntimeException
Unable to resolve symbol: GET in this context
so, what do I have to do to be able to evaluate forms in my buffer as with clj in a cljs project?#2020-06-0909:17bozhidar@patrickanium I guess you forgot to load the buffer first (`C-c C-k`) and your requires are not in scope.#2020-06-0913:46Jim NewtonI've defined a record named Foo with a print-method and in the cider repl, it seems to ignore my print-method . Is that normal? My emacs value of cider-print-fn is pprint and I have not set this value anywhere. Its the value out-of-the-box as far as I know.#2020-06-0913:47Jim NewtonAt the moment I don't know if it is a Clojure bug, or a cider but, or a Jim bug.#2020-06-0913:47Jim Newtonclojure-rte.core> (defrecord Foo [x])
clojure_rte.core.Foo
clojure-rte.core> (map->Foo {:x 100})
{:x 100}
clojure-rte.core> (defmethod print-method 'Foo [v w] (.write w (format "#<Foo x=%s>" (:x v))))
#multifn[print-method 0x7665aecc]
clojure-rte.core>
{:x 100}
clojure-rte.core> (pprint (map->Foo {:x 100}))
{:x 100}
nil
clojure-rte.core> (print (map->Foo {:x 100}))
#<Foo x=100>nil#2020-06-0914:06dpsuttonIf you do these steps in a simple “clj” repl is the behavior the same?#2020-06-0914:07Jim Newtonyou mean cli from the shell command line?#2020-06-0914:09Jim Newtonfrom the clj repl it seems to work.
user=> (defrecord Foo [x])
user=> (defrecord Foo [x])
user.Foo
user=> (defmethod print-method 'Foo [v w] (.write w (format "#<Foo x=%s>" (:x v))))
user=> (defmethod print-method 'Foo [v w] (.write w (format "#<Foo x=%s>" (:x v))))
#object[clojure.lang.MultiFn 0x61e3cf4d "clojure.lang.MultiFn@61e3cf4d"]
user=> (map->Foo {:x 100})
user=> (map->Foo {:x 100})
#user.Foo{:x 100}
user=> #2020-06-0914:22Jim Newtonif I change the emacs variable
(setq cider-repl-use-pretty-printing nil)
then the repl prints using my print-method ... this seems to indicate a bug in the cider-pprint-fn implementation, that it neglects to take print-method into account. right?#2020-06-0913:50ziltiAh nevermind, it was my own user.clj causing the issue...
But anyway, CIDER is still broken with the most recent shadow-cljs ("missing instance")#2020-06-0916:01bozhidarSee https://github.com/rksm/clj-suitable/issues/15 Best you can do is to downgrade shadow for now.#2020-06-0916:31ziltiOh... thanks!#2020-06-0919:59thhellerthat has nothing to do with missing instance.#2020-06-0919:59thhellermissing instance means shadow-cljs is not started in the process you are connected to. so maybe just connected to wrong nrepl server?#2020-06-1009:22ziltiI did a jack-in, not a connect. Seems like it is the issue that's also open about cider not working when shadow uses deps.clj for dependencies.#2020-06-1009:28thhellerthis just means you need to start shadow-cljs before using it ...#2020-06-1009:29thheller(require 'shadow.cljs.devtools.server) (shadow.cljs.devtools.server/start!)#2020-06-1009:30thhellerno clue if cider is supposed to do that on its own at some point or what jack-in does exactly#2020-06-1009:34ziltiYes, jack-in is supposed to start the nrepl server, be that via CLI tools, Leiningen, Boot, or Shadow.#2020-06-1010:16thhellernrepl server yes but that has nothing to do with shadow-cljs#2020-06-1010:17thhellerbut I don't know anything about cider ... I'm just telling you that if you get a missing instance then the shadow-cljs server is not started. whether it is your job to start it or ciders I don't know.#2020-06-1503:23David Pham@bozhidar can we have a flag to remove clj-suitable while it is not working with shadow-CLJS?#2020-06-1508:26bozhidarThis will require a new release of CIDER and cider-nrepl, as we’ll need to dynamically load clj-suitable for this to work. There’s already a flag that disables suitable even today, but the current problem happens at load time and the flag doesn’t help with it.#2020-06-1508:29bozhidarI can look into this later today or tomorrow if there’s no fix for suitable by then.#2020-06-0914:24Joshua Suskalo@dpsutton Thanks for the tip! Just implementing a basic implementation of IPending fixes the issue.#2020-06-0916:24iperdomoHi all, lein 2.9.3 depends on nREPL 0.6.0 (https://github.com/technomancy/leiningen/blob/2.9.3/project.clj#L21) and the most recent version of cider-nrepl v0.25.2 depends on nREPL 0.7.0 (https://github.com/clojure-emacs/cider-nrepl/blob/v0.25.2/project.clj#L7) ... how I can deal with this conflict if my project.clj defines :pedantic? :abort ?#2020-06-0916:32iperdomolooking at https://docs.cider.mx/cider/caveats.html#injecting-dependencies-and-leiningen-pedantic-abort-mode#2020-06-0916:57bozhidarYou’re at the right place. 🙂#2020-06-0917:04Parenoid@bozhidar how do I get the requires in scope?#2020-06-0917:07ParenoidI loaded the buffer with C-c C-k but it errors on the first form (the ns one with the require).#2020-06-0917:08Parenoidwhoa... just changed to clojurescript-mode (M-x clojurescript-mode) and it works!#2020-06-0917:09Parenoidthanks for the help 🙂#2020-06-1108:05andrea.crottidoes anyone use cider-auto-test-mode
any idea how to disable that for clojurescript buffers?#2020-06-1108:30bozhidar@andrea.crotti I’m afraid we didn’t think of this, so it’s a bit hacky. You’ll have to redefine cider--test-silently. You might file a ticket for an improvement and I’ll look into adding some configuration about this or just filtering out the cljs stuff automatically.#2020-06-1115:52andrea.crottiOk thanks I'll try#2020-06-1222:59naomarikI started a deps.edn project finally and trying to get a similar workflow I had with lein repl. With lein repl it had an :init-ns option where I would start my whole app and I can just use cider-connect and have the whole context loaded already to eval anything anywhere in the codebase immediately.
From what I'm seeing from all the docs, you should use cider-jack-in or have a :cider-clj alias but this doesn't bring in any context of the app, basically just giving you a repl with nothing loaded.
I've worked around this by having a main function from my dev profile that will launch a repl that I can connect to and everything is already started. I feel I spent a bit too much time to arrive to this and there may be an easier way. What are you guys doing?
(defn -main [& args]
(spit ".nrepl-port" 39000)
(nrepl-server/start-server :port 39000
:handler (apply nrepl-server/default-handler
(map resolve (concat
['refactor-nrepl.middleware/wrap-refactor]
cider.nrepl/cider-middleware))))
(core/-main args))#2020-06-1300:13dpsuttonI’d probably do a dev.clj file that required core and called main. Don’t see the benefit of starting up your own server and connecting to it to save one requiring resolve in a user.clj#2020-06-1314:59mister_mHello - when I activate the namespace of a particular buffer I am in with C-c M-n M-n, is there a fast way to flip back to the previous namespace? Or is the standard mode of doing that simply M-x cider-repl-set-ns ?
I find myself wanting to test a couple things inside of a namespace in the repl, then jump back to my core namespace so I can use the doc function, for instance.#2020-06-1315:05Drew Verleeif i try to debug a function, and step "in" to a function from the same ns, emacs goes into "insert" mode. This is probably because of how spacemacs is setup. What would be a good way to handle this? could bind "in" to something else? Or is there an easy way to have the debug mode be the final say in this case?#2020-06-1315:09dpsutton@radicalmatt you can evaluate things inline without setting the repl ns. it should evaluate things in the correct ns. an easy thing to do is to use comment forms (the infamous "rich comment block") and this way you don't have to set your repl ns but it just works#2020-06-1315:21dpsutton@radicalmatt note my repl buffer's namespace is user but i can still evaluate things in my comment buffer in the stuff.whatever namespace using aliases only defined there#2020-06-1315:22dpsutton@drewverlee i think asking in #spacemacs might be better. that sounds like just keymap clashes and might be something that the clojure layer would want to take as a patch#2020-06-1315:42mister_m@dpsutton that's a good tip, thank you#2020-06-1416:20Drew Verleewhats the best way to view all the functions defined in a current project? I guess i'm thinkng like clojure doc but in my editor?
seems like cider-arpops with a top level namespace does this...
cider-browse-ns almost does this but i have to select 1 namespace, rather then a group funtion and show the namespace.
this might be something i can do with clojure core functions...#2020-06-1417:38practicalli-johnI use helm-swoop on the project, SPC / or SPC s p in Spacemacs, and use defn as the search pattern. Navigating the list of matches shows the code for each function.
I assume this is not quite what you were looking for, but I do find it quite useful.#2020-06-1417:50Drew VerleeThats what i have been doing, just seeing what other options there are#2020-06-1506:07Michaël SalihiAnother option with Spacemacs, is to use SPC i j (spacemacs/helm-jump-in-buffer) which give you more accurate Helm result based on semantic.#2020-06-1417:40bozhidar> whats the best way to view all the functions defined in a current project? I guess i’m thinkng like clojure doc but in my editor?
I don’t quite get this. What exactly are you aiming to do?#2020-06-1417:49dominicmApropos can be restricted to a project.#2020-06-1514:15Drew Verleehow is this done? is it by searching for a top level namespace of the project?#2020-06-1516:22dominicmYep. It looks for common roots, and uses that to figure out what is project and what isn't#2020-06-1507:55plexuswhen I open a sibling repl, is there a way to tell CIDER that in-buffer eval should go to that REPL?#2020-06-1507:59bozhidarI think CIDER currently picks the most recently used REPL if you’ve got siblings. Don’t recall if there was a way to force this, other can evaluating something in the one you want to use.#2020-06-1518:14David PhamIs it possible to make shadow-CLJS 2.10.X without the error message from Cider?#2020-06-1610:36bozhidarI’ve just pushed a snapshot update that doesn’t load the problematic suitable completion. Don’t have the time to actually test it, but I guess it should work.#2020-06-1616:06David PhamThanks!!#2020-06-1518:28Drew Verleewhen i run cider-eval-all-files and point it at a dir i would expect any updated expressions in those files to get picked up. Thats the intended effect right? i dont think its what im seeing#2020-06-1520:15Drew Verleeor i guess the better question is, how do i get a complete re-eval of all the namespaces?#2020-06-1520:22hindolCIDER may have something. I don't know it.
I just came to say, look up tools.namespace project. It's the "official" way of reloading stuff.#2020-06-1609:17hindolhttps://github.com/clojure/tools.namespace#2020-06-1610:46bozhidarcider-refresh is a wrapper around that library.#2020-06-1610:54hindolThat's very convenient. I did not know. Thank you.#2020-06-1610:39practicalli-john@drewverlee I have just tried cider-eval-all-files from the project-name/src directory and it does load in new definitions (Edit: it does not unload stale definitions). I tested this function using the latest Cider 0.25 with Spacemacs and a deps.edn project. It does seem to run in the background if used on a larger project or code that is long running, so its not tying up Emacs.
It fails if the code doesn't compile though, but I would expect that :)
cider-ns-refresh is what I would probably use if I wanted to refresh all the code in the REPL#2020-06-1610:45bozhidarIt should not unload anything, as it’s pretty basic:
(defun cider-load-all-files (directory)
"Load all files in DIRECTORY (recursively).
Useful when the running nREPL on remote host."
(interactive "DLoad files beneath directory: ")
(mapcar #'cider-load-file
(directory-files-recursively directory "\\.clj[cs]?$")))#2020-06-1610:45bozhidar(eval-all-files is just an alias for that one)#2020-06-1610:48practicalli-johnAh my bad, the definitions are in the REPL, its just clj-kondo telling me the function doesnt exist anymore 🙂 I corrected the original reply to avoid confusion...#2020-06-1612:54papachanIs it doable to keep the output from a cider-eval-sexp-at-point inside the clj file? so i can save it with all the results printed. i remember having this with lispxmp and emacs lisp.#2020-06-1613:24dpsuttoncider-eval-print-last-sexp and cider-pprint-eval-defun-at-point might be helpful for you#2020-06-1621:02papachanAh cool i just binding the cider-eval-print-last-sexp to a key and now i can C-c C̣-f and C-c C-ạ and it print the last output into the file.#2020-06-1614:31Drew Verleeon a fresh project built with clj-new i can confirm that "cider-refresh" correctly finds new symobls (functions, etc). However, on the current project i'm working on, it doesn't. on top of which, after using it. when i eval my namespace it complains that i'm re aliasing something in the ns, which it doesn't. Does this sound familiar to anyone?
In short, what works for me is directly re-evaling the new symbols/functions and killing and restarting my repl.#2020-06-1617:06eval-on-pointis there a variable that lets me specify how the inspector will display the inspected's contents? I want maps to generally be printed with a kv pair per line#2020-06-1617:28yuhanyou can toggle line truncation#2020-06-1617:28yuhanand add that to cider-inspector-mode-hook to have it done all the time#2020-06-1617:38eval-on-pointclose enough, thanks for the idea!#2020-06-1708:34papachanis there a way to unbind the <return> key from cider repl?#2020-06-1708:48papachanFrom the docs:
(define-key cider-repl-mode-map (kbd "RET") #'cider-repl-newline-and-indent)
#2020-06-1710:48bozhidarIt’s always nice to see someone reads them. 🙂#2020-06-1709:02tianshuIs it possible for a macro to tell cider which string is a docstring? something like :style/indent.#2020-06-1710:49bozhidar@doglooksgood Currently not. What’s your usecase?#2020-06-1712:31tianshuI just curious, the docstring for user macros, can't get a correct highlight.
anyway, this is not important.#2020-06-1713:03bozhidarAh, I think I misunderstood you. clojure-mode has some degree of configurability about this, but I guess it depends on the macro.#2020-06-1719:04manas_marthiI want to remap M-e to eval last sexp. how to do it? please help.
I tried this `(define-key cider-repl-mode-map (kbd "M-e") #'cider-eval-last-sexp )` but it did not work (edited)
This is the error Symbol's value as variable is void: cider-repl-mode-map#2020-06-1720:41dpsuttontrying (require 'cider) or (require 'cider-repl) before defining it.#2020-06-1722:48manas_marthithank you.
(require 'cider-eval)
(define-key clojure-mode-map (kbd "M-e") #'cider-eval-last-sexp )
#2020-06-1722:48manas_marthithis worked#2020-06-1723:18Scott SilverIf you’re working in some namespace
(ns some.namespace
(:require
[clojure.spec.alpha :as s]))
(s/fdef add-pos-ints
:args (s/cat :a pos? :b pos?))
(defn add-pos-ints [a b]
(+ a b))
and then enable spec instrumentation in the repl:
some.namespace> (require '[clojure.spec.test.alpha :as stest])
some.namespace> (stest/instrument)
then spec will give you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)
-- Spec failed --------------------
Function arguments
(... -1)
^^
should satisfy
pos?
-------------------------
Detected 1 error
but if you then reevaluate the buffer (say by calling cider-eval-buffer), then instrumentation no longer gives you the errors you’d expect:
some.namespace> (add-pos-ints 1 -1)
=> 0
this makes sense with the way instrumentation works, but it’s a frustrating development experience to have to call (stest/instrument) every time you reevaluate something.
is there any way to have spec instrumentation always be “on” in Cider?
for instance, is there some way to define a hook that would get called whenever you call cider-eval-buffer , so you could automatically call (stest/instrument) ?#2020-06-1800:56Drew Verlee@scott.silver why do you need to call instrument again? I have forgotten how that works.#2020-06-1803:34jumar@scott.silver that's how I do it and I agree it's frustrating.
@drewverlee the problem is that after you eval the buffer all your instrumentation is gone for those functions and does no fdef spec errors will be catched.
Apart from having a custom "eval buffer" function which would call stest/instrument under the hood I'm not aware of any other solution.
I might ask in #clojure-spec since it's not necessarily specific to cider#2020-06-1804:25Scott Silverthanks @jumar; is it possible to define a custom “eval buffer” function?#2020-06-1804:34dpsuttonCan you replicate this in just a bare clj repl? It’s not clear to me if CIDER is doing something bad or if just instrumentation is a bit sensitive#2020-06-1805:48jumarI don't think it's an issue with cider it's just about improving the workflow when using cider - see follow-up in #clojure-spec : https://clojurians.slack.com/archives/C1B1BB2Q3/p1592451407375900#2020-06-1805:49jumarIt's how it works in any repl/tool I believe - the functions you re-evaluate aren't instrumented anymore and you need to call stest/instrument manually#2020-06-1807:16bozhidarI don’t use spec, so I can’t provide much input on the subject. I guess the simplest solution would be to avoid eval-buffer after the first time and just re-eval updated expressions. We can also have some eva-buffer-hook where you can trigger some additional evaluations if needed.#2020-06-1808:13jumarI think problem remains even when you eval a single defn - the instrumented version os gone. But it’s for sure a smaller problem #2020-06-1808:41bozhidarSo, this instrumentation adds some metadata and the metadata gets reset, right?#2020-06-1811:12jumarI think it replaces the function with a wrapper which checks the spec and then calls the original fn#2020-06-1817:13Scott Silveryep @jumar, that’s my understanding, too:
https://github.com/clojure/spec.alpha/blob/f23ea614b3cb658cff0044a027cacdd76831edcf/src/main/clojure/clojure/spec/test/alpha.clj#L176#2020-06-1817:20Scott Silver@U051BLM8F I think adding an eval-buffer-hook would solve this issue; I personally would find it extremely useful.
would that be a difficult feature to add?#2020-06-1906:52bozhidarIt’s pretty simple to add the hook. Please, file some ticket on GitHub so I wouldn’t forget about this.#2020-06-1812:33practicalli-john@jumar I define a collection of all the functions to be instrumented and pass them to the spec instrument function using a helper function. Then if I evaluate any function definitions I call the helper function and all the functions are instrumented again. If there was a post-eval hook that calls the helper function, then that could be convenient.
For example https://github.com/practicalli/spec-generative-testing/blob/prime/src/practicalli/card_game_specifications.clj#L66-L83#2020-06-1813:26jumarThat's interesting but that won't work for me. It's a tedious work to keep this up-to-date and other devs aren't gonna do it 🙂#2020-06-1813:40practicalli-johnOh, sorry to hear about that. Maybe one day you will find a more collaborative dev team to work with :white_frowning_face:#2020-06-1812:46Drew Verleean alternative solution, outside cider, that might be more in keeping with how the creators imagined spec would get it's main utality is you do generative testing of your application. It seems unlikely that clojure wil merge with typed clojure anytime soon so i expect there always to be a friction in doing these sorts of things. If you want to jump that fence part way you can try orchestra though.#2020-06-1817:19Scott Silver@drewverlee what do you mean when you say that Orchestra can get you there part-way?#2020-06-1818:44Drew Verleehttps://github.com/jeaye/orchestra#2020-06-1813:02solfHas anyone ever wanted to be able to use C-M-x or C-c C-f (in other words, the eval defun-at-point functions) inside a (comment ...) block?
What I'd like is to keep their normal behavior (evaluating the top-level form you're currently in), but having a exception when the top-form is a comment, and evaluating the one-before-top-level form.
It's probably a peculiar need.#2020-06-1813:04solf... as I was looking through cider code to see if I could do it myself, I found a variable that already does it, clojure-toplevel-inside-comment-form. Not so peculiar after all#2020-06-1813:05dpsuttonyup! couldn't live without it#2020-06-1813:06solftime to read through all the cider options again ahah#2020-06-1813:07solfthe last time I did it, I didn't knew enough clojure to know what could interest me#2020-06-1813:02practicalli-johnI find instrumenting fdef specifications convenient during development, to help me if I am calling custom functions with incorrect arguments. Switching instrumentation on an off with a helper has been okay for now. I do want to look at using koacha for testing these before pushing code to a shared repo.
https://github.com/jeaye/orchestra looks interesting, but want to get more comfortable with spec before adopting it.#2020-06-1817:18Scott SilverOrchestra is great, but I don’t believe it would alter the requirement that you run (instrument) after re-evaluating a buffer in the repl.
i think the primary advantage of using Orchestra is that it will check your :ret and :fn specs, whereas clojure.spec.test/instrument will only check the :args#2020-06-1900:24practicalli-johnYes, that makes sense, thank you.#2020-06-1814:51yuhanI just noticed Cider is returning Java member docs and eldoc for unresolved symbols without a period, eg. (shift |) being interpreted as java.lang.StringBuffer/shift#2020-06-1903:39richiardiandreaIt might be, there was a recent bug fix in the info op and it might have cause that. It is a very balance, do you mind opening in a bug report in orchard?
#2020-06-1907:11bozhidarI agree we should be prioritizing Clojure vars in the resolution logic. As for the period - keep in mind that references to methods can appear outside the context (.methodName) - e.g. in (. foo bar) and (.. foo bar baz).#2020-06-1908:10yuhanClojure vars are currently prioritized over Java members, this only seems to happn for unresolved names#2020-06-1908:11yuhanI'll open an issue on Orchard later, was just curious if this was something new or I simply hadn't noticed before#2020-06-1814:51yuhanIs this a recent regression? I don't recall this happening before#2020-06-1822:14naomarik@thheller tells me that shadow-cljs auto-completion is broken in the repl, is there an issue for this I can follow for updates?#2020-06-1906:54bozhidar@naomarik I think that’s fixed in CIDER’s master, as I disabled the broken auto-completion there.#2020-06-1906:55bozhidarSee https://github.com/rksm/clj-suitable/issues/15#2020-06-1907:00zackteoHello! I have a qn on CIDER & Ultra compatibility - I can't tell if it has since been fixed or if I still need to apply the follow patch ... https://github.com/venantius/ultra#using-cider-alongside-ultra#2020-06-1907:18bozhidarNever used ultra myself, so I can’t really comment. It really depends on how exactly they wrote their colorizing middleware, but these days you probably don’t need it, as you can just use CIDER directly with puget.#2020-06-1907:18bozhidarhttps://docs.cider.mx/cider/0.25/usage/pretty_printing.html#2020-06-1907:20zackteoOkay! Shall look into it! Need to slowly configure CIDER ... :x#2020-06-1907:22bozhidarJust remembered that ultra uses whidbey internally and it should in theory work well with nREPL 0.6 (https://github.com/greglook/whidbey/commit/7dd57b922b6259c9b8bd51b3994a5c7df59b88ea). Still, I’d go with CIDER’s puget integration directly, as that’s all that ultra does in terms of colorizing the output.#2020-06-1907:33zackteoAlright! Shall go with that - I looked at Ultra thinking ill use it for lein repl - but realistically I probably will be using the repl mostly within emacs anyway#2020-06-1907:41bozhidarYeah, exactly. If you don’t use a lot the lein repl directly (I don’t use it at all), you won’t benefit much from ultra anyways.#2020-06-1911:35OzHello,
When trying to jack-in with cider, I get this error
[nREPL] Starting server via /usr/bin/npx shadow-cljs -d nrepl:0.8.0-alpha3 -d cider/piggieback:0.5.0 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.3-SNAPSHOT server
[nREPL] server started on 8777
[nREPL] Establishing direct connection to localhost:8777 ...
[nREPL] Direct connection to localhost:8777 established
[nREPL] Establishing direct connection to localhost:8777 ...
[nREPL] Direct connection to localhost:8777 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op eval code (require 'cljs.core))
error in process filter: Sync nREPL request timed out (op eval code (require 'cljs.core))
The error on the pending-repl is
ERROR:ERROR: Unhandled REPL handler exception processing message Unhandled REPL handler exception processing message{ :nrepl.middleware.print/stream? {1, :nrepl.middleware.print/stream? :nrepl.middleware.print/print 1, cider.nrepl.pprint/pprint, :nrepl.middleware.print/print :nrepl.middleware.print/quota cider.nrepl.pprint/pprint, 1048576, :nrepl.middleware.print/quota :nrepl.middleware.print/buffer-size 1048576, 4096, :nrepl.middleware.print/buffer-size :nrepl.middleware.print/options 4096, {:nrepl.middleware.print/options :right-margin {80}, :right-margin :op 80}, init-debugger, :op :session init-debugger, 67d4a7cc-2560-47ef-a567-291e064389e7, :session :id9da9e612-c842-4281-a0a2-4a7aff82b00b, :id 6}
This is probably a configuration problem or version mismatch but maybe you have a hint?#2020-06-1912:24bozhidar@ozfraier See https://github.com/clojure-emacs/cider/issues/2863#2020-06-1912:33OzThank you!
I was using Java 8
Trying with java 11 worked#2020-06-1918:01agAnyone using CIDER with lein-monolith? Have do I force cider-jack-in to always be at the root? This is what I mean, if I have a project with a structure like this:
.
├── project.clj
└── modules
├── module-1
│ ├── project.clj
│ └── src
│ └── module1_main.clj
└── module-2
├── project.clj
└── src
└── module2_main.clj
And my current buffer is on module2_main.clj, if I call cider-jack-in, it does it for the module-2 project. I need to force it to jack-in at the very root. Any ideas how to do that?#2020-06-1918:07dpsuttondefine a jack-in function that has the project root in it#2020-06-1918:09dpsuttonfor instance, mine at work:
(defun aclaimant-jack-in-dashboard ()
(interactive)
(cider-connect-cljs (list :host "localhost"
:port 7888
:cljs-repl-type 'figwheel-connected
'project-dir "~/projects/aclaimant/acl")))#2020-06-1918:09dpsuttonnote the project-dir there. you could set the root rather than any of the modules#2020-06-1918:10dpsuttonand instead of cider-connect-cljs could cider-jack-in-clj or whatever your needs are#2020-06-1918:17agNice. Thank you Dan, seems exactly what I'm looking for#2020-06-2017:08zhuxun2Is there a way to list all publics of a namespace in a helm and navigate through their source code?#2020-06-2017:21jumarIf you want source code why not just jump into the namespace?#2020-06-2017:40zhuxun2I guess jumping is what I do right now but I wish there was something that allows me to glance through all the functions and maybe fuzzy search a function name#2020-06-2019:06dpsutton@U6SEJ4ZUH i think cider-browse-ns achieve this?#2020-06-2106:10jumarThere’s this thing in spacemas I use: SPC i j#2020-06-2017:09zhuxun2It would have been very useful when learning a API-dense library#2020-06-2017:09zhuxun2Sometimes even more useful than the online API reference#2020-06-2020:44Drew VerleeGiven i have a ~/.clojure/deps.edn with a :deps {:extra-deps <some-lib>} i would expect that when i run cider-jack-in in my project i would expect to see <some-lib> on the class path and be able to require it. However, i don't see it and i can't require it.#2020-06-2021:08dpsuttonare those extra-deps under a alias?#2020-06-2021:08dpsuttonjust do it with a bare clj. if it works there it should work with cider#2020-06-2112:20Quentin Le GuennecHi, I need to be able do detach the cider process such as when I exit emacs, cider-jack-in-cljs doesn't fetch dependencies again. Is that possible?#2020-06-2113:27practicalli-johnUnless I miss-understand what you are doing, project dependencies for projects are saved locally, so unless you update the versions of dependencies then they are only downloaded once.#2020-06-2113:28Quentin Le Guennecyes, but for some reason, there are still fetches happening. When I deactivate my VPN (where the dependencies are downloaded), I cannot jack-in.#2020-06-2210:11EdYou can start the JVM process from a shell and then connect to it from Emacs using cider-connect or cider-connect-cljs . If you need to know what Cider is running when you call cider-jack-in, you could look in *messages* where Emacs logs to, or jack in and look in your process list, but it tries to detect what you're using to start your REPL (lein, boot, clj) and injects some dependencies for things like Cider middleware. These are controlled by your settings in Cider.#2020-06-2112:21Quentin Le Guennec(the issue here is that in my case, fetching dependencies takes a lot of time, and I restart emacs quite often)#2020-06-2210:22EdWhy are you restarting Emacs so often? I only restart when I reboot. I start Emacs with --daemon and run emacsclient -c -nw file.clj when I want to edit something from the terminal (and C-x # to tell Emacs I'm done editing that file or C-x 5 0 to close the frame). I also have this in my .zshrc - bindkey -s "^x^f" $'^aemacsclient -c -nw ' for those times when I accidentally hit C-x C-f in the terminal ;)#2020-06-2113:23practicalli-johnIs there a list of all the variables I can set in CIDER? I am creating some example .dir-locals.el files and would like to know what is possible. There are many examples sprinkled in the documentation, https://docs.cider.mx/cider/0.25/config/basic_config.html but it would be useful to have a list of them for reference.
Are they all defcustom names in the cider project? If so, I can use helm-ag to grab them.#2020-06-2114:44dpsuttonThat’s probably essentially all of them. #2020-06-2114:45dpsuttonYou could probably use emacs apropos to grab them #2020-06-2114:45dpsuttonIf there’s a version for just vars #2020-06-2115:11practicalli-johnI created this list from all the defcustom definitions in the CIDER project, there are quite a few.
https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html#2020-06-2115:18dpsuttonCan you easily add the docstrings to that?#2020-06-2115:19dpsuttonThat would be a lovely reference#2020-06-2115:19dpsuttonTo browse and point people to when asking about features#2020-06-2115:23bozhidarM-x customize-group RET cider RET 😉#2020-06-2115:28dpsuttoni never use customize. i prefer to set them explicitly in my init#2020-06-2116:47bozhidarI never use it myself, but it’s still a great way to list all the config options of a certain package.#2020-06-2117:53practicalli-john@dpsutton good idea about the docstrings... I will test my Emacs-fu 🙂#2020-06-2117:54dpsuttonhaha. its great as is since the names are usually descriptive but pointing people to this who might not have the emacs chops to search for vars or know how to do that would be nice. also, maybe a little tutorial on the header of how to do this inside emacs#2020-06-2118:12practicalli-johnI am wondering how to do a search across a project that shows the matching line and the line below. I have helm, helm-swoop and projectile.
helm-swoop does multi-line but doesnt seem to work across a whole project.#2020-06-2118:25dpsuttoni think using elisp to do this would be easier. then you could use sexp-navigation as it should be defcustom name docstring value or defcustom name value. you could capture that and use parseedn to perhaps spit it out as edn?#2020-06-2118:30practicalli-johnOh, if only I had learned elips already... I am still at the copy something from the internet stage...#2020-06-2118:32dpsuttonyeah its clunky at times. i feel slow in it but if you wrote it every day i think it would be easy#2020-06-2119:06dpsutton(let (defcustoms)
(dolist (file (directory-files "/Users/dan/projects/dev/cider" t "\.el"))
(unless (string-match-p "dir-locals" file)
(with-current-buffer (find-file file)
(goto-char (point-min))
(while (re-search-forward "defcustom" nil t)
(let ((custom (substring-no-properties (progn (paredit-forward 1)
(thing-at-point 'sexp))))
(docstring (substring-no-properties (progn (paredit-forward 2)
(or (thing-at-point 'sexp)
"no docstring provided")))))
(push (list (file-name-nondirectory file) custom docstring)
defcustoms))))))
(with-current-buffer (get-buffer-create "*defcustoms-from-cider*")
(dolist (dc defcustoms)
(insert (car dc) " : " (cadr dc) " : " (caddr dc) "\n"))))#2020-06-2119:06dpsuttonreplace the directory-files location with your own#2020-06-2119:13dpsuttonnrepl-client.el : nrepl-message-colors : "Colors used in the messages buffer."
==============
nrepl-client.el : nrepl-log-messages : "If non-nil, log protocol messages to an nREPL messages buffer.
This is extremely useful for debug purposes, as it allows you to inspect
the communication between Emacs and an nREPL server. Enabling the logging
might have a negative impact on performance, so it's not recommended to
keep it enabled unless you need to debug something."
==============
nrepl-client.el : nrepl-hide-special-buffers : "Control the display of some special buffers in buffer switching commands.
When true some special buffers like the server buffer will be hidden."
#2020-06-2119:13dpsuttonuse this version#2020-06-2119:13dpsutton(let (defcustoms)
(dolist (file (directory-files "/Users/dan/projects/dev/cider" t "\.el"))
(unless (string-match-p "dir-locals" file)
(with-current-buffer (find-file file)
(goto-char (point-min))
(while (re-search-forward "defcustom" nil t)
(let ((custom (substring-no-properties (progn (paredit-forward 1)
(thing-at-point 'sexp))))
(docstring (substring-no-properties (progn (paredit-forward 2)
(or (thing-at-point 'sexp)
"no docstring provided")))))
(push (list (file-name-nondirectory file) custom docstring)
defcustoms))))))
(with-current-buffer (get-buffer-create "*defcustoms-from-cider*")
(erase-buffer)
(dolist (dc defcustoms)
(insert (car dc) " : " (cadr dc) " : " (caddr dc) "\n==============\n"))))#2020-06-2200:22practicalli-johnHmm, when I run this script in ielm it openes all the .el files and then seems to stop. A defcustoms-from-cider buffer is not created, or if it is its deleted (assuming that may be what (erase-buffer) does. but I only get nil as the return value, so maybe the information is output elsewhere, but I dont understand where..
Its time for me to sleep, so will take another look in the morning.#2020-06-2201:44dpsutton#2020-06-2214:56rschmuklerHey all! does anybody know if there's a variable / way to have cider in a cljc file only send to one side (ie. I want to evaluate a sexp in just CLJS, or in just CLJ)#2020-06-2214:57dpsuttoni believe it should evaluate in the buffer that was most recently focused. so put point in the cljs repl, then back in the cljc ile and should be good#2020-06-2215:05rschmuklerInteresting#2020-06-2215:05rschmuklerThe behavior I seem to have is it evaluating in both buffers#2020-06-2215:07dpsuttonoh right. i think you can change the mode to clojurescript mode with m-x clojurescript-mode and it shoudl behave as you want#2020-06-2215:08rschmuklerOh, that makes sense!#2020-06-2215:10rschmuklerThanks for the help#2020-06-2215:15CaseyI'm having a helluva time getting cider working with shadow-cljs. I'm fairly certain its a cider/config issue and not a shadow-cljs issue.
The docs at https://docs.cider.mx/cider/cljs/shadow-cljs.html say "Provided you’ve configured your project correctly, you can simply use cider-jack-in-cljs " ... yet I can't find a correct configuration.#2020-06-2215:16dpsuttonconfiguration for what?#2020-06-2215:17CaseyStarting with a fresh shadow-cljs project, I can connect cider to the node-repl, and eval forms in the repl prompt. I can also use cider-eval-last-sexp to eval forms, however cider-eval-buffer doesn't seem to actually eval anything.#2020-06-2215:17dpsuttonalso, are you using lein or deps for dependencies?#2020-06-2215:17Caseyfor deps i'm using shadow-cljs', shadow-cljs.edn #2020-06-2215:18rschmuklerMake sure you have:
:nrepl {:middleware [cider-nrepl.plugin/middleware
refactor-nrepl.middleware/wrap-refactor]}
In your shadow-cljs.edn#2020-06-2215:19CaseyAh, ok, that's definitely missing.#2020-06-2215:20dpsuttoncider-jack-in-cljs will add its needed dependencies#2020-06-2215:20rschmuklerI've run into issues in the past where it adds the deps, but doesn't actually load the middleware in shadow's nrepl. That may be fixed, this was as of a few months ago#2020-06-2215:21rschmukler(But worth trying just to see if that gets it going)#2020-06-2215:21dpsuttonthat's when you are using lein/deps for dependencies#2020-06-2215:21rschmuklerAh, you're right - I am using deps.edn#2020-06-2215:22dpsuttonhere's a clever fix for that from lambda island: https://github.com/lambdaisland/chui/blob/master/.dir-locals.el#L8-L10#2020-06-2215:24Caseyis it just an oversight that thats not added to the docs at https://docs.cider.mx/cider/cljs/shadow-cljs.html ?#2020-06-2215:24CaseyI thought it was strange that it stated Provided you've configured your project correctly but then never provided a configuration, just some commands on how to connect.#2020-06-2215:25dpsuttoncan you post your shadow-cljs.edn file?#2020-06-2215:25Casey{:source-paths
["src/dev" "src/main" "src/test"]
:dependencies []
:nrepl {:middleware [cider-nrepl.plugin/middleware
refactor-nrepl.middleware/wrap-refactor]}
:builds {}}#2020-06-2215:26dpsuttonyou can get rid of the middleware key. i'm surprised to see no builds there though#2020-06-2215:26CaseyEr, when I first showed up it didn't have the :nrepl bit#2020-06-2215:26Caseythis is just a basic test project using the node-repl#2020-06-2215:32CaseyHm, something has broken, I can't get it working with or without the :nrepl key. Posting a test project to github..#2020-06-2216:10dpsutton@ramblurr got a link?#2020-06-2216:36CaseyGot pulled away, will finish it up in a bit#2020-06-2217:33CaseyHow does the shadow-select option differ from the normal shadow one?#2020-06-2301:56sofraI am trying to follow the instruction here to get and embedded nrepl server.
It works without the cider-nrepl-handler but when I add it I start getting null pointer exceptions. Not really sure how to start debugging this.
using
[nrepl "0.7.0"]
[cider/cider-nrepl "0.25.2"]
with exceptions
ERROR: Unhandled REPL handler exception processing message {:op out-subscribe, :session ae41ee90-9689-44cf-b204-c1381837eeb0, :id 5}
ERROR: Unhandled REPL handler exception processing message {:op classpath, :session ae41ee90-9689-44cf-b204-c1381837eeb0, :id 6}
java.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cider.nrepl$wrap_out$fn__8686.invoke(nrepl.clj:312)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_undef$fn__8740.invoke(nrepl.clj:471)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_apropos$fn__8622.invoke(nrepl.clj:118)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_test$fn__8722.invoke(nrepl.clj:420)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__8181.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_trace$fn__8728.invoke(nrepl.clj:442)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_tracker$fn__8734.invoke(nrepl.clj:460)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at cider.nrepl$wrap_complete$fn__8634.invoke(nrepl.clj:132)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at nrepl.middleware.sideloader$wrap_sideloader$fn__8431.invoke(sideloader.clj:102)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__8380.invoke(session.clj:297)
at nrepl.middleware$wrap_conj_descriptor$fn__7978.invoke(middleware.clj:16)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:19)
at nrepl.server$handle_STAR_.invoke(server.clj:16)
at nrepl.server$handle$fn__8442.invoke(server.clj:36)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)#2020-06-2302:52dpsuttonHow are you starting the nrepl server?#2020-06-2307:03CaseySo, after adding cider/cider-nrepl to my ~/.shadow-cljs/config.edn things seem to be working well now.#2020-06-2307:09CaseyIts noted that cider's test functions don't work for cljs, what's the conventional way to run cljs tests in the repl?#2020-06-2308:09bozhidarI know some people just add a simple command that wraps the test runner. There’s also https://github.com/magnars/kaocha-runner.el which probably works in such cases.#2020-06-2313:43naomarik@ramblurr shadow-cljs comes with a JS test runner https://shadow-cljs.github.io/docs/UsersGuide.html#_testing#2020-06-2313:45naomarikNot in the REPL though, but I'm pretty happy with it.#2020-06-2313:55CaseyYea, that's what I'm using now. Its works well enough, but I miss being able to run single tests when working on one little issue like I can in normal clj+cider#2020-06-2313:55CaseyI end up (comment)ing out deftests as needed but it is a little clunky#2020-06-2314:11naomarikYeah for me runs fast enough (actually instant for the tests I have) where I don't mind.#2020-06-2320:01Drew Verleei get the following error when i try to start an nrepl commandline:
➜ aft git:(master) ✗ clj -R:nrepl -m nrepl.cmdline
Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:194).
Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
I assume the solution here is to add refactor nrepl to my deps but the docs i was reading dont mention it.#2020-06-2320:04dpsuttonwhat version of nrepl is present in the nrepl profile?#2020-06-2320:04Drew Verlee{:nrepl
{:extra-deps
{nrepl/nrepl {:mvn/version "0.8.0-alpha4"}
cider/piggieback {:mvn/version "0.5.0"}}}#2020-06-2320:04dpsuttonthat's a weird one#2020-06-2320:05dpsuttonhave you been hacking on nrepl and installed a custom version?#2020-06-2320:05naomariknot really -- just add refactor-nrepl#2020-06-2320:05dpsuttoni'm confused why it would expect it there#2020-06-2320:05naomarik:repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.2"}
refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"}
cider/piggieback {:mvn/version "0.5.0"}}
:extra-paths ["env/dev/resources" "env/dev/clj"]
:main-opts ["-m" "nrepl.cmdline" "--middleware"
"[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]"]}
this is what I have in mine#2020-06-2320:06naomarikactually if you're not running from emacs it would be weird#2020-06-2320:06Drew Verleecorrect, im not running from emacs#2020-06-2320:07naomarikmaybe from piggieback dep? dunno...#2020-06-2320:07Drew Verleeis my nrepl dep really old? i tried to get the latest but mine says 8 and yours 25#2020-06-2320:08Drew Verleeoh thats cider nrepl on yours#2020-06-2320:09naomariki'm using {:mvn/version "0.6.0"} for nrepl#2020-06-2320:10Drew Verleeif the goal is to launch a server that a nrepl port i can talk to so i can develop in a different context. then i wouldn't need cider which is for emacs#2020-06-2320:11naomarikbtw clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.0-alpha4"}}}' works for me without error#2020-06-2320:12naomarikclj -Sdeps '{:deps { cider/piggieback {:mvn/version "0.5.0"}, nrepl/nrepl {:mvn/version "0.8.0-alpha4"}}}' works for me... maybe something else going?#2020-06-2320:13Drew Verleebut those dont pass a main option#2020-06-2320:14Drew Verlee-R:nrepl without piggy (and likely with) starts a repl. when i pass -m nrepl.cmdline it throws that error#2020-06-2320:16naomarikah forgot the main fn,
clj -Sdeps '{:deps { cider/piggieback {:mvn/version "0.5.0"}, nrepl/nrepl {:mvn/version "0.8.0-alpha4"}}}' -m "nrepl.cmdline"
nREPL server started on port 44073 on host localhost -
this invokation works for me#2020-06-2320:16naomarikmaybe search your project for any hard references to refactor-nrepl or if deps.edn is merging config from somewhere else?#2020-06-2320:17Drew Verleeill do a clean#2020-06-2320:22Drew VerleeThat invocation fails for me in my project. would Sdeps override whats in my deps file? my ./clojure/deps.edn fils is empty. Is there any stale state that would be lying around?#2020-06-2320:23naomarikdoes it work outside the project folder? i'm not sure to be honest about your question -- i would assume so#2020-06-2320:23Drew Verleeit fails outside the project folder too.#2020-06-2320:23Drew Verleehuh. thanks, ill look into this more#2020-06-2320:24naomarik-Sdeps EDN
Deps data to use as the last deps file to be merged#2020-06-2320:43Drew Verleewhat version of clojure are you running?#2020-06-2322:04naomarikjust saw this -- clj -Sdescribe says :version "1.10.1.536"#2020-06-2322:30Drew Verlee@U0DHHFEDP this command works for me:
➜ ~ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.25.2"} }}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
nREPL server started on port 46293 on host localhost - <nrepl://localhost:46293>#2020-06-2322:31Drew Verlee"1.10.1.502"#2020-06-2320:24naomarikyou might have some other file somewhere else#2020-06-2320:24naomariktry it with this option -Srepro
Ignore the ~/.clojure/deps.edn config file#2020-06-2320:24naomarikclj -Sdeps -Srepro '{:deps { cider/piggieback {:mvn/version "0.5.0"}, nrepl/nrepl {:mvn/version "0.8.0-alpha4"}}}' -m "nrepl.cmdline"
nREPL server started on port 44073 on host localhost -
#2020-06-2321:25Drew Verleeif i run
clj -Srepro -Sdeps '{:deps {cider/piggieback {:mvn/version "0.5.0"} nrepl/nrepl {:mvn/version "0.8.0-alpha4"}}}' -m "nrepl.cmdline"
(note you have to reverse the options from what you posted) i get the same missing refactor middleware error#2020-06-2321:46naomarikwhat's clj -Sdescribe say?#2020-06-2414:06Drew VerleeHow would i got about setting the port for the nrepl server thats starting? I'm starting a remote nrepl server via the tools sdeps cider-clj alias documented here: https://docs.cider.mx/cider/basics/middleware_setup.html#using-tools-deps. I assume its an options i pass to nrepl.cmdline ...#2020-06-2414:19dpsutton0 and nil are assumed to be a random open port. -p/--port PORT Start nREPL on PORT. Defaults to 0 (random port) if not specified.#2020-06-2416:53Drew VerleeI launched a kuberentes pod where i specified the main-namesapce as nrepl.cmdline and passed it args for the cider middleware and port. Then i ran a tunnel that lets me talk to pods as if there local and ran cider-connect and passed it pod ip and nrepl/containerPort. This results in : Buffer *cider-uninitialized-repl* has no process . I'm not sure what that implies. I would also be open to any docs or success stories people have had doing this type of thing.#2020-06-2417:37Drew VerleeMy port forwarding wasn't working the way I had thought it did.#2020-06-2501:05neilyioIs there a better way to view Clojurescript error messages in CIDER? It's very awkward to have long messages like this printed out in the REPL, with no formatting or text wrapping. Even worse, they all just pile up before the empty prompt so it's very difficult to visually separate them. There must be a better way than this... Is there an option to have a properly formatted buffer pop-up? I'm using shadow-cljs.#2020-06-2501:13dpsuttonI’ve never seen errors like that#2020-06-2501:14dpsuttonIs there an actual error in your project? The auto complete has been a bit iffy with shadow. So perhaps it is that?#2020-06-2501:19neilyioThis particular error is indeed an unusual one... I'm getting a INTERNAL COMPILER ERROR after npm install --save jimp and using :require ["jimp" :as jimp] as you can see on the left hand side of my window. That's definitely something I'll bring up in #shadow-cljs, but right now all my compilation errors print out like this. Is this normal?#2020-06-2501:25dpsuttonI thought I remembered clickable errors in the repl for cljs#2020-06-2501:26dpsuttonI’d be interested to see a more traditional null pointer or whatever. I almost never look in the repl for stack traces since they are in the browsers console#2020-06-2501:29neilyioIt'd be great to clarify my understanding on this, which is that:
1. Successfully compiled ClojureScript will show errors from the generated JavaScript in the browsers console, and the browser's console is the best place to watch for those errors- not anywhere in CIDER or Emacs. Is that right?
2. If the ClojureScript cannot compile properly (syntax error, etc), it prints out an error message in the REPL in CIDER just below the previous output (with no formatting or text wrapping). The only way to watch for and read those error messages is to scroll up and down in the CIDER REPL. This is how I currently read errors that pop up from a shadow-cljs hot reload upon saving changes in a file. This is also what I'm hoping to find a better solution for.#2020-06-2501:36neilyioI do find that, sometimes and for certain errors, my localhost:8080 in the browser will show a nicely formatted message from shadow-cljs that identifies a compilation error. But most of the time, it just prints it out in the repl and leaves an outdated version of the app showing in the browser, sometimes with a message like "shadow-cljs - The Websocket Connection was closed!"#2020-06-2501:38neilyioI really do feel like I'm doing something wrong, because I've heard so many good things about this CIDER/ClojureScript/shadow-cljs developer experience in the inconsistencies here are very frustrating. If someone can point me in the right direction, I'd love to turn the knowledge into a comprehensive blog post for beginners.#2020-06-2501:40dpsuttonI’m sorry you’re having issues with non compiling code. I expect the browser console and the browser heads up display from shadow might have better information?#2020-06-2501:41dpsuttonThis is probably a weak spot of cider but I suspect it is nicer for “regular” errors#2020-06-2501:43neilyioOh, I'm just letting off some steam I guess. It's been much harder than I thought to get into a flow with these tools... There's a lot of complexity in the ClojureScript environment to wrap your head around when you're brand new to it. I really appreciate your getting back to me so quickly.#2020-06-2501:44neilyioIf you have a syntax error in your ClojureScript, like a missing bracket, where do you usually find out about it? In the REPL? I don't think those errors make it to the browser console, do they?#2020-06-2501:58dpsuttonYeah that’s true#2020-06-2501:59dpsuttonI almost never have those. But the hud in the browser is where I’d expect to see it#2020-06-2502:02neilyioGuess I'll just have to turn on strict parens. Thanks!#2020-06-2502:12dpsuttonOh yeah. I wouldn’t edit clojure without structural editing#2020-06-2504:51David PhamSmart parens is golden. It changed the way I code for sure.#2020-06-2504:55David Pham@neil.hansen.31 did you use the ^dev/after-load metadata for shadow-CLJS? Usually a function wrapping dom/render entry point will be called every time you update your files.#2020-06-2520:19neilyioThat is something I'm using now, but it took me a little too long to find out about. The shadow-cljs user guide is very thorough, but as a beginner (to Clojure and shadow-cljs), it made my head spin. After I've wrapped my head around all this, I'd love to eventually help with the creation of some more beginner friendly materials.#2020-06-2510:58bozhidarIf someone wanted auto-trimming of their REPL buffers you can check out https://docs.cider.mx/cider/repl/configuration.html#auto-trimming-the-repl-buffer#2020-06-2513:48solfLove it!#2020-06-2512:48dpsutton> REPL shortcut trim.
chefs_kiss.jpg#2020-06-2512:49dpsuttonvery nice!#2020-06-2612:46jumarCan I disable the cider stacktrace popup when an exception is thrown?
I'd rather show it manually only when I need it.#2020-06-2613:39dpsuttonYes you can. There’s a defvar for it#2020-06-2613:40dpsutton#2020-06-2613:41dpsuttonOn mobile so not sure what it’s called. If you C-h v and start typing cider error I bet you’ll see it#2020-06-2614:05dpsutton(setq cider-show-error-buffer nil) is the ticket#2020-06-2614:35jumarPerfect, thanks!#2020-06-2617:11bennyevery time auto complete kicks in for my shadow project, i get a npe, any suggestions?#2020-06-2618:21zhuxun2When in a cljc file, how do I force (cider-find-var) to jump to the cljs source rather than the clj source? Currently it always defaults to the clj file.#2020-06-2700:40dpsutton@zhuxun2 sorry to get back so late. All of the smarts are powered by whatever repl buffer you were last in. If you were last in a clojure repl, it will go to the clojure sources. if last in a clojurescript buffer it should go to the clojurescript versions. its possible to change the mode to clojurescript-mode or clojure-mode rather than clojurec-mode to force this behavior#2020-06-2809:34niveauverleihIn spacemacs, can I reuse a cider session from another project that I am no longer working on, iso. shutting the old one down and startung a new one?#2020-06-2812:34hindolThat does not gain anything in my opinion.#2020-06-2813:38practicalli-john@nick.romer sesman keybindings were added to the clojure layer in Spacemacs earlier in the year, so there are quite a few options https://develop.spacemacs.org/layers/+lang/clojure/README.html#managing-repl-connections-1#2020-06-2814:00niveauverleih@jr0cket That was spot on.#2020-06-2814:18practicalli-johnI havent really re-used CIDER sessions, so would be interested to hear what works for you, if you are able to share some time. Thanks.#2020-06-2814:44niveauverleihWell, simply open a clj file and launch a cider session via cider Jack in (, '). Then open a clj file from a different project (but in my case it had the same dependencies) and use SPC m m l b = link buffer to REPL session (sesman-link-with-buffer) to reuse the existing session.#2020-06-2903:03euccastrowhen I cider-jack-in-clj+cljs into a figwheel-main project and try and reload namespaces with clojure.tools.namespace.repl/refresh (http://e.g.as triggered by integrant.repl/reset) I get the following exception:
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (figwheel/repl.cljc:1372:5)."
:data #:clojure.error{:phase :compile-syntax-check, :line 1372, :column 5, :source "figwheel/repl.cljc"}
:at [clojure.lang.Compiler analyzeSeq "Compiler.java" 7115]}
{:type java.lang.ClassNotFoundException
:message "cljs.stacktrace"
:at [java.net.URLClassLoader findClass "URLClassLoader.java" 471]}]#2020-06-2904:04euccastrothis doesn't happen if I cider-jack-in-clj and cider-jack-in-cljs separately. is cider-jack-in-clj+cljs not recommended for figwheel-main if you're going to use clojure.tools.namespace.repl/refresh? am I missing out on anything by not being able to use the same session for both?#2020-06-2905:06euccastrojust in case someone else runs into the same problem, I worked around it by restricting the set of directories that clojure.tools.namespace.repl/refresh will traverse (a good idea anyway):
(ns user
(:require
[clojure.java.classpath :as cp]
[clojure.string :as str]
[clojure.tools.namespace.repl :as nsrepl]))
(apply nsrepl/set-refresh-dirs
(for [root (cp/classpath-directories)
:when (and (or (str/starts-with? root "dev/")
(str/starts-with? root "src/"))
(not (str/includes? root "/cljs/"))
(not (str/ends-with? root "/cljs")))
f (file-seq root)
:when (.isDirectory f)]
f))#2020-06-2905:08euccastro(don't C+P this code blindly since it's tailored to the directory structure of my project; the important part is filtering out cljs directories)#2020-06-2909:35strsndHello! What is an idiomatic way to limit the amount of printing of exceptions that reach the cider repl from other threads? I can use alter-var-root to make them restrict print-length as well but is there a better way?#2020-06-2910:04jumarIsn’t that done by your logging framework?#2020-06-2911:01strsndUnfortunately it is not a thread creation I have under control#2020-06-2911:02strsndIn theory it should be - yes.#2020-06-2911:10jumarBut you should have your logging under control- so you can limit or filter certain messages#2020-06-2911:17strsndRight, for a sensible application I would do it, but it is troublesome while just prototyping things in the REPL.#2020-06-2918:36practicalli-john@dpsutton I updated the reference page for CIDER configuration variables, adding the descriptions https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html#2020-06-2918:36dpsuttondid you try running that script again?#2020-06-2920:14practicalli-johnI used the output you posted in slack and a bit of vim editing magic. I tightened up the wording a little in places#2020-06-2918:37dpsuttonthat is awesome!#2020-06-3014:23gonUpdated to latest Melpa and now when I cider jack-in I get#2020-06-3014:24gonERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :op init-debugger, :session e83ad834-3874-48b1-afe7-be93cac01ca7, :id 6}
java.lang.ClassNotFoundException: com.sun.javadoc.ClassDoc, compiling:(cider/nrepl/inlined_deps/orchard/v0v5v10/orchard/java/legacy_parser.clj:1:1)#2020-06-3020:07bozhidarI don’t think we changed anything in that part of the code recently. Seems like some built-in JDK class is missing, but I have no idea why that started happening for you after a CIDER update.#2020-07-0108:15gonObviously com.sun.javadoc.ClassDoc is present, within tools.jar.... starting lein repl in a separated process and then cider-connect there are no exceptions thrown....#2020-07-0108:31gontryed to cider jack-in in a deps.edn project and it works fine.... so the problem seems restricted to lein projects...#2020-06-3014:24gonJava jdk 8#2020-06-3014:57pmooserGuys, I've been using cider forever, but I feel like I haven't learned anything new about it in a long time. Can I ask for some guidance with cider-connect-clj&cljs ? My setup is ... I have a JVM instance which I usually connect to with cider-connect ... but I also have a shadow-cljs instance (for my cljs builds), and I've never ever used a cljs repl via cider. Is it possible to connect this way to two separate processes (ie, one via the JVM and one via shadow-cljs) ?#2020-06-3015:18practicalli-johnhttps://docs.cider.mx/cider/cljs/shadow-cljs.html may be of interest to you.#2020-06-3017:59Nathan SaritzkyI'm trying to use Cider with Clojurescript, but none of the interactions are working. I'm getting a "No cljs REPLs in the current session" message, though the REPL itself is working just fine. Does anyone have any insight? I'm using Shadow-CLJS connected to a browser.#2020-06-3019:32Nathan SaritzkyFigured out it's not connect the session to my buffers automatically.#2020-07-0112:51euccastrothat happens to me before I have loaded the page that includes the compiled cljs in my browser#2020-07-0112:53euccastrobefore that, the REPL is considered a clojure one. once you load the code and figwheel (or similar) connects, the REPL becomes a cljs one and cider will know to use that for cljs interactions. HTH!#2020-07-0114:47Nathan SaritzkyHmm, that hasn't been happening for me. I don't know why. At least I know how to deal with it, for now.#2020-07-0116:29euccastrooh, maybe that's because I'm serving my page at a different port than figwheel expects. I guess I could set :open-url or something, but it no longer bothers me once I've found out the cause#2020-06-3022:15papachan@nsaritzky i suggest you to use a .dir-locals.el at your project directory where it contains all the options you need to open a new repl with shadow.#2020-07-0106:46jacklombardWhat is the use of the cider-nrepl middleware? Do I really need it to connect to an nrepl server using cider?#2020-07-0106:47jacklombardWhat will I miss if I don’t use the middleware, I am able to connect fine to an nrepl server without the middleware#2020-07-0106:48jacklombardI have inherited a project where there is hard dependency on cider-nrepl. We are not trying to aot compile our project for distribution so that the source is unavailable. I not be including project.clj in my jar file but cider-nrepl needs the project.clj and hence stops the jar from running because of this.#2020-07-0107:08jacklombardOkay I got this https://docs.cider.mx/cider-nrepl/nrepl-api/supplied_middleware.html. Nevermind#2020-07-0107:27bozhidar@frozenfire1992 CIDER will work even without cider-nrepl, but it will be limited when it comes to functionality.#2020-07-0109:22jacklombardThank you! 🙂#2020-07-0107:28bozhidarI think that making a hard dep to some project is kind of weird, as I doubt anyone would be running any of the advanced debugging features in production, but who knows.#2020-07-0107:28bozhidar🙂#2020-07-0108:08jumarCan I somehow "open" the repl buffer literally? SImilar to what emacs/spacemacs offer me by default when opening a large file?
The thing is that Emacs gets really slow when my app logs lot of messages to standard out so I'd like speed it up#2020-07-0109:43bozhidar@jumar I guess you can just enable saving the REPL log to a file and open that file.#2020-07-0109:44jumarYou mean configuring my logging framework?#2020-07-0109:45jumarIt's rather special, but in this case I was also debugging an issue when the error happened only when writing to stdout#2020-07-0109:47bozhidarI guess then you can save your REPL buffer as a file and work with that file directly.#2020-07-0113:05jumarMy problem is that Emacs/Cider is just really slow in this case - in terminal it’s fine but Emacs will freeze for up to a minute while waiting for the output to be written to the repl buffer; the process that generates this output only takes several seconds #2020-07-0206:16jumarAsked in #spacemacs too: https://clojurians.slack.com/archives/C09C8GRLY/p1593670518006700#2020-07-0206:54bozhidarEmacs has well known issues with handling of long lines. That’s nothing that can be fixed in CIDER and the best recipe is to keep the REPL buffer’s size in check. https://docs.cider.mx/cider/repl/configuration.html#auto-trimming-the-repl-buffer#2020-07-0207:51jumarThanks - I'll try that; it could help#2020-07-0220:14magraI know it might not help in your case. I disable logging to console, enable logging to a file and have a separate terimal window open with tail -f log.#2020-07-0305:45jumar@U15BH4U4V that could work in most of the cases; I'll give it a try#2020-07-0210:15jacklombardIs there a way to load the cider-nrepl middleware on the fly?#2020-07-0210:20practicalli-johncider-jack-in-clj#2020-07-0210:24jacklombardWhen cider-connect ing, can I load the middlewares on the fly?#2020-07-0212:45practicalli-johnThe cider-connect process connects to a running project, so you need the cider-nrepl middleware to talk to that process.
The command line you use to run the Clojure project should include all dependencies, including any middleware. This can be added to the project or the general configuration of the build tool you are using (e.g. Leiningen, Clojure CLI or Boot).
https://docs.cider.mx/cider/0.25/basics/up_and_running.html#2020-07-0212:46jacklombardYes I am aware of that, and this is what I wanted to do on the fly#2020-07-0221:10bozhidarnREPL 0.8 supports dynamic loading of middleware, but CIDER hasn’t implemented that yet.#2020-07-0221:10bozhidarSee https://nrepl.org/nrepl/building_clients.html#_modifying_middleware#2020-07-0304:56jacklombardThanks that is what I was looking for, but the examples use cider middleware. When you say it hasn’t been implemented yet, do you mean, CIDER doesnt automatically do that for us when we cider connect but we can load the middlewares manually?#2020-07-0304:58jacklombardAlso a noob question, say I can load these middlewares dynamically, will they be added to the nREPL client or the server?#2020-07-0304:59jacklombardServer I am assuming#2020-07-0305:19bozhidarThe idea is that client would load them dynamically into the server. That’s why the client would need to know how to do so.#2020-07-0305:20bozhidarInvoke the right ops, know where to look for the resources it will load, respond to the server messages.#2020-07-0306:43jacklombardGot it, thanks 🙂#2020-07-0312:49alexyakushevHello folks#2020-07-0312:49alexyakushevDid anything change lately (= in the last 3-6 months) related to how the indentation works?#2020-07-0606:15bozhidarI don’t remember any indentation-related changes this year.#2020-07-0312:51alexyakushevI'm experiencing some very strange behavior with code loaded via tools.namespace that Emacs' indent doesn't respect :style/indent hints. But it is enough to manually recompile the namespace with the function that has :style/indent to make it work correctly.#2020-07-0602:27xconconxI'm having trouble with M-x cider-jack-in when I try to start a new REPL I get this feedback:
The lein executable isn't on your 'exec-path
The only problem is that i download lein to /usr/bin and when I describe exec-path Its value is:
("/home/sfernandez/.local/bin/" "/app/bin/" "/usr/bin/" "/app/libexec/emacs/26.3/x86_64-pc-linux-gnu/")
So, I'm not sure if that's the problem...
In scratch I did (print cider-lein-command) and it's value is:
"lein"
"lein"
That is "lein" printed twice? Even if I execute $ lein repl in terminal and then try to connect to it that works fine, but I get this warning:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!
Should I just always use cider-connect ? I've been stuck on trying to get jack in to work for a while
Thanks all#2020-07-0602:51dpsuttonI always use cider jack in. If you cider-connect you need to ensure that ciders middleware are set up #2020-07-0602:51dpsuttonCan you execute “which lein” from a terminal and then do the same from an eshell buffer#2020-07-0602:54xconconx@dpsutton which lein from terminal gives: /usr/bin/lein
which lein from eshell buffer gives:
which: no lein in (/home/sfernandez/.local/bin:/app/bin:/usr/bin)
that seems problematic?#2020-07-0602:55dpsuttonYeah. Seems like it should be seeing it. Which OS?#2020-07-0602:56dpsuttonWhat about “/usr/bin/lein repl” from eshell#2020-07-0602:56dpsuttonMy guess is user and permissions are incorrect?#2020-07-0602:56dpsuttonHow did you install lein. I wouldn’t expect it to end up there#2020-07-0603:05xconconxPop!OS 20.04 LTS x8664
“/usr/bin/lein repl” from eshell -> just gives a command not found?
i could have installed it incorrectly i'm kind of a noob, I did :
wget
and then a : sudo mv lein /usr/bin from root
then i changed directory to /usr/bin and chmod a+x lein
and I ran the script it seems to have worked fine? it did install and download the self-install package, i just followed instructions from: https://leiningen.org/ in Install section#2020-07-0603:06dpsuttonhave you restarted emacs since installing it?#2020-07-0603:07xconconxuhh like closing it and reopening 🙂 lol?#2020-07-0603:07xconconxdoes that count as restarting ?#2020-07-0603:07dpsuttonI don't know what closing it means. If you ensure that the emacs process is killed and restarted. gets complicated since some people use emacsclient#2020-07-0603:08dpsuttonwhat are the user and group for ls -l /usr/bin/lein#2020-07-0603:12xconconxpretty sure i've restarted it and ls -l /usr/bin/lein is "-rwxrwxr-x 1 sfernandez sfernandez 13413 Jul 5 20:50 /usr/bin/lein"#2020-07-0603:12xconconxtbh I don't really know the difference between user and group though#2020-07-0603:12dpsuttonno worries. groups are just groups that users can belong to#2020-07-0603:13dpsuttonbut nothing out of the ordinary there. i was suspecting maybe it got moved and set root as its user#2020-07-0603:14xconconxyeah, this is sad#2020-07-0603:14xconconxi don't get why emacs isn't seeing it from eshell ...#2020-07-0603:16xconconxthanks for your help @dpsutton btw#2020-07-0603:16dpsuttonfrom eshell what do you get from just ls /user/bin#2020-07-0603:16dpsutton(of course!)#2020-07-0603:18xconconxwhole bunch of stuff with ls /usr/bin
i tried ls /usr/bin | grep "lein" and got nothing as expected#2020-07-0603:18dpsuttonwell at least its consistent#2020-07-0603:19xconconx@dpsutton tbh that's pretty good at least hahaaa#2020-07-0603:19dpsuttonmaybe try putting it somewhere else on your path? I don't understand how it wouldn't be visible#2020-07-0603:19dpsuttoni have a ~/bin that i put stuff in#2020-07-0603:20dpsuttonand lein is in there#2020-07-0603:20xconconxok ill try that and see if it helps#2020-07-0603:23xconconxok im making some modifications im going mad though#2020-07-0603:23xconconxim gonna restart after doing some sudo updating and upgrading i dont even know#2020-07-0603:25xconconxmad same error#2020-07-0603:26dpsuttonsame error when putting the lein script elsewhere on your path?#2020-07-0603:28xconconxoh god bless a new error i think i know how to fix this one#2020-07-0603:29xconconx@dpsutton genius move i copied script to $HOME/.local/bin and that did the trick#2020-07-0603:31dpsuttondid it illuminate why the original placement wasn't working or its working as you expect from the new location?#2020-07-0603:31xconconxyeah now im just googling this part but the error was
error in process sentinel: Could not start nREPL server: /home/sfernandez/.local/bin/lein: line 255: type: java: not found
Leiningen couldn't find 'java' executable, which is required.
Please either set JAVA_CMD or put java (>=1.6) in your $PATH (/home/sfernandez/.local/bin:/app/bin:/usr/bin).
#2020-07-0603:32dpsuttonha. that makes a lot of sense#2020-07-0603:32xconconx@dpsutton i really just ran a java --version saw some output and was on my way earlier very sad#2020-07-0604:15xconconx@dpsutton Did you know that if you launch the GUI version of emacs from favorites it doesn't get any information from your $PATH, but if you launch it from terminal everything works lmao, sigh...#2020-07-0612:09practicalli-john@sfernandez0201 if you update your path in your dotfiles then any GUI application will require a logout of the desktop (or restart the operating system) if run from favorites or some other type of application launcher. If you update the path in dotfiles then you need to restart a terminal or use source .dotfile-name to read in the new path setting. This is standard on Unix systems (Linux, MacOSX).
I also configur .profile to read the .bashrc file, so that apps run from favourites or an app launcher also used the settings in that file.
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
#2020-07-0615:22xconconxI updated $PATH in .zshrc and did run source afterwards. I restarted and still had the same problem, when I launch emacs from favorites, I still have a different $PATH than if I launch it from terminal. I didn't try adding your suggestion to .zshrc though. I will try that. Thanks!#2020-07-0614:48tianshuIs it possible to specify the port for leiningen plugin cider/cider-nrepl . I'm trying to use docker for development, so I want a fixed port number to expose in Dockerfile.#2020-07-0618:47iarenazaIf I understood you right, and you are using Leiningen to start your project REPL, then this is what we add to our project.clj file when using Docker: https://github.com/magnetcoop/pubsub/blob/master/project.clj#L25-L26#2020-07-0703:52tianshuhow you start your program, with lein repl?#2020-07-0716:45iarenazaYes, lein repl :headless in our case.#2020-07-0614:54dpsuttonhow are you starting your project? You should be able to specify the port you want for nrepl#2020-07-0618:29nickIs it possible to send a function or a region to repl and paste the result right after it?
(+ 1 2)
;; trigger-some-magic-cider-func which pastes back into editor:
3
Basically, just trying to avoid manual copying from cider REPL and pasting it back.#2020-07-0618:46Michaël Salihi@nfedyashev Yes you can use cider-eval-defun-to-comment#2020-07-0618:47nickThank you!#2020-07-0618:49Michaël SalihiYou're welcome. :)
> It is bound to C-c M-;, <M-return> e ;, M-m m e ;, and many ordinary text#2020-07-0706:54practicalli-john, e ; in Spacemacs Evil normal mode.
There are also pretty print versions of comment functions#2020-07-0707:54nick@U05254DQM what do you mean by pretty print versions of comment functions?#2020-07-0708:01practicalli-johnThese functions pretty print (e.g. print data structures in a more human readable form) as comments in the source code
cider-pprint-eval-defun-to-comment
cider-pprint-eval-last-sexp-to-comment
They are comment versions of the pretty print functions:
cider-pprint-eval-defun-at-point
cider-pprint-eval-last-sexp
I use the eval-last-sexp commands for expressions nested inside others and defun-at-point for the overal expression.#2020-07-0708:13nickIt must be pretty handy for big and complex data structures.
Thanks for sharing!#2020-07-0708:20practicalli-johnpprint to comment is useful for maps with lots of keys or nested data structures. Be careful not to use it for huge return values as it doesnt limit itself to 100 results like the other evaluations do (i should figure out if there is an option for this). The cider-inspector is an excellent way of reviewing uncomfortably sized data https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html#2020-07-0618:47iarenazaIf I understood you right, and you are using Leiningen to start your project REPL, then this is what we add to our project.clj file when using Docker: https://github.com/magnetcoop/pubsub/blob/master/project.clj#L25-L26#2020-07-0713:32pieterbreedHi everyone; I have a question about the cider debugger and what "stepping in" means... With this code:
(defn a []
(+ 1 1))
(defn b []
(a))
If I set up b for debugging (C-c C-c) and run it, the debugger stops inside of it. In my mind, step in is supposed to let me navigate the instruction pointer into a instead it steps over it (like I pressed n for next). Is this expected for cider? From memory, other IDE's seems to allow you to step into functions that have not been explicitly instrumented... What is the expected CIDER behaviour and what are your expectations of what step in means?#2020-07-0713:36jumarYes, that's expected but might depend on what a is in particular (I don't know much about limitations though).
It more or less works for me in such scenarios.#2020-07-0713:37pieterbreedthe more-or-less is what I'm finding too.. .it's highly inconsistent whether I can step into a fn or not...#2020-07-0713:36euccastroI'd like to bind a project-specific Clojure function (e.g., integrant.repl/restart ) to an emacs command, so I can bind that to a convenient keystroke. I know there's cider-run but I need to enter the function name every time and then pick a namespace. is there any way to set up my .dir-locals.el or otherwise avoid the need for that interaction?#2020-07-0714:27euccastroOK, this worked
(defun eucc-reset-project ()
(interactive)
(cider-ensure-connected)
(cider-interactive-eval "(integrant.repl/reset)"))
#2020-07-0720:51fappyCan the CIDER repl be ‘paused’ , kind of like the way you can pause a unix process with Ctrl-z ?#2020-07-0721:00dpsuttona unix process is backgrounded with control-z and it keeps working but you can do stuff in the terminal. Can't you just got to a different buffer in emacs? aren't you doing the same thign essentially?#2020-07-0721:01dpsuttonwhat do you anticipate happening if a cider repl were paused?#2020-07-0721:03fappyI’m using spacemacs and going through a period of finding out why it gets bogged down when I run my project … and hopefully I can find modes etc to disable for the repl buffer. But until then I’m hoping for a way to tell emacs “stop everything for that buffer for now so I can do other things”#2020-07-0721:03dpsuttonso you're trying to solve the problem that the repl is making emacs slow?#2020-07-0721:03fappyyes#2020-07-0721:04dpsuttonone likely culprit is long lines and many lines in the buffer#2020-07-0721:04fappyand until I do, I’m hoping for a Ctrl-z without the second bg part#2020-07-0721:04dpsuttontry C-u C-c C-o to clear the buffer#2020-07-0721:05fappycan I tell CIDER to output all println’s to a file instead of the buffer?#2020-07-0721:05dpsuttonare you getting lots of logging output?#2020-07-0721:05fappydefinitely#2020-07-0721:05dpsuttonhere's a helpful dir-locals.el file
((nil
(cider-redirect-server-output-to-repl . nil)))
#2020-07-0721:06fappyI have lein running in a terminal, and I connect to it from emacs#2020-07-0721:06dpsuttonhelpful if you have tons of logging. but the proper answer is configure your logger. log to a file, change the logging level, or just change the expectation that you don't want your repl to get the logs#2020-07-0721:07dpsuttonok. restart your lein process and have cider-redirect-server-output-to-repl set to nil#2020-07-0721:07dpsuttoneither through dir-local file or just set it globally in emacs if you like#2020-07-0721:09fappythis is going to be such a great improvement!#2020-07-0721:09fappydoes the lein process itself have to be new? Or only the cider connection to it?#2020-07-0721:09dpsuttoni believe it needs to be new#2020-07-0721:10dpsuttonbecause in the process you hijack the stdout#2020-07-0721:10dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj#L107#2020-07-0721:10fappyhijack? the terminal output and my tee to a file remain happy…#2020-07-0721:11dpsuttonif things are happy then don't go a-changing#2020-07-0722:08agI feel I asked this question before, but I completely forgot how to do this. I need execute a specific Clojure code after cider gets connected/jacks-in, can someone remind me?#2020-07-0722:32practicalli-johnThere are configs for a reset
((clojure-mode . ((cider-refresh-before-fn . "practicalli.dev/stop")
(cider-refresh-after-fn . "practicalli.dev/start"))))
#2020-07-0722:36practicalli-johnOr do you mean cider-repl-init-code#2020-07-0722:40practicalli-johnThere is a list of all the cider variables on this page https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html#2020-07-0801:58agThat's exactly that I needed. Thank you John!#2020-07-0810:15practicalli-johnPlease share any examples of using this if you can, thanks#2020-07-0722:09agtried setting cider-launch-params, that doesn't seem to work#2020-07-0805:05agIs there a way to ignore ~/.lein/profiles.clj values when cider-inject-dependencies-at-jack-in is t and use them only when it's nil?#2020-07-0806:47dominicmLein is in control of reading that file, not cider.#2020-07-0806:47dominicmCider gets no say over it#2020-07-0805:18Gleb PosobinI am getting this exception when starting the repl with cider-jack-in from cider, repl can't do anything afterwards, when I try to eval any line it gives this error again. What could be the reason?#2020-07-0805:31bozhidar@posobin Lately a few people have been reporting this problem with Java 8. Switching to a new Java should fix it, although I don’t know what caused the breakage in the first place, as nothing has changed in CIDER and it seems something it needs is now missing.#2020-07-0806:49dominicmI wonder if some versions of java 8 (eg different builds) lack the doc generator#2020-07-0816:37Aaron CummingsI have a network situation where dns lookups outside the company network hang. Is there a way to configure the export-edn-url used in the nrepl wrap-clojuredocs to point elsewhere, perhaps with a .emacs setting?#2020-07-0902:56Aaron CummingsI have worked around this issue by touching an empty file with a future mtime at ~/.cache/orchard/export.edn. Now the clojuredocs middleware won't attempt another download until I'm long retired.#2020-07-0903:00Aaron CummingsMy question now ... Is there an existing mechanism to configure the cider nrepl middleware (either options, or turning individual middlewares off) from emacs?#2020-07-0914:08Drew Verleecider seems to be giving me type hint information about the method i'm calling on the java class. But can it give me the return type of the method?#2020-07-0914:11Drew Verleei guess if i eval it, this in the information outputted#2020-07-0914:11Drew Verleeor i could call type on it#2020-07-0914:14Drew Verleei would think that calling cider-java-doc on the symbol would give me the java docs if calling type on it and manually entering the type would work, but that doesn't seem to work in all cases.#2020-07-0914:29andrea.crottiis there a way to make sure that when switching to a repl buffer, it never replaces the buffer I'm currently on?#2020-07-0914:30andrea.crottiI'm not sure I undestand the pattern of the behaviour but often even if there already another window available it still replaces the one I'm on, which is never what I want to do#2020-07-0915:18dpsutton@andrea.crotti can you explain? not sure what you expect to happen. if you switch to a buffer, it replaces the buffer you are viewing. you can make a split and switch one of those buffers to the repl#2020-07-0915:19andrea.crottiwell sometimes when I switch to the repl buffer it doesn't replace the buffer I'm on#2020-07-0915:19andrea.crottiwould like to just enforce that behaviour somehow#2020-07-0915:19dpsuttoni'm not following what you mean by switch to repl buffer then#2020-07-0915:19andrea.crottijust cider-switch-to-repl-buffer#2020-07-0915:20dpsuttonahh, cider-switch-to-repl-buffer . i was thinking just colloqually of "switching to the repl buffer"#2020-07-0915:20dpsuttonsorry about that#2020-07-0915:20andrea.crottinp my bad#2020-07-0915:22dpsuttonhave you seen cider-repl-display-in-current-window?#2020-07-0915:22dpsutton"Controls whether the REPL buffer is displayed in the current window."#2020-07-0915:24andrea.crottiyeah, it's off though atm#2020-07-0915:26andrea.crottiI can dig a bit deeper#2020-07-0915:26andrea.crottiso maybe it should always display in a different widow but when for some reason it can't it will use the same window#2020-07-0918:39practicalli-johnIs there a variable I can use to tell sesman-start which type of repl session I would like to start for a specific project? So instead of being prompted by a list of cider-jack-in-clj cider-jack-in-cljs ,,, CIDER uses a variable value in the project .dir-locals.el and starts the appropriate repl session for the project.
I find sesman-start easier to use than remembering keybindnigs for each cicer-jack-in-* and cider-connect-* sessions, although in some projects is always going to be the same type of repl session. Thank you.#2020-07-0919:25Drew VerleeMy question might be smilar to what practicalli is asking about. At least in the same vein. I have a shadow-cljs project with a .dir-locals.el that contains
;; For Emacs users
;; simplifies commands need to start application via `cider-jack-in-cljs' by picking options here
;; rather then having to choose them at the command line.
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((clojurescript-mode
;; You use a shadow-cljs to build the project
;; This answers the question "which command should be used?"
(cider-preferred-build-tool . shadow-cljs)
;; This sets a default repl type and answers the question "select cljs repl type".
(cider-default-cljs-repl . shadow)
;; This tells shadow cljs what to build and should match a key in your shadow-cljs.edn
;; build map. e.g :builds {:<some-key> {...}}
;; pramas passed to shadow-cljs to start nrepl via cider-jack-in
(cider-shadow-default-options . ":app")))
Which put togehter some months back in order to simply my startup process. Now it seems running "cider-jack-in-cljs" and picking up that configuration isn't doing what i expect:
1. i get prompted for the command cli or shadow, when the .dir-local should take care of this.
2. upon selecting shadow-cljs it jsut seems to start the shadow server but not connect to it.
Any ideas welcome. I'll try to dig into this on the weekend.#2020-07-0919:28Drew Verleecould the fact the project is a submodule somehow be causing an issue?#2020-07-1218:27bozhidarAre you running cider-jack-in while in a ClojureScript source buffer? If you aren't, those dir-locals won't get applied.#2020-07-1218:28bozhidarThe submodule shouldn't a problem, as long as you're running jack-in from a file within it.#2020-07-1316:13Drew Verlee> Are you running cider-jack-in while in a ClojureScript source buffer? If you aren't, those dir-locals won't get applied.
I believe i am. I'll try on a toy project so i can be more sure i understand the context though. Thanks for the reply.#2020-07-1316:50Drew Verleehow do i check if i'm in a clojurescript source buffer?#2020-07-1316:50Drew Verleeyea my buffer list says clojurescript#2020-07-1316:53Drew Verleemaybe shadow cljs changed something? Now the dir locals setup in the shadow docs works
https://shadow-cljs.github.io/docs/UsersGuide.html#_simplify_startup_with_dir_local
I recall before it didnt.#2020-07-0922:06neilyioIs there a way to get CIDER evaluation (like cider-eval-last-sexp) to play nicely with Clojurescript? I keep getting "No available JS runtime" message. I'm doing browser/Electron development with shadow-cljs. I realize that evaluation relies on the "browser runtime" and needs to be loaded through an index.html etc. But I'd like to know if there's anyway around this, it feels like I'm missing out on Clojure's best feature. Is everyone using Clojurescript just foregoing interactive evaluation in CIDER?#2020-07-0922:09dpsuttonthere certainly is in CIDER. i'm not sure how to get that working with electron. with browser it should be straight forward. cider-jack-in-cljs and off you go#2020-07-0922:24neilyioHmm you're right that worked. This is great!#2020-07-0922:25neilyio@dpsutton I think my issue was that I was using cider-connect-cljs and I was seeing this: (ignore the obvious +2 error, problem persists even with that corrected).#2020-07-0922:28neilyioI wanted to use cider-connect-cljs because the error messages from shadow-cljs format much better in my Terminal than in the CIDER repl. If there was a way to redirect the CIDER output into a seperate, well-formatted buffer (the way cider-inspect does) I'd be a happy man.#2020-07-0922:30neilyioIs this a known limitation of cider-connect-cljs? I really thought it would be functionally the same as cider-jack-in-cljs, just with the actual "process" being "hosted" outside of Emacs.#2020-07-0922:41neilyiocider-jack-in-cljs also only seemed to solve the problem with a browser project, not with an Electron project.#2020-07-0922:49neilyio...and got it to work! Two things I found:
1. With Electron, there are two separate builds to think about for main process and the renderer process. I was selecting main on cider-jack-in-cljs, when I should have selected my renderer build.
2. I needed to actually "refresh" the Electron "page". It wouldn't work right away. I suppose this makes sense now that I'm thinking about it, but I don't have a great mental model of how all these ClojureScript servers and compilers are working, so I'm finding that I can't really anticipate these problems before they happen.#2020-07-0922:52neilyio@dpsutton Thanks for putting me on the right track. I really wouldn't have consider cider-jack-in-cljs without your suggestion. I'd still love to know why cider-connect-cljs won't work, to help improve the aforementioned mental model.#2020-07-0922:55dpsuttonwhen you start up your own process and cider-connect to it, are you including the middleware that CIDER needs?#2020-07-0922:56dpsuttonthe CIDER repl will print what command it is using if you want to see#2020-07-0923:00neilyioI am getting a little message at the top... clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0 and n/a, respectively.#2020-07-0923:00neilyio...if that's my problem, color me very embarassed.#2020-07-0923:01dpsuttonthat shouldn't be causing too many issues. I don't use refactor-nrepl though#2020-07-0923:10neilyioI can live with this. Now I'm wondering my cider-inspect won't work... All is fine in my browser-based project, but in the electron one (with the above (+ 2 2) example) I'm getting Inspector error for: 2 in the *cider-inspect* pop-up window.#2020-07-0923:11neilyioI know you said you don't know about the Electron workflow (starting to think I don't either...), and this has been enough to keep me going today, thank you!#2020-07-0923:34dpsutton@neil.hansen.31 anytime!#2020-07-1000:08neilyioAlright here's a hard one. Has anyone figured out a way to evaluate "async" expressions? For example, I have load-image which returns a channel. I'd like to take! the value from this channel and evaluate the result, in a form like this (<! (load-image "/Users/neil/Desktop/stock-bg.jpg")). Of course, the problem is that Error: <! used not in (go...) block when I cider-eval-last-sexp.#2020-07-1002:02dpsuttonclj or cljs?#2020-07-1002:02dpsuttonin clj just (<!! ... in cljs, you'll need to actually do the go block or use one of the async functions that provide a callback#2020-07-1020:01hugodWhen an exception is printed in the repl, it gets an overlay that makes it clickable to jump to the source of the frame. It seems broken to me as it fails to resolve a file. In cider-jump-to-locref-at-point either cider-sync-request:ns-path or cider-sync-request:info is returning an empty string, which means the loc plist is not checked for its “file”. Is this a bug in the middleware or in the elisp?#2020-07-1218:25bozhidarProbably a bug in the middleware. Please, file a ticket about this.#2020-07-1111:28jumarCan I somehow tell cider to stop showing stdout in the cider-repl buffer but still show it in the nrepl-server buffer?
This seems to happen sometimes by chance (especially after cleaning the repl buffer manually via cider-repl-clear-buffer - although this is confusing and not desirable, I'd like to be able to do it explicitly; one reason for that is that emacs/cider can become really slow when a lot of text is logged on stdout - nrepl-buffer (using the Fundamental mode) seems to handle it better.
Note: others have suggested before that I redirect logs to file but my question isn't about that#2020-07-1115:13magra@jumar Does cider-redirect-server-output-to-repl control what you are after?#2020-07-1115:15jumarLikely, thanks!#2020-07-1207:01bozhidarNote that this setting would only affect output that would normally be bound to the server's own output stream. For logging it might help, yes.#2020-07-1207:02bozhidar> This seems to happen sometimes by chance (especially after cleaning the repl buffer manually via cider-repl-clear-buffer
That's news to me. 🙂 I can't see how cleaning the REPL can affect that behavior, but in software everything's possible in guess. 😄#2020-07-1223:46ziltiIs it intended behaviour that the arrow showing the current line doesn't move while debugging a form marked with #dbg? It is impossible to tell which line (let alone expression) is currently being evaluated#2020-07-1300:02zilti...oh, seems to only happen when a #? is involved. On the other hand, when it isn't involved, the mnemonic info bar is missing#2020-07-1304:27bozhidarI don’t quite get what you mean, but it might be a good idea to file a bug report.#2020-07-1312:31pinkfrogI encounter this:#2020-07-1312:31pinkfrogdir already refers to: #’clojure.repl/dir in namespace#2020-07-1312:32pinkfroghow to by pass that an error? I feel like that’s a warning at most.#2020-07-1312:57practicalli-johnUse a different name for your own def expression to avoid over-writing existing code from libraries.
(def etcd-db-path "/opt/etcd/")
It is good practice to use environment variables for system values such as paths, rather than hard coding them into code.#2020-07-1313:24pinkfrog@jr0cket hi emacs expert. I am facing a problem that, I define a short cut in hydra to invoke cider-find-dwim#2020-07-1313:24pinkfrogbut evil-jump-backword sometimes jumps to wrong locations. do you suffer such an issue?#2020-07-1313:58practicalli-johnI don't really use that command, so haven't noticed. If you have command-log you can run that and check the keybinding is calling the function it's supposed to (i.e. nothing is over-riding the key binding in particular states).#2020-07-1314:04pinkfroghow do you jump to the definition and back ?#2020-07-1314:18practicalli-johnIf a definition is in the same file/buffer, then I probably use ' ' (single quote twice). If the definition is in another file, then either close its buffer or SPC TAB#2020-07-1407:07Ben SlessHello ciderians,
I'm trying to start a headless repl with docker run and cider-connect to it. Getting the following error message:
[nREPL] Establishing direct connection to localhost:9999 ...
[nREPL] Direct connection to localhost:9999 established
[nREPL] Connection closed unexpectedly (connection broken by remote peer)
nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
This is how I ran it:
docker run \
-p 9999:9999 \
-e "TOKEN=$TOKEN" \
--rm \
-v "$PWD":/usr/src/app \
-w /usr/src/app clojure:openjdk-14-lein-2.9.3 \
lein \
update-in :dependencies conj \[nrepl\ \"0.8.0-alpha5\"\] -- \
update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- \
update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3-SNAPSHOT\"\] -- \
repl :headless :host localhost :port 9999
Is there another port I need to bind?#2020-07-1407:17Ben Slesstrivially solved with --net=host instead of port mapping. huh.#2020-07-1413:06Ian Fernandezmine .dir-locals.el is#2020-07-1413:06Ian Fernandez((clojure-mode
(cider-jack-in-default . "clojure-cli")
(cider-clojure-cli-global-options . "-A:test")
(clojure-align-forms-automatically . nil)))#2020-07-1413:06Ian Fernandezjack-in-default is not giving me directly clojure-cli#2020-07-1413:06Ian Fernandezit opens the menu asking if its lein or clojure-cli#2020-07-1413:07dpsuttonWhat’s the docstring for “cider-jack-in-default”?#2020-07-1413:08Ian Fernandezcider-jack-in-default is a variable defined in ‘cider.el’.
Its value is ‘clojure-cli’
This variable has an alias: ‘cider-default-repl-command’.
This variable is safe as a file local variable if its value
satisfies the predicate ‘symbolp’.
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 0.9.0 of the cider package.
Documentation:
The default tool to use when doing ‘cider-jack-in’ outside a project.
This value will only be consulted when no identifying file types, i.e.
project.clj for leiningen or build.boot for boot, could be found.
As the Clojure CLI is bundled with Clojure itself, it’s the default.
In the absence of the Clojure CLI (e.g. on Windows), we fallback
to Leiningen.
#2020-07-1413:08Ian Fernandezbut I want this on this project#2020-07-1413:08dpsuttonThat says “the value will only be consulted when no identifying file types “ are found#2020-07-1413:09dpsuttonYou want the preferred build tool version#2020-07-1413:09Ian Fernandezahn#2020-07-1413:10Ian Fernandezanyone here knows about a variable I can change to have a default jack-in command?#2020-07-1413:17bozhidar@d.ian.b See cider-preferred-build-tool.#2020-07-1413:17Ian Fernandezthanks!#2020-07-1413:19Ian Fernandezit worked ! @bozhidar =))#2020-07-1416:53myguidingstarHow do I change cljs compiler option when jack-in with cider? I use clojure cli against nodejs. My guess is to start from the form (cider.piggieback/cljs-repl (cljs.repl.node/repl-env))#2020-07-1417:18myguidingstarah, it's the parameters to cljs-repl after the first. I tried a hash-map instead of flattened keys, therefore I got errors#2020-07-1420:43papachanWhen i execute C-u C-c M-j i am able to write and run some alias from my deps.edn. but cider dont execute this alias if i dont remove all the line:
/usr/local/bin/clojure -Sdeps ... -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
#2020-07-1421:07dpsuttoni'm not sure i follow#2020-07-1421:08dominicm@papachan does your alias contain :main-opts?#2020-07-1421:08papachanright now i disable all. i have this:#2020-07-1421:09papachanjust left :extra-paths with a dev directory to check it run clj file there#2020-07-1421:09papachanwhen i call from command line clj -A:dev it run perfect and show a result after being compiled.#2020-07-1421:17papachanOK seems the alias run as expected because i see the files from my dev/ directory. But the difference from calling from command line, it dont compile the files from this directory. i have to do it manually.#2020-07-1421:19dominicm:main-opts do not run with Jack in#2020-07-1421:20papachanah ok. good to know. is there a way to see which config is loaded with cider repl? to check the directory list, classes etc#2020-07-1421:42dpsuttonthe repl will startup and show its startup command#2020-07-1500:06papachanOK after testing several time, i just play with some extra-deps from my alias and check they have been correctly loaded with cider-jackin. Also i configured a global options for my project and it run fine.
((nil . ((cider-clojure-cli-global-options . "-A:dev"))))
#2020-07-1521:58Drew VerleeI'm not sure if this is a shadow-cljs question or a cider question.
Given this dir-locals file:
((nil . (
(cider-preferred-build-tool . shadow-cljs)
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "app"))))
i would expect running "cider-jack-in-cljs" to automatically pick shadow and start watching the app "app".
in my messages buffer i get the following :
[nREPL] Starting server via /usr/local/bin/npx shadow-cljs -d nrepl:0.8.0-alpha5 -d cider/piggieback:0.5.0 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.3-SNAPSHOT server
[nREPL] server started on 8777
[nREPL] Establishing direct connection to localhost:8777 ...
[nREPL] Direct connection to localhost:8777 established
Visit '' in a browser? (y or n) y
I suppose i would expect to see mention of the "app".
ALso i would expect to have a cider connection, but when i check my buffer (or what ever the mini tab at the bottom is) it says "no connection".
If i check my buffers i have a shadow cljs buffer:
;; Startup: /usr/local/bin/npx shadow-cljs -d nrepl:0.8.0-alpha5 -d cider/piggieback:0.5.0 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.3-SNAPSHOT server
;;
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
;;
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (528 files, 1 compiled, 0 warnings, 9.15s)
To quit, type: :cljs/quit
[:selected :app]shadow.user>
cljs.user>
Similary, if i run "shadow-cljs watch app" i get a running shadow cljs server but if i try to connect to the nrepl server presented by "cider-connect-cljs" it fails.#2020-07-1615:08Drew Verleemy root shadow config was referencing old cider deps. This might have been the main issue. Though i believe shadow claims the :dependencies in ./shadow-cljs/config should be ignored if the project was set to use deps.
Atm things seem to be working so i can't get more information. or i guess i could add the old nrepl dependencies back in.#2020-07-1617:58jsabeaudryWhat could cause cider-refresh to fail the second time with only whitespace modifications?#2020-07-1618:01jsabeaudryIt says syntax error compiling the ns form of another namespace because of: No namespace: foo but the other namespace exists and it loaded fine fresh with a new repl.#2020-07-1621:22Ian Fernandezfolks anyone have a tip to ~unalign the cider-alignment that I made in some code?#2020-07-1621:45Drew Verleeare you asking how to undo the current alignment or to not have it align code in general?#2020-07-1706:34bozhidarAlignment doesn't come from CIDER, it's a feature of clojure-mode.#2020-07-1719:11Ian Fernandezaw, ok! thanks @U051BLM8F#2020-07-1719:11Ian FernandezI want to undo alignment in some code because some of teammates hates alignments on maps =(#2020-07-1719:11Ian Fernandezhahahah#2020-07-1722:21Drew Verlee> hates alignments on maps =(
I'm guessing he/she doesn't like that your git commits are updating more code then you changed. Which is a valid issue. i long for the day its not an issue, but there it is.#2020-07-1816:52Ian Fernandez=(#2020-07-1900:46Drew VerleeSo given a .dir-locals (below) file below i would expect it to find refactor-nrepl because its being passed as a dep (as per the message). my guess is that because were telling shadow to use clojure deps for dependency management it somehow doesn't get passed in.
;; ((nil . (
;; (cider-preferred-build-tool . shadow-cljs)
;; (cider-default-cljs-repl . shadow)
;; (cider-shadow-default-options . "frontend"))))
;; no version of refactor-nrepl
;; WARNING: clj-refactor and refactor-nrepl are out of sync.
;; Their versions are 2.5.0 (package: 20200405.1419) and n/a, respectively.
;; You can mute this warning by changing cljr-suppress-middleware-warnings.[:frontend] Compiling ...
;; message
;; [nREPL] Starting server via /usr/bin/npx shadow-cljs -d nrepl:0.8.0-alpha5 -d cider/piggieback:0.5.0 -d refactor-nrepl:2.5.0 -d cider/cider-nrepl:0.25.3-SNAPSHOT server
#2020-07-1900:47Drew Verleemy current solution is to avoid using cider jack in and instead to pass all the nrepl deps @ version=release via a clojure deps alias. with the downside that if a version updates then it will be out of sync with my cider version. but i should get a warning.#2020-07-1901:00dpsuttonthere's nothing in that dir-locals file about refactor-nrepl. where does your expectation come from that "i would expect it to find refactor-nrepl"?#2020-07-1901:04dpsuttonif you cider-jack-in, the following controls what is injected: https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L4108#2020-07-1901:04Drew Verleeisn't that what -d refactor-nrepl:2.5.0 does? -d is "adds additional dependency'#2020-07-1901:04dpsuttonyes but i think you need to configure the middleware yourself when using deps.edn#2020-07-1901:05Drew Verleeso i have to both inject the dep and then tell what to use it?#2020-07-1901:05dpsuttonhttps://github.com/clojure-emacs/cider/issues/2812#2020-07-1901:05dpsuttonif i'm following correctly yes. you need to get the middleware not just on the classpath but as part of the handlers for nrepl when starting up#2020-07-1901:08dpsuttonIf the popular middleware cider-nrepl is found on the classpath (e.g. it’s included in :dependencies), it will be used automatically. No additional configuration required. This can be disabled by setting :nrepl {:cider false}.#2020-07-1901:08dpsuttonhttps://shadow-cljs.github.io/docs/UsersGuide.html#nREPL#2020-07-1901:08dpsuttonso thomas is very nice and looks for cider-nrepl on the classpath and does the right thing. refactor is not privilieged like this and needs to be set up manually#2020-07-1901:09dpsuttonone thing you could do is use a bog standard shadow-cljs project and see what cider does and then imitate that (which is what i did in that issue above where they wanted to use deps.edn)#2020-07-1901:10dpsuttonplexus solves this nicely in chui : https://github.com/lambdaisland/chui/blob/master/.dir-locals.el#L10#2020-07-1901:13Drew Verleei'll need to learn some emacs lisp before i can make sense of that. i guesss thats getting higher and higher on my todo list#2020-07-1901:13Drew Verlee.it would seem to add nrepl middleware though, which i understand the need for.#2020-07-1901:14dpsuttonthis is using cider-jack-in-clojurescript and then adding to the list of cider-jack-in-nrepl-middlewares the value "shadow.cljs.devtools.server.nrepl/middleware"#2020-07-1901:14Drew Verleeso in my case i would additional add refactor-nrepl if i wanted it.#2020-07-1901:14dpsuttonwhich if you use cider-jack-in-clojurescript with shadow and deps you'll need. otherwise you need to add refactor-nrepl into the middleware when starting it up manually from the command line#2020-07-1901:16dpsuttonhere's what's going on:
1. from the command line, shadow automatically does its own middleware and cider's
2. from emacs, CIDER will automatically use cider-nrepl and refactor-nrepl middleware.
If you want to use deps.edn and shadow from emacs, you need to make sure shadow's middleware is on set up correctly (the dir-locals link i sent you from chui). If you want to start it up from the command line you need to make sure that you get refactor-nrepl middleware manually added in#2020-07-1901:18Drew Verleei see. so i was incorrect, i wont need to add refactor-nrepl if i use said dir-locals.el because what i miss in that setup is the shadow middleware.#2020-07-1901:19dpsuttonthat's my understanding yes. refactor-nrepl gets inserted automatically if you are using clj-refactor.el#2020-07-1901:24Drew Verleegotcha. This has been very helpful. I think the next thing i need to do is understand what the middleware is doing. But not tonight 🙂#2020-07-1901:24dpsuttonthe hardest part about middleware is tracing through the several projects they span and getting a way to prod them in a repl. Sometimes its tough to figure out if you should look in orchard, cider-nrepl, or nrepl itself.#2020-07-1901:39Drew VerleeMy thought was to have emacs manage the nrepl deps so that I didn't have to sync them. Maybe that's not a good goal.
What you explained above makes sense. I think an additional issue was that when I was running shadow cljs from the command line and was passing it nrepl as a dep, I was unable to connect from emacs to the port it exposed.#2020-07-1903:05dpsuttonI think that’s a good goal. And if it’s deps that manages your deps all you need is that middleware bit from chui #2020-07-2013:50vemvSometimes (probably rarely, and only in large codebases), in a specific ns, a specific macro will not get recognised as such, so I lose syntax highlighting and indentation rules for that specific macro
That very same macro, in all other ns'es will get recognised properly.
Does this sound familiar? Currently or in the past few years?
(I use a version-frozen CIDER from circa 2017 so this may have been fixed)#2020-07-2113:23bozhidarHaven’t seen this, but you should probably upgrade at some point. I think today CIDER is much better than 2017. 🙂#2020-07-2123:25vemvThanks, I appreciate knowing that this is bit of an odd issue to have.
Definitely want to upgrade, it just doesn't happen to be trivial with all my forked stuff 🌀#2020-07-2014:58magraHi, I have a fulcro project. At the moment I jack-in-clj&cljs via shadow-cljs. It works on the whole but I have conflikting jvm opts for the backend and the UI. I now have different aliases in deps.edn. I want to have cljs and clj to have two separate jvms with two separate nrepl connections to allow for the backend and UI to be independent of each other (and run with separate jvm-opts). When I jack in to one of them and then try to jack-in to the other I get a message that there is already a connection and whether I want to connct a sibling instead, which is what I do not want since it would get me conflicting jvm-opts. Is there a way to do this or should I switch to starting the jvms by hand and then cider-connect?#2020-07-2015:12dpsuttoni think sibling is different than what you are reading into it.#2020-07-2015:12dpsuttonjack in clj and then jack in cljs and have them be siblings. should work fine#2020-07-2015:18magra@dpsutton Thanks! I think you are right. I was so damned sure what it does from "experience" from a year ago.#2020-07-2015:19dpsuttonawesome! i haven't really delved into sesman and sessions and what exactly sibling means. but i agree with you that its a word that brings a lot of connotations#2020-07-2015:19dpsuttonmade me nervous the first few times i used it too#2020-07-2015:19magraYou won't believe how much misconfiguration of my dev environment I did to work around this misconception of mine.#2020-07-2015:19dpsuttonhaha 🙂#2020-07-2118:21jhacksI’m trying out cider-toggle-trace-var and cider-toggle-trace-ns. Is there any way to list the vars or namespaces that are being traced. It looks like some vars have the cider-traced-face applied and some don’t (in Emacs).
Also, is there anyway to disable all tracing without tracking down each var/namespace individually?#2020-07-2118:21jhacksThis is the reference I’m using: https://docs.cider.mx/cider/0.23/debugging/tracing.html#2020-07-2120:10borkdudeIs it a good habit to check in .dir-locals files into source control? E.g. see https://github.com/borkdude/carve/pull/29.
That PR wants to add a .dir-locals to "teach" CIDER that it should include :test profile from deps.edn. What are other ways of doing this?#2020-07-2120:18practicalli-johnIf it's just a common thing like a :test alias to add the test path, then it seems very low value. It's a general alias that can be added to the .clojure/deps.edn file and it can be used via C-u cider-jack-in as well as a .dir-locals.#2020-07-2120:20borkdudeThanks.#2020-07-2404:18bozhidarDepends on the nature of the things in the .dir-locals.el - typically I check it in and include there stuff that are “standard” for the project. People can have a local .dir-locals2.el on top of this.#2020-07-2406:27borkdudeaha#2020-07-2120:12dpsuttonits tough. if someone has more things in their dir-locals its better for it to be gitignored so there's no fighting and unstaged differences all the time#2020-07-2120:12dpsuttonat work we recently had to have personal ones so put a template in the readme and added it to gitignore#2020-07-2120:13borkdudeThat's my feeling too. I don't want to dictate how people's editor config should look like.#2020-07-2120:14borkdudeDoes cider have an option to include alias deps when jacking in? I myself start the REPL always from the command line, but I guess a lot of people just use cider-jack-in#2020-07-2120:14dpsuttonyes. jack in with a prefix allows editing of the jack in command#2020-07-2120:14dpsuttonthe keybinding is C-c M-j so C-u C-c M-j or C-u m-x cider-jack-in#2020-07-2120:17borkdudecool, thanks#2020-07-2120:26practicalli-johnIf your project docs include guides on using with tools, you could include an example. There are lots of possible options for .dir-locals, e.g https://practicalli.github.io/spacemacs/clojure-projects/project-configuration.html#2020-07-2120:26borkdudeRight, and that's a good reason not to include it in source control, because everyone wants to have a slightly different one#2020-07-2120:46practicalli-johnReading the docs for Carve, the PR seems unrelated to the use of Carve. So I wouldn't even add this to the docs.#2020-07-2120:47borkdudethis is carve, not calva#2020-07-2120:52practicalli-johnCan't spell anymore... The docs on the repo of the PR doesn't seem to discuss running carve from a Clojure repl environment, just from a command line or CI service.#2020-07-2121:17borkdudeThe PR is intented to make carve unit tests work with CIDER#2020-07-2120:41dominicmIt's long been a wish of mine that project vs user configuration was distinguished. Edge does the "wrong" thing here, but the user experience is far better because of it. Edge's dir locals sets a few more things though.#2020-07-2120:42dominicmVim doesn't really have any directory config, and the user space solutions are pretty flexible.#2020-07-2120:43dpsuttonwhat is "edge" here?#2020-07-2120:47practicalli-johnJuxt Edge, a curated way to write Clojure projects
https://www.juxt.land/edge/index.html#2020-07-2120:44borkdudeThe new browser from Microsoft? Although I suspect that's not what he meant#2020-07-2120:44dpsuttonyeah that's the only thing i can think of called edge. maybe is a vim plugin or something#2020-07-2120:48dominicmSorry. JUXT edge. The clojure starter project. https://github.com/juxt/edge
This is what is generated: https://github.com/juxt/edge/blob/master/lib/edge-app-template/resources/clj/new/app.template/dir-locals.el#2020-07-2121:04dpsuttonnever used it. i'll give it a shot next time#2020-07-2121:05dpsuttonnot clear to me though. is that a sample repo that you clone and then change or is it a template for clj-new/lein new#2020-07-2206:31dominicmThe edge docs are more useful. It's a repo you clone, and build your application in. The idea is that the "framework" can be modified very easily. So there's never a blocker to going to production.
There's a small template which helps you create an application within the repo.#2020-07-2209:26Quentin Le GuennecHello, cider-jack-in-clj fails because lein cannot download a dependency, even though that dependency is already in my local maven repositories. Any idea?#2020-07-2211:08practicalli-johnDoes it fail to download the library when using lein deps ?
Do you have an old version of Leiningen?
Can you start a REPL outside of CIDER with Leiningen?
Does the library exist on Maven Central or Clojars?#2020-07-2213:12Carmine Casciatofor whatever reason, I have to run clojure in the directory first, then I can jack in#2020-07-2213:46dominicmIs it a snapshot?#2020-07-2214:26Quentin Le GuennecI deleted ~/.m2/repository/repo_xxx/_remote.repositories and it solved the issue#2020-07-2312:06zackteoHello! Is there a setting in CIDER that splits up string output if it is too long? Or isit just my code hmm#2020-07-2312:53KevinNot sure, maybe try setting cider-repl-use-pretty-printing to nil ?#2020-07-2312:57zackteoAh yes that worked! hmmmm not sure how I should proceed tho, but I guess this isn't exactly too common an occurrence hmmm#2020-07-2313:03KevinNot sure why it's being printed that way. When I print a list in the repl (with the option enabled) it doesn't get printed like that#2020-07-2313:05KevinOh wait, nevermind. If I print a (long) list of symbols I get the same#2020-07-2313:07zackteoOh whoops yeap I guess it isn't a string but a list of symbols!#2020-07-2313:25KevinJust curious, are you making a text adventure game? :)#2020-07-2320:55Drew Verleewhy is it a list of symbols out of curiousity#2020-07-2709:59tvirolaiLooks like it's the text adventure example from Land of Lisp book ported to Clojure.#2020-07-2710:09zackteo@UG9U7TPDZ I wish I were or rather using clojure to make something in general but I was reading through http://www.lisperati.com/clojure-spels/casting.html#2020-07-2710:10KevinVery cool though, I should really read this sometime#2020-07-2710:15zackteoIs actually a pretty short read :o I heard casting spels with lisp was a good read. Was just an okay read for me :thinking_face:. Tho the LFE version of this is apparently pretty extensive and good hmmm#2020-07-2702:20frozenlockI throw an ex-info with a spec-related explain-data (with ::s/failure) and my message is replaced.
I think it's caused by this https://github.com/clojure-emacs/cider-nrepl/blob/7358676ae1db33b4807bfa1bbaa57879d54573ae/src/cider/nrepl/middleware/stacktrace.clj#L294#2020-07-2702:21frozenlockIs this a bug? I like the way the spec failure is printed, but I still would like to see my original error message with it.#2020-07-2715:40ghadican someone explain or point me to documentation on how CIDER assigns/links REPLs and editor sessions (.nrepl-port stuff?)#2020-07-2717:17kirill.salykinyou probably saw it already, but just in https://docs.cider.mx/cider/usage/managing_connections.html#2020-07-2912:02eval-on-pointIs there a way to set default cli options when you are jacking in without a project? It would be nice to have some choice dependencies loaded in without having to manually prefix cider-jack-in and include your profiles#2020-07-2915:45zaneYes. You could set cider-clojure-cli-global-options.#2020-07-2915:45zaneIf you wanted different options per-project you could use .dir-locals.#2020-07-2918:42eval-on-pointright, thanks. I wasn't thinking that it would be over-written if my project had a .dir-locals#2020-07-2919:32zaneYou’re welcome! The docs have a section on this: https://docs.cider.mx/cider/config/project_config.html#2020-07-3018:35Clark CollinsDoes anyone know of a good source or project template setting up Cider, Shadow-CLJS, Reagent? I can start a server and connect Cider to it, but I’m having some difficulty sending forms to the repl.#2020-07-3019:44dpsuttoncan you describe what you're doing? if connecting to an existing shadow server use shadow-select. if starting shadow's server in emacs just use shadow#2020-07-3020:54Clark CollinsI can start the server and connect to it, can do things in the repl which are sent to the browser console (js/console.log “foobar”). But I’d like to to do cider-eval-last-sexp-to-replwhich does nothing for me currently.#2020-07-3021:06Clark CollinsBasically I can’t C-x C-e anything from a source buffer to the repl#2020-07-3021:41Clark Collins~For whatever reason it’s now working.~ Tried to replicate, broken again…#2020-07-3021:10ddellacostahey folks, cross-posting here at thheller’s suggestion: https://clojurians.slack.com/archives/C6N245JGG/p1596127530257600#2020-07-3021:11dpsuttonuse shadow-select instead of shadow if you have the server running already#2020-07-3021:11dpsutton(I think)#2020-07-3021:12dpsuttonand cider-connect-cljs not jack in. jack-in will own the process but you've already got one started#2020-07-3021:12ddellacostayeah that’s what I am doing, sounds like the docs are wrong then#2020-07-3021:12ddellacostathanks :thumbsup:#2020-08-0105:07peeyWhen I'm using cider to debug, I can evaluate arbitrary expressions
in the minibuffer by pressing e in the debugging context. Can I also use the repl to execute things in the debugging context?#2020-08-0206:19bozhidarPresently you can't.#2020-08-0318:44peeyThanks!#2020-08-0107:50peeyAlso cider-test-run-all-tests gives some weird results for programs containing state (e.g. atom), but lein test on the CLI gives the expected behavior. Are there some gotchas for cider related to module loading and reloading that I should be aware of?#2020-08-0108:27dpsuttondo you have a minimal repo? nothing springs to mind#2020-08-0206:20bozhidarSame here.#2020-08-0302:31mafcocincoI’m sorry for the lack of technical details WRT this question, but I’m kind of stumped. Under a standard configuration of CIDER, what is the difference, if any between launching a REPL via cider-jack-in vs. launching it from a terminal window with lein repl. The reason I ask is that I’m building a Clojure client library for FoundationDB and when I launch my REPL using lein repl from a terminal window, the classes from the FoundationDB java library load without a problem. However, when I try to load those same classes via the CIDER REPL, I get a NoClassDefFound exception when trying to use one of the imported classes (`com.apple.foundationdb.FDB`). The import works correctly but, implying the name is present. The error does not occur until I try to use the class. Just looking for some general guidance one where to look/ideas for debugging as my FoundationDB configuration appears to be correct (works from the terminal REPL) and I’m not really sure what to try next WRT debugging the REPL configuration within CIDER.#2020-08-0302:32mafcocincoOne other note, I check to see if there was a difference in classpath between the 2 REPL instances and there was not.#2020-08-0302:51dpsuttonWhen you cider jack in it should print the startup command at the top of the repl. Try identical steps from “lein repl “ and then the version cider spits out#2020-08-0303:25mafcocincoGreat suggestion, tried it and works from the terminal, still not working from CIDER.#2020-08-0303:32mafcocincoFound a work around with cider-connect. Since the process is working in my terminal with an nREPL running, I just pointed CIDER to that instance and it appears to be working fine. A little extra setup for this specific project, but it works!#2020-08-0303:34dpsuttonIs this open source?#2020-08-0303:34dpsuttonI’d be interested in a minimal repro #2020-08-0303:45mafcocincoit is not but I’ll see if I can get a minimal OSS repo for you this week.#2020-08-0303:52dpsuttonThat would be great#2020-08-0314:54bozhidarCIDER 0.26 (Nesebar) and nREPL 0.8 are out! More details - https://github.com/clojure-emacs/cider/releases/tag/v0.26.0 and https://metaredux.com/posts/2020/06/15/nrepl-0-8-evolving-the-protocol.html Special thanks to Clojurists Together for their support and to all the contributors for their help! Cheers! cider#2020-08-0319:59richiardiandreaHi there, long time no see in this channel 😄 (the trend might change)
I was wondering if cider has an option to stop asking for symbol to document on C-c C-d d - most of the times I want to ask for doc at point#2020-08-0320:01dpsutton@richiardiandrea
(defun cider-prompt-for-symbol-function (&optional invert)
"Prompt for symbol if funcall `cider--should-prompt-for-symbol' is truthy.
Otherwise attempt to use the symbol at point for the command, and only
prompt if that throws an error.
INVERT is used to invert the semantics of the function `cider--should-prompt-for-symbol'."
(if (cider--should-prompt-for-symbol invert)
#'cider-read-symbol-name
#'cider-try-symbol-at-point))#2020-08-0320:01richiardiandreaawesome, sorry I got lazy 😄#2020-08-0320:01richiardiandreathank you very much#2020-08-0320:01dpsuttonof course!#2020-08-0320:05richiardiandreaaaaand the defcustom is cider-prompt-for-symbol#2020-08-0408:03bozhidarThat's one default I will probably change at some point. Originally it wasn't prompting, someone pointed out that most similar command in Emacs were prompting and we needed to be consistent with them, so that's how we ended up here. I still don't see much value in the current default, though. I just got used to it. 🙂#2020-08-0602:38yuhanfor what it's worth, both Spacemacs and Doom set that variable to nil as a "sensible default"#2020-08-0320:05richiardiandreaaaaand the defcustom is cider-prompt-for-symbol#2020-08-0509:56practicalli-johnAny recommendations for books / tutorials / blogs to learn elisp enough to help me hack on CIDER ?#2020-08-0510:05Johannes F. Knauf@U05254DQM
• https://exercism.io/my/tracks/emacs-lisp
• https://www.gnu.org/software/emacs/manual/html_node/elisp/index.html#Top
• https://www.gnu.org/software/emacs/manual/html_node/eintr/#2020-08-0510:06Johannes F. KnaufThese are the resources, I used. But I am far from being an expert.
What I think is far more difficult than learning the elisp language is getting a grasp of the ecosystem that is in use nowadays.#2020-08-0510:07Johannes F. KnaufBut for hacking on an existing package that should be fine.#2020-08-0511:52practicalli-johnThanks, its useful to know which things you used. I'll be adding what I find useful to the Practicalli Spacemacs book and to http://docs.cider.mx if I find any extra tips on Hacking CIDER.#2020-08-0721:24justinbarclayI can't comment on reading docs or articles too much...
But I have found C-h f , C-h v , M-. and C-u C-M-x have helped me learn a ton about whatever I'm trying to hack on. (Define function, define variable, xref-find-definitions, and eval-defun+edebug-it)#2020-08-0721:29justinbarclayXah Lee also has an intro to elisp series http://ergoemacs.org/emacs/elisp_basics.html#2020-08-0603:54nivekuilare there any workarounds to this issue? https://github.com/clojure-emacs/cider/issues/1775#2020-08-0701:26Steinerwhen there is some variable conflict in cider-repl, how can I do to reset cider?#2020-08-0710:11practicalli-johncider-restart or if you know the var name use cider-undef and type the name to remove from the repl.#2020-08-0710:16Michaël SalihiYou can also use sesman-restart (Spacemacs shortcuts`, m q r`) if you want restart session without restarting the repl.#2020-08-0800:57Steiner@U05254DQM is that needed to start cider-mode?
and I don't find cider-reset in cider-mode#2020-08-0801:01practicalli-johnSorry, should have been cider-restart. My brain is full of flu...#2020-08-0801:02SteinerI have tried cider-restart before, but it still store the former status#2020-08-0801:16practicalli-johnHave you tried cider-ns-refresh ? I assume you fixed the conflict and saved the changes and if you stop/start the REPL the conflict goes away.#2020-08-0801:26Steinernope, I will do it later#2020-08-0717:39bennygetting this with auto-complete (after pausing ~1s+). any ideas?#2020-08-0718:47KevinI remember (vaguely) having this issue. I switched to company-mode instead of auto-complete-mode#2020-08-0718:47KevinSeems to be the "better" auto completer for Emacs these days#2020-08-0719:24bennyi don’t seem to have an auto-complete-mode — seems company mode is already on 😕#2020-08-0719:51KevinSorry, I remembered wrong. Try this instead
(setq cider-enhanced-cljs-completion-p nil)
#2020-08-0720:08bennythat stopped the error, thanks @UG9U7TPDZ!#2020-08-0802:19richiardiandreaI think suitable enhanced completions got broken after a shadow-cljs changes...I wanted to have a look there but did not have time#2020-08-0808:36bozhidarYeah, it has been broken for a while now. I disabled it completely in CIDER 0.26 while someone gets to fix it.#2020-08-0721:13ziltiSo when using cider-connect-clj&cljs to connect to a running shadow-cljs instance, how do I get the cljs REPL to work? I get a REPL, no errors, the first line just before the prompt says [:selected :main] but as soon as I send anything to the REPL all I get is "No available JS runtime."#2020-08-0721:13zilti;; ClojureScript REPL type: shadow-select
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/nrepl-select :main))
#2020-08-0721:25dpsuttonthis happens because cljs needs a runtime, usually either a browser or a node instance. is this a webapp? if so open your browser and it should all work out#2020-08-0721:28thheller@zilti see https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting#2020-08-0808:51Jim NewtonIf I have a function with a long docstring, and I type in the buffer (my-function then emacs shows me the first few lines of the docstring in the minibuffer, when what I really want to see is the arglist. I suppose the arglist is at the end of the minibuffer, but it is obscured. Shouldn't they be shown in the other order?#2020-08-0808:53Jim Newton#2020-08-0815:58Jim NewtonIf there a way in cider to see the values of the local variables when examining a stack trace?#2020-08-0816:06dpsuttoni don't believe stack traces have any such information to provide#2020-08-0816:06dpsuttonyou can use (ex-info "boom" {:values :of-interest}) and these should be shown in the stack trace#2020-08-0816:11Jim Newtonyes thats for stacktraces caused by my call to ex-info.#2020-08-0816:11dpsuttonI thought it should work. Let me see#2020-08-0816:11Jim Newtonpitty that local variables are not available in stack traces.#2020-08-0816:33justinbarclayI think what you're looking for is eldoc? https://docs.cider.mx/cider/config/eldoc.html#2020-08-0816:38kiranshilaHey everyone. In the piggieback docs, it says I can set :nrepl.middleware.print/print to nrepl.util.print/pr to force using cljs's pr. How exactly do I set that? Is that something I put into dir-locals?#2020-08-0817:13bozhidarSee https://docs.cider.mx/cider/0.26/usage/pretty_printing.html#2020-08-0817:26kiranshilaThanks#2020-08-0817:02Jim NewtonYes, I have eldoc-mode enabled already. The problem is that the text of the docstring preceeds the arglist.#2020-08-0817:11bozhidar@jimka.issy You're getting the docstring, because for some reason this var wasn't resolved to a function type. You should check *nrepl-messages* to see what types was assigned to it by nREPL/cider-nrepl.#2020-08-0910:31Jim Newtonwhat is `*nrepl-messages*` , is it an emacs buffer or a clojure dynamic variable?#2020-08-0910:32Jim NewtonI don't find such a clojure variable, nor emacs buffer nor emacs-lisp variable.#2020-08-0910:35Jim NewtonAhh, I think I see the problem. it is defined like this. So the arglist is [_value type-designator] but cider can't figure that out. perhaps cider is not smart enough to get the arglist of the function pass as 3rd argument to defmulti ?
(defmulti typep
"Like instance? except that the arguments are reversed, and the
given type designator need not be a class. The given type
designator may be a (1) class, (2) a symbol resolving to a class, or
(3) a CL style type designator such as
(not A)
(and A B)
(or A B)
(satisfies A B)
(= obj)
(member a b c)"
(fn [_value type-designator]
(if (sequential? type-designator)
(first type-designator)
type-designator)))#2020-08-1107:28kah0onaHi y’all, got a question on .dir-locals
Since I’ve never used it before (i know), I wonder how it is expected to work. I want to select ‘figwheel-main’ as the REPL and "dev" as the build ID.
I jack in with cider-jack-in-clj&cljs#2020-08-1107:28kah0onabut then it still prompts me for which repl I want.#2020-08-1107:28kah0onaI have the .dir-locals.el file in my project root#2020-08-1107:29kah0onashould I have a .cljs file buffer open before jacking in?#2020-08-1107:33dpsuttoncan you paste your dirlocals file here?#2020-08-1107:36kah0ona((clojurescript-mode . ((cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . "dev"))))#2020-08-1107:37kah0onaalso: i jack in using above cider-jack-in-clj&cljs using , \, my spacemacs binding#2020-08-1107:37kah0ona(not sure if that matters)#2020-08-1107:37kah0ona(imo it shoudln’t ;-))#2020-08-1107:47dpsuttonyeah those are only available when the buffer is in clojurescript mode. i always use nil there instead#2020-08-1107:48kah0onaso:
((nil . ((cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . "dev"))))#2020-08-1107:48kah0ona?#2020-08-1107:48dpsuttonyeah restart and give that a whirl#2020-08-1107:48kah0onathx#2020-08-1109:26CaseyCan cider help automatically add/modify :require forms to the current namespace when an unresolved var from is typed?#2020-08-1110:01bozhidar@ramblurr I think clj-refactor.el had some functionality that does this. CIDER itself doesn't having anything on the subject.#2020-08-1110:06Caseygotcha, I'll take a look#2020-08-1110:09zackteoBy any chance does anyone know why my vector of string will be split up to 1 element per line?
volcanoes.core> (first csv-lines)
;; => ["Global Volcanism Program - Volcanoes of the World 4.7.6"
""
""
"Basic List of Holocene Volcanoes"
""
"Downloaded on 14 Mar 2019 at 12:00 PM"
""
""
#2020-08-1110:11zackteothis is in the cider-repl window#2020-08-1110:24bozhidar@zackteo CIDER enables pretty-printing by default. You can turn it off if you'd like.#2020-08-1110:25zackteo@bozhidar how do I turn it off/toggle it? :o#2020-08-1110:26bozhidarhttps://docs.cider.mx/cider/0.26/repl/configuration.html#pretty-printing-in-the-repl#2020-08-1110:27zackteoThank you!!!#2020-08-1116:46MatDHi. If anyone is using Emacs Doom and have a few minutes to spare, I'm trying to test this demo repo and the sequence seems off using Emacs Doom (the author is not using doom). I'm trying to assert if doom is changing the cider prompts sequence somehow. https://github.com/robert-stuttaford/clj-cljs-app/issues/2#2020-08-1201:04MatDNevermind, I figured it out#2020-08-1123:31stardivinerI use cider-doc on clojure.lang.RT. But it does not open with correct java doc URL. Is this an error bug? Do you have same behavior?#2020-08-1203:53jumarThis depends on your setup, java version, etc. I haven't been able to do that either, at least since I'm using JDK version > 8.
Advice usually goes like adding java sources to your project explicitly.
Here's one issue mentioning this problem: https://github.com/clojure-emacs/cider/issues/2269#2020-08-1209:06stardivinerI got it, I installed package openjdk-src and openjdk-doc . The Javadoc is available now. Thanks a lot @U06BE1L6T#2020-08-1210:06jumarPerfect; btw. which JDK version you use?#2020-08-1210:06stardiviner14.0.1 version#2020-08-1210:07stardivinerI'm using Arch Linux.#2020-08-1210:07stardivinerInstalling source and docs package should also works for systems like Ubuntu etc.#2020-08-1210:23jumarYou're lucky 🙂. I have sources installed on my Mac OS in /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home/lib/src.zip but it doesn't work for me#2020-08-1210:26stardivinerI used to proposed a related feature request, https://github.com/clojure-emacs/cider/issues/2406 You might can inspired from it.#2020-08-1208:44Ben SlessWhat's the best way of configuring the java version per project? I have not found a way of setting environment variables with dir-locals and cider has no variable which would translate to LEIN_JAVA_CMD
This was probably asked in the past but I was unable to find an answer online#2020-08-1209:41bozhidar@ben.sless I never thought of this actually, as I typically work on projects that target the same JDKs. Probably it'd be easiest to change the Emacs exec-path in dir-locals.#2020-08-1210:01Ben Slesshuh, didn't occur to me to manipulate exec-path. I'll try and report results. Thanks 🙂#2020-08-1210:09Ben SlessDo dir-locals support something like
(cons "/usr/lib/jvm/java-14-openjdk-amd64/bin/" exec-path)
Its read literally 😞#2020-08-1617:36bozhidarYou need eval if you want to invoke some function in dir-locals - https://emacs.stackexchange.com/questions/21955/calling-functions-in-dir-locals-in-emacs#2020-08-1210:09jumarI fought with various different setups using jenv on Mac OS in the past but eventually gave up - now I'm using the most recent version (14) for all the projects#2020-08-1210:16Ben SlessWell, I can just put this in a script and set it as a dir-local ((nil . ((cider-lein-command . "lein14"))))
cat lein14
#!/usr/bin/env sh
LEIN_JAVA_CMD=/usr/lib/jvm/java-14-openjdk-amd64/bin/java lein "$@"
#2020-08-1210:16bozhidarYeah, that would work.#2020-08-1210:52plexusWould someone with commit bit on piggieback have time to review this PR? https://github.com/nrepl/piggieback/pull/117 🙏#2020-08-1212:15bozhidarIt's on my todo list.#2020-08-1213:28plexusthank you ❤️#2020-08-1210:53plexusCurrently when using a browser repl-env the logic to pprint evaluation results will error. This fixes that.#2020-08-1211:16mhcathello cider people, I have a strange error which shows up when I try to cljr jump to references to a function at point - it gives me the “this will take a long time” warning, then computes for a bit, then fails with an exception complaining about a bad keyword in a dev namsepace. The “cause” exception has the following message and first few lines:
Caused by: clojure.lang.ExceptionInfo: [line 149, col 32] Invalid keyword: ::streams/topology. {:type :reader-exception, :ex-kind :reader-error, :file "/Users/joni/Scratch/xapix/clojud/dev/src/dev.clj", :line 149, :col 32}
at refactor_nrepl.util$ex_info_assoc.invokeStatic(util.clj:27)
at refactor_nrepl.util$ex_info_assoc.doInvoke(util.clj:24)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:660)
at refactor_nrepl.find.find_macros$find_macro_definitions_in_file.invokeStatic(find_macros.clj:51)#2020-08-1214:29practicalli-johnSounds like you have a keyword in the dev.clj file that is invalid.
Some clj-refactor commands require all the code to compile, so if there are bugs in the code they will fail.#2020-08-1215:37mhcatwell sure, but the keyword is valid - streams is an alias for a required namespace. A few minutes later I was actually able to run the same command on a different symbol and it worked. That keyword is defined as an integrant key, if that’s relevant#2020-08-1215:38mhcatthe fact that it worked after a while, suggests to me that some code was not loaded prior to the first invocation, but was loaded before I ran it again.#2020-08-1215:40mhcathmm, I had some luck in the past disabling the pre-assembly of the AST, because of weird code loading issues and exceptions, as well as dynamic rebinds which caused errors - perhaps I’ll give that a shot next time I see this#2020-08-1211:16mhcatI can make a bug later if that’s required, but I figured I’d ask around first#2020-08-1307:45robert-stuttafordnewest cider requires paredit-24, but emacs comes bundled with paredit-22. can anyone point me to a snippet that'll force the correct version of paredit to be installed from melpa, please?#2020-08-1310:01robert-stuttafordroot cause: i had the wrong melpa domain in my package list :face_palm: .#2020-08-1312:14borkdudeI'm working on files mounted via a network share while connected to a REPL on the remote machine#2020-08-1312:15borkdudeI was hoping that cider-find-var would work, since the paths stored as metadata on the vars are relative#2020-08-1312:17borkdudeI guess I'll have to write some elisp myself unless someone has an idea here#2020-08-1312:18borkdudeMaybe cider could support some base-path setting which accounts for the difference in mount point#2020-08-1312:43borkdudeI've made a horrible horrible hack and made a directory in linux named /Users/borkdude/mnt/dre/DocSearch/app so I have exactly the same paths on linux and macOS#2020-08-1312:43borkdudeAnd now it works 😂#2020-08-1313:26dpsuttonBorkdude check out “cider-path-translations”#2020-08-1313:26dpsuttonI use it for docker but it might work here#2020-08-1313:27borkdudewow... interesting... !#2020-08-1313:28kardanWe got some elisp, if that does not work#2020-08-1313:28kardanhttps://github.com/akvo/akvo-lumen/blob/master/backend/.dir-locals.el#2020-08-1313:28dpsutton@kardan that was my exact motivation. It might work for you#2020-08-1313:29kardan(as in if it’s not available in the version). Using the cider-path-translation sound like the goto path#2020-08-1313:29kardan🙂#2020-08-1313:41borkdudeHow do I clear settings that were in dir-locals? I got it wrong the first time and now it seems they are cached somewhere?#2020-08-1313:42borkdudenever mind, restarting worked. this is AWESOME!#2020-08-1313:43kardanWith a lot of disclaimers I think you can close buffers that lives in that path and then reopen#2020-08-1317:35vemvDoes CIDER make use of javadoc-only dependencies in the form of [ "1.10.1" :classifier "javadocs"]?
My impression (from skimming the .el code) is that not. Which wouldn't be much surprising, as parsing javadocs' .html sounds like a pain :)#2020-08-1319:52dominicmIt does.#2020-08-1319:53dominicmJust isn't anything to do with .el. It's in orchard.#2020-08-1320:09borkdudeIssue with CIDER 0.26 and 0.27.0snapshot and babashka + cider-doc :
https://github.com/babashka/babashka.nrepl/issues/26#2020-08-1419:41bozhidarI've cut 0.26.1 that includes the fix for this bug.#2020-08-1419:41borkdude:thumbsup:#2020-08-1322:45agI wanna add a custom cider-debugger command. Has anyone done something like that?#2020-08-1617:31bozhidarI think you can just check the code for the existing commands. It's relatively straightforward.#2020-08-1405:10agI want cider--pprint-eval-form of a given value, similarly how eval works while debugging#2020-08-1602:27Ian Fernandezhello, there's a way to redirect output of cider-eval-print-last-sexp to kill-new ?#2020-08-1617:30bozhidar@d.ian.b Currently no.#2020-08-1617:49dpsutton(cider-interactive-eval "(java.util.UUID/randomUUID)"
(nrepl-make-response-handler nil
(lambda (_buffer value)
(kill-new value)
(message "copied %s" value))
(lambda (_buffer out)
(kill-new out)
(message "copied %s" out))
(lambda (_ err)
(message "error evaluating: %s" err))
'()))#2020-08-1617:50dpsuttonthat copies both out and returned values. not sure if that's what you want. but read the docstring for nrepl-make-response-handler. or you could check out the source of cider-interactive-eval and pass a single handler in there that does what you want#2020-08-1617:52Ian FernandezI've stopped on nrepl-make-response-handler trying to understand#2020-08-1617:52Ian Fernandezfirst steps on emacs-lisp 😅#2020-08-1617:52Ian Fernandezthanks @dpsutton#2020-08-1617:58dpsutton(cider-interactive-eval "(java.util.UUID/randomUUID)"
(lambda (response)
(nrepl-dbind-response response (value)
(when value
(kill-new (format "%s" value))
(message "copied %s" value)))))#2020-08-1807:55bozhidarSomething like this will get the job done, but without the pprint that @d.ian.b asked for, so you might consider using its handler instead.#2020-08-1617:59dpsuttonbit easier i suppose.#2020-08-1618:01Ian Fernandezwhat is nrepl-dbind-response ?#2020-08-1618:08Ian Fernandezwow, defmacro on elisp rs#2020-08-1618:08Ian FernandezI have to study more, thanks @dpsutton#2020-08-1618:09dpsuttonyour emacs should just go to definition if you hit m-. you can also use m-x apropos to read the docstring. but it should be a bit understandable: given a response from nrepl, bind the binding value to some notion of value in the repsonse. its essentially a dictionary that's defined somewhere in CIDER#2020-08-1618:12Ian Fernandezyeah, I've put the entire dictionary on kill-new but it was not a stringp#2020-08-1618:12Ian Fernandeznewbie question, how can I see the type of some output on elisp? there is a (type output) ?#2020-08-1618:12dpsuttonthat would just be map destructuring in clojure. but emacs lisp doesn't have that functionality baked in. there are some macros that provide it but they are not super standard and have a bit of weird syntax#2020-08-1807:53bozhidarIt has some destructuring support today ((e.g. pcase-let), but it didn't have it 7 years ago. 😄#2020-08-1618:14dpsuttonif you step through the function with the debugger it should be pretty visible. define the form above in a function and then instrument it and then call it#2020-08-1618:14dpsuttonalternatively, check out nrepl-dict.el and its just a simple hashmap i believe#2020-08-1618:15dpsuttonif you check out nrepl-make-response-handler you can see what it is using nrepl-dbind-response to capture
(nrepl-dbind-response response (content-type content-transfer-encoding body
value ns out err status id)#2020-08-1711:33zackteoMight be a silly question but how does one add dependencies, without killing cider and starting it up again. I can't seem to get it to work with cider-restart#2020-08-1712:13practicalli-johnThe most reliable way I found was to restart the cider repl.
I use deps.edn projects and stop/starting a repl only takes a couple of seconds.#2020-08-1712:14zackteo@U05254DQM I was looking at your guide actually https://practicalli.github.io/spacemacs/refactor/clj-refactor/managing-library-dependencies.html
does cider-restart usually work? 😮#2020-08-1712:54practicalli-johnIt seems to depend on the project and the version of CIDER / clj-refactor. I found clj-refactor unreliable and I beleive hot loading of dependencies in a running REPL was disabled, as it used to cause a lot of issues at one time. Not sure if it was re-enabled.#2020-08-1713:03zackteoI see I see :o#2020-08-1713:28practicalli-johnAdding new namespaces works reliably without restarting the REPL, cider-ns-reload or cider-ns-refresh, but I've always stopped/started the REPL when adding a library dependency.
cider-restart as I understand it only restarts the connection to the REPL and not the REPL itself. So I use cider-quit and cider-jack-in-clj#2020-08-1713:28practicalli-johnFor example, if you start a REPL from cider-jack-in-clj and evaluate code, after a cider-restart those evaluations will still be there. At least that is what happened when I tested this.#2020-08-1807:46Trung DinhI use sesman-restart after add dependencies, it works for me#2020-08-1810:19zackteoOhhhh @U018XDZJ4RG What's sesman actually? :o#2020-08-1812:15Trung Dinhhttps://metaredux.com/posts/2019/11/07/hard-cider-hard-restart.html here you go#2020-08-1812:16practicalli-john@UUSQHP535 sesman is the session manager that is used with Cider. It can be used for managing all connections to the REPL. sesman-start provides a menu to choose a Clojure or ClojureScript REPL to jack-in to or connect to.
sesman has a browser to show all current connections
https://develop.spacemacs.org/layers/+lang/clojure/README.html#managing-repl-connections
,' calls sesman-start in the develop branch of Spacemacs for a while now along with the , m menu for managing connections#2020-08-1711:41zackteoI know I can add them with cljr-add-project-dependency albeit that broke somehow then i restarted emacs. But yeah doing that still doesn't allow me to do (require '[net.cgrand.xforms :as x])#2020-08-1809:50mhcathey cider people, I'm seeing a completion error which is eventually debilitating - not 100% certain it's a cider thing, but I'm trying to narrow it down.
Lisp error: (error "Lisp nesting exceeds 'max-lisp-eval-depth'")
There's a trace here: https://gist.github.com/j0ni/53f215608190a3a8ae05dbc9af62a558 - it's doom emacs so I have a doom/info dump there as well#2020-08-1809:52mhcatthe trace is a lot longer, because, well the error kind of explains - it's a recursive call which is causing it, so there's a lot of repetition#2020-08-1809:53mhcatAnyways, I'd appreciate any suggestions or ideas#2020-08-1810:25skaThe trace contains no traces [sic] of cider as far as I can see. It looks like a combination of yasnippet and company that breaks. Maybe one of your YA snippets contains something that makes company kick in again or so? Just wildly and blindly shooting in the dark here.#2020-08-1810:36mhcathmm, got no snippets and I removed the yasnippets module (a doom thing) - I did a bit more digging, and noticed that after about 30 seconds of not touching anything completion actually happens#2020-08-1810:36mhcat(company idle time is set to nil)#2020-08-1810:36mhcatsame error happens on describe-key tab, but eventually it does describe (same wait)#2020-08-1810:37mhcatand tells me it is cider-repl-tab, which seems to resolve all the way to the correct default command... and yet#2020-08-1810:37mhcatso I'm guessing that this is a defadvice somewhere and I will continue to figure it out#2020-08-1810:38mhcatdoom is an education, but I actually like it quite a lot. it has forced me to relearn my vi fu, but is sufficiently different to be a weird freak, but then, so am I, so ¯\(ツ)/¯#2020-08-1810:38mhcatthanks for giving it brain time though, I appreciate it!#2020-08-1810:50skaSorry for being able to really help with this.#2020-08-1810:53mhcatah so not yasnippets - that's just in a cond, and it's not the clause which is executing#2020-08-1810:56mhcatit's evil bindings, is what it is#2020-08-1811:02mhcatfwiw: https://github.com/hlissner/doom-emacs/blob/a736158daea05ea7a32d0aeb46755b0a1412813a/modules/config/default/%2Bevil-bindings.el#L26#2020-08-1813:07practicalli-johnI am trying to understand the purpose of the cider-restart command as it only restarts the connection to the REPL. Is it there solely to manage any issues Emacs has connecting to the external REPL process? I cant seem to find any other use for it.
sesman-restart does a REPL restart and connects to the new REPL.
cider-restart does not seem to clear the code evaluated in the REPL (cider-ns-refresh / reload that provides that functionality anyway).
Just wondering if I was missing something. Thank you.#2020-08-1816:44simonkatzI’m using shadow-cljs for a ClojureScript project. I use shadow-cljs watch client, and I can use cider-connect-cljs to connect to the ClojureScript REPL — all good.
Is there a way to also connect to the Clojure REPL that must also exist? (Something is doing macroexpansion.)
I’ve tried the following:
cider-connect-clj gives me “nrepl--direct-connect: [nREPL] Direct connection to localhost:nnnnn failed”.
cider-connect-sibling-clj gives me “No clj REPLs in current session”. (I’m not really sure what a sibling is, FWIW, so no real idea whether that should do anything close to what I want.)#2020-08-1907:54gonIn the shadow-cljs log you should have a line like this
shadow-cljs - nREPL server started on port 8777
#2020-08-1907:55gonin the top level shadow-cljs.edn
:nrepl {:port 8777
:middleware [refactor-nrepl.middleware/wrap-refactor]}#2020-08-1907:56gonwhich starts the nRepl server#2020-08-1908:40simonkatzHmmm, I was missing that :middleware, so I’ve added it (and I’ve added [refactor-nrepl "2.5.0"] to the dependencies in my ~/.shadow-cljs/config.edn), but I still have the same behaviour. Is there something else I need?#2020-08-1910:49simonkatzAh, I can get a CLJ and a CLJS REPL with cider-connect-clj&cljs.#2020-08-1905:26ozzloyi'm new to cider. i am trying to use cider with biff example project. i tried:
git clone https://github.com/jacobobryant/biff biff1#2020-08-1905:29ozzloycd biff1/example
./task setup
./task dev
open localhost:9630
builds -> app
emacs biff1/example/src/example/client/app.cljs
M-x cider-jack-in-cljs
and i get the error message:
> error in process sentinel: Could not start nREPL server: shadow-cljs - config: /home/ozzloy/src/clojure-explorations/biff-stuff/biff1/example/shadow-cljs.edn
> shadow-cljs - connected to server
> server already running#2020-08-1905:30ozzloyhow do i get to (js/alert "hi")?#2020-08-1905:31ozzloyi've also tried killing ./task dev and then doing cider-jack-in-cljs#2020-08-1905:41ozzloywhich command should be used? shadow-cljs. ClojureScript REPL type shadow, shadow-cljs build app. Visit localhost:9630 in a browser? y. then i get this output: https://wtools.io/paste-code/b1OJ#2020-08-1912:58Juan A. SanchezAnyone has any good example/blog post on using cider with docker?#2020-08-1916:29zaneNo, but the key bit is just making sure that relevant ports are available from outside the container.#2020-08-1916:29zaneOnce you’ve got that taken care of everything just seems to work, at least in my experience.#2020-08-1916:31Juan A. Sanchez@U050CT4HR So if I do a cider-connect and give it a port it will inject the libraries it needs?#2020-08-1916:32zaneOh, I’m not sure. The last time I tried it was back before auto-injection.#2020-08-1914:35Sam HeatonQuick question if anyone knows: Is it expected behaviour for a clojure.lang.Compiler$CompilerException ("No reader function for tag dbg") to be thrown when trying to compile (C-c C-k) a buffer with a #dbg annotation on a function for debugging?#2020-08-1914:39dpsuttonnot expected. those tags are defined in cider-nrepl. are you sure you have cider-nrepl on your classpath?#2020-08-1914:42Sam HeatonI'm connecting to an external Boot repl via CIDER.. although the CIDER version the Boot command is using is 0.21.1.. that may be the problem#2020-08-1914:43dpsuttondoes the boot repl have cider-nrepl on the classpath?#2020-08-1914:45Sam HeatonI believe so
boot -d nrepl\:0.6.0 \
-d cider/cider-nrepl\:0.21.1 \
[...]#2020-08-1914:46Sam HeatonI'm not sure if I can boost the cider-nrepl version due to some old middleware in the project, but I'll try that#2020-08-1914:49dpsuttonthe #dbg data reader has been there since about 0.10.0 so it should be there. check whats in *data-readers*#2020-08-1914:50Sam HeatonHmm, ok. Thank you!#2020-08-1914:51Sam HeatonEmpty map!#2020-08-1914:51dpsuttonthen you are missing some things. can you verify that cider-nrepl is on your classpath?#2020-08-1914:51dpsuttonand not just what you think the startup command is but find it on the path#2020-08-1914:52dpsutton(apropos "cider") should be sufficient#2020-08-1914:54Sam HeatonHad to qualify the apropos namespace (weird) but here's the result
(cider.nrepl/cider-middleware
cider.nrepl/cider-nrepl-handler
cider.nrepl.middleware.out/cider.nrepl.middleware.out.proxy$java.io.OutputStream$ff19274a
cider.nrepl.middleware.out/cider.nrepl.middleware.out.proxy$java.io.Writer$ff19274a
cider.nrepl.middleware.out/cider.nrepl.middleware.out.proxy$java.util.TimerTask$ff19274a
cider.nrepl.middleware.util.cljs/cider-piggieback?cider.nrepl.version/cider-version-reply
[bunch of internal stuff])
#2020-08-1914:55Sam HeatonThe internal stuff is not Cider related, but has the word "decider" in it so..#2020-08-1914:55dpsuttongotcha. this is interesting. i'd google for boot and data-readers. wonder if there's a bug#2020-08-1914:55dpsuttonhttps://github.com/boot-clj/boot/issues/47#2020-08-1914:56Sam HeatonOof. Thank you. Good find#2020-08-1914:58Sam HeatonLooks like I'll have to update the build.boot. Thank you! This turned out to be more complicated than I expected#2020-08-1914:39dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/data_readers.clj#L1#2020-08-1914:41zackteoHi guys, does anyone configure their .clojure/deps.edn for use with CIDER? Was trying to figure REBL out and that led me to https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn which I don't think is exactly very relevant ... I can't tell.#2020-08-1914:42dpsuttoncider uses its own main to start up the nrepl server with the correct middleware. REBL uses a main to set itself up. there is a middleware to use both at the same time but i've never done it. you shouldn't need to configure deps.edn to work with CIDER. if starting up a deps.edn backed project CIDER knows how to inject its dependencies and start up correctly#2020-08-1914:47zackteoI see I see. Do many people integrate REBL into their workflow actually? Have been trying to understand it#2020-08-2413:29rickmoynihanYou can use my nrebl middleware to do this:
https://github.com/RickMoynihan/nrebl.middleware
I’ve been meaning to contribute it to cider for a while, but never quite got around it#2020-08-1914:48dpsuttoni have no idea about how many people use it. i know of one vocal advocate of sean corfield. it seems like its built for socket repls mostly. You could also perhaps start up an nrepl server manually in a dev namespace and let REBL start the way it likes but i'm not sure if this will limit its functionality#2020-08-1914:52zackteoI see I see! 😮#2020-08-1918:38jumarGive cider inspector a try and you might not need REBL at all#2020-08-1922:58practicalli-john@zackteo I have a ~/.clojue/deps.edn configuration that includes several data browsers, REBL, Portal and Reveal. https://github.com/practicalli/clojure-deps-edn
I mainly use the cider-inspector though, its excellent for navigating through data structures, especially nested data structures and paging through larger data sets (really useful for data science). Its also much simpler to use.
https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html#2020-08-2100:43flefikit's a little bit confusing right now to understand which version of cider goes with which version of cider-nrepl. recently upgraded spacemacs+cider and had some issues with bumping cider-nrepl, and had to do a few attempts before I got it right. Perhaps there should be a table, or a release note for cider-nrepl detailing which version of cider to use in conjunction?#2020-08-2108:27practicalli-johnMy approach has been to update to the latest nrepl library whenever I update the cider packages in Spacemacs (although I don't use cider-connect that much, so doesn't affect me if I forget)#2020-08-2109:29bozhidar@UAEFFG05B You mean something like https://docs.cider.mx/cider/about/compatibility.html#compatibility-matrix 😉#2020-08-2110:45flefik@U051BLM8F haha exactly! thanks ❤️#2020-08-2103:31zackteoCool! Thanks @jr0cket @jumar!#2020-08-2103:35dpsuttonolder CIDERs used a cider-nrepl version equal to CIDERs version. now you can check the value of
(defconst cider-required-middleware-version "0.25.3"
"The CIDER nREPL version that's known to work properly with CIDER.")
#2020-08-2109:30bozhidarThere's also https://docs.cider.mx/cider/about/compatibility.html#compatibility-matrix#2020-08-2109:55arohnerAfter upgrading from cider 0.25.1 to 0.26.0, when I try to M-x cider-connect I’m now getting This is not a REPL or SERVER buffer; is there an active REPL?#2020-08-2110:03arohnerweird. After restarting Emacs, it worked when I entered the port manually, just hitting Enter to get the default port did not#2020-08-2208:08bozhidarI haven't changed any related code between 0.25 and 0.26. Or at least I can't think of any such changes.#2020-08-2316:02Sam RitchieHey all - in CLJS, I've implemented `IPrintWithWriter` for a js type called `Fraction`, and for some reason the repl, when printing, refuses to show a space:#2020-08-2316:02Sam Ritchie;; implementation
(write-all writer "#sicm/frac " (str x))
(rationalize 1 10)
;; => #sicm/frac(/ 1 10)
#2020-08-2316:02Sam Ritchiepr-str does the right thing:
(pr-str (rationalize 1 10))
=> "#sicm/frac (/ 1 10)"
#2020-08-2316:03Sam Ritchieany escaped characters like `\"` cause it to stop printing. I was trying to get the repl output to match pr-str and print #sicm/frac (/ 1 10), with a space... any thoughts on what I'm doing wrong here?#2020-08-2316:03Sam Ritchiethis is with:
;; CIDER 0.25.0snapshot (package: 20200521.627), nREPL 0.7.0
;; Clojure 1.10.1, Java 1.8.0_221
#2020-08-2410:45bozhidarYou can try turning off pretty-printing in the REPL and see if the results will match your expectations.#2020-08-2418:18Sam RitchieThanks, I’ll try this!#2020-08-2500:53grzmI ssh from a macOS box into an Ubuntu box and run Emacs there. On the remote Ubuntu box, I upgraded Emacs to 27.1 via nix-env. cider-connect-clj is now failing straight away with Searching for program: No such file or directory, /usr/bin/security AFAIK /usr/bin/security is only macOS thing. google hasn’t been helpful. I’ve recompiled my elpa packages. I’ve grepped my entire home directory for /usr/bin/security How should I got about further debugging this?#2020-08-2500:55grzmI suspect I’m missing the forest for the trees, so I’m hoping there are some lumberjacks out there.#2020-08-2501:13dpsuttonany chance you can completely remove CIDER from the equation? run whatever startup command CIDER is trying to run on the linux box#2020-08-2501:38grzmMy emacs debugging isn’t what it could be, but by evaling (cider-connect-clj '(:host "localhost" :port 3188)) directly in a scratch buffer rather than interactively (via M-x), it works.#2020-08-2501:45grzmHmm. I think it might be a change in auth-sources. I’ve got mac-os-keychain stuff in there in my common emacs config. Earlier versions didn’t seem to care so much about it. /usr/bin/security is related to macOS keychain access.#2020-08-2501:46grzmThanks for the prompt and the push, @U11BV7MTK!#2020-08-2501:47grzmConfirmed: removing that part of my init.el cleared the errors.#2020-08-2501:48grzmthanks Clojure once again for its stability across upgrades#2020-08-2506:52bozhidar🙂#2020-08-2501:19aginteresting, apparently, if you try to cider-debug-defun-at-point while you already in debugging mode - CIDER gets a bit confused.#2020-08-2506:52bozhidar@ag What happens?#2020-08-2514:37agfor me it just blocks Emacs. You can get out of it with C-g, it's not a big deal.#2020-08-2508:13CaseyOccasionally it happens that some operation goes wrong, and a huge pile of SQL or other data is spilled into my cider repl buffer. This almost always causes emacs to go unresponsive, leading to a necessary kill -9 emacs . What options are available to me to deal with this, while not disabling the log entirely?#2020-08-2512:34dpsuttonI’ve taken to not subscribing to out and failing logs elsewhere #2020-08-2603:24agI keep discovering CIDER debugger gotchas. It seems it doesn't break in partial functions for some reason, e.g:
(defn foo [a b c]
#dbg
,,,
)
(def bar (partial foo :something))
breakpoint gets ignored#2020-08-2609:21jumarThis works for me just fine:
(defn pp [x y]
#dbg (+ (inc x) y))
(def p (partial pp 10))
(p 10)
#2020-08-2716:50agInteresting. thanks for trying it out. I'm gonna keep an eye. Maybe it's my local setup.#2020-08-2607:05CaseyRunning cider-test-run-ns-tests results in a cons: Symbol's function definition is void: first error. I don't see anything in github issues about this.#2020-08-2607:25agfirst is a function alias for car, afaik it doesn't exist in older versions of Emacs. what version you're using?#2020-08-2612:30Casey26.3#2020-08-2618:54ag27.1 has been released two decades ago (measured in Javascript years), why not upgrade?#2020-08-2619:50CaseyI use emacs from my package manager (Fedora). Usually Fedora's packages are updated rather aggressively. Suppose I could install from source.#2020-08-2619:51CaseyApparently 2 JavaScript years is a little more than 6 months 😝#2020-08-2620:22agSomeone should do a PhD research on the topic.#2020-08-2808:20CaseyAnyways, so cider requires emacs 27? The https://docs.cider.mx/cider/basics/installation.html say back to 25.1 is supported#2020-08-2905:45agI just searched, nowhere in cider codebase I see (first) being used, must be some other dependency. run describe-function, see maybe something advising it#2020-08-2614:14andrea.crottimm something funny going on after the last upgrade
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.1\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.19\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.18\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Could not find artifact com.billpiel:sayid:jar:0.1.0-SNAPSHOT in clojars ()
#2020-08-2614:15andrea.crottitwo different versions of sayid in the command executed, and the one it complains about it's another one entirely#2020-08-2614:15andrea.crottilein deps works though, it only fails when I do cider-jack-in-clj&cljs#2020-08-2614:19andrea.crottiwhere is sayid even added anyway? I can't find references in cider or cider-nrepl#2020-08-2614:20dpsuttonthere's a CIDER plugin for sayid that you might have installed. its a bit like refactor where it injects itself#2020-08-2614:22andrea.crottiah yes ok I removed it, let's see if it works now#2020-08-2614:22andrea.crottiso somehow it was injecting itself twice at least#2020-08-2614:23andrea.crottiah yes it's gone now thanks, I wasn't really using it anyway#2020-08-2614:24dpsuttonhttps://github.com/clojure-emacs/sayid/blob/master/src/el/sayid.el#L144#2020-08-2614:24dpsuttonare you on doom or spacemacs?#2020-08-2614:24andrea.crottiah cool thanks, and neither my own config#2020-08-2614:24andrea.crottithat has grown for more than 10 years, probably doom or spacemacs would be better though tbf 😄#2020-08-2614:25andrea.crottibut I'm lazy to change now#2020-08-2614:25dpsuttonnah i wouldn't change. often people using those don't know what's gone into the clojure layer which is why i asked#2020-08-2617:24practicalli-johnI know whats in the Spacemacs clojure layer, as I contributed some of it 🙂
Sayid is optional in Spacemacs develop and off by default#2020-08-2617:26dpsuttonoh awesome!#2020-08-2617:26practicalli-johnclj-refactor is also optional in Spacemacs develop and off by default. Plexus added that a while back#2020-08-2617:32dpsuttongotcha. i thought i remember more things being added by default#2020-08-2620:14practicalli-johnSpacemacs clojure layer used to be kitchen sink... but has many more optional packages which are off by default. The Spacemacs clojure layer has a comprehensive set of vim-style key bindings for CIDER, thanks to me :)
Doom includes clj-refactor by default, but does not include sayid. The vim key bindings used to be very limited, but seems more have been added in the last few months.#2020-08-2614:27andrea.crottiyeah I don't like to not really know how my editor is configured#2020-08-2622:18neilyioIs it possible to get cider-enlighten-mode working for ClojureScript? Or is it straight up incompatible?#2020-08-2808:20CaseyAnyways, so cider requires emacs 27? The https://docs.cider.mx/cider/basics/installation.html say back to 25.1 is supported#2020-08-2721:14neilyiobump^#2020-08-2723:27zackteo@neil.hansen.31 Seems like it should be possible - it doesn't say it doesn't work for cljs in cider docs 😮#2020-08-2800:59neilyioThanks @zackteo, I would have thought so too, but that's kind of par for the course with Clojure documentation...#2020-08-2801:01neilyioI'm trying it out with the exact examples from https://docs.cider.mx/cider/debugging/enlighten.html with no luck. Emacs tells me "Cider-Enlighten mode enabled", but evaluating the examples doesn't display the values in the buffer. Simply nothing happens.#2020-08-2801:01neilyioIf this is the case, hopefully CIDER docs can make it more clear which features do and don't work on CLJS?#2020-08-2801:05neilyioOr perhaps I'm misreading the docs, it is implied https://docs.cider.mx/cider/debugging/debugger.html that "The debugger currently does not support ClojureScript", and perhaps that means that everything under the debugging section (including macroexpansion and tracing) doesn't support CLJS.#2020-08-2801:06neilyioIt would probably be nice for each feature page to have a little note like https://docs.cider.mx/cider/debugging/profiling.html to make it crystal clear to users what does and doesn't work in ClojureScript.#2020-08-2801:07neilyioAll that being said, I'd give an arm and a leg for all these features to support ClojureScript, that's where all my dev time is spent.#2020-08-2806:31bozhidarI’m afraid it’d be quite complex to support some of the Clojure features on ClojureScript, otherwise we would have done this by now. 🙂 Feel free to open a ticket about the documentation and I’ll update it when I can. If I recall correct enlighten is implemented in terms of the debugger which means it’s definitely Clojure-only for now.#2020-08-2801:17zackteoUnfortunately, bozhidar personally doesn't really use cljs so development on that end is tougher?#2020-08-2806:32bozhidarYeah, that’s true. Still, haven’t gotten to mastering cljs. 🙂#2020-08-2801:17zackteoAm trying to figure out some CLJS CIDER stuff at the moment too 😅#2020-08-2805:19zackteoAnyone here uses CIDER for cljs? I can't seem to get the CIDER jack-in-cljs to work? Any tips for doing so? 😮#2020-08-2805:24dpsuttoncljs has more moving parts. can you describe your project? figwheel, figwheel main, shadow, deps.main?#2020-08-2805:24dpsuttonwhat issue are you seeing besides it not working?#2020-08-2805:31zackteoWas trying the reagent template - https://github.com/reagent-project/reagent-template after adding +shadow-cljs and +cider , am I can lauch it separately from the command line but can't quite seem to understand how I would launch it with shadow with `cider-jack-in`#2020-08-2805:31zackteolet me try it out again another time first ...#2020-08-2805:37dpsuttoni did lein new reagent check and then cider-jack-in. once the repl is up, (ns-publics *ns*) showed that start-server was defined so i gave that a shot and that got the backend up. then cider-jack-in-cljs, choose figwheel and reload the webpage and i was up. i'm not sure what +cider is doing but i just omitted it and all is grand#2020-08-2805:39dpsuttonthat puts an ancient version of cider in there. just ignore that option and things will work just fine#2020-08-2805:39zackteoSorry how does (ns-publics *ns*) work? I often have trouble figuring out which options to pick for when doing a cider-cljs-jack-in#2020-08-2805:40dpsuttonthat's a clojure function that shows you the public vars in a namespace#2020-08-2805:40zackteookay but yes, have got it running (Not sure why i couldn't previously) hmmm#2020-08-2805:41zackteoLike just by running cljs.user> (ns-publics *ns*) ?#2020-08-2805:41dpsuttoncider-jack-in-cljs has many options because there are many optionsin the cljs tool space unfortunately. the first you need to choose is which build tool you are using. this template uses figwheel so choose that. and you should be done#2020-08-2805:42dpsuttoni did that call in the clojure repl (not the cljs repl like you are doing). when the repl starts, the webserver isn't started yet. i was hoping (and was correct) that there would be a handy function to crank up the webserver#2020-08-2805:42zackteoso even tho I picked the +shadow option I should still run it with figwheel? Think I am confusing 2 different things unfortunately#2020-08-2805:42dpsuttoncheck.repl> (ns-publics *ns*)
{stop-server #'check.repl/stop-server,
start-server #'check.repl/start-server,
server #'check.repl/server,
get-handler #'check.repl/get-handler}#2020-08-2805:42dpsuttondon't pick the shadow option. this template doesn't use shadow. pick figwheel#2020-08-2805:43dpsuttonwait, you mean on the command line when you created it from the template?#2020-08-2805:43zackteoyep!
lein new reagent <name> +shadow-cljs
#2020-08-2805:44dpsuttonthat's not a valid option it seems. where did you enter +shadow?#2020-08-2805:44dpsuttonah. then yes. start your backend up. then cider-jack-in-cljs, choose shadow. then shadow needs to know which build you want. it should offer you a list of known builds#2020-08-2805:45dpsuttonlooks like app is what you want#2020-08-2805:46zackteoso you usually run cider-jack-in-clj for the backend first then cider-jack-in-cljs? 😮#2020-08-2805:46dpsuttonyes#2020-08-2805:46dpsuttonon a project with both a backend and a frontend like this#2020-08-2805:47zackteorightt, then how would you determine which command should be used lein vs shadow-cljs#2020-08-2805:48dpsuttonyou chose shadow-cljs. it emitted a shadow-cljs.edn file which controls how the executable shadow-cljs spins up the cljs compiler. CIDER is merely asking you which build tools are involved so it knows how to start up the right programs. shadow is a stand alone thing.#2020-08-2805:49dpsuttonand shadow is exclusively cljs. so for the backend you just start up lein (and notice you didn't get a choice when cider-jack-in). for the frontend you're telling it to use shadow and then it has one last question about which build to use#2020-08-2805:51zackteoDo I connect the clj and cljs repl as siblings then?#2020-08-2805:51dpsuttonyes#2020-08-2805:51dpsuttonthat kinda just means "same project"#2020-08-2805:52zackteocider-jack-in-clj&cljs does the same right?#2020-08-2805:53dpsuttonnot exactly. it uses the same jvm i think and that's not possible here where the backend is a lein project and the frontend is a shadow project#2020-08-2805:54zackteoOkay that might have been the issue i was having then whoops :x#2020-08-2805:54dpsuttoni think that uses the same jvm and gives you two repls, the second of which just starts up the cljs compiler. at the top of the repl are the startup commands which might help explain things
;; Startup: /Users/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost
;;
;; ClojureScript REPL type: figwheel
;; ClojureScript REPL init form: (do (require 'figwheel-sidecar.repl-api) (figwheel-sidecar.repl-api/start-figwheel!) (figwheel-sidecar.repl-api/cljs-repl))
#2020-08-2805:55dpsuttonthe first command is how the repl started up lein ... repl essentially. the second is how it started the cljs compiler for you. (start-figwheel!) (cljs-repl) in essence#2020-08-2805:55dpsuttonthat's not possible when shadow is a separate executable and process#2020-08-2805:56zackteobut if i were to use figwheel it would have been okay?#2020-08-2805:56dpsuttoni think so. let me check#2020-08-2805:58zackteoThanks so much for your help!! Oddly enough tooling is what's getting me stuck ><#2020-08-2805:58dpsuttonworks for me#2020-08-2805:59dpsuttonthe tooling can be difficult. CIDER really tries to show you exactly what is going on with those startup commands. so that you can always read the documentation of the underlying tool to know what problems you might be hitting#2020-08-2805:59dpsuttonbut hopefully you're on your way now#2020-08-2805:59zackteoright! I thought the shadow is the standard nowadays, which i why I try to avoid figwheel perhaps am kinda wrong to think that#2020-08-2806:00dpsuttonfigwheel is outdated but still pays the bills for lots of projects. bruce rewrote it as figwheel-main for a modern flair. i'm quite partial to shadow for its fantastic interop with npm packages. it does a lot of really nice stuff. the build report is also quite nice. there are some UI tools for inspecting things as well#2020-08-2806:01dpsuttonthe two main contenders are shadow-cljs and figwheel-main. if you're up and running with shadow i'd just carry on with that and get back to cranking out cool ideas#2020-08-2806:03zackteoquick question. How and do you transition from cljs.user to shadow.user and back (like in terms of your workflow#2020-08-2806:04dpsuttoni don't know what shadow.user is. but i would just be in whatever namespace i needed to be in for my code#2020-08-2806:05dpsuttonC-c C-k will evaluate namespaces and C-c M-n n will switch the repl to that namespace. you can also use (require 'my.ns) and then (in-ns 'my-ns) to change the repl namespace as well#2020-08-2806:05dpsuttonhttps://clojure.org/guides/repl/introduction has good info i believe#2020-08-2806:08zackteoRight! Thanks so much! 😄#2020-08-2806:08zackteoC-cM-n n works for cljs/ clj and cljc ?#2020-08-2806:36bozhidarIt should. After all it simply evals in-ns.#2020-08-2809:22practicalli-johnCider worked just fine on Emacs 26.3 for the last year and a half. I was also using CIDER on Emacs 27 (before and after its release as the new stable version). I am now running CIDER daily on Emacs 28.
I would avoid using Emacs 25.1 (although I am fairly certain CIDER would work fine) as there are issues with the package repository authentication and its two releases behind now#2020-08-2809:31CaseyIn particular my issue is: Running cider-test-run-ns-tests results in a cons: Symbol's function definition is void: first error. I don't see anything in github issues about this.
as you can see in that thread, ag said first is a function that doesn't exist in "older versiond of emacs"#2020-08-2809:35practicalli-johnWhen moving to Emacs 27 I've deleted quite a few Emacs packages and restarted Emacs to download fresh copies. This seems to fix issues with Emacs not finding things. Its a quick brute force fix and I just had to do that with Magit today. It doesnt explain the underlying issue, but so far its worked. Not had your issue with CIDER though, so no guarantee.#2020-08-2810:25CaseyOk, I upgraded to Emacs 27. That didn't fix it. cons: Symbol's function definition is void: first still when running cider-test-run-ns-tests #2020-08-2811:25practicalli-johnI didnt think Emacs versions was the issue, appologies if I gave that impression. Did you delete all CIDER related packages from ~/.emacs.d/elpa/ ?
Have you run Cider test runner before or is this the first time?
Have you used a test runner on the command line?
To narrow down an issue, its useful to know if the project runs or tests run on the command line.#2020-08-2811:27practicalli-johnIf you are using leingingen and lein test gives a similar error, then is seems its a bug in the project#2020-08-2812:59iarenazaI can confirm that cider-test-run-ns-test runs in vanilla Emacs 26.3 (Debian GNU/Linux Stretch), using CIDER 0.25.0 (Bergamo). I use it regularly and just checked it a few seconds ago.#2020-08-2813:24Casey• lein test works
• cider-run-test works on individual tests#2020-08-2813:25Casey• I have used cider test runner before
• I have used the cli runner
• And yea, I purged and re downloaded my elpa packages#2020-08-2815:05practicalli-johnI am at a loss of other ideas. If its not specific to the Clojure project itself then I dont know what to suggest, sorry.#2020-08-3110:29ska@U70QFSCG2 can you provide a stacktrace in Emacs. You could try to M-x toggle-debug-on-error and then reproduce the problem. Maybe that tells us more where the problem is coming from.#2020-08-2812:27Risetto{:a {:a 1}
:b {:b 2}}
and
{:c {:c 3}
:d {:d 4}}
=>
{:a {:a 1}
:b {:b 2}
:c {:c 3}
:d {:d 4}}#2020-08-2812:34practicalli-johnYes, merge works
(merge {:a {:a 1}
:b {:b 2}}
{:c {:c 3}
:d {:d 4}})#2020-08-2812:35practicalli-john#beginners is a better channel for help on general Clojure topics, a lot more people in that channel generally.#2020-08-2812:35RisettoI realized I was being stupid, my maps were inside a list all along#2020-08-2812:35RisettoThank you for the response!#2020-08-2812:35RisettoWill keep that in mind next time, thanks 🙂#2020-08-2812:36practicalli-johnEasy to do. I use rainbow parens with CIDER to help show the structure of the code#2020-08-2812:37RisettoThis was from the repl, which doesn't have any highlighting at all. never looked into it, but do you know if it's possible to enable rainbow parens in there? 😄#2020-08-2812:37RisettoWould be fantastic#2020-08-2812:38RisettoJust enabling it worked, cool.#2020-08-2812:40practicalli-johnIf you use Spacemacs (a community config for Emacs), there is also the #spacemacs channel. Otherwise any CIDER related questions should get an answer here.#2020-08-2812:42RisettoAh nice, this Slack seems to have it all! 🙂#2020-08-2813:03practicalli-johnThere are lots of other ways to get help too.. here is a quick guide to them https://practicalli.github.io/blog/posts/cloure-community-getting-help/#2020-08-2812:27RisettoHow is this achieved? Conj, concat and merge seems to just put them into a list together#2020-08-2812:30RisettoMerge should do the trick, right?#2020-08-2812:56practicalli-johncider-jack-in question: is there a way to configure the jack-in command line to not include the -Sdeps part? (the deps that are auto-injected to make it work)
I appreciate I can use the universal argument to edit the command each time...
I have a Clojure CLI alias that runs REBL repl with nREPL and I can successfully connect with cider-connect-clj but when using cider-jack-in-clj and a .dir-locals.el file to set the alias, something in the -Sdeps section of the command line is conflicting.
I guess I should really figure out the conflict (but that may take a while).#2020-08-2813:02dpsuttoni think you can set cider-inject-dependencies-at-jack-in to nil and it might then work?#2020-08-2813:07practicalli-johnAdding that config to .dir-locals.el seems to kill the aliases I add too, unless I have got the config wrong
((clojure-mode . ((cider-inject-dependencies-at-jack-in . nil)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl"))))#2020-08-2813:08practicalli-johnWith that .dir-locals.el file cider-jack-in uses the command line:
[nREPL] Starting server via /usr/local/bin/clojure -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
#2020-08-2813:09practicalli-johnand of course that goes bang because there is no nrepl 🙂#2020-08-2813:11dpsuttonmaybe you want cider-jack-in-nrepl-middlewares then?#2020-08-2813:12dpsuttonoh i'm not sure and its too early for me. but i suspect you'll have to walk through cider--update-jack-in-cmd and see where the different parts get added. you may need to add a new keyword to the params that are threaded through? or maybe the easiest way is to add a way to just give it an absolute command. there's no real reason it has to be dynamic if you are calling just a known string#2020-08-2813:13practicalli-johnIf I can set an absolute command for cider-jack-in-clj using .dir-locals.el that would work just fine.#2020-08-2813:14dpsutton:jack-in-cmd is the params key. maybe update the logic to not override this if its already present?
(defun practicalli/REBL () (interactive) (cider-jack-in :jack-in-cmd "clj stuff"))#2020-08-2813:30practicalli-johnHmm, I thought I could be clever and use something like that in the .dir-locals.el file, but it didnt work.
((clojure-mode . ((eval . (progn
(cider-jack-in-cljs :jack-in-cmd "/usr/local/bin/clojure -R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl"))))))
I'll try it just in the init.el file.#2020-08-2813:32dpsuttonyes there's no logic to conditional set :jack-in-cmd you would need to extend it i think#2020-08-2813:33practicalli-johnAh this is getting complicated, sounds like something for the weekend. Thanks for all the pointers though... I can live with cider-connect for now 🙂#2020-08-3016:47iarenaza@jr0cket Now that I've seen in http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#practicalli the exact command line you wanted for clj, this is the closer you can get in CIDER using .dir-locals.el without changing the code:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))#2020-08-3021:56practicalli-johnThank you, that is a much nicer approach.
I started looking at adding a clojure-rebl project type, but didn't get it working (it seems I still have a great deal to understand about the CIDER code). Thanks again.#2020-08-3016:47iarenaza@jr0cket Now that I've seen in http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#practicalli the exact command line you wanted for clj, this is the closer you can get in CIDER using .dir-locals.el without changing the code:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-R:nrepl:cider-nrepl:cognitect-rebl -A:nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))#2020-08-2922:35ozzloyi have a lein new figwheel app, and i've modified app.core/app-state and can't seem to open a repl with the new state. i am not sure how to completely reload. i've tried completely killing the repl, closing the browser, rm -rf target and it's still an old version of app-state#2020-08-3006:48practicalli-johnSometimes it's the web browser cache that doesn't get cleared, although this seems less common now#2020-08-2922:38ozzloyTHERE IT ISSSS!!! there was an old page open in a different browser#2020-08-2922:38ozzloyall is well again.#2020-08-3008:38zackteoWhat should I do when I get error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1) doing a cider-jack-in-cljs after selecting figwheel. Am following Eric's Purely Functional Re-frame course#2020-08-3015:05dpsuttonI’m not sure. Can you check the “Messages” buffer (with asterisks not bold) and see if there was any output?#2020-08-3101:17zackteo@U11BV7MTK the relevant bits are ...
[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[me.raynes/fs\ \"1.4.6\"\] -- update-in :dependencies conj \[compliment\ \"0.3.6\"\] -- update-in :dependencies conj \[com.cemerick/pomegranate\ \"0.4.0\"\] -- update-in :dependencies conj \[org.tcrawley/dynapath\ \"0.2.5\"\] -- update-in :dependencies conj \[nrepl\ \"0.8.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.1\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost
[nREPL] server started on 46173
[nREPL] Establishing direct connection to localhost:46173 ...
[nREPL] Direct connection to localhost:46173 established
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
error in process filter: Sync nREPL request timed out (op clone id 1)
#2020-08-3101:19zackteoWould otherwise be run with lein figwheel#2020-08-3101:24zackteoIf I try to connect to the running nrepl from above ... I get
nrepl-send-sync-request: Sync nREPL request timed out (op eval code (seq (.split (System/getProperty "java.class.path") ":")) id 99)
#2020-08-3101:34dpsuttonIs this public? Or based on a template?#2020-08-3101:35dpsuttonStrange to see so many dependencies added on the command line like that#2020-08-3101:57zackteoIt is public#2020-08-3101:57zackteohttps://github.com/lispcast/understanding-re-frame/tree/001#2020-08-3101:58zackteoI checkout the 001 branch -
git checkout -f 001
#2020-08-3009:43Umar DarazHello friends,
I m unable to start cider-jack-in-clojurescript for my shadowcljs project in spaceemacs
but cider-jack-in works fine.
Please help me know what i m missing to make it work!
Here are the logs that I m getting.
Thanks
A session with the same parameters exists (clojure-projects/reviews:localhost:56442). You can connect a sibling instead. Proceed? (y or n) y
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.0"} cider/piggieback {:mvn/version "0.5.1"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'
[nREPL] server started on 57396
[nREPL] Establishing direct connection to localhost:57396 ...
[nREPL] Direct connection to localhost:57396 established
error in process filter: user-error: The shadow-cljs ClojureScript REPL is not available. Please check for details
error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details
#2020-08-3015:06dpsuttonIt’s not starting shadow it’s starting through clj. That’s strange#2020-08-3103:58Danny Almeidaclj-refactor issues when pom.xml is present in tools.deps project. The refactor code thinks it's a leiningen project and says :dependencies key missing.. Is there a way to make clj-refactor ignore pom.xml file when evaluating what kind of project it's refactoring.#2020-09-0108:37Jim NewtonI don't understand what happens when I start cider (using cider-jack-in). which files get loaded? it seems to be a function of the current directory. Normally I first open (in emacs) one of the .clj files of my project, then exec cider-jack-in. It seems the clj files under the src directory are loaded, but not the clj files under the test directory. So when I try to call (run-tests) at the cider repl, no tests are found.#2020-09-0108:38Jim NewtonWhat's the correct working flow for this?#2020-09-0108:45Jim NewtonFrom the shell if I use "lein test" from the repl in the project directory, then all the tests seem to get run. But when I start cider, and require clojure.test then (run-tests), no tests are found.#2020-09-0109:07practicalli-john@jimka.issy From my understanding, the Cider test runner only runs those tests that have been evaluated and are therefor in the REPL.
When I first start the REPL I will open the test file in a buffer and call Cider run all tests. This will load (evaluate) the code in the current buffer and therefore can run the tests as they are in the REPL.#2020-09-0109:09practicalli-johnIf I rename test functions, I will undefine them first and then change their name and evaluate the new function, before running tests again.#2020-09-0109:11practicalli-johnI don’t believe CIDER loads any Clojure code when starting a REPL. However, if the project has a user.clj file on the class path, then that code will be loaded by the REPL itself, as it starts in the user namespace by default.#2020-09-0110:57Jim Newton@jr0cket That's not the behavior I observe. I don't have a user.clj file, but when I start cider, it apparently loads a file at src/clojure_rte/core.clj and sets the ns to the one defined in that file, so that my prompt at the repl is clojure-rte.core>. It seems it has loaded all the files that core.clj requires as well, probably simply as a result of the :require in that ns definition.#2020-09-0111:00practicalli-johnSounds like you have that set in Leiningen, it's not something I believe CIDER does, but something it uses#2020-09-0111:00Jim NewtonWhile I don't have a user.clj file, I do seem to have a project.clj file in the project top level directory. Perhaps this is what cider has loaded? Its content is the following.
(defproject clojure-rte "0.1.0-SNAPSHOT"
:description "Regular type expressions, for Clojure"
:url ""
:license {:name "MIT"
:url ""}
:plugins [ [lein-cloverage "1.1.2"]]
:dependencies [[org.clojure/clojure "1.10.0"]
[lein-cloverage "1.1.2"]
[org.clojure/data.json "1.0.0"]
[org.clojure/math.combinatorics "0.1.6"]]
:main ^:skip-aot clojure-rte.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
#2020-09-0111:00practicalli-johnTher you go, it's set in your project file#2020-09-0111:03Jim NewtonSo does cider read the project file automatically, or is this something I've told it to do, or something I've told lein to do? I set up the project some time ago. I don't remember how, but probably using lein new#2020-09-0111:14practicalli-johnCider simply calls Leiningen, which you can see if you use C-u before cider-jack-in. Cider adds a few dependencies to ensure the Leiningen runs the REPL with an nREPL server so Cider can connect to the REPL.
Leiningen starts the REPL using the details in project.clj and therefore switches the namespace.#2020-09-0111:16practicalli-johnAs cider connects to the REPL I assume it gets the current state of that REPL over the nREPL connection.#2020-09-0111:16practicalli-johnI am sure @dpsutton or @bozhidar will correct anything I got wrong 😁#2020-09-0111:18practicalli-johnI consider the REPL as a separate process that Cider connects to, once it's established. Cider jack-in automates the who process.
Otherwise you would start a repl on a terminal window using lein repl and then use cider connect to establish the nREPL connection#2020-09-0111:18Jim NewtonOn a bit more investigation, it seems that cider/lein/clojure indeed HAS loaded the tests. Because if I run (run-all-tests) it runs lots of clojure internal tests, but also runs the tests defined in my project. It seems to be simply that (run-tests) only runs the test in the current namespace. There does not seem to be a concept of run-tests-in-project.#2020-09-0111:21practicalli-johnThere are quite a few test functions.
If all tests are loaded in the REPL then the all tests command will run them all I believe (I should check this)#2020-09-0111:24practicalli-johncider-test-run-project-tests is the function that gets called when I run tests#2020-09-0111:26practicalli-johnI uses Spacemacs which has a function called spacemacs/cider-test-run-all-tests which first loads the current buffer and then calls cider-test-run-project-tests . This should run all tests in the project (but maybe only so long as those tests have been evaluated)#2020-09-0111:27Jim NewtonInteresting, I've never run the tests using the cider- functions; rather I've always run them either from the shell using lein test or from the repl.#2020-09-0111:31practicalli-johnTest runners run from the command line should always run all tests from the files. Cider seems to mainly run what has been evaluated in the REPL, so I tend to use it for the test namespace I am working on.
It can be possible to have CIDER test runner having a slightly different set of tests than are written to files, especially if you rename deftest functions without undefining the old names (or restarting the REPL). However, the cider test runner is very convenient for rapid feedback.
Some test runners have a watch mode, so will run when ever you save code to files, this can be quite useful too. An of course I assume you have a test runner working with what ever CI service you are using 🙂#2020-09-0111:44Jim NewtonI do periodically like to run all the tests of my project inside cider because it is easier to debug a failure than when such is reported from the lein command line. Furthermore, I like to run all the tests of my project, rather than just what has changed, because I have lots of functions with subtle dependences. For example I have a logic-reasoning-engine which has certain set of capabilities. From time to time I improve it to make it smarter, and this causes certain tests to fail which were assuming a less intelligent engine. Of course I prefer to find this out before pushing to gitlab#2020-09-0204:54Lucy WangHello guys, in Emacs cljr-clean-ns doesn't work well with shadow-cljs's npm import syntax, e.g.
(ns foo
(:require ["react" :as react]
["@material-ui/core/Button" :default Button]))
After I run cljr-clean-ns both would be removed even though they are used in this ns ...
Is this not supported, or am i missing something that could make it work?#2020-09-0213:03Lucy Wangcreated a github issue https://github.com/clojure-emacs/clj-refactor.el/issues/476#2020-09-0219:31eval-on-pointI think that it would be nice in general to have a "non-destructive" clean-ns, which doesn't remove unused deps. Sometimes I require in a library that I am using in the repl but have not yet used in the buffer, and it gets lost when I use add-missing-libspec. I think it would be a good candidate for a prefixed-version of the refactor#2020-09-0219:35eval-on-pointLooks like it can be set via a configuration option here: https://github.com/clojure-emacs/refactor-nrepl/blob/master/README.md#configuration#2020-09-0317:04Kevin MungaiHi, how can I specify the alias or aliases in a project using tools.deps when jacking in? One way I have found is using .dir-locals.el but I can only create one at a time. Thanks in advance for your answers.#2020-09-0317:16dpsuttonuse a prefix arg when jacking in. for me jack in is C-c M-j so do C-u C-c M-j#2020-09-0317:16dpsuttonthat will let you edit the string to your heart's content#2020-09-0317:34Kevin MungaiThanks, works like a charm!#2020-09-0319:06practicalli-john@mungaikamau7 a .dir-locals.el can include multiple aliases with cider-jack-in. https://practicalli.github.io/spacemacs/clojure-projects/project-configuration.html
I use this file to include lots of different aliases I have in my Clojure deps.edn
https://github.com/practicalli/clojure-deps-edn#2020-09-0321:01deadghostNot entirely sure if this is a cider q or lein q, when I start my REPL, my src/ namespaces are loaded in but not my test/ namespaces. This can be confirmed with (ns-publics 'project.foo-test) => No namespace: project.foo-test found. What do I need to configure to get this going?#2020-09-0321:17deadghostAfter running M-x cider-test-run-project-tests I can then run M-x cider-test-run-ns-tests on project.foo and have project.foo-test tests run.#2020-09-0322:31practicalli-john@deadghost Its a CIDER question (it works the same with Leiningen and Clojure CLI tools).
Using the project command will load all test namespaces, using the ns command only loads the current.
To be sure, evaluate the buffer containing the tests before running the tests.
I am sure someone can explain it better. I just assume I need to evaluate the tests before running them.#2020-09-0402:47deadghostYes cider-test-run-ns-tests works after running cider-load-buffer on project.foo-test. I would like all my test namespaces loaded in on REPL startup.#2020-09-0407:38bozhidarThere's no such functionality built-in, but you can have some hook that loads all you namespaces when you connect to the REPL server. Just keep in mind that this might trigger some side-effects, which is the main reason CIDER will never auto-loading anything.#2020-09-0408:35practicalli-john@deadghost To require specific namespaces on REPL startup, add a user.clj file to a project (somewhere on the classpath) and add the require expressions for each namespace.
https://practicalli.github.io/clojure/clojure-tools/configure-repl-startup.html#requiring-namespaces
The require expressions can be part of the user ns expression or as their own require expression.#2020-09-0418:30schmidt73is there any built in macro for this patter:#2020-09-0418:30schmidt73#2020-09-0418:31schmidt73I know you could use if-let but then you have to give the thing a name...#2020-09-0418:42dpsutton(or e body)#2020-09-0418:43dpsuttonbut these questions should probably go in #clojure or #beginners depending on the question. nothing about CIDER in that question#2020-09-0507:38Malik KennedyTrying to follow https://github.com/practicalli/clojure-deps-edn to get REBL working. I clone into ~/.clojure and run
cd ~/.clojure/
clojure -A:outdated
Attached is the error, I've highlighted the part of the error I think is to blame.#2020-09-0510:26practicalli-johnThere is a #practicalli channel for questions about the practicalli settings 🙂
I have recently changed the :outdated alias to use antq, so I will do some more testing. Thanks#2020-09-0510:31practicalli-johnThere is a page on using REBL, including a section on using it with CIDER.
http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html
The aliases were updated on August 28th, so ensure you have the latest changes from practicalli/clojure-deps-edn
It also uses the Cognitect dev-tools install of REBL, so you should not need to update the aliases in ~/.clojure/deps.edn as they no longer include a :local/root style dependency.#2020-09-0511:19practicalli-johnI've run :outdated and pushed all relevant changes https://github.com/practicalli/clojure-deps-edn/commit/46d48e5fb814fd8da9c233d5c6cf83bc33358bd8
The JavaFX library version have been kept at 11 to match the stable release of Java. I am not currently testing REBL on intermediary Java release.#2020-09-0507:38Malik Kennedy| | java-sources/java-sources | | Failed to fetch |
#2020-09-0507:39Malik KennedyI have updated the :java-8-sources and :java-11-sources keys to where it's installed on my machine as well.#2020-09-0511:17practicalli-johnIf you have to define a :local/root for the REBL library, then you are not using the latest version of these aliases. I recommend updating and using the Cognitect dev-tools release of REBL.#2020-09-0619:28theeternalpulseHi, is there a way to have cider connect to a specific host/port/repl-type/config when I do cider-connect-clj instead of choosing each time?#2020-09-0623:10nivekuilC-h f cider-connect-clj tells meInitialize a Clojure connection to an nREPL server. PARAMS is a plist optionally containing :host, :port and :project-dir. On prefix argument, prompt for all the parameters.
#2020-09-0701:35theeternalpulseah, I'd have to wrap the function and rebind to look in a config, figured it allowd configuring out the box#2020-09-0814:24deadghostSo I run cider-test-run-ns-tests in foo.bar and it says No test namespace: foo.bar-test because the test ns wasn't loaded in on startup. What command can I use to load foo.bar-test such that I can create a binding that will run a command in foo.bar that will load foo.bar-test and run all tests in foo.bar-test?#2020-09-0814:30dpsuttoncan i recommend just getting used to evaling the namespaces you want to use?#2020-09-0814:35deadghostDo you mean:
• switching to the test buffer
• evaluating the test buffer
• switching back to original buffer
• run tests
I'd like to:
• eval test buffer from original buffer
• run tests#2020-09-0820:53deadghostI got it working FYI#2020-09-0814:31dpsuttonif you're in a buffer just a C-c C-k will eval it#2020-09-0820:49ozzloymaybe this is a cider issue, i'm in cljs repl, and the following happens:
cljs.user> (goog.object/get gevents/EventType (clj->js :KEYUP))
WARNING: Use of undeclared Var goog.events/EventType at line 1 <cljs repl>
"keyup"#2020-09-0820:49ozzloyit says the var is undeclared, but also gives the value i was expecting#2020-09-0820:50ozzloyalso, when i run figwheel, the webpage updates correctly, and displays a warning#2020-09-0820:51ozzloyat the top i have (ns doing-io.core (:require [goog.events :as gevents] ...)#2020-09-0821:02dpsuttondoubt its a CIDER issue#2020-09-0821:02dpsuttonhttps://github.com/clojure/clojurescript/blob/master/samples/twitterbuzz/src/twitterbuzz/core.cljs#L15-L16#2020-09-0821:03dpsuttoni checked https://grep.app for these#2020-09-0821:38ozzloythanks!#2020-09-0821:40ozzloy@dpsutton +1#2020-09-0821:44ozzloyi've never heard of https://greg.app before, but it makes a lot of sense#2020-09-0821:44ozzloyanother thing i'm surprised i don't see more of: AI support for code writing#2020-09-0902:28ozzloywell, this is also probably not a repl issue, but the clojurescript channel is asleep#2020-09-0902:29ozzloybut here goes:#2020-09-0902:29ozzloy(set! (. temp-input -value) "") works in a repl, but not when i put it in a file.#2020-09-0902:30ozzloyhow do i clear a form input text field? following this guide https://www.learn-clojurescript.com/section-2/lesson-15-capstone-temperature-converter/#2020-09-0902:31ozzloyi tried (gdom/setTextContent temp-input "") which does nothing at all to the text field.#2020-09-0902:42ozzloyfigured it out. i was not reloading things correctly. incorrectly using the atom#2020-09-1011:33abdullahibraHi everyone,#2020-09-1011:34abdullahibrawhen i open file before running cider-jack-in, it's usually working fine with clojure mode, but if i open another clojure file while cider-jack-in already is already running, then i'm not at clojure mode#2020-09-1011:35abdullahibrahave anybody experienced that issue?#2020-09-1013:58practicalli-john@abdullahibra Sorry, never seen that in years of using Cider. Are you sure the file name has a Clojure extension, .clj, .cljs .cljc .edn
What happens if you run the command clojure-mode#2020-09-1013:58abdullahibrayeah all files with clojure ext#2020-09-1013:59abdullahibrasymbol's function definition is void: cider-turn-on-eldoc-mode#2020-09-1014:00dpsuttonhow did you install CIDER?#2020-09-1014:01abdullahibrainstall-package#2020-09-1014:01abdullahibrathat's my init.el#2020-09-1014:02abdullahibra;;;;
;; Packages
;;;;
(or (boundp 'predicate) (defvar predicate))
(or (boundp 'inherit-input-method) (defvar inherit-input-method))
(or (boundp 'ido-cur-item) (defvar ido-cur-item))
(or (boundp 'ido-default-item) (defvar ido-default-item))
(or (boundp 'ido-cur-list) (defvar ido-cur-list))
(set-frame-font "monospace 11" nil t)
;(defvar predicate)
;(defvar inherit-input-method)
;(defvar ido-cur-item)
;(defvar ido-default-item)
;(defvar ido-cur-list)
;; Define package repositories
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "") t)
(add-to-list 'package-archives
'("tromey" . "") t)
(add-to-list 'package-archives
'("melpa" . "") t)
(add-to-list 'package-archives
'("gnu" . "") t)
(add-to-list 'package-archives
'("org" . "") t)
;; (setq package-archives '(("gnu" . "")
;; ("marmalade" . "")
;; ("melpa" . "")))
;; Load and activate emacs packages. Do this first so that the
;; packages are loaded before you start trying to modify them.
;; This also sets the load path.
(package-initialize)
;; Download the ELPA archive description if needed.
;; This informs Emacs about the latest versions of all packages, and
;; makes them available for download.
(when (not package-archive-contents)
(package-refresh-contents))
;; The packages you want installed. You can also install these
;; manually with M-x package-install
;; Add in your own as you wish:
(defvar my-packages
'(;; makes handling lisp expressions much, much easier
;; Cheatsheet:
paredit
;; key bindings and code colorization for Clojure
;;
clojure-mode
;; extra syntax highlighting for clojure
clojure-mode-extra-font-locking
;; integration with a Clojure REPL
;;
cider
;; new packages
auto-complete
highlight-parentheses
markdown-mode
ac-nrepl
;; allow ido usage in as many contexts as possible. see
;; customizations/navigation.el line 23 for a description
;; of ido
ido-ubiquitous
;; Enhances M-x to allow easier execution of commands. Provides
;; a filterable list of possible commands in the minibuffer
;;
smex
;; project navigation
projectile
;; colorful parenthesis matching
rainbow-delimiters
;; edit html tags like sexps
tagedit
;; git integration
magit))
;; On OS X, an Emacs instance started from the graphical user
;; interface will have a different environment than a shell in a
;; terminal window, because OS X does not run a shell during the
;; login. Obviously this will lead to unexpected results when
;; calling external utilities like make from Emacs.
;; This library works around this problem by copying important
;; environment variables from the user's shell.
;;
(if (eq system-type 'darwin)
(add-to-list 'my-packages 'exec-path-from-shell))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
(unless (package-installed-p 'cider)
(package-install 'cider))
;; Place downloaded elisp files in ~/.emacs.d/vendor. You'll then be able
;; to load them.
;;
;; For example, if you download yaml-mode.el to ~/.emacs.d/vendor,
;; then you can add the following code to this file:
;;
;; (require 'yaml-mode)
;; (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
;;
;; Adding this code will make Emacs enter yaml mode whenever you open
;; a .yml file
(add-to-list 'load-path "~/.emacs.d/vendor")
;;;;
;; Customization
;;;;
;; Add a directory to our load path so that when you `load` things
;; below, Emacs knows where to look for the corresponding file.
(add-to-list 'load-path "~/.emacs.d/customizations")
;; Sets up exec-path-from-shell so that Emacs will use the correct
;; environment variables
(load "shell-integration.el")
;; These customizations make it easier for you to navigate files,
;; switch buffers, and choose options from the minibuffer.
(load "navigation.el")
;; These customizations change the way emacs looks and disable/enable
;; some user interface elements
(load "ui.el")
;; These customizations make editing a bit nicer.
(load "editing.el")
;; Hard-to-categorize customizations
(load "misc.el")
;; For editing lisps
(load "elisp-editing.el")
;; Langauage-specific
(load "setup-clojure.el")
(load "setup-js.el")
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(ansi-color-faces-vector
[default bold shadow italic underline bold bold-italic bold])
'(beacon-color "#f2777a")
'(coffee-tab-width 2)
'(custom-enabled-themes (quote (sanityinc-tomorrow-eighties)))
'(custom-safe-themes
(quote
("52588047a0fe3727e3cd8a90e76d7f078c9bd62c0b246324e557dfa5112e0d0c" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "a7051d761a713aaf5b893c90eaba27463c791cd75d7257d3a8e66b0c8c346e77" "4cf3221feff536e2b3385209e9b9dc4c2e0818a69a1cdb4b522756bcdf4e00a4" "4aee8551b53a43a883cb0b7f3255d6859d766b6c5e14bcb01bed572fcbef4328" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "628278136f88aa1a151bb2d6c8a86bf2b7631fbea5f0f76cba2a0079cd910f7d" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "1b8d67b43ff1723960eb5e0cba512a2c7a2ad544ddb2533a90101fd1852b426e" "82d2cac368ccdec2fcc7573f24c3f79654b78bf133096f9b40c20d97ec1d8016" "679ee3b86b4b34661a68ba45bbd373eab0284caee6249139b2a090c9ddd35ce0" "9e54a6ac0051987b4296e9276eecc5dfb67fdcd620191ee553f40a9b6d943e78" "7f1263c969f04a8e58f9441f4ba4d7fb1302243355cb9faecb55aec878a06ee9" "1157a4055504672be1df1232bed784ba575c60ab44d8e6c7b3800ae76b42f8bd" "cf08ae4c26cacce2eebff39d129ea0a21c9d7bf70ea9b945588c1c66392578d1" "5ee12d8250b0952deefc88814cf0672327d7ee70b16344372db9460e9a0e3ffc" default)))
'(fci-rule-color "#2a2a2a")
'(flycheck-color-mode-line-face-to-color (quote mode-line-buffer-id))
'(frame-background-mode (quote dark))
'(hl-todo-keyword-faces
(quote
(("TODO" . "#dc752f")
("NEXT" . "#dc752f")
("THEM" . "#2d9574")
("PROG" . "#4f97d7")
("OKAY" . "#4f97d7")
("DONT" . "#f2241f")
("FAIL" . "#f2241f")
("DONE" . "#86dc2f")
("NOTE" . "#b1951d")
("KLUDGE" . "#b1951d")
("HACK" . "#b1951d")
("TEMP" . "#b1951d")
("FIXME" . "#dc752f")
("XXX+" . "#dc752f")
("\\?\\?\\?+" . "#dc752f"))))
'(nrepl-message-colors
(quote
("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#a7a6d4" "#9796c4" "#b48ead")))
'(package-selected-packages
(quote
(tern-auto-complete auto-complete-sage which-key fira-code-mode pretty-symbols org yaml-mode highlight-symbol company spacemacs-theme zenburn-theme color-theme-sanityinc-tomorrow color-theme-sanityinc-solarized sunburn-theme queue 0x0 command-queue cider go-mode idris-mode 0blayout web-mode buffer-move clojars clojure-cheatsheet clojure-mode clojure-project-mode cider-spy cider-profile cider-decompile tagedit smex rainbow-delimiters javap-mode ido-ubiquitous exec-path-from-shell cider-hydra cider-eval-sexp-fu)))
'(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e")))
'(vc-annotate-background "#433844")
'(vc-annotate-color-map
(quote
((20 . "#BC8383")
(40 . "#CC9393")
(60 . "#DFAF8F")
(80 . "#D0BF8F")
(100 . "#E0CF9F")
(120 . "#F0DFAF")
(140 . "#5F7F5F")
(160 . "#7F9F7F")
(180 . "#8FB28F")
(200 . "#9FC59F")
(220 . "#AFD8AF")
(240 . "#BFEBBF")
(260 . "#a7a6d4")
(280 . "#676694")
(300 . "#777694")
(320 . "#8786b4")
(340 . "#9796c4")
(360 . "#b48ead"))))
'(vc-annotate-very-old-color "#b48ead")
'(window-divider-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(split-window-right)
;; Tell emacs where is your personal elisp lib dir
(add-to-list 'load-path "~/.emacs.d/lisp/")
;;(global-company-mode)
(require 'highlight-symbol)
;;(global-set-key [(control f3)] 'highlight-symbol)
;;(global-set-key [f3] 'highlight-symbol-next)
;;(global-set-key [(shift f3)] 'highlight-symbol-prev)
;;(global-set-key [(meta f3)] 'highlight-symbol-query-replace)
;; magit global key
;;(global-set-key (kbd "C-x G") 'magit-status)
(setq python-shell-interpreter "/home/visof/.pyenv/shims/python")
(setq prettify-symbols-alist '(("lambda" . 955)))
(defun my-add-pretty-lambda ()
"make some word or string show as pretty Unicode symbols"
(setq prettify-symbols-alist
'(
("lambda" . 955) ; λ
("fn" . 955)
("->" . 8594) ; →
("=>" . 8658) ; ⇒
;;("map" . 8614) ; ↦
;;("clojure.set/intersection" . 8745) ; ∩
;;("clojure.set/union" . 8746) ; ∪
("elephant" . 128024)
("owl" . 129417)
)))
;;(add-hook 'clojure-mode-hook 'my-add-pretty-lambda)
;;(add-hook 'haskell-mode-hook 'my-add-pretty-lambda)
;;(add-hook 'shen-mode-hook 'my-add-pretty-lambda)
;;(add-hook 'tex-mode-hook 'my-add-pretty-lambda)
;;(global-prettify-symbols-mode 1)
;;(global-fira-code-mode)
(global-set-key (kbd "C-z") 'undo)
;(global-set-key (kbd "C-s-/") 'undo-tree-redo)#2020-09-1117:09nickI have a strange behavior in cider after(most likely after extensive printing/logging)
some moment whenever you send a function/ns/region to cider REPL, and switch to repl
your cursor by default always placed before sent function/ns/region, so you have to jump to the end of it before you can execute/enter it.
It happens pretty regularly but I don't have an exact steps to reproduce it.
Did anyone have this issue?
As a workaround, I use (cider-quit)(cider-jack-in-clj) but it is a bit annoying#2020-09-1117:14dpsuttontry just C-c C-o for cider-find-and-clear-repl-output#2020-09-1117:16nickThanks Dan! Next time I see it, I try cider-find-and-clear-repl-output#2020-09-1117:19dpsuttonyeah usually what happens is that the repl gets a lot of stuff in it and the stuff gets confused.#2020-09-1117:19dpsuttonclearing it resets all that stuff#2020-09-1119:08nick@dpsutton
cider-find-and-clear-repl-output didn't work for me
but spacemacs/cider-find-and-clear-repl-buffer solved the issue(at least this time).
Thanks again#2020-09-1210:52psdpIs fuzzy completion enabled by default for ClojureScript? How can I disable it? I want scoped completions.#2020-09-1617:30eval-on-pointHas anyone been using REBL with cider? I'm having some trouble getting the UI up and am wondering if there are any examples out in the wild for me to study#2020-09-1618:56practicalli-john@mitchell_clojure Yes, I have CIDER running with REBL when using Clojure CLI tools (deps.edn) projects. Will dig out the details...
http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#run-rebl-for-nrepl-based-editors
This will change slightly when the next version of Clojure CLI tools is release (in a few weeks or so), but its just substituting -R and -A flags with the new -M flag.#2020-09-1619:00eval-on-pointooh, right here? https://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#run-rebl-with-nrepl#2020-09-1619:00practicalli-johnYes thats it 🙂#2020-09-1619:00eval-on-pointYou beat me to it 🙂 thank you for the great resource! Should have known to check there first#2020-09-1619:03practicalli-johnI am doing a little refactor for the next release of Clojure CLI tools, so it will look more like https://github.com/practicalli/clojure-deps-edn/blob/qualified-alias-keywords-and-new-flags/deps.edn#L297-L316
But you need to use version 1.10.1.681 or greater of the Clojure CLI tools for it to work.#2020-09-1619:17practicalli-johnThere is also Reveal, which has a nice clean UI and you can connect to that with cider-connect if you run the version that has an nREPL server
https://practicalli.github.io/clojure/clojure-tools/data-browsers/reveal.html#using-reveal-with-nrepl#2020-09-1619:19practicalli-johnI still use the cider-inspector the most, its really convienient and does most of what I need (exept turn data into graphs... but I can to that with Oz).#2020-09-1620:19eval-on-pointIMO, a great config option with spacemacs and the inspector is
(with-eval-after-load "cider-inspector"
(define-key cider-inspector-mode-map
(kbd "f") 'ace-link-cider-inspector))#2020-09-1620:20eval-on-pointbrings up ace links on all the values, so you don't need to tab over to them#2020-09-1710:49shemI was debugging some functions with cider-debug-defun-at-point and one of them produced a "Method code too large!" error. It is a largish function, 48 lines. Is there anything to be done except split the function?#2020-09-1806:25jumarThat doesn't sound like a big function. Is that a java exception?
Maybe the function itself uses some complicated macro that produces a lot of code under the hood?#2020-09-2109:57shem#2020-09-2109:58shemI suppose it is a java exception#2020-09-2110:01shemThere's nothing exotic going on, except a call to postal/send-message, which uses java interop#2020-09-2112:34jumarWhat happens if you "macroexpand-all" it?
Does removing a specific piece of the implementation help?#2020-09-2309:57shemyeah, i got it working by commenting the call to postal/send-message#2020-09-2100:05yhHi, I added [ring-cors "0.1.13"]in my dependencies. But, in core.clj , cider cannot autocomplete the ring.middleware.corswhen I try to require it. Anyone how to fix it? (`clojure-lsp` can find the ring.middleware.cors candidate)#2020-09-2107:42practicalli-johnUnless you have some form of hot-load library to load in new dependencies into a running REPL, the the REPL should be restarted (stop, start) to pick up the new dependency.#2020-09-2117:43yhThanks @U05254DQM. I am doing the (stop, start) approach, and can load the namespace successfully. The problem is there is no autocompletion of ring.middleware.cors from cider’s company mode (after injection). It is not really a big deal. I am just wondering whether there are some easy fix for the autocompletion.#2020-09-2119:05kingcodeHow do I eval something in the code which yields a larger result, to be pretty-printed to the REPL - sort of equivalent to C-x e..?#2020-09-2212:29practicalli-johnThe cider inspector is a great tool for paging through large results and can also navigate nested data structures
https://docs.cider.mx/cider/debugging/misc.html#_inspecting_values
Some screenshots here
https://docs.cider.mx/cider/debugging/misc.html#_inspecting_values#2020-09-2214:24kingcodeThanks!#2020-09-2119:07kingcodeSorry, I just saw that cider-insert-last-sexp-in-repl does the trick 🙂#2020-09-2119:11dpsuttonthere are some nice options around that to make it evaluate for you#2020-09-2119:12dpsutton(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
#2020-09-2122:54kingcodeThx @dpsutton#2020-09-2212:29practicalli-johnThe cider inspector is a great tool for paging through large results and can also navigate nested data structures
https://docs.cider.mx/cider/debugging/misc.html#_inspecting_values
Some screenshots here
https://docs.cider.mx/cider/debugging/misc.html#_inspecting_values#2020-09-2208:44Risetto(defn- func
; my comment gets indented way over here
...)#2020-09-2208:44Risettois that something any of you have experienced?#2020-09-2211:30iarenaza@olle142 Yes, that's a Common Lisp convention, inherited by clojure-mode (see, e.g., https://stackoverflow.com/a/6365579). The comment-column variable sets the comment column used by single semicolon comments. clojure-mode redefines it to be 40 locally to the buffer.#2020-09-2211:31iarenazaThat convention expects you to use two semicolons for that comment.#2020-09-2211:41RisettoOh! Thanks a lot#2020-09-2314:44Ben SlessHi all, I'm trying to do some hacking on cider. How do I ensure the code I send to the REPL will get evaluated on the namespace of the file I'm in?#2020-09-2314:48dpsuttonwhen you eval in-line that happens automatically. the ns is sent along with the code form. the repl has a namespace and this is the ns that is used. i can't think of a good way to do this that also allows for input from a user.#2020-09-2314:49dpsuttonone suggestion would be to make a read only buffer that could contain the inputs and outputs to things that are evaluated in-line. so it would appear like a repl but only contain the inputs and outputs to cider's evaluating inline#2020-09-2314:50dpsuttoni suppose you could put stuff in the cider-send-to-repl to attempt to set the current ns to the file's ns#2020-09-2314:50Ben SlessI'll describe what I'm trying to do, maybe it'll help clarify things: I thought it would be nice to add a cider-decompile interactive command, sort of like cider-macroexpand-1. For that I started my hacking around the cider-macroexpand.el file#2020-09-2314:51Ben SlessThe idea was to take the output and display it in a temporary buffer in java mode#2020-09-2314:51Ben Slesscider-macroexpand uses cider-nrepl-send-sync-request#2020-09-2314:52dpsuttonthat sounds great.#2020-09-2314:53Ben SlessIt does, but cider-nrepl-send-sync-request doesn't eval in the current ns unlike cider-interactive-eval (?)#2020-09-2314:54dpsuttonsend along the ns then#2020-09-2314:54Ben Slessno harm in trying#2020-09-2314:56dpsuttonyou can see how it sends that along. it sends the ns into cider-nrepl-request:eval. which just builds up a list like
(("ns" whatever) ("code" "code to be evaluated") ....)#2020-09-2314:56dpsuttonthere's a helper function nrepl--eval-request which builds all that up and the ns is threaded through#2020-09-2314:58Ben SlessHA#2020-09-2314:58Ben Slessit works!#2020-09-2314:58dpsuttonawesome!#2020-09-2314:59dpsuttonwould love to see a screenshot.#2020-09-2314:59Ben Sless#2020-09-2315:01dpsuttonthat is super awesome!#2020-09-2315:01Ben SlessI'll prepare a PR?#2020-09-2315:02dpsuttonwhat dependencies does this require?#2020-09-2315:02Ben SlessThat's the next thing I was going to ask about 🙂#2020-09-2315:03Ben Slessit requires [com.clojure-goes-fast/clj-java-decompiler "0.3.0"]#2020-09-2315:03Ben Slessso perhaps it should be an extra module, not part of core cider#2020-09-2315:03dpsuttonyeah this may just be a cool thing people can add. not sure if CIDER should depend on that#2020-09-2315:04dpsuttonperhaps the documentation could take this? A section on expanding and customizing CIDER and show how easy it can be to add new features like this#2020-09-2315:04Ben Sless(transitively depends on [org.bitbucket.mstrobel/procyon-compilertools "0.5.34"])#2020-09-2315:06Ben SlessTheoretically, there's a bigger feature here. The ability to take some arbitrary piece of code at point, wrap it in an expression, potentially parametrized over some variables, and evaluate that, instead#2020-09-2315:06Ben Slessoff the top of my head, it could be useful for profiling, benchmarking, decompiling, they all behave the same#2020-09-2315:07Ben SlessThat requires no extra dependencies, and introduces an easy extension point#2020-09-2315:11dpsuttoncan you give an example? or the proposed change to CIDER? i'm not following as it seems you kinda used the building blocks already present. i'm assuming you constructed a handler using one of the handler functions and that took the response, opened a new buffer and made it java mode. and the eval you reused one of the existing functions or made a new one using a template more or less?#2020-09-2315:11Ben SlessYes#2020-09-2315:16Ben SlessThis isn't a big feature, more of a convenience where you'll need to plug in a few parameters:
• pre command
• wrap command
• output buffer name
• output buffer mode
• cider-jack-in extra dependencies
• command name
• command keys
This can be exposed as a single function which will allow users to make small extensions to cider without modifying the core, even with extra dependencies#2020-09-2315:17Ben SlessJust eval it as a hook after loading cider#2020-09-2316:24Ben SlessIn the meanwhile I threw my work https://github.com/bsless/clj-decompiler.el/blob/master/clj-decompiler.el, I'll add some README instructions, credits, etc.
Hope you find it useful 🙂#2020-09-2316:30Ben SlessDo I need to list any/all of the authors of cider-macroexpand.el in the copyright or authorship section? The file is loosely inspired by it.#2020-09-2405:21ozzloyi often get error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op eval code (require 'figwheel.main)) when running cider-jack-in-cljs in this project https://github.com/athomasoriginal/demo-clojurescript-app#2020-09-2405:21ozzloybut not every time. sometimes it works, opens a browser, opens a repl connected to it, does all the good things#2020-09-2405:35ozzloyi think i got it. need to set nrepl-syn-request-timeout to a higher value. was 10, is 20. has worked the last few times i've tested it. this is a big improvement over the prior success rate.#2020-09-2414:26Jim NewtonI've define a macro which I'd like to indent the same as case. Is there a way to tell cider (and hopefully also tell cursive) that I want it to use case rules for indenting?
(rte-case '(1 2 3)
(:* String) 0
(:* Number) 1
(:* Long) 2)))
currently it indents as follows:
(rte-case '(1 2 3)
(:* String) 0
(:* Number) 1
(:* Long) 2)))
Since some of the users of my library use cursive, it would be nice if it indents the same for both.
I'm a little surprised that it doesn't just work because the lambda list of case is [e & clauses] and the lambda list of rte-case is [sequence & clauses].#2020-09-2415:23iarenaza@jimka.issy Don't know about Cursive, but clojure-mode (which is what CIDER relies on for indentation[1]) uses a list of builtin forms/macros and their associated indentation specifications. You can change them and add your own specs to that list, using define-clojure-indent macro. CIDER also supports indentation specification via metadata[2], which could be a way to share indentation specifications with Cursive. But I don't use Cursive, so I don't know if it supports that metadata specification.
[1] https://docs.cider.mx/cider/0.26/config/indentation.html
[2] https://docs.cider.mx/cider/0.26/indent_spec.html#2020-09-2416:42Jim NewtonI saw those docs, already. Thanks. But I didn't see how I could say I want my macro to indent like case.#2020-09-2416:42Jim NewtonDo I have to re-engineer what case did?#2020-09-2416:44Jim NewtonIs it strange that cider doesn't just notice that the macro lambda list is [x & y] ?#2020-09-2416:46Jim NewtonCommon lisp has &rest and &body which have the same evaluation semantics, but notifiy the human reading the code, and also the IDE/editor that what folows &body is the body of a function, usually in a macro call-site.#2020-09-2509:18iarenazaAs I said, CIDER isn't in charge of indentation, clojure-mode is. And clojure-mode only deals with text buffers, so it doesn't "eval code" (as CIDER does) and thus doesn't know if a given form is a function or a macro (as stated in the first link I provided), or what the "macro lambda list" is . Of course clojure-mode knows about the core Clojure macros (like case) and thus it can indent them the way you would expect. But for unknown ones (like yours) it can only guess. And I suspect the safe guess is "assume it's a function" (as opposed to "assume it's a macro"), so it applies the default indentation for functions.
So you need to tell clojure-mode that you want some form(s) to be indented a particular way (using one of the two methods documented in the first link).
In your case you can have a look at the indent specification for case in clojure-mode (see https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L1569-L1644) and use put-clojure-indent or define-clojure-indent as suggested in the first link:
(put-clojure-indent 'rte-case 1)
(define-clojure-indent (rte-case 1))
Or you can programmatically get the indentation spec for case with clojure--get-indent-method and use that to define the rte-case indentation spec:
(put-clojure-indent 'rte-case (clojure--get-indent-method "case"))
(define-clojure-indent (rte-case (clojure--get-indent-method "case")))
#2020-09-2513:57Jim NewtonOK, that's interesting. Slime (the predecessor of cider) asks the running lisp for hint on indentation if available.#2020-09-2513:58Jim Newtonso indentation might change/improve as you develop your code.#2020-09-2421:01bartukahi, I have a question related to orchard , I noticed that xref/fn-deps cannot find macros used inside a function. there are ways around it?#2020-09-2421:03dpsuttonProbably not. I imagine it can only contemplate the expanded form?#2020-09-2502:36bartukasorry, my internet connection was really bad. Yeah, you are right. I was imagining that would be possible get these info in a different way#2020-09-2502:36bartukabut probably not 😕#2020-09-2500:12v3gaHi, I recently saw someone using cider on youtube and they had a buffer called cider-results. How would I go about making that visible? I didn't see it in the docs.#2020-09-2507:50Michaël Salihi@decim Hi, did you mean a buffer called `*cider-inspect*`?
If so, you can call cider-inspect-last-result command.#2020-09-2511:07v3gaIt looks like that’s it. Thanks. He must be using an older version of cider but that’s the exact functionality I was looking for. Thanks #2020-09-2511:07v3gaIt looks like that’s it. Thanks. He must be using an older version of cider but that’s the exact functionality I was looking for. Thanks #2020-09-2512:03practicalli-john@decim The cider inspecter is really useful for exploring data, paging through large data sets and navigating levels of nested data
https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html#2020-09-2517:46v3gaYeah. I’ve been looking for something like this. #2020-09-2515:10andrea.crottiis there an easy way to explore a javadoc API from Emacs/cider?#2020-09-2515:13andrea.crottiactually https://github.com/skeeto/javadoc-lookup
works decently but only for the java sdk#2020-09-2515:15dpsuttonThere’s a cider javadoc command that will open a browser. Not sure if that’s what you’re looking for#2020-09-2515:21andrea.crottiyeah but it doesn't work with generic libraries#2020-09-2515:22andrea.crottiyeah it's kind of the same as the javadoc-lookup package in a way#2020-09-2517:46v3gaYeah. I’ve been looking for something like this. #2020-09-2517:54practicalli-john@andrea.crotti I add Java source code to the class path to help CIDER find docs for Java libraries. I appreciate this may not be available for all libraries
For example, with Clojure CLI tools, I use an alias to add the openjdk sources and it helps a lot
https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L230-L243#2020-09-2618:23Gleb PosobinCider or sesman slows down emacs when typing: there are noticeable delays after some of the keystrokes.
Seems to happen when I have one cider session open, but the current clojure buffer belongs to a different project without a session started.
Here is the profile, seems like cider tries to determine the current session on every key press, which calls file-truename recursively a lot: https://gist.github.com/posobin/41f01d386e516bcc13431c8281fb10cb
Should I file this as a bug? If so, to cider or sesman?#2020-09-2720:19practicalli-johnIf using something like parinfer and Cider with aggressive indent I could see this situation arising as they continually fight against each other as you’re typing.#2020-09-2721:30Gleb PosobinParinfer is off.#2020-09-2723:11practicalli-johnSorry I don't have any other ideas, I've never seen that kind of issue in the last five years (using Cider & Spacemacs).
Maybe someone else has suggestions.#2020-09-3006:59bozhidaraggressive-indent-mode doesn't play nice with CIDER. If you disable it your problems will go away.#2020-09-3007:00bozhidarYou can still file a bug with sesman, as there might be some opportunity to improve the session resolution but for me with big enough files aggressive-indent-mode was slow even for Emacs Lisp and Clojure files without CIDER, that's why I stopped using it a long time ago.#2020-09-3013:49Gleb Posobin@U051BLM8F Do you call the command to reindent the file manually then?#2020-10-0120:31bozhidarInfrequently. I tend to press TAB a lot. 🙂#2020-09-2718:08Jim Newtonis there a way to make cider-macroexpand-1 show meta data in the expanded macro?#2020-09-2814:35yuhanquick workaround: define a helper that wraps the current form in macroexpand, and pass it to cider-inspect-expr#2020-09-2810:33Trung Dinhhi, I’m trying reframe starting from this lein template https://github.com/day8/re-frame-template , after doing lein new re-frame acme +cider and try doing cider-jack-in-cljs , seems that shadow can’t pick the build name (:app) and I got cryptic error, any idea please?#2020-09-2810:34Trung Dinh#2020-09-2810:34Trung Dinh#2020-09-2810:35Trung Dinh#2020-09-2813:47Michaël SalihiHi, found this relative issue here : https://github.com/day8/re-frame-template/issues/137#2020-09-2903:48Trung DinhThanks#2020-09-2816:54Lone RangerDoes anyone know a trick for seeing what symbols are interned into REPL memory in a CIDER session?#2020-09-2820:29afleckis there a way to get the nrepl session id of the focused repl window? i've found cider-describe-nrepl-session but that asks you to choose among sessions. I just want to know the session used by the current repl window. 2 sessions pop up and if I send commands with one session id it affects the current repl, but if I send to the other it doesn't#2020-09-2901:07lispers-anonymousDoes sesman-info show you the information you need? It will show me what buffers/directories each cider session is linked to.#2020-09-2901:08lispers-anonymousDefault key looks like it's C-c C-s i#2020-09-2901:10lispers-anonymoussesman-browser at C-c C-s w has the same information but it's not in the mini buffer.#2020-09-2912:47afleckI'm looking specifically for the nrepl session ID. sesman doesn't do that as far as I can tell#2020-09-3006:56bozhidarYou see two session in the describe command, as one is the evaluation session and the other is the tooling session (used internally by CIDER). They should be denoted differently when you select them.#2020-09-2820:30afleckif there's a connection to a project using clj&cljs there's 6 options#2020-09-2912:57borkdudeIs it possible to send forms to multiple nREPLs at the same time from CIDER?#2020-09-3006:54bozhidarNo, it's not. Each REPL is backed by a single connection. It shouldn't very hard to hack around this - e.g. start two connections in the same project and change the evaluation dispatch code to send the forms to all connections of the same type in the same project. But it's probably going to be a big ugly. 🙂#2020-10-0111:48borkdudesesman-link-with-buffer works quite well#2020-10-0111:48borkdudeI wonder if sesman could maybe solve this problem: link with multiple sessions ;)#2020-10-0111:50borkdudeHmm, the readme explicitly states buffers are only attached to 1 sessions. Ah well#2020-10-0407:39slipsetI’d love this.#2020-09-2912:58borkdudeThe use case is I have an app spun up twice but I'd like to keep the backend code in sync#2020-09-2913:45Jim NewtonNo comment syntax is defined. Use: Does anyone get this error occasionally in emacs when using cider?#2020-09-2913:46Jim Newton#2020-09-3013:21tvaughanPossibly related? https://github.com/clojure-emacs/cider/issues/2724#2020-09-3014:48Jim Newtonsorry, I don't see the connection. Are you sure you referenced the correct issue?#2020-09-3014:58tvaughanThey both involve a macroexpand error. That's all#2020-09-3015:01Jim Newtonahhh. I see.#2020-09-2913:47Jim NewtonI suspect it is somehow related to the fact that I pressed 'm' in the cider-macroexpansion buffer, and my macro intentionally threw an exception.#2020-09-3007:02bozhidarProbably something messed up clojure-mode's syntax table. You can file a ticket with some repro steps and I'll take a look when I can.#2020-10-0107:58Jim NewtonHi bozhidar, I've created an issue as you requested. Here it is https://github.com/clojure-emacs/cider/issues/2903#2020-10-0107:59yuhanit's probably some unrelated package's minor mode causing this#2020-10-0107:59yuhanhappened to me using Outshine#2020-09-3007:03bozhidarBtw, after taking a couple of weeks off Slack I'm back. 🙂#2020-10-0107:34Jim Newtonis there a way to get a URL to a message or thread in the clojurians feed?#2020-10-0107:34Jim NewtonI'd like to link a message to an issue in github.#2020-10-0114:53lispers-anonymousYou might want to copy the content of the message(s) in question before they get deleted. Free slack doesn't keep all the messages around.#2020-10-0117:59Jim Newtoninteresting.#2020-10-0118:00Jim NewtonI actually much prefer https://clojureverse.org but I'm assuming the information will stay forever#2020-10-0215:55lispers-anonymousI think the clojure zulip mirrors slack and those will stick around forever: https://clojurians.zulipchat.com/#2020-10-0108:23claynonmouse over the message > in the right side close to the reactions button there will be a More actions(three vertical dots) > Copy link#2020-10-0109:27Jim Newton#2020-10-0109:27Jim NewtonAm I blind? I don't see it.#2020-10-0109:37Jim NewtonI found a Copy Link item when I mouse on the date. I think that's the right one.#2020-10-0216:38Nassin((clojure-mode
(cider-clojure-cli-global-options . "-M:dev:nrepl:nrepl-opts")))
#2020-10-0216:39NassinThat prepends only, how do I replace the entire jack-in cmd ?#2020-10-0216:40dpsuttonif you drop that and just use -A:dev you'll achieve the same thing. CIDER already throws its deps and main options in there correctly (which is what you are trying to accomplish with nrepl and nrepl-opts)#2020-10-0216:41Nassinit is an example, I want per project specific commands, different nrepl, cider-nrepl versions etc...#2020-10-0216:44dpsuttonalternatively, just start it from the command line like that and then cider-connect.#2020-10-0216:45dpsuttonis probably the easiest. it looks like if you call (cider-jack-in (list :edit-jack-in-command "whatever you want"))#2020-10-0216:45dpsuttonbut would probably need a patch to have a wholesale dropin of the jack in command from dir-locals#2020-10-0216:45dpsuttonshouldn't be too hard. but at that point i don't see any real benefit over just cider-connect#2020-10-0216:46dpsuttonand personally would want the process outside of emacs. but i can see some people wanting it as an emacs subprocess i guess#2020-10-0216:47Nassinyep, using cider-connect currently, wanted to 'slim' more the project setup but no biggie, thanks#2020-10-0216:50dpsuttonyeah. especially if you have multiple versions there's no good way to select from multiple different fully formed startup commands. One thing to note is that if you jack-in with a prefix arg you can edit the entire jack in string to whatever you want. useful for "one off" type of jack ins, adding profiles willy-nilly, etc#2020-10-0217:20practicalli-john@kaxaw75836 The following has an example .dir-locals.el that will switch off all the auto-injection that cider-jack-in command does, leaving the clojure command and aliases to run
http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#run-rebl-for-nrepl-based-editors#2020-10-0221:21zaneIs *cider-test-report* supposed to show which test in a clojure.test/are form failed?#2020-10-0513:52Yehonathan SharvitHow we could get out of the “already refers to” situation in Cider?
Quite often I am moving a function foo from ns a to ns b and when in ns c I am requiring (a :refer [foo] instead of (a :refer [foo]) , CIDER complains:
Unhandled java.lang.IllegalStateException
foo already refers to: #'a/fo in
namespace: c
#2020-10-0513:52Yehonathan SharvitThe only solution I found so far is to restart the REPL, which is a sacrilege!#2020-10-0514:08dpsuttonCIDER isn't complaining. Clojure is. If you can get away from using :refer you'll be fine. If not, there is ns-unmap.#2020-10-0514:08dpsutton(ns-unmap 'c 'foo) and then (require [new-ns :refer [foo]])#2020-10-0514:20Yehonathan SharvitThank you @dpsutton#2020-10-0514:20Yehonathan SharvitIs there a way in Cider (or in Clojure) to clear completly a ns?#2020-10-0514:21dpsuttonyou could try cider-ns-reload after changing the namespace to the new location of foo. I don't know if that will work or not though#2020-10-0514:29Yehonathan SharvitIt doesn’t work#2020-10-0514:33dpsuttonah bummer. i'm not aware of anything then#2020-10-0516:43bozhidarI think you meant to say cider-ns-refresh.#2020-10-0516:44bozhidar(that uses tools.namespace internally)#2020-10-0516:45bozhidarThere are some docs here https://docs.cider.mx/cider/0.26/usage/misc_features.html#reloading-code#2020-10-0720:03datranI'm trying to cider-jack-in-clj&cljs, but the cljs half is failing. It works fine if I just run cider-jack-in-cljs, though#2020-10-0720:03dpsuttonis it shadow-cljs based?#2020-10-0720:04datranyeah, and deps.edn for the clj side#2020-10-0720:04datranI know you can combine them but that hasn't worked well for me so far#2020-10-0720:04dpsuttonthat uses the same build tool for both. so if you need two different executables (clj and shadow-cljs) then you can't do it that way#2020-10-0720:04dpsuttonjust jack in and then jack in cljs#2020-10-0720:05datranwhen I do that it asks me about connecting a sibling repl, and then fails#2020-10-0720:05datranwhen I do them together I get this message: `error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check https://docs.cider.mx/cider/basics/clojurescript for details1#2020-10-0720:07datranwait, trying jack-in-clj and then jack-in-cljs works! I think I was doing them in the reverse order#2020-10-0720:07datranthanks :thumbsup:#2020-10-0801:26ozzloywhat's the right way to make a change to .dir-locals.el and have variable be set in the currently open files?#2020-10-0801:28ozzloyfor example, line 5 here: https://gitlab.com/ozzloy/figserv/-/blob/master/.dir-locals.example.el#L5 is supposed to start my server when starting cider.#2020-10-0801:28ozzloyi've tried closing and re-opening the .cljs file, i've tried m-x revert-buffer,#2020-10-0801:32ozzloythis may have something to do with me having .dir-locals.el as a symlink to .dir-locals.example.el, that's just a guess though.#2020-10-0801:58dpsuttonEasiest is probable restarting emacs. There’s a function “hack-local-variables” that might help as well. Check out the documentation on that#2020-10-0802:03practicalli-john@ozzloy_clojurians_net Reverting the buffer or reopening the same file has always loaded in the .dir-locals.el file for me. Although I have never tried using a symlink.#2020-10-0802:03ozzloyit turned out the help buffer wasn't updating#2020-10-0802:04ozzloyi killed and re-opened it#2020-10-0802:04ozzloyi tried removing the symlink and re-`C-h v variable`#2020-10-0802:07ozzloysorry, that was scattered. i tried again without symlink and just copied the .dir-locals.example.el to .dir-locals.el and that didn't work. i then tried killing the help buffer that displays the value of the variable, and then re-doing C-h v variable-name and then i finally got the new value displayed.#2020-10-0802:10ozzloybut now i have a different problem. i added "--init src/fyi/tuwo/figserv/server.clj" to the clojure command line and now it's looking for a file named "-Sdeps", here's the messages buffer: https://www.appdevtools.com/pastebin/FCGXrp#2020-10-0802:11ozzloyi'm trying putting the --init src/... at the end, that didn't fail in the same way when i ran it in bash#2020-10-0803:06ozzloyok, maybe i don't know what i want#2020-10-0803:58dpsuttonWhat are you trying to do?#2020-10-0807:19practicalli-john@ozzloy_clojurians_net It sounds like the auto-injected configuration that cider-jack-in uses is conflicting with the alias set in the .dir-locals.el configuration. Assuming you can connect to the project without Cider injecting the extra dependencies, then you can disable them using the following in a .dir-locals.el
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-M:lib/cider-nrepl:inspect/rebl:middleware/nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))
The Clojure project will need to include the cider-nrepl library or have that library included in the alias used to start the project, for example
http://practicalli.github.io/clojure/clojure-tools/data-browsers/rebl-data-visualization.html#run-rebl-for-nrepl-based-editors#2020-10-0807:26ozzloy@jr0cket i might try that tomorrow. going to wrap up and go to sleep soon.#2020-10-0807:28practicalli-johnI've just woken up, good luck 🙂#2020-10-0807:32ozzloythanks!#2020-10-0807:32ozzloygood morning!#2020-10-0807:29ozzloy@jr0cket & @dpsutton i'm trying to make play a game of bingo with my grampa, and other family. http://bingo.challenge-bot.com/ is what i have so far. it serves an isolated bingo game to each person that connects. i'd like to sync multiple players up by having them share the called numbers. i'm currently trying to do that with sente#2020-10-0807:29ozzloyi'm thinking sente can make it so the server knows the current called numbers and push that out to the players. and there can be a master player in charge of adding numbers to the list of called numbers#2020-10-0807:31practicalli-johnI assume you mean this project (and not the anti-aging skin care)
https://github.com/ptaoussanis/sente#2020-10-0807:31ozzloycurrent code for the bingo game is here: https://gitlab.com/ozzloy/b1ng0/ but right now i'm working on a throwaway thing just to learn the libs (sente, compojure, ring etc)#2020-10-0807:31ozzloyyeah#2020-10-0807:31ozzloyi mean that#2020-10-0807:31ozzloymy throwaway project: https://gitlab.com/ozzloy/figserv#2020-10-0807:33ozzloyi'm not married to sente. if there's a way that someone knows that is easier, i'm down to try.#2020-10-0807:33ozzloygood night, and thank you all!#2020-10-0814:58timvisherIs it expected that CIDER (emacs) and cider-nrepl (leiningen plugin) are now out of sync? CIDER is on 0.26 and cider-nrepl is on 0.25.4.#2020-10-0815:02dpsuttonyes they are no longer in lockstep
(defconst cider-required-middleware-version "0.25.3"
"The CIDER nREPL version that's known to work properly with CIDER.")
in cider.el line 408#2020-10-0815:02dpsutton(apparently i'm a few commits behind)#2020-10-0815:07timvisherSweet. That's kind of what I figured. It was nice to connect to the REPL and not get the big scary "YOUR VERSIONS MISMATCH HEATHEN REBEL SCUM!" message. 😂#2020-10-0815:08dpsutton"THINGS WILL BREAK AND ITS YOUR FAULT! I"M DROPPING ALL YOUR TABLES AS WE SPEAK!"#2020-10-0815:10timvisherAt least that's how I always read it. LOL#2020-10-0815:21bozhidar😄 😄 😄#2020-10-0815:21bozhidar> Prior to CIDER 0.18, CIDER and cider-nrepl were always released together and their versions had to match for things to work (e.g. CIDER 0.15 required cider-nrepl 0.15). But as the prominence of cider-nrepl grew and many other tools started using it, the two projects evolved separately and are no longer in tight lock-step. Usually, any recent version of cider-nrepl should be (mostly) compatible with a recent version of CIDER. You can check the required version of cider-nrepl for your version of CIDER by looking at cider-required-middleware-version.#2020-10-0815:22bozhidar(from the docs https://docs.cider.mx/cider/0.26/basics/middleware_setup.html)#2020-10-0816:14timvisherI knew you all would've written about it somewhere.#2020-10-0816:14timvisherThanks for your tireless efforts, @bozhidar! Although I still wish my logo had been accepted for the project. 😜#2020-10-0816:15timvisher(Not bitter…)#2020-10-0816:54dpsuttonwhat was the logo? got it handy?#2020-10-0817:00timvisherLOL I'll see if I can dig it up. I'm sure I have it Dropbox somewhere. 🙂#2020-10-0817:08timvisherLOL. The Internet Is Awesome. https://github.com/clojure-emacs/cider/issues/399#issuecomment-27913728#2020-10-0817:09timvisherMy favorite comment was @bozhidar telling me how it looked like a frozen chicken! 😂 https://github.com/clojure-emacs/cider/issues/399#issuecomment-27909759#2020-10-0817:09timvisherGod this is bringing back memories.#2020-10-0817:10dpsuttonfrozen chicken! lol#2020-10-0819:44bozhidar@timvisher I'm laughing out loud right now! I remember your logo proposals, but I definitely didn't remember that comment I made. 😄 😄 😄#2020-10-0911:33bruno.bonacciHi,
does anyone know if there is a way in Cider to provide a custom cljfmt formatting configuration?#2020-10-0913:55bozhidarCustom in what sense? CIDER just runs cljfmt, so it should pick whatever configuration you have.#2020-10-0914:21bruno.bonacciWhere does cljfmt read the configuration from?
I’d like to provide the following configuration
:cljfmt {:remove-consecutive-blank-lines? false
:remove-surrounding-whitespace? false
:indents ^:replace {#".*" [[:inner 0]]}}#2020-10-0915:55bozhidarThat's the integration point https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj#L28#2020-10-0915:55bozhidarIt seem you actually have to pass the configuration to the middleware. I had forgotten how that code looks.#2020-10-0915:57bozhidarIt also seems we didn't expose this through the existing format commands in CIDER.#2020-10-0915:58bruno.bonaccii see: the cider call would be here, right?
https://github.com/clojure-emacs/cider/blob/1be3b89c00d9fe6d2b69e5b719d168e22d333a25/cider-client.el#L714#2020-10-0916:36bozhidarYeah, that's the "low-level" request function, most of the user-facing code is in cider-format.el.#2020-10-0916:36bozhidarIt shouldn't be hard to change this. Probably we can expose the configuration through a defcustom.#2020-10-1010:07bruno.bonacciThanks for the info, I’ll add a issue to cider and, when i get a bit of time, I’ll try to PR.#2020-10-1012:25teodorluHi! I'm dabbling a bit in Clojurescript again, and I must say that my experience with CIDER and Clojurescript is way better now than it was two years ago! I'm really liking how easy it is to jack-in and get live-reloading and a browser-connected REPL 💯#2020-10-1012:27teodorluQuick question. Is there a good way to provide arguments for cider-jack-in-cljs in a project? I'm selecting shadow-cljs, shadow, :app and "No, I do not want to open a browser" each time I'm starting my project. Could I provide this with .dir-locals.el ? Or is there another preferred way?#2020-10-1012:29ziltiYou can do it with .dir-locals.el, yes! Here's the one I am using in my project:
((nil . ((cider-clojure-cli-global-options . "-A:dev")
(cider-default-cljs-repl . shadow-select)
(cider-shadow-default-options . ":main")))
(cider-mode (eval add-hook 'after-save-hook 'cider-eval-buffer nil t)))
#2020-10-1012:30teodorluGreat, thanks!#2020-10-1012:30teodorluMay I ask what the last line does? Are you auto-evaluating whole buffers on file changes?#2020-10-1012:31ziltiYes, but that line is actually broken, but I haven't looked into fixing it yet#2020-10-1012:32teodorluOK. Thanks for the help :thumbsup:#2020-10-1217:06grounded_sageDoes anyone know the cause of this error?
java.lang.NullPointerException: Cannot invoke "jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.getOptions()" because "this.configuration" is null
It is preventing me from bumping nrepl dependencies.#2020-10-1217:09dpsuttonthis doesn't seem CIDER related? no idea what is going on here#2020-10-1217:09grounded_sageIt only happens when I bump the dependencies of nrepl/nrepl and cider/cider-nrepl#2020-10-1217:10grounded_sageCurrently we are on older versions in an alias. Which runs fine. But doing the default jack-in by calva it fails and even using the latest versions of these dependencies causes the same issue.#2020-10-1217:11dpsuttonhave you got any more of the stack trace?#2020-10-1217:11dpsuttonalso, can you leave out cider-nrepl and just run from the command line?#2020-10-1217:17grounded_sageYes I can do it from the command line when I run clj#2020-10-1217:17grounded_sageIt’s just when I try and jack in using calva that issues are arising#2020-10-1217:17dpsuttondo you get the error when leaving out cider-nrepl from the command line? or does it make it to a repl?#2020-10-1217:18grounded_sageNo I can run a repl from command line#2020-10-1217:18dpsuttonhave you got more of the stack trace?#2020-10-1217:22grounded_sage#2020-10-1217:25grounded_sage@U11BV7MTK this might not be the best place/way to share stack traces? I can also paste it directly in channel in a code block?#2020-10-1217:28dpsuttonopen an issue in orchard with this stack trace if you could#2020-10-1217:29dpsuttoni think there's been some work in this recently and someone might have context#2020-10-1217:19grounded_sageActually let me just get a new one. Because that was when I was doing this from lein#2020-10-1217:24grounded_sageRuns fine on
{cider/cider-nrepl {:mvn/version "0.19.0"}
nrepl/nrepl {:mvn/version "0.5.3"}}#2020-10-1217:27dpsuttonwhat's your jvm version?#2020-10-1217:27dpsuttoni saw it had a decent message for the NPE#2020-10-1217:59grounded_sageYep the latest reported issue seems to be the same as I am encountering.#2020-10-1218:14Ben SlessHi All, I hope it's okay to share this here. This small package wouldn't have been possible without you (and it's built on top of CIDER).#2020-10-1222:34anonimitorafHi guys, pretty new to Clojure/Emacs but I was wondering, given the existence of the datafy and nav protocols, I dont think Ive seen alternative implementations of REBL in Emacs/Cider. Are there any plans? I'm actually also interested in helping out#2020-10-1223:40practicalli-johnI've found the Cider Inspector to be incredibly useful to explore large and nested data structures, even some Clojure transforms of some nearly data science data.
I have not yet seen much about datafy or nav, so it's unclear what I am missing.
I have had Congitect REBL connected to the Cider session, so all evaluation is also shown on REBL, but haven't used it that much. I seem to be missing understanding about the tool.#2020-10-1300:20anonimitorafOhh, TIL that there's a CIDER inspector. I'll check this out later!
From the few vids/articles I've watched/read, REBL has an implementation + UI of the datafy / nav protocols#2020-10-1317:26practicalli-johnI would like to know more about datafy and nav, its on my todo list (which is very long)#2020-10-1306:53MacrozI'm a little baffled but looks like .dir-local.el with cider-default-cljs-repl doesn't work if I cider-jack-in-cljs only when I cider-jack-in#2020-10-1306:54Macrozvery baffled because I think it used to work, I can find issues of it working and not working, and even on this slack people suggesting it#2020-10-1307:46Macroz(obviously doesn't work with the regular jack-in)#2020-10-1313:14jcf@U0PPLKYR4 double check you're using .dir-locals.el. Note locals is plural.#2020-10-1313:33dpsuttonAlso it has a dot at the beginning #2020-10-1314:14jcfThanks, @dpsutton. I've updated my comment to include the leading dot. 🙂#2020-10-1319:05Macroz.dir-locals.el yes the filename is correct#2020-10-1319:08MacrozI'm currently using cider-version 1.0.0snapshot (package: <tel:202009131139|20200913.1139>)#2020-10-1707:36Macrozso can anyone just confirm that dir locals works for them using also shadow-cljs? I'll try debugging this#2020-10-2005:30sylvainIt works for me#2020-10-2005:31sylvainI have this in my .dir-locals.el:#2020-10-2005:31sylvain((nil . ((cider-clojure-cli-global-options . "-A:devtools:dev:shader-editor")
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . ":app")
(cider-shadow-cljs-global-options . "-A:devtools:dev:shader-editor"))))#2020-10-2005:39sylvainI mean the cider-shadow-cljs-global-options is correctly passed to shadow-cljs when doing cider-jack-in-cljs. I still get a popup asking me to chose between clojure-cli and shadow-cljs which is weird.#2020-10-2012:33dpsuttonIf there are two project type files cider needs to ask which one to use. You can set cider preferred build tool if you like#2020-10-2107:57sylvainAh ok right. But there's no way to specify a different build tool for cider-jack-in-clj and cider-jack-in-cljs it seems. In my case I'm using clojure-cli for one and shadow-cljs for the other.#2020-10-1313:20jcfHi folks!
I've been chatting over in #shadow-cljs about a problem with jacking into a CLJS REPL. https://clojurians.slack.com/archives/C6N245JGG/p1602593984417600
The gist of it is when I invoke cider-jack-in-cljs with a shadow-cljs project that uses tools.deps I'm told "No namespace: cider.piggieback found".
I found the following issue, that was closed by a rather egregious bot without a fix (the suggestion was to manually configure things rather than relying on Cider's built-in support): https://github.com/clojure-emacs/cider/issues/2812
I've tried the suggested workaround and unfortunately it did not get me a working CLJS REPL.
What I'm wondering is this: is this a combination of tools that people are using or have I wandered off the beaten path? Should I stick with Cider and Figwheel Main or do Cider and shadow-cljs play nice with a cider-jack-in-cljs?#2020-10-1313:36dpsuttonShadow is phenomenal and you’re right where you want to be. The tooling is a little rough if you use deps to run shadow but is really nice if you use shadow to manage your deps#2020-10-1313:49jcfThanks, @dpsutton. That's what I'm thinking.#2020-10-1313:50dpsuttonIf you look at the dir locals for lambda island “chui” it has some tricks to make deps managed shadow nicer though#2020-10-1314:06jcfEvaling indent rules. Interesting.#2020-10-1321:14zackteoMay I ask what is the best way to handle the following? Other than restarting emacs entirely? Under sesman-restart for some cases and cider-restart for other cases. But what other ways of restarting cider are there? Other than closing emacs 😮
error in process filter: nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1
error in process filter: Sync nREPL request timed out (op clone id 1)
#2020-10-1321:29hugoWell if your nrepl isn’t responding you can kill that process and then close the repl buffers.#2020-10-1321:42zackteo@hybas3 Like the buffer? The error still occurs after killing the buffer and running cider-jack-in-cljs again#2020-10-1322:02plinshello everyone, Im trying to customize the cider-jack-in command, I need to expose an env variable and use a custom lein command to open the repl
the official docs state that ‘You can use C-u M-x cider-jack-in RET to specify the exact command that cider-jack-in would run. This option is very useful is you want to specify a something like a lein or deps.edn profile.’
Im using doom emacs with evil mode, so C-u takes me to beggining of the buffer
is there any other way of doing that?#2020-10-1401:09practicalli-johnPerhaps Doom Emacs used SPC u as C-u , this is how Spacemacs calls the universal argument to modify the cider-jack-in command (and other things)#2020-10-1401:11practicalli-johnDoom has a discord channel, which may be useful of more use for Doon specific questions.#2020-10-1322:09dpsuttondo you know how to do a prefix argument in emacs?#2020-10-1322:09plinsIm afraid not#2020-10-1322:11dpsuttondid you try it from normal mode and insert mode? No idea how to do this in evil mode#2020-10-1322:11dpsuttonprobably ask in #emacs to get more eyes on it#2020-10-1322:12plinsalright, I was wondering if there was a command, accessible by M-x that would do what C-u M-x cider-jack-in does, but thanks anyway 🙂#2020-10-1322:13dpsuttonno. cider-jack-in is the command. the prefix arg (`C-u`) is how you modify the command#2020-10-1707:36Macrozso can anyone just confirm that dir locals works for them using also shadow-cljs? I'll try debugging this#2020-10-1403:08ozzloynot sure if this is a cider question. after starting a repl, then updating deps.edn to have a new dependency, how do i get the repl to see that new dependency? right now i'm restarting the whole repl#2020-10-1403:09ozzloyalso, is there a shortcut to get the repl to switch to the namespace of a buffer i'm currently in?#2020-10-1409:17practicalli-john@ozzloy_clojurians_net I found restarting the REPL to be the most reliable way.
If you evaluate code in source code buffers, there is no need to switch namespace on the repl buffer. Cider evaluates code in the namespace it's contained in.
There is a cider command to send current namespace to the REPL (can't remember what that's called, but should be obvious by its name)#2020-10-1416:36fenton@ozzloy_clojurians_net simply load the file with: load-buffer-set-ns, this will load the file and change the ns of the repl to the loaded file.#2020-10-1510:25mhcatHello everyone, I am having problems downloading cider/cider-nrepl 0.25.4 - I see this
Error building classpath. Could not transfer artifact cider:cider-nrepl:jar:0.25.4 from/to clojars (): Range Not Satisfiable (416)
Anyone have any ideas what might be up here?#2020-10-1513:16mhcatWelp, for the record, a previous attempt to download had failed part way through, leaving 2 files which should not have been there
cider-nrepl-0.25.4.jar.part cider-nrepl-0.25.4.jar.sha1-44a45c1810349766484376557361.tmp
I removed the 0.25.4 repository subdir locally and the next attempt worked fine#2020-10-1513:26bozhidarProbably some clojars issues.#2020-10-1618:23Endre Bakken StovnerAuto-completion in Cider requires compliment. Is this something I should download myself? (I am trying to debug why auto-completion does not work in doom emacs with clojure lang option)#2020-10-1618:47dpsuttonits a dependency of cider-nrepl and is there automatically if you are using that. note that cider-jack-in will automatically do this for you if you are using it in that manner#2020-10-1906:25theophilusxI have an issue with cider-clojuredocs when working on a project using tools.deps (Clojure CLI). This seems to be spacemacs specific. When I run cider-clojuredocs I get an "wrong type argument: char-or-string-p nil error. Other things appear to be working fine - I can evaluate forms in the repl, run tests, evaluate forms etc. However, cider-clojuredocs gives the above error and things like cider-doc or cider-apropos fail with errors about unable to resolve symbol even though I'm requesting standard/core functions. Running the same project, but using lein rather than CLI and all works fine. Running CLI based project in a basic emacs setup (no spacemacs) seems to work fine as well, so I have logged an issue with the spacemacs maintainers. Just wondering if anyone else has seen this?#2020-10-1907:26bozhidarI haven't seen such problem myself, and I don't see how it can be related to the build tool in general. Do you have the complete stacktrace for the error?#2020-10-1907:41theophilusxThe stacktrace is
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
cider-clojuredocs--content(nil)
cider-clojuredocs-lookup("case")
cider-try-symbol-at-point("ClojureDocs doc for" cider-clojuredocs-lookup)
cider-clojuredocs(nil)
funcall-interactively(cider-clojuredocs nil)
call-interactively(cider-clojuredocs nil nil)
command-execute(cider-clojuredocs)
#2020-10-1908:01theophilusxI just did a comparison of the cider buffer for the non-spacemacs working version and the spacemacs failing one. They are both identical - load the same versions, same arguments and same cmd line.
This has to be something spacemacs is doing with how it is passing arguments in. I notice that when running spacemacs, when I do , h d (the binding for cider-clojuredocs, there is no default value - the prompt just says "clojuredocs doc for: while with the working version, it has a default value (current symbol under point) e.g. clojuredocs doc for (default println): for example.#2020-10-1909:27bozhidarYeah, probably some configuration difference. Please, open a ticket on CIDER's issue tracker with all this info and I'll take a closer look when I can.#2020-10-1909:27bozhidarShouldn't be hard to figure this one out.#2020-10-1909:38bozhidarYou can also try https://docs.cider.mx/cider/0.26/troubleshooting.html#debugging-cider-commands#2020-10-1910:10theophilusxOK, will try some troubleshooting first and then if I don't make any progress will open an issue. I do suspect it is spacemacs specific and have laready opened and issue on the spacemacs repo site.#2020-10-2105:52theophilusxI tried to debug this problem, but it was beyond my elisp skills. I've logged an issue against the cider repo.#2020-10-1907:24ozzloyi made a deeply nested namespace in my project for testing stuff out. now my repl prompt is very long and that makes me sad. is there a way to shorten it to not have the entire namespace, or like the first letter of each folder?#2020-10-1907:25bozhidarYes - https://docs.cider.mx/cider/0.26/repl/configuration.html#customizing-the-repl-prompt#2020-10-1907:26ozzloyoh hi, thanks!#2020-10-1907:25ozzloynm, i found it#2020-10-1907:29adiHello! I'm running into an issue using re-jump.el for navigation in a re-frame app. I think I have an idea of where the problem originates. However, I've not debugged emacs packages much. I'd appreciate help figuring out whether I'm on the right track. Details in this issue: https://github.com/clojure-emacs/cider/issues/2912#2020-10-1909:26bozhidarI'll respond to your ticket.#2020-10-1907:41theophilusxThe stacktrace is
Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
cider-clojuredocs--content(nil)
cider-clojuredocs-lookup("case")
cider-try-symbol-at-point("ClojureDocs doc for" cider-clojuredocs-lookup)
cider-clojuredocs(nil)
funcall-interactively(cider-clojuredocs nil)
call-interactively(cider-clojuredocs nil nil)
command-execute(cider-clojuredocs)
#2020-10-2012:20Quentin Le GuennecCan cider wrap lines of the repl?#2020-10-2020:46Louis Kottmannhello! is there a way to tell Cider to drop into its REPL with the current context when it hits a #break instead of its debugger?#2020-10-2107:29bozhidar@lkottmann Currently no.#2020-10-2107:29bozhidarIf you want to evaluate code within the context you have to do this from the debugger.#2020-10-2113:04Louis KottmannMaybe I'm missing something as I am new to Clojure, but that's usually how I work to debug something. I.e: binding.pry in ruby, or pdb.set_trace() in python.
Is there no such need in Clojure that nobody requested that feature on Cider?#2020-10-2113:05Louis KottmannAt the moment when I feel the need for repl debugging I use https://github.com/GeorgeJahad/debug-repl but it is much inferior to ciders repl#2020-10-2109:55michalhey, whenever I try to flush completion cache I'm getting nrepl-send-sync-request: Wrong type argument: stringp, abort-on-input. I'm not sure what might cause that problem. any hints?#2020-10-2110:23bozhidarSeems like there's an invocation with wrong arguments somewhere. Open a ticket about this and I'll check it out later.#2020-10-2110:55michalthanks, ticket created. as I described, this problem is actually a minor one, the real issue I tried to investigate is why I have no autocompletion on namespaces (like (java.util._) or qualified symbols (like (clojure.string/_). I though that flush may help but I feel like it's not that easy 🙂#2020-10-2121:59jmckitrickWhat’s the purpose of this prompt and the resulting browser page?#2020-10-2121:59jmckitrickVisit '' in a browser? (y or n)#2020-10-2121:59jmckitrickIs it useful outside the functionality CIDER provides already?#2020-10-2122:03dpsuttonposted in shadow as well but (setq cider-offer-to-open-cljs-app-in-browser nil) i believe#2020-10-2122:04dpsuttonif you are developing a webapp using cljs, you need the runtime. so it helpfully tries to load up the page for you#2020-10-2122:11jmckitrickOk, I see. How is that different from a clj backend and shadow/figwheel front end?#2020-10-2122:11jmckitrickDo you mean cljs entirely in the browser?#2020-10-2122:12jmckitrickoh, perhaps a web worker or something without a rendered page/dom…. maybe?#2020-10-2122:13dpsuttonif you are making a webapp the js engine is the browser. so its offering to open the browser so you can run the emitted js code from your cljs#2020-10-2122:15jmckitrickok. I guess I just don’t see how that’s different from bookmarking localhost:3000 and opening that.#2020-10-2122:15jmckitrickExcept that page shows something very different, of course#2020-10-2122:17dpsuttonnot every project uses port 3000. its customizable and shadow will pick other ports if the one you specified is taken#2020-10-2122:32jmckitrickHmm. It shows me build status etc, and I thought for sure that page must have a use if someone went through all the trouble of designing it 🙂 rather than just overriding it to point to my app#2020-10-2209:15magraI do not know the official name of that page but I consider it the shadow-cljs dev tools. Shadow-cljs supports multible builds like test etc. It also shows compile and recompile status. And if you use tap> in cljs it shows up here to. Also notifications about builds come from this.#2020-10-2209:16magraIf you use eg. fulcro quite a lot of things show up here. It might be bleak on a bare new app.#2020-10-2209:18magraOn my setup the app communicates with the server, also in production, via 3000. It communicates with shadow-cljs via 9600.#2020-10-2209:37magraCorrection: browser, not app. And maybe consider it a dashboard.#2020-10-2201:02practicalli-johnGetting a weird error when running cider-jack-in-clj with a Clojure CLI deps.edn project and using an alias with the -M flag rather than the deprecated -A flag (I've tried a few aliases with the same error). I have tried this with several versions of Clojure CLI tools installed, from 1.10.1.697 onwards.
Using the -A flag does not give this error...
error in process sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdeps (No such file or directory)
CIDER 1.0.0snapshot (package: <tel:202009301242|20200930.1242>)
Update: In the #tools-deps channel I am asking if the -M flag has issues when the -Sdeps option is also supplied (as I cant seem to turn -Sdeps injection for cider-jack-in-clj off completely with variables in .dir-locals.el)#2020-10-2210:39practicalli-johnRoot cause:
When using a .dir-locals.el file to set (cider-clojure-cli-global-options . "-M:env/test") the -M flag and aliase is placed before -Sdeps when it should be placed after
clojure [clj-opt*] -M[:aliases] [init-opt*] [main-opt] [arg*]
-Sdeps is an clj-opt (as shown when running clojure -h in a terminal)
A working command line with the -M flag and an :env/test alias should look as follows:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -M:env/test -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
The same positional rule applies for -A flag, however, the -A flag seems more flexible about following the rules.
As a temporary work-around I can use the universal argument (C-u in Emacs / SPC-u in Spacemacs) before calling cider-jack-in and manually edit the command line, putting the alias in the right position.
I still havent found a way to disable the -Sdeps from being injected. I can configure for an empty deps list, but have not found a way to prevent the -Sdeps option from being added, except by removing all arguments including the -M alias and -m main-namespace
I'e raised an issue and see if I can figure out a PR, although I got a little lost looking at the jack-in code last time.
https://github.com/clojure-emacs/cider/issues/2916#2020-10-2210:39practicalli-john^ @U06KGTXL5#2020-10-2221:37iarenaza@jr0cket @U06KGTXL5 I suggested a potential fix in the Github issue.#2020-10-2311:13practicalli-johnPull request to fix the Clojure CLI projects ordering of parameters
https://github.com/clojure-emacs/cider/pull/2917#2020-10-2201:12theophilusxI am seeing the same error as @jr0cket, but using cider 20201020..1058 package#2020-10-2210:39practicalli-johnRoot cause:
When using a .dir-locals.el file to set (cider-clojure-cli-global-options . "-M:env/test") the -M flag and aliase is placed before -Sdeps when it should be placed after
clojure [clj-opt*] -M[:aliases] [init-opt*] [main-opt] [arg*]
-Sdeps is an clj-opt (as shown when running clojure -h in a terminal)
A working command line with the -M flag and an :env/test alias should look as follows:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -M:env/test -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
The same positional rule applies for -A flag, however, the -A flag seems more flexible about following the rules.
As a temporary work-around I can use the universal argument (C-u in Emacs / SPC-u in Spacemacs) before calling cider-jack-in and manually edit the command line, putting the alias in the right position.
I still havent found a way to disable the -Sdeps from being injected. I can configure for an empty deps list, but have not found a way to prevent the -Sdeps option from being added, except by removing all arguments including the -M alias and -m main-namespace
I'e raised an issue and see if I can figure out a PR, although I got a little lost looking at the jack-in code last time.
https://github.com/clojure-emacs/cider/issues/2916#2020-10-2212:01Steinerhey. how can I use cider to debug my code, I watch the doc, but found nothing I understand.#2020-10-2212:01Steinercan you tell me how to operate??#2020-10-2212:02practicalli-john@steiner3044 debugging basics with Cider https://practicalli.github.io/spacemacs/debug-clojure/cider-debug.html#2020-10-2212:06Steinersorry, I don't use spacemacs, but original one#2020-10-2212:22practicalli-johnonly difference is C-M-x instead of , d b to start#2020-10-2212:28Steinereh, which one should I use??#2020-10-2212:30Steinereh, what operation should I do first??#2020-10-2212:37practicalli-johnC-u C-M-x with the cursor on a function will instrument that function. This adds breakpoints to that function.
Then evaluate a call to that function using the usual key bindings or command
A menu should appear above the instrumented function.
Use n (next) to step through the evaluation of each expression or form in the function, using any arguments passed to that function.#2020-10-2215:21SteinerI have to say, C-M-x in may key-bind is cider-eval#2020-10-2216:19practicalli-johnC-u C-M-x it seems. I dont use the cider keybindings, but the keybinding is described in the docs#2020-10-2212:42Steineranother question, how to set proxy in cider, cider-jack-in failed because former proxy port is forbidden by me, and now I use a new port for proxy#2020-10-2215:53Steinereh, I am trying to debug in cider now, and I copy this code from doc:
(loop [i 0]
#break
(when (< i 10)
(println i)
(recur (inc i))))
but it throws me an error that
1. Caused by java.lang.RuntimeException
Unmatched delimiter: )
what's happening??#2020-10-2215:53Steinerps: I am sure `
{:user {:plugins [[cider/cider-nrepl "0.9.0"]]}}
has been writen in my .lein/profile.clj#2020-10-2215:55dpsuttonthat version was released in 2015.#2020-10-2215:56Steiner!!!#2020-10-2215:56Steinerwhat should I do#2020-10-2215:57dpsuttoni can't believe it even works. remove that from lein profiles. if you use cider-jack-in CIDER now makes sure the correct dependencies are added#2020-10-2215:58Steineryou mean write [cider/cider-nrepl "0.9.0"] in to my project.clj??#2020-10-2215:59dpsuttonno. don't add anything. if you use cider-jack-in it will add it automatically. also, that version is from 2015 so you certainly shouldn't use that version in any case#2020-10-2216:00Steinerbut however, cider-toggle-trace-var only works when [cider/cier-nrepl] writen in .lein/profile.clj#2020-10-2216:01dpsuttonCIDER needs cider-nrepl on the classpath. if you remove that from your lein profiles, but you use cider-jack-in CIDER will add the correct version for you on startup#2020-10-2216:01dpsutton/Users/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost#2020-10-2216:01dpsuttonis an example of the way that CIDER starts up a lein project. as you can see, it includes the correct recent version of cider-nrepl for all features of CIDER to work correctly#2020-10-2216:02dpsuttonif you are starting your project in another manner then you are responsible for ensuring the dependencies are on the classpath. I'd recommend a profile and then lein with-profile +name-of-the-profile that includes the dep [cider/cider-nrepl "0.25.3"] or the most recent version of cider-nrepl#2020-10-2216:06Steineruser-error: 'cider-toggle-trace-var' requires the nREPL op "toggle-trace-var" (provided by cider-nrepl)#2020-10-2216:06SteinerI remove content of .lein/profile.clj#2020-10-2216:09dpsuttonhow did you start your repl?#2020-10-2216:09Steinercider-jack-in#2020-10-2216:10dpsuttonat the top of the repl buffer do you see something like: ;; Startup: with a big command after it? can you post that?#2020-10-2216:11dpsuttonand what is the output of lein --version ?#2020-10-2216:11Steiner2.8.1 maybe it's too low#2020-10-2216:12dpsuttonyeah. lein upgrade 2.9.4 should update it#2020-10-2216:16Steinerhold on please, I install it from apt, now I want to build it from source, just for fun, can I do it??#2020-10-2216:16dpsuttoni guess? uninstall from apt and then do what you want#2020-10-2216:41Steinerwow, I solve that after upgrade leiningen, thank you#2020-10-2216:42dpsuttonand in general, never put stuff in lein/profiles. Use a profile in the project or let CIDER manage it for you#2020-10-2216:59Steinerone more question

how can I do like this??
I copy it in my emacs, but find it not stop#2020-10-2217:04Steinerand this is Startup message
;; Connected to nREPL server -
;; CIDER 1.0.0-snapshot, nREPL 0.8.2
;; Clojure 1.8.0, Java 11.0.8
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
;; If you're new to CIDER it is highly recommended to go through its
;; user manual first. Type <M-x cider-view-manual> to view it.
;; In case you're seeing any warnings you should consult the manual's
;; "Troubleshooting" section.
#2020-10-2311:13practicalli-johnPull request to fix the Clojure CLI projects ordering of parameters
https://github.com/clojure-emacs/cider/pull/2917#2020-10-2317:57EdHi. Part of my workflow currently is having a bit of test code in a comment form next to the function I'm currently working on, and I change the function a bit, and then eval the same bit of code again. Is there a way for cider to remember that bit of code and run it again? Took a quick glance at the docs and didn't see anything, but might well have missed it ...#2020-10-2318:45EdI couldn't find anything, so I hacked this together
(defvar-local last-sexp-contents nil)
(defun ed-clojure/eval-last-sexp (&optional re-run-previous-sexp)
"Hacked patched from cider (defun cider-eval-last-sexp ... )
Evaluate the expression preceding point. If invoked with
RE-RUN-PREVIOUS-SEXP, use that rather than the value at point
buffer."
(interactive "P")
(if re-run-previous-sexp
(progn
(setq last-sexp-contents (cider-last-sexp))
(cider-interactive-eval nil nil (cider-last-sexp 'BOUNDS) (cider--nrepl-pr-request-map)))
(if last-sexp-contents
(cider-interactive-eval last-sexp-contents nil nil (cider--nrepl-pr-request-map))
(user-error "No sexp has been run in this buffer - invoke with prefix arg to eval an sexp"))))
which seems to work for me ... is this a terrible idea? Have I done a bad thing? Or is it worth me putting a PR together?#2020-10-2400:39EdPR raised https://github.com/clojure-emacs/cider/pull/2920#2020-10-2318:46Edor is it just me that has this problem?#2020-10-2318:52Endre Bakken StovnerI get the following error when trying to jack-in both clj and cljs: Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11).
There are suggested fixes here: https://github.com/clojure-emacs/cider/issues/2812, but I do not understand them. Anyone have a simpler fix? XD Or know a better place to ask?#2020-10-2322:06ziltiJacking in both clj and cljs with shadow-cljs never worked for me, I usually just run npx shadow-cljs watch main on the command line, then just connect clj and cljs with cider#2020-10-2322:10dpsuttonit can't. that command tries to use two different sessions in the same process. That isn't possible when shadow is the process for FE and clojure/lein is running the backend#2020-10-2322:10dpsuttonif you use figwheel, you can start up lein or clojure, and then run a clj repl as normal and another session that invokes the figwheel build process and ultimately gives you a cljs repl#2020-10-2412:56Chrishi guys, before I open an issue on github I thought about asking here first…the auto-complete menu seems to be a bit bugged for me, let’s say I input (map and get all available options with this prefix and I try to “scroll” through the options I can use C-j to go down, but whenever I press C-k to go up, it selects the currently highlighted option and inserts a ? . C-n and C-p do not work either to scroll through the options. Whenever I use C-n to scroll through the options I get the following log in the *Messages* buffer:
user-error: No dynamic expansion for 'map' foundInvalid face attribute :extend t
I’m on MacOS currently but I have the same issue on Windows as well. I’m using ivy-mode and company-mode as well in case that’s relevant…not sure if anyone had a similar issue#2020-10-2412:56ChrisI’m currently using my own version of Emacs, however, I had a similar buggy auto-completion when I previously used doom emacs#2020-10-2412:58ChrisArrow keys are the only option to correctly navigate through the auto-completion menu. Furthermore, this is only an issue when working with Clojure. For other languages and their auto-completion menus it works properly#2020-10-2412:59ChrisI’m not sure how to debug it properly since I can’t e.g. use C-h k and then check which command is being executed with C-n or C-p since it then immediately closes the auto-completion menu#2020-10-2415:00practicalli-john@christian.paling I do not experience an error when trying to replicate the issue you are experiencing, the C-j and C-k keys work fine when working with Clojure.
I am using CIDER 1.0.0snapshot (package: <tel:202009301242|20200930.1242>) with GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2020-09-19, running on Ubuntu Linux 20.04. Helm is used as the completion framework and am using Spacemacs develop as the Emacs configuration.#2020-10-2415:07ChrisI have CIDER 1.0.0snapshot (package: 20201024.833) with Emacs 26.3#2020-10-2415:07ChrisIs there any way to debug this issue ?#2020-10-2415:21ChrisJust tried it out on Spacemacs and it works there for me as well. However, the completion is quite different there.#2020-10-2501:36theeternalpulseI noticed when I try to eval a defun of an "erased" (via #_) function it throws an EOF exception. is there a way to override this and have cider recognize that in certain situations. I know it would lead to side effects if you call eval buffer or something, but any way to do it on a per command basis?#2020-10-2820:26DerekA project I work on has recently started to err out when calling cider-jack-in-cljs . The error in question looks like this:
{:type :js-eval-exception,
:error
{:status :exception,
:value "Eval timed out!",
:stacktrace "No stacktrace available."},
:form (set! cljs.core/*print-namespace-maps* true),
:js "(cljs.core._STAR_print_namespace_maps_STAR_ = true)"}#2020-10-2820:30DerekLooks like upgrading the version of clojurescript to the latest fixed it#2020-10-2910:57Eamonn SullivanHi all, I think I've asked this question before, but I can't remember how I fixed it. I have a https://github.com/eamonnsullivan/github-api-lib that loads fine in Cider and I can run tests for namespaces (C-c , n), but when I try to run all of the project's tests, I get No assertions (or no tests) were run.Did you forget to use 'is' in your tests?. They run fine from the CLI (`clojure -M:test:runner`). What is cider looking for and isn't finding?#2020-10-2911:04practicalli-john@eamonn.sullivan the cider test runner will run tests evaluated in the repl. Test runners (:test/runner) will run the tests by reading all the source code files.
When using the cider test runner I typically evaluate the test code in the REPL first. In Spacemacs a wrapper was added to evaluate the current namespace before calling cider test runner, so running cider-test-run-all-tests command from the *_test.clj file usually loaded all the tests.#2020-10-2911:08Eamonn SullivanI do the same, but even if I evaluate all of the tests and code (C-c C-k) on every file, cider still doesn't run the project tests. It's not a huge deal. I just like that happy little feeling to see all of the assertions passing, but the important ones are about the code I'm currently modifying...#2020-10-2911:14Eamonn SullivanC-c , l (run loaded tests) also fails with the same error, even when all of the tests are loaded. I'm pretty sure there was some way to set up the aliases to get this to work...#2020-10-2913:35practicalli-johnI assume the alias used which cider-jack-in or when starting the repl externally, includes :extra-paths ["test"]
I include the following alias in my ~/.clojure/deps.edn
:env/dev
{:extra-paths ["dev"]}
https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L80-L82#2020-10-2912:14otfromhmm... I seem to be having a problem with emacs taking ~100% cpu and hanging while trying to debug some code. Is anyone else having a similar issue? (it might just be b/c the function is horrible, but if it wasn't so ugly I wouldn't need the debugger 😄 )#2020-10-2912:15otfromI'm getting a Syn nREPL request timed out and my emacs locks up nicely. I'm running the latest from MELPA on emacs 27.1#2020-10-2912:16otfrom(I'm presuming it is me which is why I'm asking first)#2020-10-2912:59practicalli-john@otfrom I assume you are using o from the debug menu if you need to step over any infinite lazy sequences, eg. (range). Thats the only time I recall blowing up emacs with cider debug.#2020-10-2913:01otfromdebugging a much shorter function seems to work. I'll need to remember to step over the lazy seqs (esp the infinite ones)#2020-10-2913:32practicalli-johnI learnt by forgetting to do this many times 🙂#2020-10-2913:01otfromthx @jr0cket#2020-10-2913:33otfromone thing (that I'm pretty sure is a config thing) is that when I am debugging, I get the truncated value in the src window where I'm stepping through, but I get a much larger single line value that goes to *Messages*, which then slows down all of emacs due to the long lines bug. Is there a way to turn this off?#2020-10-2913:35otfromI know I can delete the buffer (same as I know how to clear the repl buffer), but I'd like to stop it from happening#2020-10-2913:40practicalli-john@otfrom I assume its probably one of these Cider variables... https://practicalli.github.io/spacemacs/reference/cider/configuration-variables.html#2020-10-2913:44otfromI'm having a look at that now. I'm wondering if it is the minibuffer bit of the overlay#2020-10-2914:49otfromhmm... I can't find a way to get at this. I've limited the overlay to only show at the end of the line, not the mini-buffer, I've changed the print quota to 160. Had a look through the docs and the issues and I can't find a way to limit printing of large data structures (not infinite, but big) in *Messages*#2020-10-2914:53otfromnot quite sure what to do next#2020-10-2916:00otfromI'm solving the debugging problem by just rewriting the horrible code#2020-10-2920:21waffletowercider and cljfmt seem to be in accord. I now work for a company that uses cljstyle, and sadly cider/cljfmt and cljstyle have indentation differences. Besides using a after-save-hook has anyone reconciled these unfortunate differences in a way they could live with?#2020-10-2920:22dpsuttonclojure-mode has a few different settings for indentation. ideally you can get clojure-mode to indent in the way you like and then put them in a dir locals file for your work repo#2020-10-2920:23dpsuttonhttps://github.com/clojure-emacs/clojure-mode/#indentation-options#2020-10-2920:30waffletowerThanks, will probably have to create a lot of dir locals files 😀#2020-10-2920:34dpsuttonyou should only (or hopefully) need only a single one. put it at the root of your directory structure and it will cascade to any file in that tree#2020-10-3000:27timsgardnerHey, I couldn't easily find a satisfactory solution to this googling. In emacs I'm trying to use babel to send forms to the cider repl. When I enter a clojure code block and run cider-eval-last-sexp, cider-eval-last-sexp-to-repl, cider-eval-defun-at-point, etc, nothing happens, not even an error message. These commands work as expected in a clojure file. Does anyone know how to get this working? Thanks#2020-10-3005:51sgepigonTry sesman-link-with-buffer? https://docs.cider.mx/cider/usage/managing_connections.html#context-links#2020-10-3007:15timsgardnerthanks that looks like it's working!#2020-10-3007:17timsgardnerI wish everything in emacs didn't require hours of googling, obsolete docs, source spelunking 😕#2020-10-3007:17timsgardneryou saved me a lot of time, thanks again#2020-10-3007:37nivekuilIn reply to @slackt03rzgpfr=2du3q8mmre_x:nivekuil.comyou saved me a lot of time, thanks againover time you get an intuition for things :) is there anything you can think of that would have made the org-mode <-> cider connection requirements clearer?#2020-10-3007:42timsgardnerThanks for asking, I'm composing a medium doc now. The problem here was that it involved triangulating many different libraries, some of which are obsolete, the docs for each of which assume familiarity with another library. It's also completely possible there's a compact recipe for this somewhere and I didn't find it.#2020-10-3007:52timsgardnerThe org docs for ob-clojure are extremely vague about how to connect a session and get fully set up for source block evaluation. The github README for ob-clojure-literate is outdated because ob-clojure-literate was integrated into org contrib two years ago. I could not find a fully explicit account of how to get access to org contrib libraries that actually worked for me, instead I pieced together from examining package-list-packages and a stack overflow post that a package called org-plus-contrib is relevant. With some trepidation, since this sort of thing can subtly screw up emacs sometimes, I installed it, taking care to require it before using other org functions (a poster on stack overflow recommended this). The commands ran but didn't work correctly. Looking inside the ob-clojure-literate source, I found much depends on the presence of cider-connections. By trial and error I found this function has a non-null return in a clojure source file while cider is active but not in the source block buffer. After reading the ob-clojure-literate source some more I checked slack again and got your very welcome answer. Through more trial and error I pieced together that sesman-link-with-buffer expects to be given the name of sessions as provided in the top line of each entry in sesman-browser. That worked.#2020-10-3007:55timsgardnerThis sort of thing is probably inherently difficult to document because there are many moving parts#2020-11-0118:34bozhidarI think ob-clojure didn't keep up with recent CIDER developments and this caused a lot of confusion in the end.#2020-11-0118:34bozhidarI don't use it myself, that's why I don't follow its development closely.#2020-10-3012:09Jim Newtonhow can I re-indent all the lines in a file using cider? I've done a search/replace on some function names, now many lines are not indented correctly.#2020-10-3022:47nivekuilIn reply to @slackt03rzgpfr=2du010vp3uy9x:nivekuil.comhow can I re-indent all the lines in a file using cider? I've done a search/replace on some function names, now many lines are not indented correctly.there's also aggressive indent mode which automatically formats as you go#2020-10-3012:11Jim NewtonAnswering my own question. I found indent-region I was looking for reindent and not finding anything useful#2020-10-3017:58Louis KottmannC-x h <tab> should do the trick#2020-10-3018:02Eric IhliIs there something about how Cider evaluates things that would cause the following behavior?
I define a function,
(ns integrant.repl)
(defn suspend []
(println state/system)
(when state/system (ig/suspend! state/system))
:suspended)
If I run that from my REPL in Emacs, it works find.
When I set cider-ns-refresh-after-fn to integrant.repl/suspend, I don't get that println at the REPL or to the Messages buffer#2020-11-0118:48fredericHi, silly question: I have a deps.edn project with a directory structure where the foo namespace would be in the src/main/foo/bar.clj file.
But when I create that file in Cider, it adds a (ns main.foo.bar) namespace declaration instead.
Is there some configuration I can tweak so that it generates a (ns foo.bar) form instead?#2020-11-0120:15practicalli-johnIt seems unusual to have a directory under src that is not part of the namespace. I would remove the main directory if its not part of the namespace and problem solved.#2020-11-0120:16practicalli-johnOtherwise, if you keep main directory, I assume you have had to set :paths ["src/main"] configuration in the project deps.edn file to make the code run with a namespace without main (otherwise I assume it will fail if run on the command line or as a jar)#2020-11-0122:55fredericI agree that it's unusual.#2020-11-0122:55frederic:paths is already set to ["src/main"] , and the code runs fine#2020-11-0122:58fredericI'm just trying to find out if there is a way to make Cider work a little better with the existing code base#2020-11-0201:05practicalli-johnIf the namespace is being added automatically when a new file is created in cider, then it's clj-refactor at work. The namespace is not added if clj-refactor is not enabled.
So take a look at that project for options.
Also try the clojure-mode refactoring to manually add the namespace, see if that respects the path set in the deps.edn file#2020-11-0210:13fredericOh, that would explain why I didn't find anything in the cider docs 😅
Thank you!#2020-11-0208:17timsgardnerHey all, another question (and I'm not even sure it's a cider question specifically): is there a way to suppress warnings? I'm doing something vaguely hacky and don't want to see my repl light up with red warnings all the time#2020-11-0209:27practicalli-johnEvaluate code in source code buffers is way more efficient way of coding (hacking). With that approach you don't need to have the REPL buffer shown...#2020-11-0210:38bruno.bonacciHi all,
@bozhidar will be presenting the Dark CIDER to the London Clojurians Meetup.
We will learn all the dark secrects of CIDER directly from its author.
RSVP: https://www.meetup.com/London-Clojurians/events/274159509/#2020-11-0217:06Jimmy MillerSo, I'm trying to deal with a boot project and use cider-jack-in-clojurescript. Sadly, this ends in an error. I have tracked down the issue, to classpath conflicts on clojure/clojurescript versions in cider/piggieback 0.5.x. In cider/piggieback 0.4.2 there is no direct dependency on a clojure version. Using that version things work fine.
I am curious why the explicit reference to clojure 1.8? This project is using clojure 1.10.#2020-11-0217:19dpsutton#2020-11-0217:19dpsuttonnothing of note seems to have changed. i'm surprised#2020-11-0217:21dpsuttoni also can't determine where the specific dep comes from#2020-11-0217:22dpsuttonclj -Sdeps '{:deps {cider/piggieback {:mvn/version "0.4.2"}}}' -Stree
org.clojure/clojure 1.10.1
org.clojure/spec.alpha 0.2.176
org.clojure/core.specs.alpha 0.2.44
cider/piggieback 0.4.2#2020-11-0217:23Jimmy MillerYou can see on clojars that 1.8 is listed as a dependency https://clojars.org/cider/piggieback/versions/0.5.1#2020-11-0217:24dpsuttonand with
(defproject foo "0.0.1"
:dependencies [[cider/piggieback "0.4.2"]])
....
/t/piggie ❯❯❯ lein deps :tree
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
[cider/piggieback "0.4.2"]
[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
[nrepl "0.7.0" :exclusions [[org.clojure/clojure]]]
/t/piggie ❯❯❯
#2020-11-0217:25dpsuttonah, i was checking with 0.4.2 like an idiot 😞
lein deps :tree
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
[cider/piggieback "0.5.1"]
[javax.xml.bind/jaxb-api "2.3.1"]
[javax.activation/javax.activation-api "1.2.0"]
[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.8.51"]
[com.google.javascript/closure-compiler "v20160315"]
[args4j "2.0.26"]
[com.google.code.findbugs/jsr305 "1.3.9"]
[com.google.code.gson/gson "2.2.4"]
[com.google.guava/guava "19.0"]
[com.google.javascript/closure-compiler-externs "v20160315"]
[com.google.protobuf/protobuf-java "2.5.0"]
[org.clojure/data.json "0.2.6"]
[org.clojure/google-closure-library "0.0-20151016-61277aea"]
[org.clojure/google-closure-library-third-party "0.0-20151016-61277aea"]
[org.clojure/tools.reader "1.0.0-beta1"]
[org.mozilla/rhino "1.7R5"]
[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
[nrepl "0.7.0" :exclusions [[org.clojure/clojure]]]#2020-11-0217:25dpsuttonthis seems fatal#2020-11-0217:25dpsuttonthe fact that it has clojure, clojurescript and closure-compiler around seems pretty fatal#2020-11-0217:38dpsuttonhttps://github.com/nrepl/piggieback/issues/118#2020-11-0218:02Jimmy MillerThank you so much @dpsutton#2020-11-0218:03dpsuttonno problem. sorry about that. hopefully @bozhidar can create a clean jar soon. i'm a bit surprised the version profile is put in there#2020-11-0218:05dpsuttonif i do lein jar and then
clj -Sdeps '{:deps {cider/piggieback {:local/root "target/piggieback-0.5.1.jar"}}}' -Stree
org.clojure/clojure 1.10.1
org.clojure/spec.alpha 0.2.176
org.clojure/core.specs.alpha 0.2.44
cider/piggieback /Users/dan/projects/dev/piggieback/target/piggieback-0.5.1.jar
it seems to work#2020-11-0218:06dpsuttonso perhaps if you clone it, lein jar && lein install it will work for you? then you could confirm that all is well#2020-11-0218:54Jimmy MillerThat does indeed fix the issue for me locally#2020-11-0219:02dpsuttoncan you add that to the issue then @jimmy? with this stuff its nice that there's some confirmation that the new jar has a good chance of being correct#2020-11-0219:05Jimmy MillerPosted#2020-11-0221:20bozhidarPiggieback 0.5.2 is out with fixed dependencies. Thanks for spotting and reporting this!#2020-11-0221:21dpsuttonthanks for the release @bozhidar!#2020-11-0311:00bozhidarYou're welcome!#2020-11-0506:18theeternalpulseWhat's the most I guess effective way to work with macros in clojurescript when connected to the cljs repl? I noticed I can't really eval macros in the clj file so kind doing rapid testing in the same ns while creating it like I would anything else.#2020-11-0510:17Louis Kottmannin cider you have cider-macroexpand-(1|all)#2020-11-0510:18Louis Kottmannotherwise in the REPL you can just (macroexpand 'myform)#2020-11-0521:34devnhello friends. how do I find all usages of a particular fn definition?#2020-11-0521:54devnI was thinking C-c C-? r#2020-11-0521:57devnbut perhaps I need to load all namespaces for it to work? wondering how people typically do this. I’m looking to check for usages, and then jump through them#2020-11-0522:06dpsuttonCIDER is always nrepl based so its just whatever is in the running instance. clj-refactor might have some tools for this and i know that lsp certainly has tricks for this#2020-11-0522:28devnnormally i’m not jealous of of Cursive, but I’m wondering how people do “Find Usages” in emacs/cider land#2020-11-0808:06bozhidarI've always found projectile-ag to yield great results for me, but your mileage might vary. 🙂 CIDER's built-in find-usages functionality works only on loaded namespaces and only for Clojure. clj-refactor and anacondo-mode might give you better results, as an alternative to using LSP. Too many options these days. 😄#2020-11-0522:29devnI suppose I’ve always just grepped around, but I’m doing a bunch of reorganization right now. It’s in a project with 3 source dirs: a cljs src dir, a clj src dir, and a cljc shared source dir that is referenced by both the cljs and clj src dirs#2020-11-0522:32dpsuttoncan't recommend lsp enough#2020-11-0522:32dpsuttonif you're consistent with your imports its also often easy to look for alias/var-name to find them as well#2020-11-0523:12devn@dpsutton cheers. i’ve been hearing about lsp for ages, but haven’t taken the plunge. do you have any suggested reading?#2020-11-0523:12devnim using a pretty stock emacs setup + cider#2020-11-0523:12dpsuttonme too. i think there's some good stuff in the readme for lsp#2020-11-0523:13devnand is it complementary to CIDER, or a replacement? i guess i’ve always been a bit confused#2020-11-0523:13devnmy former coworker wrote clojure-lsp. should have asked him when he was around 😄#2020-11-0523:13dpsuttonhttps://github.com/snoe/clojure-lsp#emacs#2020-11-0523:13dpsuttonyou worked with snoe?#2020-11-0523:13devnya#2020-11-0523:14dpsuttoncomplimentary to CIDER. or at least that's how i used it. it offers no repl.#2020-11-0523:14dpsuttonah cool. i was at aclaimant until about a month ago with him#2020-11-0523:14devnnice. i was at outpace with him about 5 years ago. came back to outpace a couple years ago after he’d moved on.#2020-11-0523:15dpsuttonahh i've heard them talk about it#2020-11-0523:31devn@dpsutton so do you have clojure-lsp running with emacs?#2020-11-0523:32dpsuttoni did but not at my new job#2020-11-0523:33dpsutton(when personal/work-machine
(use-package lsp-mode
:load-path "~/projects/elisp/lsp-mode"
:hook ((clojure-mode . lsp)
(clojurec-mode . lsp)
(clojurescript-mode . lsp))
:init
(setq lsp-enable-completion-at-point nil)
;; (setq indent-region-function #'clojure-indent-function)
:config
(require 'lsp-clojure)
(dolist (m '(clojure-mode clojurec-mode clojurescript-mode))
(add-to-list 'lsp-language-id-configuration `(,m . "clojure")))
(setq lsp-clojure-server-command '("bash" "-c" "cd ~/projects/clojure/clojure-lsp && lein run")
lsp-enable-indentation nil)
;; (add-hook 'clojure-mode-hook #'lsp)
;; (add-hook 'clojurescript-mode-hook #'lsp)
;; (add-hook 'clojurec-mode-hook #'lsp)
))
almost straight out of the readme. i prefer CIDER's completion and not indenting with lsp#2020-11-0523:36devnand then when you enter a cl[j/jc/js] file how do you start it?#2020-11-0523:36devni added lsp-mode and configured it like the README suggests, and put the clojure-lsp binary on my PATH#2020-11-0523:39devnI see you require lsp-clojure — where does that come from?#2020-11-0523:40dpsuttonthat's part of lsp emacs package. when you enter a clj/cljc/cljs file it should start due to the hooks in the snippets#2020-11-0523:44devnhrmmm, doesn’t seem to be starting or hooking in for some reason#2020-11-0523:45dpsuttonwas the buffer already open when you evaluated the use-package form above?#2020-11-0523:45devnnah im restarting emacs to make sure#2020-11-0523:46dpsuttonnot sure then.#2020-11-0523:46devnI do see lsp-log in my buffers#2020-11-0523:46devnThe following clients were selected based on priority: (server-id clojure-lsp, priority 0)#2020-11-0523:48devnI keep getting “no language servers associated with this buffer”#2020-11-0600:12devnhmph, I think I may have figured it out by doing the explicit lein run instead of referencing the binary#2020-11-0600:14devnoh god this is great.#2020-11-0600:14devnhow did I live without this for so long :X#2020-11-0602:54theophilusxWith clojure-lsp, how do you turn off warnings about unused declarations for defn forms which are not used? I'm working on a library, so have numerous defn forms which are not used in the project (apart from the tests of course). All of them have a warning about unused declarations. Looking through the docs, there seems to be config options to manage unused namespaces etc, but nothing which seems applicable for unused defn forms?#2020-11-0605:13dpsutton#emacs might have more lsp traffic. I think there might be an lsp centric channel as well that might get you more information. That sounds like hopefully it’s covered. Public api of an library seems like a common use case#2020-11-0605:27theophilusxYes, I expect public API for a library is a common use case. I use lsp-mode with Javascript and had a similar issue, though it was easy to find the linter option to turn off. With clojure-lsp, not as straight-forward, but I suspect I just need to find out what configure option to set. I'll try some of the emacs groups.#2020-11-0721:33borkdudeThat channel is #lsp#2020-11-0800:15dorabI want to NOT switch to the REPL buffer on insert. So I set (via customize) cider-switch-to-repl-after-insert-p to nil in my ~/.emacs.d/init.el file. That works (in the sense that the cursor stays in the source buffer, when I do C-c M-p). However, it says that this variable is deprecated and that I should use cider-switch-to-repl-on-insert instead. However, when I set cider-switch-to-repl-on-insert to nil via customize in my ~/.emacs.d/init.el that does not work (in the sense that my cursor does shift to the REPL buffer). Any ideas what I might be doing wrong?#2020-11-0808:03bozhidarWhat version are you on? I see we have only cider-switch-to-repl-on-insert these days.#2020-11-0808:13bozhidarAh, I see what's wrong. Actually we have two defcustoms in the code for this. I'll fix it.#2020-11-1016:09dorab@U051BLM8F Thanks. I am on the latest stable release.#2020-11-1016:10dorabcider version 0.26.1#2020-11-0801:51dpsuttonI think you want to ignore the deprecation warning. I think I may have gotten that backwards. After insert is the newer one. On insert was ambiguous and deprecated#2020-11-0808:04bozhidarI don't see a deprecation warning at all in the code, but I'm pretty sure cider-switch-to-repl-on-insert is the name of the defcustom.#2020-11-0808:14bozhidarMy bad. I found the actual problem. The old defcustom is still around.#2020-11-0808:20dpsuttoni think i did the deprecation backwards yeah#2020-11-0808:31bozhidarNope, you did it right. I double-checked with the changelog and what's actually used in the code.#2020-11-0802:20dorabThanks @dpsutton.#2020-11-0802:32nmkipHi, I'm trying to run Reveal with cider using tool.deps but I'm stuck.
I added this to my global deps.edn
:reveal-nrepl
{:extra-deps {vlaaad/reveal {:mvn/version "RELEASE"}
nrepl/nrepl {:mvn/version "RELEASE"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[vlaaad.reveal.nrepl/middleware]"]}
and I created a .dir-locals.el in the project I'm trying to run Reveal.
((clojure-mode . ((cider-clojure-cli-global-options . "-A:reveal-nrepl"))))
When I run cider-jack-in-clj this is what gets executed:
/usr/local/bin/clojure -A:reveal-nrepl -Sdeps '{:deps {nrepl {:mvn/version "0.8.1"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'
Shouldn't the middleware vector contain vlaaad.reveal.nrepl/middleware ? Am I missing something? I also tried "-M:reveal-nrepl" in the .dir-local.el file.#2020-11-0802:57dpsuttonI doubt main opts from a profile get mixed together like that. They certainly aren’t merged. Use a prefix Arf when jacking in and just add the profile and args there. I think there are some args you can adjust but don’t know them offhand#2020-11-0803:04nmkipHow do I do that? 😛#2020-11-0803:40dpsuttonHit control-u m-x cider-jack-in and it will let you edit the jack in command#2020-11-0803:48nmkipI'll try, thanks! Do I have to do that every time? Or is there a way to automate it?#2020-11-0809:12practicalli-johnCider connect is a simpler approach. Jack-in dependencies over-rides the aliases
I raised this issue and suggested fix, but haven't had any feedback as to if this would be an okay fix
https://github.com/clojure-emacs/cider/issues/2922
Switching off the dependencies for jack-in and still use an alias via a global options variable in dir-locals requires setting several variables
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-global-options . "-M:lib/cider-nrepl:inspect/rebl:middleware/nrebl")
(cider-jack-in-dependencies . nil)
(cider-jack-in-nrepl-middlewares . nil)
(cider-jack-in-lein-plugins . nil)
(cider-clojure-cli-parameters . ""))))
If the suggested fix is acceptable, this could be replaced by a single variable, to switch off the auto-injection#2020-11-0816:02theeternalpulsesometimes when I'm jacked in to a shadow-cljs session, I can do eval in the buffer, and sometimes I can't. At first i thought it was because there was an error, so I'd refresh and see if one is thrown, but now I'm just eval-ing either gives me nothing (in a cljs file) and it always returns nil in a clj file that I'm using for a macro.#2020-11-0915:21theeternalpulsefigured it out, needed to use cider jack-in/connect clj&cljs, or just connect to the clj after connecting to cljs.#2020-11-0922:01kennytiltonI am just getting ready to set up Emacs/CIDER on a new box after a while on IJ/Cursive. I have done this before and know I was not crazy about Spacemacs, There are lots of articles out there on ding this, but is there a preferred Emacs/CIDER starter write-up we refer folks to? 🙏#2020-11-0922:11justinbarclayIf you want something more out of the box or with bells and whistle than doom-emacs is pretty slick for *nix users. It's generally for more advanced Emacs users but it's pretty fast and scrappy compared to Spacemacs.
https://github.com/hlissner/doom-emacs#2020-11-1002:08practicalli-johnUse the http://cider.mx docs if you dont want a community configuration like Spacemacs
For those that use Spacemacs, I wrote a book to make the most out of it https://practicalli.github.io/spacemacs/ Unfortunately that seems of less relevance to you I am afraid.
Otherwise use prelude, especially if you want just the Emacs keybindings rather than Vim/Evil approach.#2020-11-0922:04dpsuttoni think the docs are the best. reading through that might be the biggest bang for buck. http://cider.mx is straight forward and you'll get the most up-to-date and authoritative answers#2020-11-0922:05kennytiltonThx, @dpsutton. I belatedly thought to check the CIDER site but did not see anything. Thanks for the link!#2020-11-0922:06dpsuttonif you want my config here it is:
(use-package cider
:demand t
:load-path "~/projects/dev/cider/"
:init
(load "cider-autoloads" t t)
:config
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
(setq cider-font-lock-dynamically t)
(setq cider-show-error-buffer nil)
(setq cider-repl-display-help-banner nil)
(setq cider-repl-pop-to-buffer-on-connect 'display-only)
(setq cider-repl-tab-command (lambda () (company-indent-or-complete-common nil)))
:bind (:map
cider-repl-mode-map
("RET" . cider-repl-newline-and-indent)
("C-j" . cider-repl-return)
;; :map
;; paredit-mode-map
;; ("C-j" . cider-repl-return)
))
just get rid of the "load-path" parts and that's a bulletproof setup (in my opinion)#2020-11-0922:07kennytiltonOK, saw that. This is a new company toy, no Emacs yet. I think I see some promising links on that. Thx again.#2020-11-0922:07kennytiltonHaha, you read my mind on the config. Thx!#2020-11-1013:27practicalli-johnUsing Reveal data visualisation with Cider
Reveal can visually represent data as charts as well as text, tables, etc. There is even a chessboard example on https://vlaaad.github.io/reveal/
I've added several configuration options for using Reveal with Cider, for both cider-connect and cider-jack-in
https://practicalli.github.io/clojure/clojure-tools/data-browsers/reveal.html#2020-11-1023:22timsgardner#break never works for me. I don't know what I'm doing wrong#2020-11-1023:24dpsuttoncan you try this simple example and eval it?#2020-11-1023:25dpsutton(let [x 3]
#break (+ x 1))
#2020-11-1023:26timsgardnerhuh, that works @dpsutton#2020-11-1023:32dpsuttonThen to cover the basics, are you evaling the form after adding the tag?#2020-11-1023:32timsgardnerbut if i have this in a source file:
(defn glorp []
(let [x 3]
#break (+ x 1)))
and run (glorp) from a repl I just get 4, no break#2020-11-1023:32timsgardneryeah#2020-11-1023:32timsgardner^ in that example I ran cider-load-buffer in the buffer with the breakpoint#2020-11-1023:33timsgardnerif I define it in the repl with the breakpoint and then run it, it works#2020-11-1023:34dpsuttonWhat if you leave it in the source buffer but just eval the single defn and then call it?#2020-11-1023:35timsgardnerhm that works#2020-11-1023:36timsgardnerthough when I press q I get a NullPointerException (for forms defined in the repl too)#2020-11-1101:09jmckitrickHas anyone ever seen this error while starting cider with clj tools?#2020-11-1108:49practicalli-johnhttps://clojurians.slack.com/archives/C03S1KBA2/p1605040651307300#2020-11-1114:12tvaughanI was just struggling with this. I modified cider-clojure-cli-global-options to include an alias that also included a different version of nrepl. Getting rid of the duplication solved it for me#2020-11-1101:10jmckitrick#2020-11-1102:42dpsuttonSomeone posted those errors in #clojure earlier today#2020-11-1113:07jmckitrickYeah, I'm working with @kanwei to figure it out, and we're stuck.#2020-11-1114:02Louis Kottmann@timsgardner I used to think it was not working as well until yesterday where I wanted to get to the borrom of it, the gist is:
- ensure you have [cider/cider-nrepl "0.25.4"] in your lein plugins (or equivalent)
- put the #break in front of the sexp you want to break on. If you put it above, it does not work#2020-11-1118:55timsgardnerah, thank you, I'll try that!#2020-11-1118:15jmckitrickQuestion: I just started on a clj/cljs project where the devs use cursive. I'm a cider guy. I got the backend up and running with no issue. The front end is shadow-based, but since they use cursive, they don't need a cljs repl. They have a whole source file that starts up the shadow server. What does the deps.edn or shadow-cljs.edn need so I can jack in with CIDER?#2020-11-1118:17dpsuttonwhich controls the deps? are they in deps.edn or shadow-cljs.edn?#2020-11-1118:17dpsutton> They have a whole source file that starts up the shadow server.
what does this mean?#2020-11-1118:18jmckitrickSorry, I'm excitedly running at the mouth. Let me try something...#2020-11-1118:37jmckitrickThe deps are in deps.edn.#2020-11-1118:38jmckitrickshadow-cljs.edn is only for shadow config#2020-11-1118:38jmckitrickThere's a class with an entrypoint which starts up shadow internally (not via CLI)#2020-11-1118:39jmckitrickIt sets some params, does some sass work, etc... and starts an nrepl.#2020-11-1118:39jmckitrickAnd everything runs locally, front and back end.#2020-11-1121:50jmckitrickI'm thinking there must be a way to start from that endpoint, and still have CIDER connect.#2020-11-1121:52dpsuttonif you get cider-nrepl in there it should just work to cider-connect to the nrepl server that shadow starts up#2020-11-1122:25jmckitrickok I'll try again...#2020-11-1122:26jmckitrickOh wait... cider-nrepl, that's what I need. My first time working with a non-trivial deps.edn project#2020-11-1122:56jmckitrickMaking progress.... what does ':missing-nrepl-middleware' mean once shadow connection is made?#2020-11-1207:06bozhidar@jmckitrick Where do you get this?#2020-11-1210:00jmckitrickI started a project with tools. deps, and it's dev entrypoint starts shadow. I called cider-connect-to-cljs and followed the prompts, and that keyword was printed out in the output text of the repl right before the prompt appeared. I'm about to do more experimentation now#2020-11-1210:00jmckitrick@U051BLM8F ☝️:skin-tone-2:#2020-11-1210:03bozhidarGot it. I guess it's something coming from shadow, as it's certainly not coming from CIDER.#2020-11-1210:04bozhidarProbably cider-nrepl is not on your classpath or something like this.#2020-11-1210:05jmckitrickYes, this is my first time trying to connect cider to a non-trivial tools.deps project with shadow.#2020-11-1210:05jmckitrickDid you get my recent email? 🙂#2020-11-1212:53jmckitrick@U051BLM8F I landed a full-time Clojure gig, so I'm finally in a position to make some CIDER contributions. I think I emailed you a question about one feature I would work on... IF I can get my new project to connect CIDER to both repls.#2020-11-1411:39bozhidarYeah, I did, but I've had a couple of very busy weeks and I'm a bit behind on my email responses. Sorry about that!#2020-11-1611:25jmckitrickNP... anyway, I am 100% up and running and ready to help. No more excuses.#2020-11-1611:26jmckitrickIs it still the best course to pick a project and look for low-hanging fruit issues? Or is there another approach you'd suggest?#2020-11-1611:26jmckitrickI'm also decent at writing and proofreading docs.#2020-11-1717:32jmckitrick@U051BLM8F I saw a 'todo' for switching between clj and cljs connections, IIRC. Would that be a good feature to tackle?#2020-11-1807:55bozhidar> Is it still the best course to pick a project and look for low-hanging fruit issues? Or is there another approach you'd suggest?
Yeah, definitely.#2020-11-1807:56bozhidar> @U051BLM8F I saw a 'todo' for switching between clj and cljs connections, IIRC. Would that be a good feature to tackle?
Totally up to you. Generally it's best to work on things that you perceive to be valuable yourself.#2020-11-1813:43jmckitrick@U051BLM8F ok, I found it. cider-repl-switch-to-other. I want this feature! I see it has a FIXME. How can I help with it?#2020-11-1813:51jmckitrickIt mentions we need to implement cycling as session can hold more than 2 REPLs#2020-11-1819:49bozhidarSure.#2020-11-1820:49jmckitrickSo.. if you'd point me in the right direction, I'll try to make that happen. Any existing examples of a similar 'cycling' anywhere else?#2020-11-1209:25Jim Newtonwhat is the correct way to enable flycheck-mode on .clj files when using cider? Do I need to make this based on the .clj extension, or do I need to make it based on cider mode? Is this a cider thing or an emacs thing?#2020-11-1209:29Jim Newtondo I want something like this in my .emacs file? (add-hook 'cider-mode-hook 'flycheck-mode)#2020-11-1210:02bozhidarI just enable it globally.#2020-11-1211:23Jim Newtoninteresting, what does that do in non-clojure buffers?#2020-11-1411:38bozhidarIt defers to whatever linters are configured for the underlying major mode (or nothing).#2020-11-1210:03bozhidarhttps://github.com/bbatsov/emacs.d/blob/master/init.el#L499#2020-11-1211:53borkdudeWhat are the best resources for someone already knowing some Clojure, but wanting to migrate from VSCode to emacs, to learn e.g. CIDER and emacs?#2020-11-1213:06practicalli-johnI wont claim this is the best, but hopefully its useful.
https://practicalli.github.io/spacemacs/#2020-11-1213:07borkdude^ @stevan.radanovic :)#2020-11-1211:53borkdudeAsking for @stevan.radanovic#2020-11-1212:15pezBasically one needs to know that M-x is the equivalent to the command palette. 😃 Also, I think the document that @plexus is putting together would be of help. Not sure how ready he is to share it this widely, though so I’ll let him decide that.#2020-11-1212:18jmckitrickI've started a CIDER project using Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.2"} cider/cider-nrepl {:mvn/version "0.25.4"}}}' -A:dev -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2020-11-1212:18jmckitrickThat's the output CIDER gives me. It does a bunch of work, but then never returns a working repl.#2020-11-1212:18jmckitrickI see both nrepl and cider-nrepl are injected.#2020-11-1212:43plexushappy to share, not sure how generally useful it is. It is deliberately splitting very fine hairs, which may not be very useful for a user looking for practical info https://docs.google.com/spreadsheets/d/1PjW5Vaz3-DSTx6fkfHVbwVV5J6cfKq3xttwnwgzNS8Q/edit#gid=919814025#2020-11-1212:43plexusIt's more intended for people working on tools to be able to compare with prior art#2020-11-1212:43borkdudebtw I have mapped my paredit keybindings such that they work the same in VSCode/Calva as in emacs/CIDER#2020-11-1213:30pez@borkdude have you updated the emacs/CIDER bindings or the Calva ones?#2020-11-1213:31borkdudeCalva ones#2020-11-1213:31pezCan I haz?#2020-11-1213:31borkdudelemme check#2020-11-1213:32pezIf you post it as a gist I can link to it from the Calva docs.#2020-11-1213:32borkdudeThis is one:
I'm not sure how to make a gist of this.#2020-11-1213:33pezThere should be a keybindings.json file there on your machine somewhere…#2020-11-1213:38borkdude@pez https://gist.github.com/borkdude/6958364c88312713e62f13d8ba2b28e7#2020-11-1213:41jmckitrickSo here's where I'm confused... here is the command line I used to start the app:#2020-11-1213:42jmckitrickclj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.2"} cider/cider-nrepl {:mvn/version "0.25.4"}}}' -M:dev -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2020-11-1213:42jmckitrickWhich is right out of CIDER's jack-in setup, with an extra param -M:dev for clj tools config.#2020-11-1213:43jmckitrickYou can see that nrepl (also in deps.edn already), cider-nrepl, and cider-middleware are all injected.#2020-11-1213:44jmckitrickHowever, when I run cider-connect-cljs and provide localhost and the port configured in the dev startup code for nrepl, I get a CIDER repl with this warning:#2020-11-1213:44jmckitrick'WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!'#2020-11-1213:44jmckitrickSo... what's missing or disconnected?#2020-11-1214:12practicalli-john@jmckitrick What configuration is in the :dev alias? Does it contain :replace-deps ?#2020-11-1214:13jmckitrickno#2020-11-1214:17dpsuttonDoes it have its own main?#2020-11-1214:18jmckitrickOk, I'm in business! Whew. So I had it working yesterday, then a rare git issue lost my changes (uncommitted, unstashed, etc...)#2020-11-1214:18jmckitrickBut I'm trying a different approach now...#2020-11-1214:18jmckitrickhttps://docs.cider.mx/cider/0.26/basics/middleware_setup.html#using-embedded-nrepl-server#2020-11-1214:19jmckitrickI'm not sure it's ideal, and I'd rather handle this in deps.edn and CIDER rather than changing my company's startup code, even though it's only the dev endpoint.#2020-11-1214:30jmckitrickNext is CLJS. It seemed like it was working, but:#2020-11-1214:30jmckitrick`[nREPL] Direct connection to localhost:9630 established
[nREPL] Connection closed unexpectedly (connection broken by remote peer)`#2020-11-1214:31jmckitrickSo it connects then immediately closes.#2020-11-1215:00theeternalpulseI tried creating a macro in a clojurescript project and adding a {:style/indent 1} meta tag and it indents fine if I use the macro in the same buffer but once I import it and use it in a cljs file it indents all arguments when I only want it to indent once. Is there something I'm missing to get the other buffer to pick up the indentation?#2020-11-1216:08theeternalpulseI noticed the change once I re-named the macro, if Ihave it start with "def" seems to indent normally without the style indent#2020-11-1216:09dpsuttoni think the rules for indentation can be a bit simplistic but sometimes beneficial. Things that start with def (`defthingy`, etc) use the def rule. Same as functions/macros that start with with. Lots of times you get the intended behavior for free from the more simple matching rules but sometimes it is unintended#2020-11-1216:10theeternalpulseright, but shouldn't setting the indentation spec take into effect?#2020-11-1216:10theeternalpulse(defmacro withstyles
{:style/indent 1}
[styles component]
(let [bind-forms (style-bindings styles)]
`(let [~@bind-forms]
~component)))#2020-11-1216:10dpsuttonit sounds like there are two rules in conflict. i don't know how or even if there is a conflict resolution strategy#2020-11-1216:10theeternalpulsein the same buffer, the macro indents properly, but importing via require works#2020-11-1216:11theeternalpulse(withstyles [interact [grow pointer]
grow [*interact another one]
a [choice-a]
b [choice-b]
conditional [(if (= 1 1) a b)]]
[:div {:class interact}
[:div {:class grow}]
[:div {:class conditional}]])#2020-11-1216:11theeternalpulsethat's in the clj file#2020-11-1216:11theeternalpulse(defn close-button []
(withstyles [interact [dim pointer]
position [absolute right-0]
style [ma2 pa1 w1 h1 f5 ba br-100 b--transparent bg-red]]
[:div {:class (classes interact position style)
:onClick #(unset-state! :dashboard/visible-topic)}]))#2020-11-1216:11theeternalpulsethis is in a cljs file with the specification
(ns hot-topics.dashboard
(:require-macros [hot-topics.tachyons :refer [withstyles]])
,,,)
#2020-11-1216:12dpsuttondo you have a cljs repl open and is the namespace loaded?#2020-11-1216:12theeternalpulseyeah#2020-11-1216:12theeternalpulseI even eval'd both buffers just in case#2020-11-1216:12dpsuttonthen might be a bug with indentation in cljs. maybe open an issue with a minimal repro?#2020-11-1216:13dpsuttonand is this the case only with def and with prefixes? ie if you rename this to foo does it behave correctly?#2020-11-1216:15theeternalpulseyeah, I just created a new one with a different name and same problem, interesting#2020-11-1216:15dpsuttonmaybe check the documentation if indentation metadata is supported at all for cljs?#2020-11-1216:18theeternalpulseseems like (put-clojure-indent 'withstyles 1) does it#2020-11-1216:19dpsuttonyeah that's the static stuff. i'm wondering if the metadata (and therefore nrepl support required) version works at all#2020-11-1308:52bozhidarI don't think anything from the track-state middleware works with ClojureScript.#2020-11-1308:56bozhidarMy bad. It seems it should work. Haven't used cljs in a very long time, so my memory on the subject is fuzzy.#2020-11-1216:19theeternalpulseit seems to only work in the clj repl, maybe there's a communication issue with the metadata between clj/cljs#2020-11-1216:20theeternalpulseI'll try and make a minimal example when I have time and see if it's not already submitted, but you pointed me in the right direction#2020-11-1216:20dpsuttoni would verify in documentation that this is supported at all before trying to diagnose a bug#2020-11-1216:20dpsuttonthere are several features that are clj only when it comes to nrepl support. the debugger being an example that quickly comes to mind#2020-11-1216:25theeternalpulsetrue, I see I can't do (meta #'withstyles) in cljs, but in clj it's fine, so maybe that's just a limitation with cljs to find out how to indent forms#2020-11-1216:27dpsuttonoh i filed a bug report that cljs drops some meta from defs like arglists. i wouldn't be surprised if this was similar. if you alter-meta that with-styles after explicitly you could check if that helps#2020-11-1216:34theeternalpulseno luck, I think as far as cljs is concerned it just knows the name and hands it off to the compiler to deal with#2020-11-1216:34theeternalpulsemaybe I'll just have a localdirs with those declarations#2020-11-1216:35theeternalpulseI'm curious how it works with macros out in the wild as libs, how do they set it across the board for consumers#2020-11-1221:17practicalli-johnWould a pull request be welcome for the issue I raised https://github.com/clojure-emacs/cider/issues/2922#2020-11-1221:25dpsutton@jr0cket comment left. suggested maybe just a new var that will be used as the whole connection argument if provided#2020-11-1221:40practicalli-johnThanks for the feedback.
Wouldn't replacing the whole command line require a lot more changes to the Cider code. I'll take another look and see if I understand that part of the code.#2020-11-1221:45dpsuttonprobably not. it ultimately ends up in a single string called cmd and a process is started like that#2020-11-1221:48dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider.el#L1279-L1285 is where the string is built up and here the string is just passed into nrepl-start-server-process https://github.com/clojure-emacs/cider/blob/master/cider.el#L1007-L1011#2020-11-1221:48dpsuttonall you have to do is just not do any work when a string is given#2020-11-1312:21practicalli-johnDoes that mean I can just wrap an if statement around the call (cider--update-jack-in-cmd) at https://github.com/clojure-emacs/cider/blob/master/cider.el#L1006
Something like this?
(let ((params (thread-first params
(cider--update-project-dir)
(cider--check-existing-session)
(if cider-full-jack-in-command
:jack-in-cmd cider-full-jack-in-command
(cider--update-jack-in-cmd))))
#2020-11-1312:41practicalli-johnThat code generates
error in process sentinel: Could not start nREPL server:
So I probably have the :jack-in-cmd cider-full-jack-in-command wrong...#2020-11-1312:52practicalli-johnOr is it because I'm using an if in a thread-first macro?#2020-11-1313:05practicalli-johnYes, something different about thread-first in elisp, as this code doesnt work either
(let ((params (thread-first params
(cider--update-project-dir)
(cider--check-existing-session)
(plist-put :jack-in-cmd cider-custom-jack-in-command))))
(print cider-custom-jack-in-command)
(print params)
(nrepl-start-server-process
(plist-get params :project-dir)
(plist-get params :jack-in-cmd)
(lambda (server-buffer)
(cider-connect-sibling-clj params server-buffer))))
seems thread-first doesnt put params where I want it to be 😞#2020-11-1313:10practicalli-johnActually, looking through some of the other code, editing the cider-jack-in-clj function doesnt make sense, as a similar change would need to be made to the other cider-jack-in-* functions#2020-11-1313:13practicalli-johnLooking at cider--update-jack-in-cmd is very confusing. So without further suggestions, I'm afraid I am stuck. Unless its okay to wrap an if after the let* and wrap the rest of the body of that function (that feels bad)
I am not seeing the simplicity in this approach so far 🙂#2020-11-1313:27practicalli-johnI've summarised this on the github issue https://github.com/clojure-emacs/cider/issues/2922#issuecomment-726763365#2020-11-1312:57st3fanIs it possible to load a new dependency into my project without fully restarting? (Not entirely sure this is a Cider question)#2020-11-1314:25zanehttps://github.com/clj-commons/pomegranate#2020-11-1411:41bozhidarSee also https://nrepl.org/nrepl/0.8/usage/misc.html#hot-loading-dependencies#2020-11-1417:24st3fanOh I missed that. Thank you so much I am going to give that a try next time.#2020-11-1317:14jmckitrickSo if I have cider connected to a shadow project and the repl is warning me No available JS runtime. yet jump-to-definition is working, what functionality will I be missing?#2020-11-1317:15dpsuttonthe repl#2020-11-1317:15dpsuttoni'm surprised that jump to definition is working and suspect its a different implementation than nrepl backed but not positive. No available JS runtime happens when you haven't loaded your emitted js code in a browser or a node process#2020-11-1317:16dpsuttonthere's a jvm running clojurescript and nrepl but it does not do any evaluation of cljs. that requires a JS runtime which is not yet present#2020-11-1415:17st3fann00b question: i am running my web api inside the repl now - but how do i log or print things? i am debugging something and I would like to print a few values#2020-11-1415:42bozhidarJust use regular logging/printing functions. If some log output doesn't appear in the REPL buffer you can check *nrepl-server*.#2020-11-1416:49st3fanOh I see it appears but in a really odd place in the repl …#2020-11-1416:49st3fan#2020-11-1416:52st3fanAnd println from my app code doesn’t appear at all - maybe Jetty captures stdout?#2020-11-1416:54st3fanOk that may be caused by the code not actually properly reloading. More to explore!#2020-11-1416:56st3fanMaybe I am doing this the wrong way. I started a REPL and then started Jetty - but maybe I should keep using lein run but add a repl to it and then connect to that?#2020-11-1417:14dpsuttonThat is basically what cider is doing. Calling lein repl and connecting you to that#2020-11-1417:15dpsuttonHave you opened the nrepl buffer mentioned above?#2020-11-1417:19st3fanYeah there is an unrelated trace in there but nothing else. But I think I have another problem .. Even though I compile functions, those changes don’t seem to actually happen in my running server. I’ll explore that a bit more first.#2020-11-1417:21dpsuttonFind where your routes are def ed. You probably need to reevaluate that or perhaps start using var refs there to make sure it’s always using new code. If you have questions about that ask in beginners or clojure and you’ll get some good explanations#2020-11-1417:25st3fanThank you#2020-11-1518:23respatializedis there a way to auto-eval an expression in the REPL on namespace load? basically what I'm trying to do is auto-refer clojure.repl/doc into every namespace, because I pretty much always find myself typing (require clojure.repl [:refer doc]) in every repl session so it's available in the namespace I'm working in. just wondering if there's a general purpose solution to this that could be used to auto-load other code, as well.#2020-11-1609:46bozhidarThere's a REPL shortcut to require the REPL utils in some namespace. Type , in the REPL and you'll see what I mean.#2020-11-1520:41practicalli-john@afoltzm I'd suggest just using cider-docs and evaluate code in the source code buffer rather than evaluate in the REPL buffer directly, which requires more work (changing namespaces, etc). There is also cider-clojuredocs which also provides examples of using the function and cider-apropos that will help you find functions.
https://practicalli.github.io/spacemacs/documentation/cider-doc.html
If you really have to use the REPL buffer directly and need doc, , will open a REPL menu which has a doc function.
If you really want to type (doc function-name), then you can use the the fully qualified name, (clojure.repl/doc function-name)
You could require refer doc in every single namespace function of every project you ever work with, which I am sure will raise a few questions about why. I would definatey not recommend this 🙂#2020-11-1610:55bruno.bonacciLast chance to signup for tomorrow's event with
https://www.meetup.com/London-Clojurians/events/274159509/#2020-11-1622:52m0smithI have installed EMACS on Windows 10 from the repo. When I try and do a cider-jack-in I get "c:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe" -encodedCommand YwBsAG8AagB1AHIAZQAgAC0AUwBkAGUAcABzACAAJwB7ADoAZABlAHAAcwAgAHsAbgByAGUAcABsACAAewA6AG0AdgBuAC8AdgBlAHIAcwBpAG8AbgAgACIAIgAwAC4AOAAuADIAIgAiAH0AIAByAGUAZgBhAGMAdABvAHIALQBuAHIAZQBwAGwAIAB7ADoAbQB2AG4ALwB2AGUAcgBzAGkAbwBuACAAIgAiADIALgA1AC4AMAAiACIAfQAgAGMAaQBkAGUAcgAvAGMAaQBkAGUAcgAtAG4AcgBlAHAAbAAgAHsAOgBtAHYAbgAvAHYAZQByAHMAaQBvAG4AIAAiACIAMAAuADIANQAuADQAIgAiAH0AfQB9ACcAIAAtAG0AIABuAHIAZQBwAGwALgBjAG0AZABsAGkAbgBlACAALQAtAG0AaQBkAGQAbABlAHcAYQByAGUAIAAnAFsAIgAiAHIAZQBmAGEAYwB0AG8AcgAtAG4AcgBlAHAAbAAuAG0AaQBkAGQAbABlAHcAYQByAGUALwB3AHIAYQBwAC0AcgBlAGYAYQBjAHQAbwByACIAIgAsACAAIgAiAGMAaQBkAGUAcgAuAG4AcgBlAHAAbAAvAGMAaQBkAGUAcgAtAG0AaQBkAGQAbABlAHcAYQByAGUAIgAiAF0AJwA=#2020-11-1806:27bozhidarThere is, but it wouldn't work if you do. 🙂#2020-11-1806:27bozhidarI'm also on Windows 10 and I run Emacs from WSL2 over X410. I think this offers much better experience than the native Windows port of Emacs.#2020-11-1806:28bozhidarhttps://emacsredux.com/blog/2020/09/23/using-emacs-on-windows-with-wsl2/#2020-11-1806:30bozhidarIf you want to edit the command you mentioned - check cider-clojure-cli-command.#2020-11-1900:17recholsknauberIf you're interested in staying native to Windows, that's what I do as well. I've had a good experience using emacs installed with chocolatey: https://chocolatey.org/packages/Emacs#2020-11-1900:18recholsknauberI was stoked to find it, since previously I'd never known of a Windows package manager. I install lein, nodejs, and java from there as well#2020-11-1622:53m0smithIs there anyway to tell it not to do that?#2020-11-1819:50bozhidarHere's the recording of my "Dark CIDER" talk from yesterday https://www.youtube.com/watch?v=IvTDzKVL58Y I hope you'll learn something new about CIDER from it! Enjoy! 🙂#2020-11-1819:51dpsuttonabsolutely! great presentation @bozhidar#2020-11-1820:14practicalli-john@bozhidar Auto-trimming was useful to know about, thank you.
One thing I am not clear on. If I only evaluate in the source code buffer, does that mean the REPL buffer stays empty, i.e. no evaluation results, assuming I don't use side-effect things that print to standard out.
So, if I don't evaluate in the buffer, I should not experience any slow-down due to long lines or many lines in the REPL buffer.#2020-11-1820:20dpsuttontrivial to check? inline evaluation does nothing to the repl#2020-11-1906:53bozhidarUnless it produces output, like in the case of the issue I experienced during my live demo. 🙂#2020-11-1906:55dpsuttonyeah the trace over fibs 🙂 i've never used trace before and it looked amazing#2020-11-1909:31Karol WójcikHoly... What is that theme? ❤️#2020-11-1914:55dpsuttonIt’s built in and called brin #2020-11-2010:11Karol WójcikThank you @U11BV7MTK.#2020-11-1823:21practicalli-johnWelI have been evaluating in source code editor for the last several years without thinking about needing to clear anything, but after watching the talk by bug yesterday I just wanted to be sure I hadn't misunderstood something.
I didn't want to tell people to avoid the issue of slowing down Emacs by just using the source code buffers without checking assumption.#2020-11-1823:22practicalli-johnI almost never have the REPL buffer open#2020-11-1823:23dpsuttoni always have it open and have my results there. if there are lots of lines, especially long lines it can slow down is all#2020-11-1911:10borkdudein emacs / prelude / cider, what is the thing called that gives a visual effect on the line I'm typing when I press enter?#2020-11-1911:10borkdudeI want to turn that off in vterm#2020-11-1917:09practicalli-johnFYI if you want to keep the beacon package for some things, beacon-mode should toggle it, its just a minor mode.#2020-11-1917:10borkdudeYeah, don't really care about that one, but thanks :)#2020-11-1917:11practicalli-johnIronically I just started using it with Spacemacs, I quite like it... maybe I just havent used it long enough to get bored with it 🙂#2020-11-1913:05bozhidar@borkdude Can you show me the visual effect as I don't remember anything that's triggered on enter.#2020-11-1913:17borkdude@bozhidar It might be an effect of zenburn, I'm not sure how I can replicate this...#2020-11-1913:18borkdudewhen I disable global-hl-line-mode then it goes away, but it isn't the same as hl-line-mode#2020-11-1913:24bozhidarHmm, I trying this now on the latest Prelude but I don't see any effect when I press Return.#2020-11-1913:30borkdudeI'll let you know when I see this again.#2020-11-1913:38borkdude@bozhidar There I have it, after calling cider-connect and hitting return in the REPL.#2020-11-1913:39John MaruskaI have a similar effect called beacon, it might be that
https://elpa.gnu.org/packages/beacon.html#2020-11-1913:47bozhidarYeah, that's beacon.#2020-11-1913:47bozhidarI've removed it from Prelude recently, that's why I wouldn't see the effect. 🙂#2020-11-1913:48bozhidarNormally there should be an animation only for bigger movements in the buffer, though. Guess that's some bug in beacon.#2020-11-1913:49borkdudeah, then I should update my prelude :)#2020-11-1915:01borkdudeUpdated and I don't see it anymore#2020-11-1915:05borkdudeI want to disable hl-line-mode in vterm. How can I do that?
(add-hook
'vterm-mode-hook
(lambda()
(setq hl-line-mode nil) ;; hmm..?
(setq show-trailing-whitespace nil)))
#2020-11-1915:17borkdude@bozhidar What is the new line number stuff and how do I disable it?#2020-11-1915:18bozhidarglobal-nlinum-mode#2020-11-1915:19bozhidarFrom the changelog/docs:#2020-11-1915:19bozhidar* Enable `nlinum-mode` by default. Can be disabled by setting `prelude-minimalistic-ui` to `nil`.
#2020-11-1915:19bozhidarOps, that should be t, not nil. 😄#2020-11-1915:25borkdudelike this? (setq prelude-minimalistic-ui t) ?#2020-11-1915:25borkdudefwiw it doesn't work for me (in init.el)#2020-11-1915:29bozhidarIt should go the preload config - e.g. preload/personal.el.#2020-11-1915:30bozhidarThe var needs to be set before the UI is initialized otherwise some UI elements would briefly appear and then disappear.#2020-11-1915:33borkdudeMakes sense!#2020-11-1916:05borkdudeThat worked.#2020-11-1916:08borkdude@bozhidar what is used for highlighting the current line in a buffer and how do I turn this off for vterm only? I have a half-assed attempt a couple of lines up#2020-11-1916:11bozhidarglobal-hl-line-mode. I you think you can just add a hook for vterm that looks like (lambda () (hl-line-mode -1)).#2020-11-1916:11bozhidarHaven't used vterm, but it guess it defines a major mode named vterm-mode or something like this can you can hook into.#2020-11-1917:10borkdudethat's true. I found vterm using a couple of searches as one of the best alternatives to ansi-term, etc#2020-11-1917:12practicalli-johnvterm is what people using Spacemacs have been recommending for a while, looks very good.#2020-11-1921:33bozhidarSo, I've heard, but I was always too lazy to set it up. I did it just now and it looks pretty nice indeed.#2020-11-1917:12borkdudeI tried this, but even in the buffer where I'm executing (hl-line-mode -1) the current line stays highlighted#2020-11-1917:12borkdude#2020-11-1917:22borkdudeI found this code on stackoverflow. It works:
(global-hl-line-mode)
(make-variable-buffer-local 'global-hl-line-mode)
(add-hook 'some-mode-hook (lambda () (setq global-hl-line-mode nil)))
(add-hook
'vterm-mode-hook
(lambda()
(setq global-hl-line-mode nil)
(setq show-trailing-whitespace nil)))
The only unsatisfying thing about this is that I don't know why one has to do it like this.#2020-11-1921:36bozhidarThat's weird. I can reproduce it for every buffer, so it's not something to do with vterm. Seems something is off in hl-line-mode as normally the non-global version of the mode should work just fine within one buffer to disable/enable it.#2020-11-2112:59borkdudeYou wrote a blog about it and you didn't even tell me?
https://emacsredux.com/blog/2020/11/21/disable-global-hl-line-mode-for-specific-modes/
Thanks!#2021-11-2507:11bozhidarI often get inspired to write blog posts from random conversations. And I'm very forgetful! 😄#2020-11-1922:02Felipe Cortezhi! I'm tackling this: https://github.com/clojure-emacs/cider/issues/2901
the remaining problem is that cider-font-lock-as-clojure doesn't work well with mixed Clojure code and ANSI color codes. cider-ansi-color-string-p (which is used in cider-font-lock-as) only applies the color codes if the string starts with a color code (e.g. "\033[33mHello\033[0m"). in matcher-combinators we have "(mismatch \033[33mHello\033[0m)" etc. what's the best solution here? is always running ansi-color-apply on the font-locked Clojure code acceptable for test reports?#2020-11-2013:05bozhidarCan't we just adjust the predicate method?#2020-11-2013:05bozhidar> is always running ansi-color-apply on the font-locked Clojure code acceptable for test reports?#2020-11-2013:05bozhidarProbably that'd be fine.#2020-11-2014:22Felipe Cortezyep, adjusting the predicate method is what I meant :)#2020-11-2014:23Felipe CortezI’ll open a PR soon-ish then#2020-11-2115:41Felipe Cortezhere's the one for cider-nrepl: https://github.com/clojure-emacs/cider-nrepl/pull/683, unrelated to the coloring issue.
I'm not sure how to test it, though. my first idea was to add a cider.nrepl.middleware.test-custom-print ns with a failing test containing custom print logic, filtering it out with :test-selectors, and then calling it with session/message to run the assertions. does that sound good?#2020-11-2007:26niveauverleihIs there a way to launch emacs so that it opens a given clojure file and automatically does the cider Jack-in?
Sometimes I want to quickly try out some clojure command. I have a project "fiddle" with "fiddle.clj" under src. I want to place a shortcut on my desktop that launches spacemacs, opens fiddle.clj, starts a cider REPL and connects to it. I could run "emacs fiddle/stc/fiddle.clj" and "cd fiddle: lein repl"in parallel but that doesn't link my spacemacs session to the REPL.yet.#2020-11-2010:15Louis Kottmannmaybe with emacs --eval (cider-connect ...) fiddle.clj ?#2020-11-2012:58niveauverleihThank you! What should I put as arguments to cider-connect? Is there documentation?#2020-11-2013:07bozhidarThis will require you to have a running nREPL server.#2020-11-2013:08bozhidarI think it'd be better to just add to your init.el visiting the file in question and running cider-jack-in.#2020-11-2013:08bozhidar(assuming you always want to do the same thing when starting emacs)#2020-11-2013:08niveauverleihYes. I first start up the nrepl, then emacs like this:
...
set oldwd $PWD
cd ~/cloj-projects/fiddle/src/fiddle
tmux new-session -d -s lein-repl lein repl &> out.log
echo ",scj" | emacs fiddle.clj
tmux kill-session -t lein-repl
cd $oldwd
...#2020-11-2013:09bozhidaremacs --eval (cider-jack-in-clj) fiddle.clj will probably work as well.#2020-11-2013:44niveauverleihI get an error "wrong number of arguments".#2020-11-2013:09bozhidarcider-connect-clj is an autoloaded interactive Lisp function in
‘cider.el’.
(cider-connect-clj &optional PARAMS)
Initialize a Clojure connection to an nREPL server.
PARAMS is a plist optionally containing :host, :port and :project-dir. On
prefix argument, prompt for all the parameters.
#2020-11-2013:10bozhidarSo basically you can do something like (cider-connect-clj '(:host "localhost" :port 1234)).#2020-11-2013:10niveauverleihSorry I meant
...
set oldwd $PWD
cd ~/cloj-projects/fiddle/src/fiddle
tmux new-session -d -s lein-repl lein repl &> out.log
emacs fiddle.clj
tmux kill-session -t lein-repl
cd $oldwd
...
I will try your suggestion.#2020-11-2014:38niveauverleih@lkottmann @bozhidar @jr0cket
So this works:
This starts a lein-repl in a separate session, then spacemacs with fiddle.clj and has cider connect to the repl.
...
set oldwd $PWD
cd ~/cloj-projects/fiddle/src/fiddle
tmux new-session -d -s lein-repl lein repl :start :port 40000 &> out.log
emacs --eval "(progn (sleep-for 15)
(cider-connect-clj '(:host \"localhost\" :port 40000)))" fiddle.clj
tmux kill-session -t lein-repl
cd $oldwd
...
I also tried this:
emacs --eval "(cider-jack-in-clj '(:host \"localhost\" :port 40000)))" ~/cloj-projects/fiddle/src/fiddle/fiddle.clj
...but:
- first it asks for confirmation "do you really want to run cider-Jack-in-clj?"
- then I get an error "error in process sentinel: Could not start nREPL server:"
Anyway, I'm happy. Thanks for your help!#2020-11-2111:52bozhidarOnly cider-connect-* accept host/port params. cider-jack-in starts a server and connects to it automatically.#2020-11-2111:54niveauverleihIn theory yes, in practice I get an error "wrong number of arguments" if I don't provide any argument.#2020-11-2112:25niveauverleihOk found it . I need to provide 'nil' as argument#2020-11-2113:37niveauverleih@jr0cket @bozhidar @lkottmann
So here is my updated version
...
set oldwd $PWD
cd ~/cloj-projects/fiddle/src/fiddle
emacs --eval "(cider-jack-in-clj nil)" fiddle.clj
cd $oldwd
...
Somehow you need to first cd into the directory of the file, otherwise the cider-jack-in-clj asks for confirmation.#2020-11-2013:42erwinrooijakkersIs there a way to have CSS autocomplete in Emacs, and specifically for Tailwindcss used in Hiccup?#2020-11-2014:32hkjelsIf you don’t find a company-backend on melpa; it’s relatively easy to write one yourself if you have a good list of everything you’d like to complete.#2020-11-2013:43erwinrooijakkers[:button.bg-blue.hover:bg-blue-dark.text-white.font-bold.py-2 px-4.rounded "Button"]
#2020-11-2014:38niveauverleih@lkottmann @bozhidar @jr0cket
So this works:
This starts a lein-repl in a separate session, then spacemacs with fiddle.clj and has cider connect to the repl.
...
set oldwd $PWD
cd ~/cloj-projects/fiddle/src/fiddle
tmux new-session -d -s lein-repl lein repl :start :port 40000 &> out.log
emacs --eval "(progn (sleep-for 15)
(cider-connect-clj '(:host \"localhost\" :port 40000)))" fiddle.clj
tmux kill-session -t lein-repl
cd $oldwd
...
I also tried this:
emacs --eval "(cider-jack-in-clj '(:host \"localhost\" :port 40000)))" ~/cloj-projects/fiddle/src/fiddle/fiddle.clj
...but:
- first it asks for confirmation "do you really want to run cider-Jack-in-clj?"
- then I get an error "error in process sentinel: Could not start nREPL server:"
Anyway, I'm happy. Thanks for your help!#2020-11-2015:47jjttjjWhen I print a large data structure in the cider repl, it is printed but then instantly disappears. What's the setting to configure this? I think I set it to do this at some point but can't remember what the setting was#2020-11-2016:14jjttjjit seems to print a large thing out once or twice the first times I try but subsequently will revert to clearing the full repl after printing#2020-11-2016:14jjttjjAH nevermind, it's cider-repl-buffer-size-limit#2020-11-2017:09practicalli-john@jjttjj cider-inspect allows you to navigate and page through results. It will even follow your normal evaluations in the source code buffer.
For example screenshots
https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html#2020-11-2019:32st3fanHow about a cider-yank-last-result ? I keep having trouble easily copying for example a string result from something I evaluated. Or is there a trick for that?#2020-11-2111:51bozhidarThere's nothing currently built-in, but it'd be easy to do implement something. There's also a PR proposing something similar in progress https://github.com/clojure-emacs/cider/pull/2920#2020-11-2213:22st3fanThanks I will take a look#2020-11-2020:51borkdudeIs there a way to collapse a rich comment form? I want to do this for a presentation#2020-11-2020:53borkdudemind you, I'm not using spacemacs, but I do find some examples of that. I hope they translate to emacs / prelude as well?#2020-11-2023:54practicalli-johnI started using vimish-fold which can do very specific folding, but think that only works with Evil, so I don't think that helps, sorry.
I found folding a bit basic otherwise.#2020-11-2020:55borkdudeaha, hs-minor-mode#2020-11-2211:08niveauverleih@jr0cket I can't get the keyboard macros to work: https://github.com/practicalli/spacemacs-content/issues/11
It says "keyboard macro defined" but calling it with @ gives an error. Does it work for you?#2020-11-2222:41practicalli-johnWorks find for me when I tried it just now. I dont use keyboard macro recording very often though.
FYI. This is not related to Cider, so ideally should have been asked in #spacemacs channel as its spacemacs specific.#2020-11-2312:07practicalli-johnIs there a way in Cider to avoid recieving error messages in the REPL buffer. Evaluation is done in the source code buffer and code is calling a Spark data source, which is returning errors that slow down or kill Emacs due to the size.
I'll try putting the REPL buffer in fundamental-mode... or writing code that doesnt cause errors 🙂#2020-11-2315:16frozenlockAbout https://docs.cider.mx/cider/0.26/caveats.html#injecting-dependencies-and-leiningen-pedantic-abort-mode, why are those dependencies not a fork with unique names? (Perhaps generated with MrAnderson?)#2020-11-2315:53bozhidar@frozenlock Because nREPL won't work if you inline it. 😄#2020-11-2315:54bozhidarThat's the only dependency causing an issue with Lein, simply because Lein also depends on nREPL.#2020-11-2316:01frozenlockAh I see. Is that a limitation of MrAnderson, nREPL.... both?#2020-11-2318:06bozhidarWell, depends on your perspective. The inlining changes the namespaces of the library, which means it can't interface with anything external when inlined . So, Lein can't invoke it, external middleware won't work and so on.#2020-11-2523:16frozenlockUnderstood, thank you very much#2020-11-2317:57neilyioCIDER seems to be automatically adding :require-s to my (ns...) forms... Anybody know how to turn that off?#2020-11-2318:04bozhidarThat's coming from clj-refactor.el. Let me find the defcustom for it.#2020-11-2319:54bozhidarSet `cljr-add-ns-to-blank-clj-files` to nil.#2020-11-2320:15neilyioThanks @U051BLM8F. Just want to make sure I have the right feature. I like that CIDER will add (ns app.product-screen) when I create app/product_screen.clj. I don't want this to go away.
My issue is that if I've previously done a (:require [app.product-screen :as ps]), something is "remembering" the ps alias and trying to automatically add [app.product-screen :as ps] to the (:require ...) form when I type ps/foo. This is the behavior I'd like to go away.#2020-11-2320:16neilyioI hope that makes sense, thanks for the tip.#2020-11-2321:39bozhidarAh, my bad.#2020-11-2321:39bozhidarIt's another clj-refactor feature, so it's not coming from CIDER.#2020-11-2321:42bozhidarI'm guessing it's this one https://github.com/clojure-emacs/clj-refactor.el/blob/master/clj-refactor.el#L63#2020-11-2321:42bozhidarI don't use clj-refactor myself, so I never remembered what does what exactly.#2020-11-2322:29practicalli-johnCider can easily add the namespace to a file using the ns snippet, so along as the REPL is running (and why would it not be)
https://practicalli.github.io/spacemacs/clojure-projects/adding-files.html#adding-a-namespace#2020-11-2322:31practicalli-johnI found enough refactoring in clojure-mode that I rarely use clj-refactor. Thanks to @U051BLM8F and team for adding all these to clojure-mode#2020-11-2400:49neilyioThanks for looking that up for me @U051BLM8F! I didn't know where to start looking, and that fixes the issue.#2020-11-2405:39arthuris it possible to have more than one cider-scratch buffer in an emacs process? if I'm connected to two nrepl servers I'd like to be able to have both, or at least switch between them#2020-11-2405:39arthuror am i doing this wrong?#2020-11-2411:54bozhidarI think you need to rename the buffers after creating them, if you need more than one. You can also manually set which REPL is connected to each scratch buffer.#2020-11-2411:59bozhidarSee https://docs.cider.mx/cider/usage/managing_connections.html#context-links#2020-11-2419:57arthurwhat was the name of that thing that where cider stops and lets you edit the clj command before it starts it to run the nrepl?#2020-11-2419:58arthurit was one of the jack-in variations,#2020-11-2420:00Derekprefix the command with C-u?#2020-11-2421:47hoppyWent back to trying to lounge in emacs for a while. Getting this with cider-20201124.804. Project works in calva. Ideas?#2020-11-2421:49DerekIs there a .dir-locals.el file?#2020-11-2421:49hoppyno#2020-11-2421:52hoppynm. I'm picking :node instead of :shadow#2020-11-2421:52hoppymy bad#2020-11-2421:53hoppyI was picking node instead of shadow for repl type - getting rusty....#2020-11-2520:08Russell MullDoes anybody know how to get javadoc to actually work? It tries to open a url such as "http://org/lwjgl/glfw/GLFW.html#glfwDestroyWindow(long)", which is clearly not a real url.#2020-11-2520:14Russell MullA little source diving takes me to (nrepl-dict-get info "javadoc") giving back a url, but I'm not sure where that's coming from.#2020-11-2607:48bozhidarIt's coming from here https://github.com/clojure-emacs/orchard/blob/master/src/orchard/info.clj#L170#2020-11-2607:49bozhidarWhich is afterwards used here https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/info.clj#L61#2020-11-2607:51bozhidarI'm guessing the real problem is that you're missing mappings like https://github.com/clojure-emacs/orchard/blob/master/src/orchard/java.clj#L407#2020-11-2619:13Russell MullThanks, this looks like exactly what I need. Is there some reasonable way to inject custom calls like this? (in a deps.edn project)#2020-11-2620:01Russell MullAh, looks like cider-repl-init-code does it.#2020-11-2607:52bozhidarThe javadoc code can't know that's the actual URL on which some Javadoc is hosted, so this information needs to be added on separately.#2020-11-2611:09andrea.crottiFYI this commit https://github.com/clojure-emacs/cider/commit/ef47c1de151c212b8d2ddeb9af6c8b0dfc0e300f
broke my cider, and I fixed it buy forcing an install of the seq library from gnu, which atm I already had built-in at version 20#2020-11-2611:09andrea.crottishould the installer have tried to upgrade it automatically in theory?#2020-11-2611:09andrea.crottiI guess it will break for many others otherwise probably#2020-11-2614:38bozhidar@andrea.crotti It was my understanding that the package update was going to force the installation of the right seq.el. I saw the warning, I wasn't sure when was the function deprecated, so I just opted for the latest seq.el version to be on the safe side.#2020-11-2614:39andrea.crottiyeah I don't know how it works but the automatic update didn't happen#2020-11-2614:40andrea.crottimaybe becasue seq was both in built-in and in the gnu repository?#2020-11-2614:40andrea.crottinot sure but I just suspect many more people will have the same issue#2020-11-2620:24bozhidarPerhaps you're right. There haven't been many complaints so far, so there's also the chance yours was an isolated incident.#2020-11-2709:55andrea.crottion my personal machine I see that seq was already up to date#2020-11-2709:55andrea.crottito the latest#2020-11-2709:55andrea.crottiso yeah maybe it wasn't a widespread issue#2020-11-2614:44andrea.crottiI was wondering if it was possible to automatically name the cider repls to make it more clear which one is the clj and which one is the cljs repl#2020-11-2614:45andrea.crottiatm they are just .clj) and ...clj)<2>#2020-11-2614:45andrea.crottiideally it should be just cider-repl-$project-<clj|cljs> for example#2020-11-2620:25bozhidarIt's definitely possible and I was under the impression the project name was displayed somewhere even now (at least when using jack-in). I'll have to check, probably I haven't been paying enough attention to this.#2020-11-2708:12bozhidarYep, I can confirm there's a project name in the REPL buffer's name when doing cider-jack-in.#2020-11-2710:10andrea.crottiyeah I know the project name is there#2020-11-2710:10andrea.crottithat was just an example of how I'd like the full name#2020-11-2710:11andrea.crottiI just wanted to remove the host/port for example and add clj/cljs#2020-11-2710:11andrea.crottisince I don't think I ever used the host/port for anything#2020-11-2712:07andrea.crottiI tried to find where that string is generated btw but I failed miserabily#2020-11-2712:07andrea.crottiany hints to understand what to poke?#2020-11-2809:51bozhidarI'd start with nrepl-repl-buffer-name-template in nrepl-client.el.#2020-11-2712:15andrea.crottiis there any way to make sure that if by mistake I print out a massive amount of text in the repl, I can still kill the repl without having to kill Emacs entirely#2020-11-2712:15andrea.crottior just kill whatever is printing out?#2020-11-2712:16andrea.crottiI added the auto trimming but it doesn't really help as much sadly#2020-11-2712:42practicalli-john@andrea.crotti
cider-interrupt if output is from the last evaluation of an expression. Or sesman-quit should kill the repl. Or kill the buffer and it should kill the repl (unless your code is hanging onto resources and wont shut down. I dont think there are any guarantees with any software...#2020-11-2712:43andrea.crottiyeah I know but sometimes it takes minutes to even be able to run these two commands#2020-11-2712:43andrea.crottithe whole Emacs get locked and you can't really do much#2020-11-2712:44andrea.crottiI can kill the JVM process from the outside which sometimes helps but it's not great#2020-11-2712:45andrea.crottimaybe cider could just have a limit to the size of the string it prints out by default?#2020-11-2712:45andrea.crottisince if it's bigger than a given threshold it's very likely to just be a mistake#2020-11-2716:23practicalli-johnThis may only work in some cases, but if you have the cider-inspect window open, then evaluation results should all go there by default.
I don't think this helps if something is forcing errors into the repl, like 3rd party Java or Scala libraries.
If something is logging, it should be going to an external logging service#2020-11-2810:14bozhidarThe output is being streamed in chunks, that's why even if Emacs rejects printing something over some limit only interrupt can potentially stop the generation of more output. That's also why we went with auto-trimming instead of putting some hard limit for the output - as new chunks get streamed the older should get deleted. Unfortunately, if something outputs an extremely long line this might mess up Emacs quite a lot.#2020-11-2810:15bozhidarI still don't have any better solutions in mind than what we currently have.#2020-11-2720:00hkjelsWhy is it that I only get an nrepl and not the usual cider-repl if I set cider-clojure-cli-global-options to "-M:dev", which in turn uses
:dev {:extra-deps {;; Tracing, debugging etc.
com.bhauman/figwheel-main {:mvn/version "0.2.12"}
org.clojars.stumitchell/clairvoyant {:mvn/version "0.2.1"}
day8.re-frame/re-frame-10x {:mvn/version "0.7.0"}
day8.re-frame/tracing {:mvn/version "0.5.1"}}
:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
I think maybe, I’ve bumped into this issue before, but I don’t remember the solution#2020-11-2720:02dpsuttonI’m not sure what you mean by an nrepl but you’re not starting the nrepl command line as required. Nrepl needs its own main to start an nrepl server. You’re specifying figwheel main to do it’s own startup#2020-11-2720:11hkjelsif I leave cider-clojure-cli-global-options at nil, move the figwheel-main dep into my top-level deps and jack in, it works just fine with the REPL, but then I don’t have re-frame-10x etc#2020-11-2720:15hkjels[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.25.4"}}}' -M:dev -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware","cider.piggieback/wrap-cljs-repl"]
This is done even though I set cli-global-options, but a REPL buffer is not connected to it#2020-11-2720:15hkjelseverything works in the browser as it should though#2020-11-2720:22dpsuttonNot sure how to setup the 10x stuff. I think there are some preloads to register or something like that? The documentation shows how to do it I think#2020-11-2720:26hkjelsYeah.. That works with cider-clojure-cli-global-options set#2020-11-2821:10practicalli-johnDoes anyone recognise or understand this error message?
We have been using Cider to connect to a remote Clojure REPL using cider-connect via VSCode Live Share. I can connect to the local REPL port forwarded by VSCode, but when typing certain elements, like a vector as an argument to `(map inc ,,,) then it throws the error.
There is a button to suppress the error, which seemed to work for a few minutes, then some different things were triggering the error.
I'm using CIDER 1.0.0snapshot (package: 20201118.750) and the REPL is starting nREPL (I am checking if its also including cider-nrepl). Calva is connecting just fine to the REPL, so just wondering if if there is anything obvious to check or try. Thank you.#2020-11-2907:46bozhidarLooking at the error it's some missing parameter in the nREPL request. Unexpected middleware errors are exactly what you'd expect them to be - an internal error in cider-nrepl that shouldn't have happened in the first place.#2020-11-2907:48bozhidarFor that particular error it seems to me you've connected to some older instance of cider-nrepl, as in the past the request param for eldoc was named symbol and now it's named sym (to avoid shadowing the symbol function in the middleware code. Newer versions of the middleware support both param names for backwards compatibility, but the latest CIDER uses sym everywhere, so it can't work with older middleware.#2020-11-2907:49bozhidarI hope that makes it clear.#2020-11-2909:05practicalli-johnYes, that is very helpful indeed.
I’ll check with the group as to what what versions of Cider middleware are being included when VSCode does it’s Jack-in.
Apart from this error, Cider is working really well with the VSCode live share port forwarding of the REPL, so if you are remotely collaborating on code with VSCode and Calva you can use Emacs too (although code changes only show when the file is saved by Emacs of course)#2020-11-2821:13dpsuttoncan you click on the "All" button at the top? wondering if there's more stack trace to be had#2020-11-2821:13dpsuttonalso, if you can toggle on the nrepl logging maybe we can see the message going across the wire that triggered the error#2020-11-2823:11practicalli-johnThanks for the suggestions,. I will get more info about this error next time the server is running, either tomorrow or next weekend.#2020-11-2909:24peeyI was exploring the cider debugger, and I have never used the "inspect" feature of the debugger (because the binding "p" is mis-interpreted by spacemacs as the paste command). What am I missing? What are other ways I could invoke it?#2020-11-3006:57Gleb PosobinFor spacemacs, you can press Ctrl-z to go into Emacs mode and then use those bindings, press Ctrl-z again to go back.#2020-11-2910:34practicalli-john@p.kushwaha97 examples of using Cider Inspect
https://practicalli.github.io/spacemacs/evaluating-clojure/inspect.html
My favourite feature is just leaving the cider-inspect window open, then all evaluations go there, even when using the usual evaluation commands
If using Spacemacs develop, then I just added more key bindings for the rest of the cider-inspect functions#2020-11-2910:52peeyThis is amazing. I just updated and used inspector for the first time, thanks for making it happen and writing that nice guide!#2020-11-2911:38practicalli-johnI have a new video coming out in the next day or two that uses the cider-inspect tool a lot too... but I think that page covers most of it statically.#2020-11-2910:37practicalli-johnhttps://github.com/syl20bnr/spacemacs/pull/14152#2020-11-3017:56Tim RobinsonHi all, I'm a complete newbie to clojure and cider and I'm trying to get it going on windows 10. All I've done so far is created a ~/.lein/profiles.clj file with the line {:user {:plugins [[cider/cider-nrepl "0.25.5"]]}} . (note: I haven't actually downloaded or installed anything - does leingen do this for me automatically?)
Now when I start the repl with lein start repl I get hundreds of java exceptions like this:
java.lang.NullPointerException: Cannot invoke "jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.getOptions()" because "this.configuration" is null
at jdk.javadoc/jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.getSupportedOptions(HtmlDoclet.java:292)
... (long stack trace)
The repl still starts and I can use it from the command line but it doesn't work from vim fireplace. I'm trying to figure out whether these messages mean that cider isn't running, or whether they are just spurious and the error is somewhere in my vim/fireplace configuration.#2020-11-3018:22practicalli-john@tim.j.robinson my guess is the errors are from your project code
lein new app myapp will create a simple Clojure project and lein repl should start a REPL when run from the root of that project.
You only need a ~/.lein/profiles.clj file if using cider-connect from Emacs. If you use cider-jack-in-clj then you do not need the ~/.lein/profiles.clj file and should delete it.#2020-11-3018:24practicalli-johnIf you cant start a REPL on the command line, then it wont start from anywhere elese. So its always a good first step.
There is also a #vim channel for specific help with Vim.
If you are just starting, you may find this free book helpful https://practicalli.github.io/clojure/ which uses the newer Clojure CLI tools rather than Leiningen.#2020-11-3018:31dpsuttonWhat’s your jvm version? I think I’ve heard there’s been a change in that doclets stuff#2020-11-3018:32dpsuttonAlso if you’re using vim do you even need cider-nrepl at all? I thought that was just nrepl based#2020-11-3018:39Tim RobinsonI'm using the latest JVM - 15.0.1. When I searched for that error message there seem to be other reports of the same error (e.g. in calva and orchard) and they seem to be related to recent JVM versions so I guess that's the cause of the problem. What I'm not sure about is whether that error is fatal for cider or just a warning, because the repl itself still seems to work
anyway thanks for the hints about not needing it at all. I've deleted the profiles.clj file and now I can connect to the nrepl OK from vim 🙂 According to the fireplace documentation this means "only a subset of the functionality will be available" but I can try to figure that out with the vim channel#2020-11-3018:42dpsuttonAh ok. I wasn’t sure if that used the extra functionality. If it were me I’d drop back to a jdk 13 and go with cider nrepl#2020-11-3018:43dpsuttonI forgot what the warnings are related to. It’s something dumb about options being moved for the Java parser but it’s a minor part (I think. It’s been a bit since I’ve seen the issue)#2020-11-3019:01Tim RobinsonThanks I'll try that tomorrow. great to be up and running though 🙂#2020-11-3021:34Kira McLeanCider is no longer picking up the cider-clojure-cli-global-options from my .dir-locals.el file when I run cider-jack-in-clj..it seemed to work fine until today. What’s the best way to go about debugging that? I did recently upgrade some things but I’m not really sure where to start investigating to figure out which one broke this 😬#2020-11-3021:42dpsuttonseems unchanged since 2018: https://github.com/clojure-emacs/cider/blob/master/cider.el#L360-L361
an easy thing to check is if the dir local value is getting picked up. i always do M-: cider-clojure-cli-global-options or m-x describe-variable [ret] and then that variable.#2020-11-3021:52Kira McLeanyeah it’s really strange.. I have no idea why it just stopped working today! Looks like they’re not being loaded, cider-clojure-cli-global-options is nil.. that’s not what I want to see. Might be something wrong with my config or something. That’s a good thread to pull on, at least.. thanks for the tip!#2020-11-3021:52dpsuttonsure! you can try (hack-local-variables) to kinda poke it and make it look for the dir locals#2020-11-3021:53dpsuttonalso, i've seen people leave off the leading . in the name but from above it looks like you've got that#2020-11-3022:05Kira McLeanvery strange.. I made some changes to my config to start using org-roam over the weekend and just undid them all and now it seems to picking up .dir-locals.el again.. I’ll have to put the changes back one at a time I guess to try to figure out why. Configuring emacs is total black magic to me.#2020-11-3022:36dpsuttonWeird. I’ve never heard of a way to impact dir locals. I’m interested to hear what you find#2020-11-3022:51Kira McLeanhah.. I’ll be impressed if I ever narrow it down to one specific thing. I don’t understand what could have happened.#2020-12-0109:07bozhidarEmacs is magic! wizard#2020-12-0109:17hkjelsI do agree! What’s todays revelation?#2020-12-0111:59jmayaalvemacs is power! 🙂#2020-12-0114:25bozhidarEmacs is forever!#2020-12-0109:40Tim Robinson@dpsutton I have downgraded to JDK 13 and cider seems to be working for me now. I'm pretty sure this is the same problem reported by @grounded_sage on 12 October in this channel. Do we need to raise a bug report for this?#2020-12-0111:48dominicm@tim.j.robinson one already exists.#2020-12-0111:48dominicmGenerally it's a good idea to stick to the lts releases of java#2020-12-0113:21Tim RobinsonAh - thanks again - I didn't realise Java had LTS but I see it now.#2020-12-0114:24bozhidarI've been using mostly JDK 14 lately and I haven't noticed the issue that was mentioned here. That being said, often JDK upgrades break something as cider-nrepl relied on some internal APIs to provide optimal functionality, mostly for discovering Java metadata and parsing JavaDoc.#2020-12-0114:28Tim RobinsonFrom the messages on other forums I got the impression the problem was new in 15 but since @dpsutton suggested 13 I thought that would probably be safer.#2020-12-0114:30dpsuttonSorry I should have linked that issue to you. Instead of vaguely describe it. My bad#2020-12-0123:44st3fanIs there a shortcut to really quickly switch to the repl buffer?#2020-12-0123:48dpsuttonI think there’s a cider-switch-to-repl-buffer. Just hit m-x and hopefully you can search through the autocomplete #2020-12-0123:48st3fanah i will alias that to a good key combo 🙂#2020-12-0123:48st3fan“It is bound to C-c C-z”#2020-12-0123:49st3fanI knew this! There are just so many shortcuts 😕#2020-12-0123:49dpsuttonLearn three things and use the short cuts for a week. Then keep repeating#2020-12-0123:49st3fantwo decades of emacs, just not a lot of cider 🙂#2020-12-0123:51dpsuttonHa sorry. There’s insane differences in experience through here. Sometimes someone completely new to programming and CIDER and sometimes people who contribute to emacs itself :) no offense intended#2020-12-0123:52st3fanno worries#2020-12-0123:52st3fanmaybe i can work on a nice cheat sheet during the xmas holiday#2020-12-0201:13justinbarclayhave you tried https://github.com/justbur/emacs-which-key or completion frameworks like https://github.com/abo-abo/swiper? They both have helped raise the discoverability of keyboard shortcuts for me.#2020-12-0202:12zaneI was just about to recommend which-key.#2020-12-0209:24practicalli-johnI wrote a book on using Cider and I am still learning new things 😆#2020-12-0210:53bozhidarI'm a huge fan of which-key myself.#2020-12-0210:54bozhidar(and I recommend it in CIDER's docs)#2020-12-0210:55bozhidarBtw, CIDER already has a cheatsheet - https://github.com/clojure-emacs/cider/tree/master/refcard#2020-12-0210:55bozhidarI guess it's well hidden. 😄#2020-12-0215:07bozhidarI'll mention this here as well - here's CIDER's refcard https://github.com/clojure-emacs/cider/tree/master/refcard#2020-12-0312:50bozhidarFYI - https://metaredux.com/posts/2020/12/03/advent-of-open-source.html#2020-12-0314:23practicalli-johnI published a video on repl driven development with Spacemacs, which should also be useful to help learn some of the features of CIDER too. The commands used to drive CIDER are shown in the mode line, so you can follow along if using Prelude or your own Emacs configuration.
Video: REPL driven development in Clojure with Spacemacs
https://youtu.be/NDrpclY54E0
If there is anything not clear, please let me know. Thank you. (and thanks to @bozhidar for making CIDER and then making it awesome).#2020-12-0402:09David RenoCan someone tell me if this is reproducible for them? The first pic is after M-x cider-load-buffer. Then I go into the comment after line 6 and M-x cider-eval-last-sexp. Note that in addition to line 6 having the green fringe, line 7 gets it too. Using the latest cider: CIDER 1.0.0snapshot (package: 20201125.1146#2020-12-0402:11David RenoI don’t think it’s related, but I’m using M-x cider-connect-cljto connect to a headless lein nrepl.#2020-12-0413:33bozhidarMy guess is that's a bug you'll probably be able to reproduce any time you have the same form duplicated (e.g. try pulling the 3 + forms out of the comment).#2020-12-0413:34bozhidarProbably it's worth reporting this on the issue tracker.#2020-12-0414:00David Renook, I’ll file it. It only happens in a comment block.#2020-12-0418:50nikolavojicicIs there configuration to disable evaluation result displaying in the minibuffer?#2020-12-0418:50nikolavojicic#2020-12-0419:11dpsutton(setq cider-use-overlays t)#2020-12-0419:11dpsuttonits default is 'both#2020-12-0419:40nikolavojicicThanks.
That fixed inline eval C-c C-e and C-c C-c but not whole buffer eval C-c C-k.
It's ok to show buffer eval result in minibuffer but I'd like to see just one line or truncated result.
Also, this is slow for larger results.
(setq eldoc-echo-area-use-multiline-p nil) didn't help.#2020-12-0509:26theeternalpulseWhat's the official way to completely quit a cider program run with cider-jack-in-clj&cljs?#2020-12-0509:27theeternalpulseI've use the process list and just quitted, but recently used sesman to quit#2020-12-0511:29practicalli-john@theeternalpulse not official answer, but I will usually use sesman-quit for the current project, or if I am lazy I’ll just select the REPL buffers with Helm transient state and kill them.
Seaman browser will list all REPLs across all projects.#2020-12-0516:21dpsuttonC-c C-q from a linked source buffer will close the repl. that's what i always do#2020-12-0516:21dpsuttonwhich is cider-quit#2020-12-0516:44theeternalpulsecider-quit doesn't seem to quit the actual session, because when I re-do the jack-in it says a session already exists#2020-12-0518:14practicalli-johnI sometimes get a prompt about a dead REPL connection too. I think its sesman that asks me if I want to use a dead repl... I cant say I like the though of that, especially as I dont know what a dead repl is 🙂
I cant find anything in the otherwise excellent docs.#2020-12-0518:14dpsuttondid you do it for both clj and cljs?#2020-12-0521:45bennyis there a way to state advance a repl from "pending-cljs" to "cljs"? I'm using an unorthodox cljs connection but the REPL works fine, but the buffer to repl mapping doesn't work, despite sesman showing a link (I'm assuming based on a cursory glance in the code that the type doesn't match because it's 'pending-cljs instead of 'cljs)#2020-12-0522:08bennyanswer: M-x cider-set-repl-type RET#2020-12-0602:10dpsuttondid that fix the underlying issue for you? usually if its pending it means the cljs runtime isn't present and it has a good chance of not working#2020-12-0607:45benny@U11BV7MTK yes. I'm running the repl on an embedded armv7l board that only has node, but no java. I have a small weirdness that stdout is above the prompt, but evaluations inside the associated file works good and code completion works after adding cider-nrepl to the dependencies.#2020-12-0607:06Ben SlessAnyone here uses CIDER with reveal? How did you set it up?#2020-12-0609:32practicalli-john@ben.sless Its very simple to use reveal with CIDER connect and Clojure CLI tools
https://practicalli.github.io/clojure/clojure-tools/data-browsers/reveal.html#using-reveal-with-nrepl-editors#2020-12-0609:38Ben SlessThanks, I actually stumbled cross your guide already but things aren't that simple for me for two reasons:
Most projects I work on still use lein
Most projects I work in still use java8
iirc reveal doesn't work all that great on java8, no? I might want to use it conditionally.
Any advice regarding lein? And any way to make emacs stop asking me to apply dir locals for every buffer I open under a dir?#2020-12-0610:16practicalli-johnFor Leinigen, I assume its adding a dev-dependency section with the reveal library and version. Then create a .nrepl.edn file containing {:middleware [vlaaad.reveal.nrepl/middleware]}``
That is what I would try first. I will try find time to check today. Let me know if that works for you.#2020-12-0610:19practicalli-johnTo use Clojure CLI tools with your Leinigen projects, try adding a deps.edn file to the projects. I should contain the paths, eg. src and any dependencies.
So long as the project doesnt rely on plugins or bespoke leiningen code it should work#2020-12-0610:21practicalli-johnCant help you with Java, except to encourage the switch to openjdk 11. Java 8 is past its end of live, so using that commercially would not be an approach I would take.
I would have thought reveal would work on Oracle Java 8 but I havent tested this.
https://github.com/cljfx/cljfx#installation-and-requirements says that JavaFX should work on Java 8 but its outdated and crashes on MacOSX. It recommends Java 11#2020-12-0610:25practicalli-johnWhen Emacs loads a .dir-locals.el the prompt usually contains a ! option to accept permanently. Emacs then adds the contents of the .dir-locals.el to the custom-set-variables list in a sub-list called safe-local-variable-values#2020-12-0610:52Ben Sless> encourage the switch to openjdk 11
Working on it. We're not a small organization anymore 😞#2020-12-0611:05Ben SlessOkay, looks like it works fine with Java 8, too, but when starting with cider-jack-in-clj a leiningen repl with .nrepl.edn in the project's root directory I still don't get the reveal repl#2020-12-0611:11Ben SlessI have tried the following:
create new project with lein
add this profile section
:profiles
{:dev
{:source-paths ["./dev"]
:dependencies [[vlaaad/reveal "1.1.164"]]
:plugins [[vlaaad/reveal "1.1.164"]]}}
add .nrepl.edn
{:middleware [vlaaad.reveal.nrepl/middleware]}
lein repl fails:
lein repl
Syntax error compiling var at (/tmp/form-init293057067636070961.clj:1:2808).
Unable to resolve var: vlaaad.reveal.nrepl/middleware in this context
#2020-12-0614:19practicalli-johnTry running the REPL on the command line and using cider-connect. This will help identify if its the configuration CIDER injects when using Cider-jack-in (which cider connect does not do)#2020-12-0614:23practicalli-johnOh, I guess you have to set vlaaad/reveal as the main namespace some how... or have a lein plugin that manages that (which I don't think exists)#2020-12-0614:24practicalli-johnSorry, it has been a while since I used Leinigen..#2020-12-0615:30Ben SlessNot your fault some of us are living in the past 😉#2020-12-0719:14arthuris this
nrepl/nrepl {:mvn/version "0.8.3"}
cider/cider-nrepl {:mvn/version "0.25.5"}
enough to expect user-error: 'cider-toggle-trace-var' requires the nREPL op "toggle-trace-var" (provided by cider-nrepl) to stop happening?#2020-12-0719:14arthuri'm trying to get tracing and profiling working when connecting to a remote nrepl server#2020-12-0719:24arthurit does look like the remote side is running 0.25.5
user> cider.nrepl.version/version-string
"0.25.5"
#2020-12-0800:34Kevin FWhen running cider-test-run-ns-tests I get the message No assertions (or no tests) were run.Did you forget to use 'is' in your tests? unless I load the file with my tests in it. Is this expected behavior? Is there anyway to have cider-test-run-ns-tests load those tests automatically?#2020-12-0807:35Daniel ÖstlingSo this is probably already answered, but is there a way to have Cider pick up new dependencies in an ns-require statement and in a leinigen project.clj? Or do I have to restart the Cider process and re-jack-in ?#2020-12-0809:54iarenazaAs far as I know, you need to restart the Cider process and re-jack-in (unless you are using pomegranate). There is some work in progress in CIDER to let this work, but as far as I know, there are still some missing pieces.#2020-12-0810:54Daniel ÖstlingAlright, thanks.#2020-12-0818:49kirill.salykingoodmorning/day/evening
With the latest changes in c.t.d there are some changes on how the -m is handled and current cider jack-in fails in certain situations
for instance i have this test alias
:test {:extra-paths ["test"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.0.690"}
lambdaisland/kaocha-cloverage {:mvn/version "1.0.63"}
lambdaisland/kaocha-junit-xml {:mvn/version "0.0.76"}
ring/ring-mock {:mvn/version "0.3.2"}
mockery {:mvn/version "0.1.4"}
http-kit.fake/http-kit.fake {:mvn/version "0.2.1"}}
:main-opts ["-m" "kaocha.runner"]}
doing cider-jack-in fails because of multiple -m one from test/main-opts and another from the cider
The recommendation from #tools-deps was to define alias for cider and specify -main-opts in the alias:
clojure -Sdeps '{:deps ... :aliases {:cider/jack-in {:main-opts ["-m" ...]}}}' -M:dev:test:cider/jack-in --middleware ...
what do you think about this?#2020-12-0818:52dpsuttonhttps://github.com/clojure-emacs/cider/issues/2941
created for you @kirill.salykin. add any context you feel i missed#2020-12-0818:53kirill.salykinwow, thanks!#2020-12-0818:55dpsuttonif you could put a minimal repro that would be helpful. obviously those deps but perhaps a single ns with a test? be nice to confirm that your exact situation would work#2020-12-0818:56kirill.salykinI’ll try to do it tomorrow
link to github repo is enough?
@dpsutton#2020-12-0818:57dpsuttonactually i think i can do it#2020-12-0818:58kirill.salykinI am about to go to bed, please let me know how i can help tomorrow#2020-12-0820:12andrea.crottidid the auto-test-mode stopped working some time ago#2020-12-0820:12andrea.crottior is it just me?#2020-12-0823:04practicalli-johnSorry, I obviously didnt understand the issue... seems some of the context is not covered here. I'll look over the issue in more detail.#2020-12-0823:05dpsuttonthe point of this is to dictate which main function is run. if an alias contains a main function it will be run rather than the cider.nrepl one. the point of this issue is to ensure that the cider.nrepl main always wins the way multiple mains are managed#2020-12-0823:06dpsuttonits not an external test runner when its just on the classpath.#2020-12-0910:03Leah Neukirchenis the keybinding for cider-pprint-eval-last-sexp-to-comment a joke or am i missing something?#2020-12-0910:15practicalli-johnIn Spacemacs its just , e p e - leader + evaluate + pretty print + last sexp (expression)
Or , e p ; to evaluate pretty print to a comment (which is very nice I think).
I found the chorded key bindings the most challenging thing about Emacs, its not just a cider challenge. There are only so many combinations you can have with C-c and C-x or without over-riding other popular key bindings in Emacs.#2020-12-0910:35bozhidar@U01FQSYHRCY We literally ran out of letters/characters in the top-level cider-mode keymap, so we were forced to nest some commands. I know it sucks, but blame the English alphabet. 😄 In general all non-essential eval commands are under C-c C-v something.#2020-12-0911:29Leah Neukircheni'll map it to C-c ; or so 😄#2020-12-0911:40bozhidarGood idea! Unfortunately CIDER can't touch the C-c keybindings as that's bad form for an Emacs package, but everyone else has the power.#2020-12-1012:51Michaël SalihiHi @jr0cket
Today, you closed one Cider Github issue:
> I am no longer using cider-jack-in with Clojure CLI tools so will close this issue
I'm curious, can I ask you what's your new approch now?#2020-12-1014:56tvaughanI can't answer this question, but my own anecdotal experience says a lot of people are starting an nrepl on their own and then using cider-connect#2020-12-1015:29Michaël SalihiThx @U0P7ZBZCK.
What's the reason for? Do you think for more controls?
For the moment and in my experience, I'm happy with cider-jack-in#2020-12-1015:34tvaughan> Do you think for more controls?
Yes, over the middleware and start-up/setup so when they connect again everything is how they left it
> I'm happy with `cider-jack-in`
Same#2020-12-1109:33bozhidarI guess the main problem for most people using the Clojure CLI is that they also using some aliases in their projects that CIDER obviously doesn't know about and they have to tweak the jack-in command manually. And if they happen to have another alias with a main in it, nothing good comes out of this. 🙂#2020-12-1109:35bozhidarcider-jack-in certainly produces better results out of the box for Lein and Boot, but that's not surprising as it was created with them and in mind, and the Clojure CLI support was just adapted to what we have. I'm still using Lein all the time, so I'm far from being an expert on the all the way people are using the Clojure CLI.#2020-12-1110:14Michaël SalihiFor me and since I begin with Clojure only for two years, I use both but 80% of time Clojure CLI, I I'm not part of the era where only Leiningen /Bootreigned 🙂
Perfect, thx @U051BLM8F for this clarifications, I better understand now.
BTW thx for Cider, Projectile, and so on and on... 🙏#2020-12-1016:43Kevin FAny chance there’s a way to display the output of each form in a thread? For example something that produced comments like these:
(->> [2 1 3]
(reverse) ;; => (3 1 2)
(sort)) ;; => (1 2 3)#2020-12-1017:55Michaël Salihi@kevin586 Not exactly the solution you ask for, but did you tried cider-debug-defun-at-point?#2020-12-1018:04Kevin FYeah! The debugger is what I’m using currently, there’s just times where I forget what the output of the previous form (i.e. the output to the current form) was and would like to see it again#2020-12-1018:07Kevin FLooks like the https://docs.cider.mx/cider/debugging/enlighten.html feature is along the lines of what I’d be interested in but it applies to functions called as opposed to forms in the thread#2020-12-1018:43Michaël SalihiBy the way, very nice feature Enlighten!
I had seen in video presentation but forgot it, thanks for the reminder. :)
For your request, I don't know if it's possible.
Anyone else with the answer?#2020-12-1122:00bozhidarIt's possible in theory, but it's not currently possible (in the sense that such a feature doesn't exist).#2020-12-1122:01bozhidarYou can use eval-up-to-point to get the result of some specific part of the threading macro, though.#2020-12-1122:17Michaël SalihiNever used eval-up-to-point before, it's nice! Thanks for the advice. 👍
@kevin586 With the argument, you can print the result in the current buffer, so then it can be a solution to manually comment the result in order to keep it and not to forget the output as you
mention above.#2020-12-1122:25Kevin FAwesome, wasn’t familiar with the up-to-point functions, will check them out, thanks!#2020-12-1122:30Michaël Salihiit does the trick. 👍#2020-12-1122:34Michaël SalihiNotice that you can omit parentheses when functions in a thread macro have no arguments.#2020-12-1017:58Michaël Salihi#2020-12-1206:49AdrianHi Clojurians!#2020-12-1206:49AdrianI try to use CIDER with two REPLs one for cljs and one for clj#2020-12-1206:50AdrianI first start the cljs one with shadow-cljs#2020-12-1206:52Adrianand everything is fine#2020-12-1206:53Adrianonce I start the clj one with lein I am no longer able to evaluate expressions#2020-12-1206:56dpsuttona limitation of CIDER when there are two repls open is that the last repl you had highlighted needs to be the one you intend to evaluate in. So if you want to evaluate cljs code, the cljs repl needs to be the last focused repl and not the clj one. Likewise, if you want to evaluate clj code the clojure repl needs to be the last highlighted buffer. By highlighted i mean the buffer had your cursor in it more recently than the other one#2020-12-1206:58Adrianlet me try#2020-12-1206:58Adrianbut once the second one gets started, I loose the CIDER menu from emacs#2020-12-1206:59Adrian#2020-12-1207:00dpsuttoni've never used those menus#2020-12-1207:01Adrianme neither#2020-12-1207:01AdrianI use them to see the available commands and the keyboard shortcuts#2020-12-1207:01Adrianbut it is linked to the limitation you mentioned#2020-12-1207:01Adrian🙂#2020-12-1207:02Adrianthanks it was very helpful#2020-12-1207:03Adrianthe menus an all features disappear when the wrong repl was highlighted last#2020-12-1207:04AdrianI expected CIDER to select the repl based on file type#2020-12-1207:04Adriannevertheless is not big deal if you know about it#2020-12-1207:06dpsuttoni agree. its kind of a complication due to some internal choices at the moment#2020-12-1209:11bozhidarHmm, I'm a bit puzzled by this remark:#2020-12-1209:11bozhidar> a limitation of CIDER when there are two repls open is that the last repl you had highlighted needs to be the one you intend to evaluate in. So if you want to evaluate cljs code, the cljs repl needs to be the last focused repl and not the clj one.#2020-12-1209:12bozhidarLast time I checked if the two REPLs are the same session the evaluation commands will dispatch the evaluation to right REPL, and if there's just one REPL per session the evaluations should happen there.#2020-12-1209:13bozhidarhttps://docs.cider.mx/cider/0.26/usage/managing_connections.html#2020-12-1209:14bozhidarNormally, the most recent REPL is taken under consideration only for REPLs of the same type in the same session as then you can't easily guess which one to use.#2020-12-1209:15bozhidar> The current REPL is the most relevant REPL from the current session. REPL relevance is determined by the type of the current buffer. For example if the current buffer is a clj buffer then a clj REPL is selected. Ambiguous situations could arise when, for instance, there are multiple clj REPLs within a session, or the current buffer is a cljc buffer and both clj and cljs REPLs exist in the session. In such cases the current REPL is the most recently viewed REPL of the relevant type.
That's from the docs.#2020-12-1209:16bozhidar> but once the second one gets started, I loose the CIDER menu from emacs
That's weird and it should be happening. Can you please file a ticket with the exact steps you're taking to start the two REPLs so I can check what's going on when I can.#2020-12-1313:22jmckitrickI have a legacy project using the old (original) figwheel. I have it working perfectly with CIDER, but I always run (stop-autobuilds) and then (start-autobuilds) to add my ‘test’ build id. Is there a way to make that happen automatically? Again, this is the old figwheel, not figwheel-main….#2020-12-1319:11frozenlockCan cider-eval-last-sexp pretty-print?
I often return a map and it's currently being shown on one loooooong line.#2020-12-1319:12bozhidarIt can't as there's no good way to do pretty printing in an overlay. It's best to use the dedicated eval-pprint commands instead.#2020-12-1319:13frozenlockAh, that makes sense, thanks#2020-12-1415:33DerekI work on a combined CLJ/CLJS project. When I connect a sibling REPL, the initial connection is lost. Is this a known CIDER/Sesman issue or is it likely to be some project configuration somewhere?#2020-12-1415:42dpsuttonhow are you determining the original connection is lost?#2020-12-1415:54DerekThe modeline of my CLJS files show ‘not connected’#2020-12-1415:55Derekand I lose the ability to eval#2020-12-1415:55DerekI believe the same issue occurs if I start in CLJ code and then open a CLJS sibling. The CLJ connection is lost similarly#2020-12-1415:56dpsuttonyeah i think you're seeing a bug that we're discussing right now. CIDER is only aware of the repl your point was most recently in. If you open the first repl buffer, put your cursor in it, and then back to the source buffer is it aware its connected?#2020-12-1415:57DerekI will try that in a minute#2020-12-1416:00DerekYes! Thank you#2020-12-1416:00DerekThat was a tremendous help#2020-12-1416:02dpsuttonyou're welcome. we're discussing that issue as we speak. its an annoying limitation but just put your cursor in which ever repl you need and it should work#2020-12-1416:02DerekThe limitation is nothing compared to having both REPLs working at a moment’s notice#2020-12-1416:26jherrlinHey! I would like to have an interactive link to a file on my local filesystem in my cider-doc buffer. Does anyone know if this is possible and how i can do that?#2020-12-1416:28jherrlinTrying to set stuff like [[file:/home/john/git/project/somefile.java:23]] in my docstring, but cider-doc buffer cant create a link from that#2020-12-1613:08Quentin Le Guennechello, can I run cider-inspector within a debug session in order to inspect eg, function parameters?#2020-12-1613:10Quentin Le Guennec(when I run cider-inspect-last-sexp, I get meta information about the function itself#2020-12-1613:40bozhidar@quentin.leguennec1 You can use inspect and inspect-prompt will in the debugger, to inspect arbitrary values.#2020-12-1613:42Quentin Le GuennecOkay, thanks.#2020-12-1709:45Quentin Le GuennecHello, is there a way with cider to manipulate the ns form so that some imports are automatically included?#2020-12-1709:45Quentin Le Guennecthe use case is my user-repl ns, containing a debug atom to register some values#2020-12-1709:46Quentin Le Guennec(swap! debug-atom assoc :params params)#2020-12-1710:39nmkipHi, I'm using cider-connect-clj to connect to a socket repl at localhost:50505. I connect successfully but when I evaluate stuff it timeouts.
Starting new CIDER session ...
[nREPL] Establishing direct connection to localhost:50505 ...
[nREPL] Direct connection to localhost:50505 established
nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
Am I doing something wrong?#2020-12-1713:23David RenoI don’t think cider supports connecting to a socket repl. You may need to start the repl with nrepl support instead of socket support.#2020-12-1713:29David RenoWith that port number you may be using @U04V70XH6’s dot-clojure. If so, this is how I’m starting it to connect to cider with nrepl: clj -M:add-libs:dev:nrepl#2020-12-2014:18bozhidarYeah, CIDER works only with nREPL. inf-clojure works with socket REPLs.#2020-12-1802:12nivekuilis indent spec supposed to work with babashka? don't see the indent/macro font-lock happening in a buffer connected to a bb nrepl#2020-12-1809:14Gleb PosobinCider is saying "Inspector error for: {}" when I evaluate {} in a cljs buffer and open cider inspector. What could be wrong? I have the cider-nrepl middleware installed.#2020-12-1809:16Gleb PosobinAnd it doesn't have any problem with showing the evaluation result in the buffer in the overlay.#2020-12-1918:41robert-stuttafordfor some reason, eval to buffer or to cider-result is now outputting things twice. how do i go about debugging why?#2020-12-1919:18nivekuilCljc?#2020-12-1919:19nivekuilMaybe cider does that with two repls attached in general#2020-12-2022:33Brandon OlivierIs there an easy way to maintain the output of cider eval? I want to eval some code and continue looking at it while I work, is there like a messages buffer for cider?#2020-12-2023:43dpsuttonCider inspector sounds like that#2020-12-2102:52Gleb Posobin@brandon149 Do cider-pprint-eval-last-sexp and cider-pprint-eval-defun-at-point do what you want? They open a new buffer with the result, which doesn't change if you eval other forms, unlike the inspector.#2020-12-2102:53Gleb PosobinOr you can eval to comment, if you want to stay in the same buffer.#2020-12-2104:06datranI'm trying to cider-jack-in-cljs with a shadow-cljs project that's using deps.edn for dependency resolution, and I'm running into some trouble.#2020-12-2104:07datranI know the shadow-cljs side of things is working fine, because I can do a clj -A:shadow-cljs watch client, and then cider-connect-cljs to the resulting nrepl server without too much trouble#2020-12-2104:07datranBut I'd like to be able to launch it from emacs : )#2020-12-2104:08datranHere's the outline of the deps.edn file:
{:deps [,,,]
:src-paths [,,,]
:aliases
{:shadow-cljs
{:extra-deps {thheller/shadow-cljs {:mvn/version "2.11.9"}}
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
}}#2020-12-2104:08datranand here's my .dir-locals file: ((clojure-mode (cider-clojure-cli-global-options . "-A:shadow-cljs watch client")))#2020-12-2104:10datranWhen I jack in, there are several messages complaining about unqualified libs ("change nrepl => nrepl/nrepl"), and then it complains about unknown options:
Unknown option: "-m"
Unknown option: "--middleware"
#2020-12-2104:10datranAnd then it prints the shadow-cljs help text#2020-12-2104:11datranI've checked the shadow-cljs and cider docs for how this should work, but I couldn't find much to help with this setup#2020-12-2104:12datranAnd unfortunately I need access to some unpublished libraries, otherwise I'd just forsake deps.edn for now#2020-12-2104:15datranI suspect those unkown optiosn are coming from this connection string:
[nREPL] Starting server via /run/current-system/sw/bin/clojure -A:shadow-cljs -Sdeps '{:deps {me.raynes/fs {:mvn/version "1.4.6"} compliment {:mvn/version "0.3.6"} com.cemerick/pomegranate {:mvn/version "0.4.0"} org.tcrawley/dynapath {:mvn/version "0.2.5"} nrepl {:mvn/version "0.8.2"} cider/piggieback {:mvn/version "0.5.1"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'#2020-12-2104:15datranlooks like it's injecting some middleware, but for some reason it doesn't understand the stuff following the -Sdeps arg#2020-12-2104:16datranThere is this:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: DEPRECATED: Libs must be qualified, change compliment => compliment/compliment
DEPRECATED: Libs must be qualified, change nrepl => nrepl/nrepl
DEPRECATED: Libs must be qualified, change refactor-nrepl => refactor-nrepl/refactor-nrepl
#2020-12-2104:16datranDoes anybody know where these are defined? I could try fixing that and seeing if it works#2020-12-2105:10dpsuttonYou can’t use your own main. Cider needs the main#2020-12-2105:11dpsuttonThere’s an issue relating to how to do this. One issue is that you need to make sure that shadows nrepl middleware are present as well#2020-12-2105:13datranthat's useful! I'll see if it works if I don't use the alias#2020-12-2105:15datranah, I see what you mean about the middleware:
error in process filter: user-error: The shadow-cljs ClojureScript REPL is not available. Please check for details
error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details
#2020-12-2105:16datranBut that's a new error, and I think a very helpful direction.#2020-12-2105:26datranOk, I only had the thheller/shadow-cljs {:mvn/version "2.11.9"} dep in the :extra-deps section of the :shadow-cljs alias, I added it to the regular deps and that removed the error in process filter messages#2020-12-2105:26datranso that's progress#2020-12-2105:27datranBut now I'm getting an exception:
Unhandled clojure.lang.ExceptionInfo
missing instance
{}#2020-12-2105:27datranruntime.clj: 11 shadow.cljs.devtools.server.runtime/get-instance!
runtime.clj: 8 shadow.cljs.devtools.server.runtime/get-instance!
api.clj: 122 shadow.cljs.devtools.api/worker-running?
api.clj: 120 shadow.cljs.devtools.api/worker-running?
api.clj: 206 shadow.cljs.devtools.api/watch
api.clj: 200 shadow.cljs.devtools.api/watch
api.clj: 204 shadow.cljs.devtools.api/watch
api.clj: 200 shadow.cljs.devtools.api/watch
REPL: 1 user/eval28454
REPL: 1 user/eval28454
Compiler.java: 7177 clojure.lang.Compiler/eval
Compiler.java: 7166 clojure.lang.Compiler/eval
Compiler.java: 7132 clojure.lang.Compiler/eval
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 1973 clojure.core/with-bindings*
core.clj: 1973 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 nrepl.middleware.interruptible-eval/evaluate/fn
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 437 clojure.main/repl/read-eval-print
main.clj: 458 clojure.main/repl/fn
main.clj: 458 clojure.main/repl
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 84 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 56 nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 152 nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 202 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 201 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 834 java.lang.Thread/run#2020-12-2105:27datranSo it's finding the shadow.cljs.devtools namespace now!#2020-12-2105:42dpsuttonyeah. that's' because you're missing the shadow middleware#2020-12-2105:43dpsuttonhttps://github.com/clojure-emacs/cider/issues/2812#2020-12-2105:53datranThanks for digging up that issue. I'll try it out the solution in there and see how it goes#2020-12-2105:54datranBut I'll do that tomorrow 👋#2020-12-2112:15jrychterHi — I've been pulling my hair out trying to track down this problem — thought I'd ask, perhaps it looks familiar to someone. Some time within the last 2 months or so, something broke and I can no longer use helm-M-x reliably if I'm in a Clojure buffer or in CIDER repl. The error message is cryptic and ends with:
(fn C1 C2)]] 5
(fn COMPLETIONS)])) last completion-metadata-get display-sort-function nil copy-sequence] 10
(fn STR PRED ACTION) complete-with-action helm-completion-style helm-current-buffer completion-styles completion-flex-nospace helm-pattern] 10]’
(user-error \"No linked CIDER sessions\")")
Things work fine until I connect with CIDER. Tried debug-on-error, but I can't make the debugger window stay on screen, the moment I start marking in it, it disappears.
What's more frustrating, I can't find the string "No linked CIDER sessions" anywhere in CIDER sources.
Any ideas?#2020-12-2113:18Ben SlessHi all, are you familiar with a way of configuring cljfmt or zprint in such a way they would indent defrecords like CIDER? This is what cljfmt emits:
(defrecord Bar
- [a b])
+ [a b])
#2020-12-2120:37gonHi, I have updated to last Cider cider-20201216.1330, at jack-in now I have the error "if: Wrong number of arguments: memq, 1", inspecting the buffer nrepl-messages only "(-->" is shown. nrepl is running, but Cider not. I see that in the last version in nrepl-client.el the line (specialq (lambda (pair) (seq-contains '("id" "op" "session" "time-stamp") (car pair)))) has changed to (specialq (lambda (pair) (seq-contains-p '("id" "op" "session" "time-stamp") (car pair)))), reverting the line to seq-contains made Cider working well again. Is it just me affected by this ?#2020-12-2216:19niveauverleihDoes clj-refactor work with jdk11? I get refactor-nrepl is unreachable.#2020-12-2306:37niveauverleihDoes anyone use clj-refactor?#2020-12-2311:35robert-stuttafordI set https://github.com/robert-stuttaford/clj-cljs-app/ up on JDK11 and it works. Perhaps the answer you need is somewhere in how this is set up?#2020-12-2313:05niveauverleihThank you! That excludes JDK11 as a cause. I use spacemacs with the clojure layer
(clojure :variables
clojure-enable-clj-refactor t)
This should work automagically.#2020-12-2408:56niveauverleihFinally, I deleted refactor-nrepl in .m2 . Cider re-downloaded it and now it works.#2020-12-2216:23Gleb PosobinHow do I bind a clojure eval to a shortcut? There is cider-read-and-eval but if I call (cider-read-and-eval "(user/restart)"), the command appears in the minibuffer and I have to additionally press Enter to eval it.#2020-12-2216:25dpsutton> Read a sexp from the minibuffer and output its result to the echo area.
If VALUE is non-nil, it is inserted into the minibuffer as initial input.#2020-12-2216:25dpsuttonyou're entering a prompt for the minibuffer#2020-12-2216:49Gleb PosobinYes, but how do I avoid having to press enter?#2020-12-2216:51dpsuttonyou can't with that function. that's why i posted the docstring. that function is for reading from the minibuffer and a prompt. you will always end up in the minibuffer#2020-12-2216:51Gleb PosobinIs there another function that would do that?#2020-12-2216:52dpsuttonif you read the source of that function you can see all the things its doing. but its ultimately calling (cider-interactive-eval form)#2020-12-2216:53dpsuttonthere's some stuff relating to namespace but if you want just a simple thing that form there will do it#2020-12-2216:53dpsuttonits making a new buffer, putting an ns form of whatever the current namespace is in the buffer you're calling it from, and then your form and calling eval on the form#2020-12-2216:55Gleb PosobinAh, great, thank you! I tried looking at the source but it seemed like a lot of stuff going on there.#2020-12-2217:00dpsuttonread it again with that in mind.
1. get the current ns and make an ns form out of it "(ns %s") cider-current-namespace
2. get a buffer made just for this and erase it
3. make sure its in clojure-mode
4. if we have a ns form insert it
5. put our form in there
6. eval the form#2020-12-2217:00dpsuttoni'm not sure why the form is in the buffer and in the interactive eval form but whatever ¯\(ツ)/¯#2020-12-2306:37niveauverleihDoes anyone use clj-refactor?#2020-12-2313:05niveauverleihThank you! That excludes JDK11 as a cause. I use spacemacs with the clojure layer
(clojure :variables
clojure-enable-clj-refactor t)
This should work automagically.#2020-12-2303:11Gleb PosobinA follow-up: is it possible to load a namespace, and run a function from it in cider-interactive-eval? I have tried (cider-interactive-eval "(require 'dev) (in-ns 'dev) (restart)") and "(require 'dev) (dev/restart)", neither works, doesn't find the restart function.#2020-12-2303:18dpsuttonI think dev is sometimes weird? What happens if you just run that from a repl?#2020-12-2303:58Gleb PosobinI am actually using development, not dev, I wrote the message with dev for brevity, didn't know dev is weird. With development it works from the repl.#2020-12-2403:06mobileinkhello. getting (re)started with cider, figwheel, cljs after many months away. the cljs repl starts, and cider-load-file works, but C-x C-e throws the following error: apply: Wrong number of arguments: #[(&optional arg1 arg2 arg3) "ÀÁ\"" [clojure-quick-repls-set-connection nil] 3], 4 [2 times]. Help?#2020-12-2403:07mobileinkthis is emacs 27.1 on macos catalina, cider version 0.26.1 (Nesebar)#2020-12-2403:09mobileinkthat is, the cljs repl starts when I run cider-jack-in-cljs#2020-12-2403:15dpsuttonLooks unfamiliar to me. Where is that error? In emacs or in the repl?#2020-12-2403:59mobileinkThat was copied from *Messages* in emacs#2020-12-2404:00mobileinkWhen I place the cursor at the end of (println "This text is printed from src/obazl/core.cljs. Go ahead and edit it and see reloading in action.") and execute cider-eval-last-sexp the message prints in the minibuf.#2020-12-2404:04mobileinkSame thing with cider-eval-region. Hmm. cider-load-file does not throw an error, but it also does not print anything to the repl buffer. Oops, just noticed cider[not connected] in the minibuf. Is that normal? If I run cider-jack-in-cljs from a cljs file should it not connect?#2020-12-2404:06mobileinkstandby; just found something on the web recommending a reinstall of cider with emacs restart…#2020-12-2404:08dpsuttonCider needs a js runtime. If it’s a web app have you opened the correct url in your browser?#2020-12-2404:13mobileinkI’m using node. I just redid my emacs init.el and restarted. Now cider-load-file works; the println commands print to the cljs repl buffer. But the cider-eval-… commands throw the same error.#2020-12-2404:14mobileinkHere’s the startup cmd: [nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.0"} cider/piggieback {:mvn/version "0.5.1"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'#2020-12-2404:16mobileinkIn init.el I have (setq cider-default-cljs-repl 'node)` . deps.edn: `{:deps {org.clojure/clojure {:mvn/version “1.10.1”}
org.clojure/clojurescript {:mvn/version “1.10.773"}
com.bhauman/figwheel-main {:mvn/version “0.2.12”}
com.bhauman/rebel-readline-cljs {:mvn/version “0.1.4"}
}
:paths [“src” “target” “test”]
}`#2020-12-2404:21mobileinkSomething like this happens literally every time I return to using cider. Sigh.#2020-12-2404:21dpsuttonDid you run the node process?#2020-12-2404:22mobileinkWhat do you mean? Doesn’t cider-jack-in-cljs do that? It must, since loading the file works.#2020-12-2404:22dpsuttonThere should be an output file and you should run that file through node#2020-12-2404:22dpsuttonI doubt it’s working. You need to run the node process yourself I think#2020-12-2404:23mobileinkThat doesn’t make sense to me. What would be the point of a repl in that case?#2020-12-2404:23mobileinkGuess I’ll go back over the figwheel docs, maybe I missed something.#2020-12-2404:27dpsuttonRepl is a live process that’s interactable and evaluate forms#2020-12-2404:27dpsuttonAnd that file will run the repl when you start the node process#2020-12-2404:27mobileinkFYI I’m going from this: https://docs.cider.mx/cider/cljs/figwheel.html#2020-12-2404:28mobileinkYes, I’m familiar with the repl stuff.#2020-12-2404:28mobileinkI was using cljs repl type ‘node’. tried it with ‘figwheel-main’ and got the same error.#2020-12-2404:30mobileinkstarting to smell like a figwheel problem, I’ll try a different repl#2020-12-2404:32dpsuttonDon’t try different repls. Use the figwheel option#2020-12-2404:32dpsuttonThat will compile your stuff#2020-12-2404:33dpsuttonThen run “node my-file.js” #2020-12-2404:35mobileinkI’ve done that, builds work. I’m trying to use emacs+cider to develop with a repl, not run compiled files.#2020-12-2404:36dpsuttonRight. The repl is powered by that node process. That’s how it can eval anything#2020-12-2404:36mobileinkA plain node repl throws the same error, alas, so I guess it isn’t a figwheel problem.#2020-12-2404:36dpsuttonFigwheel should emit repl related code that allows for all of the hot loading and redefinition#2020-12-2404:37dpsuttonI don’t know what you mean a plain node repl #2020-12-2404:37mobileinkI don’t think the repl is the problem. It is running, I can evaluate code in it. The problem is cider.#2020-12-2404:38mobileinkAs opposed to a figwheel repl.#2020-12-2404:38mobileinkI.e. when cider startup prompts for a clojurescript repl, ‘node’ instead of ‘figwheel-main’, with figwheel deps removed from deps.edn.#2020-12-2404:41mobileinkprobably a version problem I suppose. that’s what often turns out to be the problem.#2020-12-2404:59mobileinkFYI submitted an issue https://github.com/clojure-emacs/cider/issues/2954#2020-12-2404:59mobileink@dpsutton Thanks for trying to figure this out.#2020-12-2405:40mobileink@dpsutton FYI, it turns out there is something in my emacs config that breaks cider. I ran with a minimal emacs init.el and it worked.#2021-12-2817:10bozhidarFYI - CIDER 1.0 is out https://metaredux.com/posts/2020/12/28/cider-1-0.html Cheers!#2021-12-2817:14DerekAwesome. Congrats @bozhidar#2021-12-2919:19mobileinkYay!
;; Connected to nREPL server -
;; CIDER 1.1.0snapshot (Nesebar), nREPL 0.8.0
#2021-12-2919:22mobileinkOnly problem is load file and load buffer do not seem to work. C-c C-e works just fine, but if I do C-c C-l I get a “Loading…” message in the minibuffer followed by => nil but the code does not seem to be evaluated. This is with a cljs ‘node’ repl evaluating code in a .cljc file.#2021-12-2919:25mobileinkHow can I debug this?#2021-12-3103:17cschephey all, I’m new to emacs and started to come up with my own config, I got cider installed but when i try to jack in I get “the clojure executable isn’t on your exec-path” — i’m on macOS, i’ve brew installed clojure/tools/clojure and i’m running with a minimal deps.end => {} and I don’t have lein installed .. any guesses?#2021-12-3103:34cschepahh was a path problem.. works if i launch emacs from the command line#2021-12-3103:34cschepbut not if i just run https://Emacs.app#2021-12-3103:35cschepany guidance on how most people launch emacs on macOS? thanks so much!#2021-12-3104:28dpsuttonThere’s a package for this that can help. It’s called exec path from shell#2021-12-3106:35cschepwonderful, thank you!#2021-12-3108:48fmnoiseHi guys, I started seeing Server returned HTTP response code: 401 for URL: when trying to cider-find-var, cider 0.22#2021-12-3108:57fmnoisesame for cider-doc#2021-12-3109:08fmnoiseI have no idea why it should go there if I'm working with my own vars, not from clojure core#2021-12-3109:13fmnoisebut same behavior for clojure core vars#2021-12-3110:34bozhidar@fmnoise Update to the latest CIDER and this will fix the issue for you.#2021-12-3110:34bozhidar(here's the background, in case you're interested - https://github.com/clojure-emacs/clojuredocs-export-edn/issues/3)#2021-12-3110:57fmnoisethanks, will try that#2021-12-3112:35joelkuiperMaybe this is already a known issue, but under java 15 (OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.1+9) connecting with cider-nrepl in Emacs gives an NPE (java.lang.NullPointerException: Cannot invoke "jdk.javadoc.internal.doclets.formats.html.HtmlConfiguration.getOptions()" because "this.configuration" is null, full trace here https://gist.github.com/joelkuiper/3abab5170f57032b99007d1bfbe304e3 ). It's not a huge issue, all other things being equal it works fine under Java 14 😛#2021-12-3112:58bozhidarYeah, it's a known problem that I haven't had time to tackle. Orchard relies on some JDK internals to parse properly JavaDoc and they keep changing the internals in every other JDK release. 😞#2021-12-3112:58bozhidarOn some days I'm wondering if I should just drop everything Java-related as it's such a pain in the ass.#2021-12-3113:00bozhidarThat's the relevant ticket https://github.com/clojure-emacs/orchard/issues/100#2021-12-3113:16joelkuiperAh thanks @bozhidar! migrating off of the java stuff seems like a plan, but also a pain in the ass to refactor I guess 😉#2021-12-3113:17joelkuipermaybe a flag to disable the javadoc related stuff? It's not like I need it for most of my regular development, although I guess that solution is probably also a bit brittle#2021-01-0420:47bozhidarWe've sorted this out and it should work with the current CIDER master.#2021-12-3120:19fmnoisewell, upgrade from 0.22 to 1.0 went smooth except single thing I had to fix https://github.com/fmnoise/emacs/commit/80078b021cd9554a7cc86ea8b5607359dd8cc330
everything else worked fine and I highly recommend to upgrade
thanks @bozhidar and everyone who participated for your work and Happy New Year everyone! 🎄#2021-01-0108:24bozhidar@fmnoise Glad to hear this!#2021-01-0108:25bozhidarHappy New Year to everyone! Code long and prosper! :spock-hand: 🎆#2021-01-0214:55vemv> On some days I'm wondering if I should just drop everything Java-related as it's such a pain in the ass.
Hope it's tongue-in-cheek ;p especially as I'm set out to solve https://github.com/clojure-emacs/cider-nrepl/issues/64 (see the last post)
As a semi-related idea, if javadocs in particular are a PITA, one could indeed drop them, as they are strictly a subset of java sources. I see Orchard already does some Java source parsing.
There's the com.github.javaparser package as well which might be particuarly stable#2021-01-0215:45bozhidar@vemv Our parser is much simpler than GitHub's - we don't really need an AST for Java sources or something like this. Orchard's Java parser extracts only the data we need for the info functionality (source locations, JavaDoc, etc).#2021-01-0215:47vemvfor clarity, I was talking about https://javaparser.org/ which artifact, oddly enough is prefixed com.github#2021-01-0215:48vemvwhat I had in mind is - you don't need javadoc if one does a simple parsing of a single source file.
you get exactly the same info a javadoc would give you, right?#2021-01-0308:01bozhidarYeah, that's true. The only downside would be the need for a third-party dep. Part of the reason we've opted for our simpler approach is to avoid having any deps in Orchard.#2021-01-0311:50vemvyeah a java dep doesn't sound mranderson-able :)#2021-01-0315:50bozhidarIt actually handles those, but Orchard doesn't use mranderson, only cider-nrepl does. And the info functionality for Clojure, Java and ClojureScript happens to live in Orchard currently.#2021-01-0215:46bozhidar(and it's the thing that got broken by some changes in Java 15)#2021-01-0308:03bozhidarFYI - GitHub Discussions are now live for CIDER. We already have an interesting discussion in progress about the definition of "breaking changes" in CIDER https://github.com/clojure-emacs/cider/discussions/2960 I hope the discussion board will be a nice addition to the issue tracker (and this chat).#2021-01-0418:06iarenaza@bozhidar In your "Dark Cider" talk you showcase the "CIDER can show images in the REPL" feature (around 51:17 in the recording). You start with the "~/kitty.png" path but you edit it to "/home/bozhidar/clojure.png" because you mention a minute later that there is a bug somewhere in CIDER that makes that feature only work with absoluted paths. But not with relative paths.
Well, I´ve looked into it, and the problem is not absolute vs relative paths. Relative paths work ok, as long as they are relative to the user.dir directory. Because that is the behaviour of (and the underlying http://java.io.File class). The problematic paths are those that contain shell expansion characters, like ~, $ etc. Precisely because they are expanded by the shell!
But when using to get a http://java.io.File object, no shell is involved. So no expansion occurs. And the file referenced by that path doesn't exist. So this check in the nREPL middleware fails: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/content_type.clj#L92
So more than a bug, I'd say this is a limitation of the underlying Java platform. Unless the middleware takes care of doing the shell expansion work there is no way this can work. By the way, I don't think it should, as this can get out of hand very quickly, given the amount of different shell expansions existing out there.#2021-01-0418:08bozhidar@iarenaza Good catch! I keep forgetting about this, because I also do a lot of Ruby and there it's trivial to do the shell globbing.#2021-01-0418:10bozhidarI guess we can at least add a note to the docs, so someone won't be surprised by this behavior, as I agree it's probably going to be too much to try to do proper globbing in the middleware.#2021-01-0515:16pinkfrogIs it possible to modify the cider repl prompt to show which evil-mode I am in ?#2021-01-0520:51zaneThat’s an interesting idea! I’m curious about your workflow. Do you not display the current evil state in the modeline?#2021-01-0601:41pinkfrogYes. but it is not easy to see compared with directly seeing it from the prompt.#2021-01-0602:39zaneMakes sense!#2021-01-0610:46solfI want to embed an nrepl server in one of my scripts, but only when enabled via a flag. However just requiring nrepl.server without calling nrepl.server/start-server is enough to prevent the script from exiting immediately. Is this intended?
Any workarounds without explicitly quitting at the end of the script?#2021-01-0610:48solfI also tried to call (require ...) inside a function, but it seems it only works when called on top-level?
(ns test
#_(:require
[nrepl.server :as nrepl-server]) ;; This is enough to prevent the script from exiting
)
(println "Hello world")
(defn -main [& args]
(println "Args:" args)
(require 'nrepl.server)
(nrepl.server/start-server :port 7882) ;; This doesn't work, seems that you can only call (require...) at top level?
)#2021-01-0612:08Edthe nrepl.server/start-server call doesn't compile because that namespace isn't available when you're compiling the -main fn ... I think you need to use something like requiring-resolve ...#2021-01-0612:10Edmaybe something like
(let [start-repl (requiring-resolve nrepl.server/start-server)]
(start-repl :port 7882))
#2021-01-0712:00sakallihi not sure how useful this is but fwiw just a heads up that when i install emacs through guix
name: emacs
version: 27.1
outputs: out
systems: x86_64-linux i686-linux
dependencies:
the cider nrepl connection breaks. error in process filter: [nREPL] Direct connection to localhost:42423 failed
but re-installing it from https://archlinux.org/packages/extra/x86_64/emacs/ it works again. sorry for not debugging any further atm.#2021-01-0712:03sakalliCIDER 1.1.0snapshot (package: 20210104.915)#2021-01-0712:04sakallican of course totally be something limited to my particular system...#2021-01-0712:18sakalliguix
GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
arch
GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3) of 2020-08-28#2021-01-0810:27bozhidar@sakalli hard to tell what went wrong without seeing a more detailed error message.#2021-01-0813:29Yehonathan Sharvit@bozhidar I just watched on YouTube your https://www.youtube.com/watch?v=IvTDzKVL58Y and I loved it#2021-01-0813:46Yehonathan SharvitI have used Cider (in Spacemacs) for a couple of years and today I learned about tracing, profiling, enlighten mode, view images in the REPL, sign in the gutter where a form has been evaled, Clojuredocs in Emacs, eval sexp up to point.
And most importantly it’s a real pleasure to watch the master clj:man-surfing: in action!#2021-01-0815:40bozhidar@viebel Thanks for the kind words! The master is a bit out of practice lately, but he hopes to make up some of the lost ground in 2021. 🙂#2021-01-0815:45andrea.crottiany reasons why cider-auto-test-modewould stop working?#2021-01-0815:46andrea.crottiit hasn't been working for a while, the value of the var is definitively t but loading a test file doesn't trigger the test to run#2021-01-0815:47bozhidar@andrea.crotti I don't recall any recent changes to the test-related functionality. Please, file a bug report about this.#2021-01-0815:47andrea.crottiyeah cool I'll double check in different projects/machines#2021-01-0815:48andrea.crottiand report if I can reproduce it all the times#2021-01-0815:49andrea.crottiactually interestingly if I just disable auto-test-mode and then enable it again it works#2021-01-0819:01bennyI totally forgot I'm in this channel and it may have not needed be a github issue: I can't get the clojuredocs via cider/nrepl. https://github.com/clojure-emacs/clojuredocs-export-edn/issues/5#2021-01-0902:54zendevil.ethHow to run cljs tests in cider?#2021-01-0902:55zendevil.ethI’ve the following file:#2021-01-0902:55zendevil.eth(ns humboi.core
(:require [humboi.core :as sut]
["@testing-library/react-native" :refer [render fireEvent]]
[humboi.auth.core :refer [google-sign-in-comp]]
[cljs.test :as t :include-macros true]))
(defn mount! [component]
(render (r/as-element component)
#js {:container (testing-container)}))
(deftest google-login-test
(is (mount! [google-sign-in-comp])))
(cljs.test/run-tests)
#2021-01-0902:55zendevil.ethand want to run test with cider#2021-01-1008:30bozhidar@ps There's no "proper" support for running cljs tests yet, but you can always run them from the REPL and maybe create some simple wrapper commands around this.#2021-01-1009:00bozhidarIf someone's into Discord - I've a started a CIDER server there (I've been getting more and more frustrated with Slack lately and I want to explore some alternatives). Here's an invite in case someone's interested in joining it https://discord.gg/nFPpynQPME#2021-01-1012:41pavlosmelissinosSlack is annoying but Discord has a horrible privacy policy and the lack of threads makes long conversations hard to follow
I'm definitely in favor of exploring alternatives but Discord seems even worse to me than Slack...#2021-01-1013:00bozhidarPerhaps. At least it has history retention. 🙂 I'm not familiar with its privacy policy, but I kind of like the simplicity of its UI.#2021-01-1013:40pavlosmelissinos> At least it has history retention.
yeah that can be an issue. There's a https://clojurians-log.clojureverse.org/ though which for the most part should make up for slack's short history
Data retention has become more complicated since GDPR though 😄
> I kind of like the simplicity of its UI
Indeed, discord definitely does a lot of things right (otherwise it wouldn't be so popular among gamers!) 🙂
Btw discussions about the privacy friendliness of discord come up every now and then on reddit. Like https://old.reddit.com/r/privacy/comments/9b16n5/is_discord_privacy_friendly/ https://old.reddit.com/r/discordapp/comments/8nw9p6/for_those_who_are_concern_about_discords_privacy/.#2021-01-1015:09teodorluDiscord also allows to split the discussion by topic. Here's what it looks like now:#2021-01-1100:58respatializedI'd recommend giving Zulip a shot for longer discussions, and the clojure community there has the benefit of mirroring messages on this slack#2021-01-1107:21bozhidarI've got no doubt that there are other good options, but I don't want to end up in 20 chats and one of the primary reasons I like Discord, is that I don't use it only for CIDER.#2021-01-1107:22bozhidarThat's pretty much the only reason I use Slack as well - it's the chat we use at work. Otherwise it's unlikely I would have been running Slack just for the Clojurians community. My message was geared mostly towards Discord users and people who dislike Slack.#2021-01-1110:53niveauverleihMy cpu shoots to 103% whenever I execute clojure code in the repl that produces an error (the java nrepl process, that is). It's at 3% before any error occurs. Any idea on how to troubleshoot this? What directories does nrepl need access to?#2021-01-1112:20bozhidar@nick.romer What's your CIDER version?#2021-01-1112:21bozhidarnREPL doesn't really need access to anything, so I'm assuming that's not a permission issue, but we need more data to figure out what's going on.#2021-01-1112:22niveauverleihI narrowed it down to datahike.api that is a require in my project. It has a lot of dependencies.#2021-01-1112:23niveauverleihI have one of the latest cider versions. I use spacemacs dev branch. How can I check the cider version?#2021-01-1112:29niveauverleihcider-nrepl-0.25.6#2021-01-1112:35niveauverleihrefactor is disabled and savehist is tiny.#2021-01-1112:52bozhidarHmm, maybe you can attach some Java profiler to the project and see what's causing the CPU spike?#2021-01-1508:18niveauverleihHi Bozhidar, I was unable to find a profiler for my system (termux on Android = arm32 terminal).
I uninstalled my jdk (adopt open 11) and replaced it with v14. The problem has gone away.#2021-01-1112:57niveauverleihI've never done profiling. Can you suggest a profiler?#2021-01-1113:46bozhidarThere's one bundled with the JDK - VisualVM.#2021-01-1114:00niveauverleihOk. thanks!#2021-01-1405:39zackteoDoes anyone know what might be causing me to get a popup of Lisp expression: in the minibuffer whenever I type something like ;; t?
Been trying to isolate the problem, and it seems that it only happens after I start a cider session#2021-01-1408:26Sergej Koščejev(I asked this in #beginners but this channel might be better.) I have a deps.edn project with a single file looking like this:
(ns stuff)
(ns stuff-test (:require stuff) (:use clojure.test))
(with-test
(defn sum [s]
(+ s 2))
(is (= 2 (sum 1))))
and I'm asking CIDER to run all tests in project. But it's telling me that there are no tests. What am I doing wrong?#2021-01-1408:35Eamonn SullivanDid you evaluate the tests? On my keymap, that's C-c, C-k, but I think it's cider-eval-buffer or something like that.#2021-01-1409:06solfWith C-c C-k it does work.
If you run all project tests it doesn indeed say no tests found#2021-01-1409:06solfMy intuition is that there might be some hardcoded logic linked to run tests in project that tries to find namespaces in a test directory#2021-01-1409:08Sergej KoščejevC-c C-k is cider-load-buffer in my keymap, it just loads the thing but doesn't run any tests (the test should fail)#2021-01-1409:08Eamonn Sullivan:man-shrugging: Yeah, I haven't been able to get cider to run all the project's tests, but I use deps.edn on all of mine and I thought that would be why. I just have cider run the tests for the file I'm working on (which does work, after being eval'd) and run all tests in a terminal window.#2021-01-1409:11solfhmm I might have found out why, but not sure yet#2021-01-1409:11solfit works if you re-order the file as follows:
(ns stuff-test (:require stuff) (:use clojure.test))
(with-test
(defn sum [s]
(+ s 2))
(is (= 2 (sum 1))))
(ns stuff)#2021-01-1409:14solfIt might be something related to this:
https://docs.cider.mx/cider/1.0/testing/running_tests.html#test-namespace-naming-convention#2021-01-1409:21Sergej Koščejevthanks, it didn't work at first but then I restarted CIDER and it started working#2021-01-1409:23solfIt's not really a solution because I don't know why it works after reordering 😅#2021-01-1409:23solfThis is the code that actually runs the tests
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/test.clj#L315#2021-01-1410:16bozhidarThere's no logic related to folder in which the tests are placed. Tests have some special metadata attached to them, and this is what CIDER is looking for to evaluate them.#2021-01-1410:16bozhidarBut as usual - you have to evaluate the test definitions before you're able to run any tests.#2021-01-1410:27Sergej KoščejevI did evaluate them before trying to run them, but it still reported there being no tests.#2021-01-1410:30Eamonn SullivanI vaguely remember being able to run all project tests in CIDER back when I used lein, but I've not successfully gotten this feature to work with tools.deps. I asked about this a while back and never got an answer. It's not a big deal (I typically just want to run the tests against the code I'm working on, and can run them all in a terminal), but it would be nice to have.#2021-01-1410:17bozhidarOften people mention they are having problems with navigation to Java definitions. Seems we've finally found the root cause of the issue https://github.com/clojure-emacs/orchard/issues/103#2021-01-1410:17bozhidarIf someone wants to help with this - be my guest.#2021-01-1413:50Christian JohansenWhen I evaluate an expression with cider-eval-last-sexp that results in an exception, the exception opens in a buffer asynchronously. This has started to take a very long time - upwards of several tens of seconds. When the buffer opens, I've usually long since fixed the underlying problem, but the buffer steals focus of the cursor. Is this a known problem, or could it be something else in my setup that's causing this?#2021-01-1509:33bozhidarMost likely you're using an old version of cider-nrepl.#2021-01-1509:35bozhidarA bunch of people reported experienced this issue after I should down https://clojuredocs-export.netlify.com. Frankly, I didn't expect that something like this would happen, otherwise I would have handled the situation differently.#2021-01-1805:06Christian JohansenAh, THANK YOU! 🙏#2021-01-1805:06Christian JohansenWas about to loose my mind there 😅 Upgraded things, and now it's back to awesome. Thanks for your hard work!#2021-01-1414:33naomarikcan anyone point me to a starting point to investigate why running any of the cider-test commands is taking a long time to run tests and show a report? everything else is instant and running tests manually with test/run-tests is also instant. nothing else about my dev environment is lagging, and awhile back running tests via cider wasn't doing this.#2021-01-1420:32naomarikfound the slowdown in cider-test-clear-highlights and cider-test-highlight-problems commenting those out makes everything perform instantly again#2021-01-1420:58naomarikdigging deeper, cider-sync-request:info is taking 2 seconds.
in nrepl-send-sync-request
(nrepl-send-request) with: (op info ns user sym sah.core-test/zh) as the request parameter is taking 2.5 secs to get a response. i have no idea where to go from here#2021-01-1422:48naomarikOoops I lied, you see the reason why I'm a projrammer is not because I want to be, but because I can get myself out of being stuck. I updated cider-nrepl from 0.25.2 to 0.25.6 and it's perfect now.#2021-01-1422:49dpsuttonawesome! glad the issue has gone away#2021-01-1422:52naomarikas a benefit my cider-error stacktrace window pops up instantly now instead of lagging for 5 seconds... actually disabled it because it was driving me crazy#2021-01-1422:52naomariki actually installed doom-emacs to see if it was my emacs config#2021-01-1422:54dpsuttonhow did you have an old version of cider-nrepl around?#2021-01-1422:59naomarikproject is old, everything was working didn't think to update that#2021-01-1500:10richiardiandreaHi all! has anybody ever seen this in the repl?
> ;; Results: Stored in vars *1, *2, *3, an exception in *e;
> ;; Startup: /home/cokap/.local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.6"}}}' -A:dev:test -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
> nil> #2021-01-1500:37richiardiandreasolved I was enabling clojure-mode for as hook to cider-repl-mode and that for some reason was breaking things#2021-01-1703:08solfI'd like to change the color of css classes in hiccup, in both "versions" (when used as [:div.classname and [div {:class "classname"}, such as in the joint screenshot. (to another color than the default keyword/string color)
I've never touched highlight syntax on emacs, what would be the best approach?
Should I just follow any font-lock generic guide or is there something specific about clojure-mode/cider highlighting that I need to take into account?
For now I'm thinking of creating a minor-mode and follow this guide:
http://ergoemacs.org/emacs/elisp_syntax_coloring.html#2021-01-1705:09solfSeems to be harder than expected, I can't just easily add regexes to fontify non-keywords strings, seems like I need to much around with the syntax table#2021-01-1711:46bozhidarYeah, it's definitely not trivial, because you also have to be careful about the order in which the different fontification rules get applied.#2021-01-1711:47bozhidarI don't think you need to touch the syntax table, though.#2021-01-1711:48bozhidarSee https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el#L750#2021-01-1711:48bozhidarThis should give you a good idea how the font-locking works today.#2021-01-1711:28yiorgosIs there a key combo to see the implementation of java code?
for example (iterate inc 1) if I do M-. on iterate it will show me the implementation of iterate which internally calls clojure.lang.Iterate/create#2021-01-1711:29yiorgoshow can I jump to the Java code?#2021-01-1711:46bozhidarSame keybinding, provided the JDK source is on your classpath.#2021-01-1712:28yiorgos> provided the JDK source is on your classpath.
I think that might be the issue, is always asking for Symbol: in the minibuffer#2021-01-1801:01vemvI created a high-quality plugin addressing this problem. I still need some feedback before announcing it elsewhere:
https://github.com/clojure-emacs/cider-nrepl/issues/64#issuecomment-752921557
If you can give it a spin I'd appreciate it much!#2021-01-1820:58yiorgosIt seems that this is a Lein plugin but I am using tools.deps 🙂#2021-01-1820:59vemvI will adapt it at some point. Luckily I didn't hardcode things against Lein assumptions#2021-01-1901:18richiardiandreaHi there! Is anybody using which-key by any chance? I am a newbie and I am wondering how I can see help for things like cider's C-c C-j for instance given C-x C-c closes the buffer 😄
Trying to understand how to use which-key mostly 🙂#2021-01-1901:33ACwhich-key kicks in after a pause when entering a prefix. here’s a example of marking a sexp (using my custom bindings) and then inserting it into the repl,#2021-01-1901:38richiardiandreaoh ok let me try that 😄#2021-01-1901:42richiardiandreacause C-c C-j C-x does not trigger it but C-c C-x does enter in it with the cider-start-map#2021-01-1901:43richiardiandreaoh, this is magic, C-c C-j and I wait a little and now things appear 😄#2021-01-1901:43richiardiandreathank you very much, you showed me the way 😄#2021-01-1901:46ACyou can also configure the amount of delay with which-key-idle-delay. (the docs say you have to set it before starting which-key-mode)#2021-01-1913:52pezSo, in a lein-figwheel project, with cider-jack-in-cljs, I expect the piggieback middleware to be injected. But it isn’t. Am I wrong expecting this? Or what could cause it to not be?#2021-01-1914:27tvaughanIn deps.edn:
:shadow {:extra-deps {binaryage/devtools {:mvn/version "1.0.2"}
cider/cider-nrepl {:mvn/version "0.25.6"}
cider/piggieback {:mvn/version "0.5.2"}
refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
thheller/shadow-cljs {:mvn/version "2.11.14"}}
:extra-paths ["test"]
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
In shadow-cljs.edn:
:nrepl {:host "0.0.0.0"
:port 5310
:middleware [cider.nrepl/cider-middleware
cider.piggieback/wrap-cljs-repl
refactor-nrepl.middleware/wrap-refactor]}
I use cider-connect not cider-jack-in to use a cljs repl, so this may not be everything, but I'm assuming the problem is that piggieback isn't found on the classpath#2021-01-1914:29tvaughanAdjust accordingly for project.clj v deps.edn#2021-01-1916:56pezThis is for jack-in so trying not to have those things specified in the project.#2021-01-1915:43dpsuttonIt always is for me. Open an issue with a repro?#2021-01-1916:55pezTo clarify, the dependency is injected. But not the middleware. The middleware is added in a profile that I don’t use ( :figwheel). So I was thinking maybe CIDER sees the middleware there and refrains from injecting it. This all was not happening on my machine, but on a clooagues, over screensharing, so I couldn’t do the experiments that I would have done otherwise. And thus have too little context for a meaningful issue, I think.#2021-01-2007:11bozhidarCIDER doesn't really check anything in the user configs and optimistically injects everything that's needed. The assumption was always that if someone tweaked their project config for some particular reason they probably know how to tweak CIDER's config as well.#2021-01-2007:11bozhidarKISS 🙂#2021-01-2007:28pezThat’s what Calva does too. Which brings me back to the question if I am wrong to expect to see the middleware injected? Calva adds this to the command line:
-- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]'
CIDER doesn’t, on my colleagues machine. So he has to add it to his global lein config or in the project. I can live with it added to the project, but I’d prefer not to have it there and rely on injection by the editors.#2021-01-2007:35bozhidarI just tested this locally and the Piggieback injection works fine.#2021-01-2007:36bozhidarThat's the CIDER command line invocation - /home/bozhidar/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\] -- repl :headless :host localhost#2021-01-2007:36bozhidar(for Lein at least)#2021-01-2007:36bozhidarI have to check if it's some problem with tools.deps.#2021-01-2007:37bozhidarFor leiningen the middlewares get the added by the Lein plugin, as it's a bit simpler this way.#2021-01-2007:37bozhidarNot sure why decided to do this differently.#2021-01-2007:55pez> For leiningen the middlewares get the added by the Lein plugin, as it’s a bit simpler this way.
So, the -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.5\"\] takes care of it?#2021-01-2007:58pezThe full Calva comand line in our project looks like so:
lein update-in :dependencies conj '[nrepl,"0.8.3"]' -- update-in :dependencies conj '[clj-kondo,"2020.04.05"]' -- update-in :dependencies conj '[cider/piggieback,"0.5.2"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.25.6"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.piggieback/wrap-cljs-repl"]' -- with-profile +test,+dev,+script repl :headless
Maybe it is overkill, but it works. 😃 With CIDER we got some intermittent piggieback complaints, and I started to suspect that missing middleware injection, but then it is probably something else causing the friction.#2021-01-2022:57NassinCurious, why doesn't WARNING: When invoking clojure.main, use -M show up in the *Messages* buffer when doing cider-jack-in?#2021-01-2022:58dpsuttonit probably shows up in the nrepl buffer. output from the process doesn't really go in messages#2021-01-2023:00Nassinoh ok#2021-01-2023:02dpsuttonwe need to migrate CIDER to use the -M version and let people upgrade#2021-01-2023:02dpsutton-M -m i mean#2021-01-2023:02dpsuttonthere's a ticket i need to do with aliases and mains as well. probably do both PRs at the same time#2021-01-2023:03NassinCool, guess it harmless for now#2021-01-2023:04dpsuttonyeah. its just a warning#2021-01-2023:04Nassinis this the issue? https://github.com/clojure-emacs/cider/issues/2941#2021-01-2023:04dpsuttonand not a warning about the program is in an unknown state but just its changing and won't support it in the future but its fine for now#2021-01-2023:04dpsuttonyeah that's the one. you interested in working on it?#2021-01-2023:05dpsuttoni think it won't be bad at all. just a bit of string editing#2021-01-2023:05dpsuttoni'm happy to help with questions. and in fact i think its so simple that i could do it independently so i make sure to think of all the possible pitfalls and help you through you landing the PR if you like#2021-01-2023:05dpsuttonmore contributors = better CIDER#2021-01-2023:07NassinI could take a look, my emacs foo is very limited at this stage but I'll take you on the 'help with questions' 😉#2021-01-2023:08dpsuttontotally. feel free to ping me here. there's also a discord server that you could join. its kinda more geared towards dev stuff so this would be perfect for you to ask questions there too#2021-01-2023:09NassinThere needs to be some clojure cli tool version detection I guess? to not break old versions#2021-01-2023:11Nassinlike -M -m won't work with older versions#2021-01-2023:11dpsuttonthere's no good way to do it. you'd have to grep the version out of a bunch of stuff. i imagine we just go towards the most current behavior and ask people update#2021-01-2023:12Nassinok#2021-01-2023:13dpsuttonyeah. but that's kinda inevitable. CIDER can't work with lein 2.7.3. you're kinda expected to upgrade. And the clojure cli tools are developed by Alex so changes are thoughtful and no backwards breaking changing (in theory. there have been some but Alex is awesome and thoughtful and this isn't a big problem at all)#2021-01-2023:15Nassinfair#2021-01-2104:01richiardiandreaHi there, let's say I want to embed my nrepl in the app. Then I want to be able to connect to it from either Calva or Cider (depending on the developer). Do they both support .nrepl.port?#2021-01-2104:01richiardiandreaand yes, it seems like I am back to doing Clojure 🎉#2021-01-2104:27dpsuttonare you asking if starting an nrepl server uses the port found in .nrepl.port or if when it starts it will write a file with the port its using into .nrepl.port#2021-01-2104:56richiardiandreaI think I answered by checking the start-server implementation...it does not save the file automatically unless launched via cmd line...
I was more wondering if both editors can read that file#2021-01-2106:38pezCalva looks for different nrepl port files depending on project type. This can also be configured using custom connect sequences: https://calva.io/connect-sequences/#2021-01-2106:40dpsuttoni thought CIDER just watches the server output for a regex to grab the port. when you cider-connect it will just ask i thought. forgot how that works and if it actively looks for that file on cider-connect#2021-01-2106:42dpsuttonyeah cider will look for that file if it exists#2021-01-2107:00dpsuttoni'm guessing its just the port in there? should be simple enough to spit that out when you start your server if you want#2021-01-2107:00dpsuttonthere's a delete on done option for files that will make sure to clean it up too to prevent it from laying around#2021-01-2116:16richiardiandreathank you both, I did not notice that Calva page 😄#2021-01-2116:18richiardiandreathere might be an issue in the different spelling though...
I see nrepl.port in calva but .nrepl-port in https://github.com/nrepl/nrepl/blob/565cc075dc8ba1179e0a9d6b4ef8eb6ae9d47f54/src/clojure/nrepl/cmdline.clj#L420
I know it's configurable but it might be worth using the same name#2021-01-2116:22pezWhere in Calva do you see nrepl-port?#2021-01-2116:22pezAlso, is there a reason you are not using jack-in?#2021-01-2116:44richiardiandreaabout the latter, yes - there is a lot of output from the app and a terminal suits us better 😄#2021-01-2116:44richiardiandreaabout the first question - maybe there is a mistake in that doc cause I see the right name under "Connecting"#2021-01-2116:45richiardiandreafound -> here it says nrepl.port https://calva.io/connect-sequences/#settings-for-adding-custom-sequences#2021-01-2117:00richiardiandreaJust FYI it does not see that customizing the REPL port file works#2021-01-2117:01dpsuttonwhat are you doing?#2021-01-2117:02richiardiandreaoh it does ... sorry I needed a vector lol#2021-01-2117:02richiardiandreathis works "nReplPortFile": [".nrepl-port"],#2021-01-2117:02dpsuttonoh for customizing calva?#2021-01-2117:10pezA bit of bad naming there…#2021-01-2117:20pez@U0C8489U6 The only place I see nrepl-port mentioned is for shadow-cljs, which actually names it like that. Is there some other place it says that?#2021-01-2117:21richiardiandreathat's the only place I saw that - and it confused me but maybe it's just me ... 😄#2021-01-2117:21richiardiandreaI have everything fully working and very smoothly now 😄#2021-01-2117:21pezAwesome!#2021-01-2117:22richiardiandrea@U11BV7MTK yes my app now launches the nrepl server and writes the file (in dev mode). Calva picks the port from it when doing Connect to an existing REPL in project#2021-01-2117:23pezThe internal terminal i VS Code is pretty good, btw. And there is this button where it can be maximized and restored quickly. So to me jack-in makes sense since it uses this terminal. Just sayn’ 😃#2021-01-2117:25richiardiandreaI like that you can customize the project name thanks to calva.replConnectSequences#2021-01-2117:25richiardiandreavery nice to your lil' custom menu 😄#2021-01-2118:42richiardiandreaoh I found it also here
https://github.com/BetterThanTomorrow/calva/blob/published/src/nrepl/connectSequence.ts#L126#2021-01-2116:18richiardiandreathere might be an issue in the different spelling though...
I see nrepl.port in calva but .nrepl-port in https://github.com/nrepl/nrepl/blob/565cc075dc8ba1179e0a9d6b4ef8eb6ae9d47f54/src/clojure/nrepl/cmdline.clj#L420
I know it's configurable but it might be worth using the same name#2021-01-2301:03AlexHey guys, has anyone gotten the fulcro RAD demo, https://github.com/fulcrologic/fulcro-rad-demo/tree/develop, setup w/ emacs?
I was looking for some guidance if you did.#2021-01-2301:16dpsuttonwhat issues are you having? Seems straightforward as its a shadow project on the frontend and just a clj project on the backend. Sounds like the only bit that might be a little confusing for someone is how to get the dev and datomic aliases involved. but if you do jack in with a prefix you can manually add those in. and there's an easy way to add them to dir locals so they are there automatically#2021-01-2305:20Alex@dpsutton thanks, and yes the bit that I wasn't sure how to do was involving the dev and datomic aliases. How do I jack in w/ a prefix?#2021-01-2305:37Alex@dpsutton nvm I got it, thanks for the help 🙂#2021-01-2306:48dpsuttonGlad it worked out. I was sim racing so didn’t see your messages :)#2021-01-2406:14stuartrexkingI’m getting an Unhandled REPL handler exception in the cider repl window when I start to type any symbol https://gist.github.com/stuartrexking/21be30e6d40691be603a248ccc8b51e9#2021-01-2406:14stuartrexkingIt’s related to eldoc but it’s not clear to me what’s causing it.#2021-01-2406:18stuartrexkingI’ve put the nrepl-messages output here https://gist.github.com/stuartrexking/cdd0614ed746c60b38c7e9bfb76f7998#2021-01-2406:23stuartrexkingThe exception is thrown on almost every character.#2021-01-2406:24dpsuttoncan you recreate this on a repl with no dependenies? deps.edn just {} and jack in?#2021-01-2406:28stuartrexking~No.~ Yes#2021-01-2406:46dpsuttonhmm. identifying the smallest deps required to make this error would be helpful but i understand if in a large project that's not easy to do#2021-01-2406:52stuartrexkingIs it an error in the application code that’s simply being bubbled up to cider, or could it be a cider issue. Hard to tell here.#2021-01-2407:06stuartrexkingActually, no, that’s not true. It does reproduce on a barebones deps.edn. The exception just takes longer to appear.#2021-01-2407:08stuartrexkingThis is the startup command that’s being run on jack-in with an empty deps.edn
Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.7"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'#2021-01-2407:28stuartrexkingThe exception is also thrown when I cider-jack-in-default#2021-01-2407:47dpsuttonIt appears to be cider tooling that’s blowing up. If you open an issue with these stack traces people will look at it#2021-01-2407:49bozhidarMight be some regression related to this fix https://github.com/clojure-emacs/orchard/commit/fd99c15f962b085e3da7c451eedcb31f7a12c4f6#2021-01-2407:50bozhidarI don't see any recent changes that might be related. At any rate - it'd be best to file a ticket with Orchard. Potentially you can try to set the inject middleware to 0.25.6 and see if this will fix the problem for you for the time being.#2021-01-2407:51bozhidarLooking at the second gist, it's definitely something to do with the change I mentioned.#2021-01-2408:02stuartrexkingYeah, no exception when I rollback to 0.25.6#2021-01-2408:02stuartrexkingThanks. I’ll open an issue with Orchard.#2021-01-2507:42bozhidar@stuartrexking I've just cut 0.25.8 that should fix the issue you encountered.#2021-01-2511:33stuartrexkingWonderful thanks.#2021-01-2513:18Sampo ToivaHi there! I'm hitting an issue where e.g. cider-eval-last-sexp timeouts and throws nrepl-send-sync-request: Sync nREPL request timed out.
cider-eval-ns-form works as expected, same goes for cider-ns-refresh . Also, code run directly in REPL works as expected. Only when evaluating code directly from clj buffer, I'm hitting that issue. Even simple forms like (+ 1 1) will fail.
Emacs version 27.1
Cider version 20210125.740
Any ideas on how I could fix this or debug this further?#2021-01-2513:23Sampo ToivaRestarting nrepl seems to fix this occasionally.#2021-01-2520:49bozhidarA more detailed stacktrace would be useful. This timeout is just the result of something else going wrong.#2021-01-2607:15Sampo Toiva@U051BLM8F I turned on debug-on-error and here's the result for evaluating (+ 1 1) in just restarted REPL: https://gist.github.com/sktoiva/6811288773ebf6c15055b6f334f1ab08
That's inside a project, and I've yet to test will this manifest in a simpler setup.#2021-01-2607:54blak3mill3rhave you tried disabling eval-sexp-fu-flash ?#2021-01-2609:10Sampo ToivaNope, not yet. Good idea.#2021-01-2607:46kirill.salykin@dpsutton thank you so much for the MR#2021-01-2608:02kirill.salykinmaybe something wrong with my setup,
currently jack-in uses this command:
/usr/local/bin/clojure -A:dev:test -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.8"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"cider.nrepl/cider-middleware\"]"]}}}' -M:cider/nrepl
which seems correct, but it still runs the kaocha runner, not plain cider#2021-01-2614:16dpsuttonhttps://github.com/clojure-emacs/cider/pull/2971#2021-01-2614:17kirill.salykini see, thank you so much for work you do!#2021-01-2614:17dpsuttonmy pleasure! sorry my first fix didn't actually, you know, fix it 🙂#2021-01-2614:18kirill.salykinnp, i didnt make any fix at all…#2021-01-2614:21dpsuttonearly testing and feedback is an incredibly useful thing. so thanks for that!#2021-01-2614:21kirill.salykinhappy to help#2021-01-2621:42kirill.salykinYour fix seems eorking for me (did quick test)#2021-01-2621:42kirill.salykinThank you so much!#2021-01-2611:59andrea.crottihappened already a few times in the last days that the cider repl goes read-only#2021-01-2611:59andrea.crottinot sure if it's something I do, but things like company and eldoc start failing since they can't write on the buffer#2021-01-2612:00andrea.crottiit's weird though , read-only doesn't seem enabled, and if I enable and disable it again it still fails in the same way#2021-01-2612:00andrea.crottinot too sure about what it is triggering it, but possibly evaluating something#2021-01-2614:53dpsutton@andrea.crotti never seen this behavior before. make an issue and see if others chime in having seen it as well?#2021-01-2616:57andrea.crottimm yeah I would like to understand how to make it happen first#2021-01-2711:41andrea.crottimm it happened again, a whole bucnh of buffers become read only#2021-01-2711:41andrea.crottilike `cider-repl--history-read: Text is read only#2021-01-2711:41andrea.crottiand I can't even restart cider I have to restart Emacs#2021-01-2715:23andrea.crottiok apparently text read onl it's not related to the buffers, it's a property that somehow got set to some text#2021-01-2715:23andrea.crottiI almost suspect that somhow I trigger that with some magic combination#2021-01-2616:57andrea.crottimaybe it's not related with cider at all#2021-01-2617:17valsenHi! new emacs and cider user here..
Having some issues when being connected to two repls simultaneously (one for my clojure cli/deps files and the other for shadow-cljs, all in the same project). Evaluating expressions from a source buffer only works for the most recently active repl. So when switching to a buffer connected to the other repl, evaluation doesn’t work and I’m getting the “no cljs REPLs in current session…” message. If I then quickly switch over to the repl buffer I’m targeting, and then back to the source buffer, it works again.
Is there some trick I can use to make cider automatically know which repl to use based on which file/buffer I’m in?#2021-01-2617:22dpsuttonunfortunately not at the moment. an open ticket to fix this and it'll be my next fix: https://github.com/clojure-emacs/cider/issues/2946#issuecomment-767507779#2021-01-2617:24valsenI should have browsed through the issues there, sorry about that and thanks for the link:)#2021-01-2617:28valsenReally looking forward to that fix!:) I haven’t yet found any editor or IDE that manages to handle this yet. At first I was using IntelliJ and Cursive, but moved away from it when I stopped using Leiningen. Currently trying out both emacs with cider and Atom with chlorine. Atom/chlorine is really slick and easier for emacs noobs like me, but chlorine can only handle one single repl connection…#2021-01-2617:30dpsuttonfor sure. multiple connections is a tricky problem. and since emacs doesn't make different instances for different projects its a bit harder in CIDER. but we make the effort and this shouldn't be a terrible change#2021-01-2617:33valsenLet me know if I can be of any help! Not sure what skills or tools are needed to contribute, but I’m a MSc student in computer science so have some general coding skills I guess:sweat_smile:#2021-01-2618:01dpsuttonwell awesome. if you follow that linked thread and google up about how to step through emacs lisp you have all the tools you need#2021-01-2617:23dpsuttonoops. linked a comment rather than the issue#2021-01-2621:56blak3mill3rDoes anybody know if it is possible to recover the redirected *out* behavior of an nREPL connection which was closed (due to a dead SSH tunnel)? The messages are still being redirected (they are not going to STDOUT of the repl server process), but they aren't going to a new CIDER repl buffer either when the connection is reestablished. Looking at https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj I thought that (after an eval op) the redirected output should arrive in the new CIDER repl buffer.#2021-01-2715:39csgerolooks like the latest changes in orchard around the classloader broke namespace refreshing#2021-01-2715:39csgerocider-ns-refresh doesn’t refresh anything#2021-01-2715:40csgeroI tracked it down to (clojure.java.classpath/classpath-directories) returning an empty list#2021-01-2715:42csgeroreverting to cider 0.25.5 fixes the issue#2021-01-2718:01DerekIs there a size limit to the inspect feature? As in above a certain size, inspect will consider it a string?#2021-01-2718:06Eamonn SullivanGood evening/afternoon/morning. In the last few days, I've started to see stack traces showing up in the REPL as I'm typing in the source buffer. They seem to be coming from attempts to understand what I'm typing. I had not seen these before. For example, I start typing (defprotocol SomeComponent... and the REPL will show a big red stack trace that starts with something like ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns my.component-lib, :sym SomeComponent, :session bbb91b00-f76e-43ea-9a63-ab68b1ab39f0, :id 95}... . I'm running in emacs 28.0.50 (the native compilation branch) with straight.el (so the main branch of everything), which often means I see issues earlier than most. But I don't know where to start looking. Cider says it's running:
;; Connected to nREPL server -
;; CIDER 1.1.0snapshot, nREPL 0.8.3
;; Clojure 1.10.2, Java 1.8.0_282
Any ideas where I can start looking? The eldoc in the stack trace might be a clue, I guess.#2021-01-2718:11Eamonn SullivanIt does seem to happen every time I'm typing an (as yet) undefined symbol, but I don't think I should be seeing the stack trace when eldoc can't recognise the symbol.#2021-01-2718:14Eamonn SullivanAh, I think these might related to eldoc-mode, which I have turned on in Clojure buffers. If I turn it off, they stop.#2021-01-2718:17Eamonn SullivanI have something like the following in my emacs config, which I probably copied from the cider docs a long time ago...
(use-package
cider
:hook ((clojure-mode . turn-on-eldoc-mode)
(clojure-mode . cider-mode))#2021-01-2718:23Eamonn SullivanThis might also be helpful:
;; Startup: /home/linuxbrew/.linuxbrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.8"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}}}' -M:cider/nrepl#2021-01-2718:28Eamonn SullivanEven if I remove that hook, eldoc mode seems to be enabled automatically? Is that right? I have to turn it off explicitly.#2021-01-2803:04stuartrexkingThis was fixed recently in this update https://github.com/clojure-emacs/cider/commit/a16ec7b19cac7997ab2adda7b158374f9391baeb#2021-01-2803:06stuartrexkingThere was a commit in orchard that broke the class loader. https://github.com/clojure-emacs/orchard/commit/fd99c15f962b085e3da7c451eedcb31f7a12c4f6#2021-01-2803:06stuartrexkingI haven’t tried 0.25.8. I’m using 0.25.6.#2021-01-2803:07stuartrexkingSee this conversation https://clojurians.slack.com/archives/C0617A8PQ/p1611468866016600#2021-01-2806:19Eamonn SullivanAh, yikes, sorry. I didn’t see the earlier conversation. I wonder why I’m still getting this in 25.8, though. :thinking_face:#2021-01-2805:19stuartrexkingI can connect to a shadow-cljs nrepl and execute code from the repl window (js/alert etc). When I try to evaluate code, it fails. The repl is “pending-cljs” in the buffer window. Any ideas on how to figure out how to evaluate from code in cljs with shadow?#2021-01-2805:20stuartrexkingAlso, when I’m in a clojurescript file i get cider[not connected]#2021-01-2806:55David PhamDo you have the latest version of cider and shadow-cljs? If yes, insure you have nrepl/piggieback as dependency #2021-01-2806:56David Pham[this how I solved a similar problem in the past{#2021-01-2807:19bozhidar@neo2551 Technically speaking, shadow-cljs doesn't use piggieback - it implements its own version of it.#2021-01-2807:20David PhamOkay! Thanks for the details :) but I did have the same problem, and it was solved by just adding the deps [maybe just correlation]. #2021-01-2807:21David PhamOne day I should start getting interested in my tools, but I fear so much :)#2021-01-2807:21David PhamI still can’t understand how to make an async call with cider to the repl haha#2021-01-2807:24bozhidarVia the API?#2021-01-2821:02kingcodeHello! I have been trying to write a fn which pages through a seq of items, and pauses b/w page-size items: what is the simplest way to read a single char from the console? I have tried (read), and various use cases of jline and http://java.io readers, but most of the time the readers destroy my cider session, or I have to enter an entire clojure form + Enter, etc…any ideas? Thx!#2021-01-2821:04FiVoHave you tried read-line?#2021-01-2821:08kingcodeI was trying to trigger a reaction on a single keystroke, but will use that if nothing else works..#2021-01-2821:09kingcodeThe ideal would be a read-char 🙂#2021-01-2821:09kingcodeThx @finn.volkel#2021-01-2821:10kingcodeI was curious to see if clojure-lanterna/curses might do the trick, but there is a learning curve and use warnings#2021-01-2821:13FiVoYou can also do (.read *in*) but in both cases you also need to press enter.#2021-01-2821:15kingcode@finn.volkel (read-line) works ..but I am wondering what it does to work smoothly as opposed to trying to implement a ’read-char…#2021-01-2821:19FiVoI am having a project (think git) where the the .dir-locals.el is not sitting at the root. I am starting emacs from the dir that contains .dir-locals.el but normal jack-in does not seem to pick it up. I checked default-directory is set to the dir that contains .dir-locals.el . When I do a jack in from a dired buffer that contains the .dir-locals.el everything works as expected. Where does Cider normally try to start a project from? Can this be configured ?#2021-01-2916:51Eamonn SullivanHi, I'm still getting the eldoc-related unhandled exception issue mentioned https://clojurians.slack.com/archives/C0617A8PQ/p1611770789065300 and https://clojurians.slack.com/archives/C0617A8PQ/p1611468866016600. I'm running
;; Connected to nREPL server -
;; CIDER 1.1.0snapshot, nREPL 0.8.3
;; Clojure 1.10.2, Java 1.8.0_282
and
Startup: /home/linuxbrew/.linuxbrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.8"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}}}' -M:cider/nrepl
It's making cider almost unusable, because I'm getting these stack traces spewing in my REPL buffer periodically and repeatedly. I'm using emacs 28.0.50 (native comp) and straight.el. I have pulled the latest cider, etc. https://clojurians.slack.com/archives/C0617A8PQ/p1611560524027400 suggest that the issue is fixed, but that's not what I'm seeing. Do I have to be on a particular branch or something?#2021-01-2917:00dpsuttoni'd probably try (setq cider-required-middleware-version "0.25.6") . I think 25.7 is where it started and 25.8 is what you're saying is still problematic#2021-01-2917:01dpsuttonalso, maybe try without refactor involved. i wonder if that's interacting in a weird way? I have no idea if that's even plausible but just try to whittle the problem down#2021-01-2917:03Eamonn SullivanI just restarted/jacked in again, but using Java 11 (instead of 8 ) and I haven't seen a stack in a few minutes now... 🤞 . I wonder if, weirdly, that has something to do with it...#2021-01-2917:08dpsuttonquite possibly. the issues they are working around are quite technical and tricky and fundamentally relate to changes in the jvm i believe#2021-01-2917:10Eamonn SullivanThanks. That'll do as a workaround for now. I normally use Java 11 for Clojure stuff, but need to use Java 8 for all of our Scala services and libraries (my actual day job). I just frequently forget to do a sudo update-alternatives --config java before starting Clojure. This will certainly act as a reminder! 🙂#2021-01-2917:24Eamonn SullivanIs there an issue I can track?#2021-01-2917:26Eamonn SullivanI see them. They already know it's a Java 8 and 9 issue, it seems.#2021-01-3008:09bozhidarBtw, it's best to report your problems upstream instead of in the chat - I don't pay much attention to it and often problems go unnoticed for a while without tickets attached to them.#2021-01-3016:16Eamonn Sullivan@U051BLM8F, thanks. I was just posting here to see if this was a known issue already. As you know (I've raised issues on your one of your repos not too long ago), I'm not shy about that!
Let me know if I can help at all on that issue. I've subscribed. I seem to be able to turn the problem on and off easily by switching between Java 8 and 11, so maybe I have some set up that could shed some light.#2021-01-3016:17bozhidarPlease, share this on the ticket. Every data point is important.#2021-01-3008:47bozhidar@eamonn.sullivan See https://github.com/clojure-emacs/orchard/issues/103#2021-01-3008:48bozhidarJeff felt that this is fixed on Clojure CLI, but I haven't had time to verify this.#2021-01-3008:49bozhidarI'm pretty sure Jeff tested this on Java 8, so I'm wondering why he didn't experience the problem.#2021-01-3104:23bmaddyI'm trying to cider-connect-cljs with a running shadow-cljs repl. It connects and the repl works great. However, when I try to cider-switch-to-repl-buffer in a cljs file in my project, I get this:
user-error: No cljs REPLs in current session "ti/fulcro-rad-demo:localhost:9000"
I've almost always used the jack-in method in the past, so I suspect there's something simple I'm missing here. Does anyone know what it might be?
(versions: emacs = 27.1, spacemacs = /cdn-cgi/l/email-protection, cider = 1.1.0snapshot, shadow-cljs = 2.11.8)#2021-01-3104:24dpsuttonif you put your cursor in the cljs repl buffer and then back into your source buffer then cider-switch-to-repl-buffer does it work?#2021-01-3104:25dpsuttonhttps://github.com/clojure-emacs/cider/issues/2946#2021-01-3104:25bmaddyNope, it still doesn't work when I do that.#2021-01-3104:26bmaddyI saw that issue in the scrollback (you posted it). I figured it didn't apply since I only have the one repl running (which I should have mentioned).#2021-01-3104:29dpsuttonah ok. interesting. let me see if i can repro#2021-01-3104:32dpsuttonhmm. works for me.#2021-01-3104:33dpsuttonthink you can put up a simple repro and create an issue? tinies thing possible#2021-01-3104:33dpsuttonand have you updated to most recent CIDER?#2021-01-3104:33bmaddyI updated today.#2021-01-3104:34dpsuttonany chance you're dealing with docker stuff? is the shadow server local?#2021-01-3104:35bmaddyNope, no docker. I realized I haven't restarted emacs in a while...trying that.#2021-01-3104:40bmaddyNo luck, same issue. I'm trying to play around with https://github.com/fulcrologic/fulcro-rad-demo. I've never used shadow before, but I could probably figure out how to set up a minimal cljs project. I doubt I'll get that done tonight though--it's getting late where I am.#2021-01-3105:25bmaddyHere's a pretty minimal setup: https://github.com/bmaddy/minimal-shadow-cljs-nodejs
I start it with yarn shadow-cljs watch app and then run/choose the following in emacs:
cider-connect-cljs
localhost
9000
shadow
node-repl
cider-switch-to-repl-buffer from the src/server/main.cljs file gives me this:
user-error: No cljs REPLs in current session "2021/minimal-shadow-cljs-nodejs:localhost:9000"
#2021-01-3105:42dpsuttonok. so i did two different ways:
first way: cider-jack-in-clojurescript
1. cider-jack-in-clojurescript, choose shadow then the app build. run "node target/main.js" to get the repl up. When i was in the shadow-cljs.edn file i ran cider-switch-to-repl-buffer and was told there are no *clj* buffers. going to server/main.cljs and tried again and it worked.
The other way i tried:
npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/piggieback:0.5.2 -d cider/cider-nrepl:0.25.8 server
npx shadow-cljs watch app # from another terminal
node target/main.js
cider-connect-cljs from main.cljs ns
cider-switch-to-repl-buffer
it worked
So i can get it to work both if i use cider-connect and also cider-jack-in. The one issue i can see that might be confusing is if your cursor (point) is in the shadow-cljs.edn file it complains that there are no clj buffers, as its assuming you want a clj repl (not cljs) when visiting an edn file. It really out to take the first available, or perhaps be smart enough that shadow is cljs really and just try that rather than the clj repl#2021-01-3105:43dpsuttonso i suspect you are running m-x cider-switch-to-repl-buffer from an edn file and not getting your repl. Have you tried from src/server/main.cljs?#2021-01-3113:14bmaddyomg that worked! I'm shocked that you have to start three separate proceses. Thank you so much for your help, @dpsutton!#2021-02-0204:36bmaddyIt turns out I spoke too soon on this. The minimal node version worked for me, but when I tried to do it with the fulcro project using a browser repl, I still couldn't get the cljs window to associate with the cljs repl. I ended up finding two things that get it to work:
1. use the repl type shadow-select (not positive this was a requirement, but I'm tired of testing)
2. I was using evil-window-left/`evil-window-right` to switch between the cljs file and cljs repl, but that will not associate them. I had to be in the cljs repl and use cider-switch-to-last-clojure-buffer to make cider-switch-to-repl-buffer associate correctly.#2021-01-3116:36dpsuttonWhen running from the command line , thheller says the server is much faster. Then the watch command is far faster. So it’s kinda shadow that does or or two processes. As for node, there is always this process. You run the browser. That provides the js environment. It just feels different here but it’s not. #2021-02-0109:29thhellerwatch app will start an implicit server if none is running#2021-02-0109:29thhellerthe benefit of separate server is that you can at any point stop and restart the watch without fully restarting the server#2021-02-0109:30thhellerbut otherwise you can just use watch without a separate server too. it is just my workflow to only use server and then do the rest from the UI or REPL#2021-02-0114:35dpsuttonThanks! I didn’t want to ping you and drag you into tooling centric discussions. That’s awesome you commented. Appreciated#2021-02-0204:36bmaddyIt turns out I spoke too soon on this. The minimal node version worked for me, but when I tried to do it with the fulcro project using a browser repl, I still couldn't get the cljs window to associate with the cljs repl. I ended up finding two things that get it to work:
1. use the repl type shadow-select (not positive this was a requirement, but I'm tired of testing)
2. I was using evil-window-left/`evil-window-right` to switch between the cljs file and cljs repl, but that will not associate them. I had to be in the cljs repl and use cider-switch-to-last-clojure-buffer to make cider-switch-to-repl-buffer associate correctly.#2021-02-0109:20bozhidar@dpsutton Feel free to add such tips for shadow-cljs to the docs.#2021-02-0109:20bozhidarI lot a lot of people would appreciate them.#2021-02-0113:53tvaughanWith the recent changes to cider-clojure-cli-parameters and cider-clojure-cli-global-options, how can I pass options like --bind and --port to the clojure cli jack-in command?#2021-02-0117:02bozhidar@tvaughan Good question. 😄 I guess cider-clojure-cli-parameters was the natural place for those.#2021-02-0117:03dpsuttoni doubt there's space for that. those need to be at the end as additional params to the main and i don't think they will work at the moment#2021-02-0117:03tvaughanI am/was doing (cider-clojure-cli-parameters . "-A:toolbox:koacha:kibit:user -M -m nrepl.cmdline --bind 0.0.0.0 --port 5309 --middleware '%s'") in .dir-locals.el#2021-02-0117:07bozhidarI guess now that we separated the aliases we can have a separate var for the params to the actual nREPL CLI. I don't know.#2021-02-0117:07bozhidarIt's hard for me to give advice given that I don't really use tools.deps.#2021-02-0117:10dpsuttoni can fix this tonight. easiest workaround at the moment is to use a prefix when jacking in and add the --bind 0.0.0.0 --port 5309 to the end of the jack in string#2021-02-0117:14tvaughan> i can fix this tonight
Please don't go to extra trouble on my account. I'm using straight.el and just happened to run pull-all today. I've since rolled back. I'm good right now. I'd be happy to create an issue on github, if that would be helpful#2021-02-0117:17dpsuttonwell it needs to be fixed and should have been contemplated in the original change. i was wondering why the middleware was a templated string and now i know 🙂#2021-02-0117:40bozhidarThis had totally slipped my mind as well. I never change the defaults, so I didn't think about the CLI options at all. I guess we need more tests. 🙂#2021-02-0117:40dpsuttoni'll add them tonight. added an issue for this. and the tests should describe all of the pathways through it#2021-02-0203:38jumarIs there a way to show a history of "inspections". That is the previous results in the inspector view.
I basically want to see and be able to navigate the list of previous evaluations
Any other good alternative? (I don't really want to send all the evaluations to the REPL but maybe that's an option)#2021-02-0207:07bozhidarCurrently there's nothing like this, but it wouldn't be hard to store the list of inspected expressions somewhere.#2021-02-0303:56jumarOne workaround could be to have an atom and just save any interesting value there via tap> . I could then inspect the atom.
It's not very convenient but something that could work right now.#2021-02-0303:58jumarI forgot if there's a way to "hook into an evaluation" in Cider; so that I could automatically call tap> every time I do cider-eval-*
Found this but it seems it's missing: https://docs.cider.mx/cider/usage/code_evaluation.html#evaluation-hooks#2021-02-0220:27danielnealI keep getting this error on a mac, with adoptopenjdk 8 java.lang.ClassNotFoundException: com.sun.tools.javac.util.List#2021-02-0220:30dpsuttongot a stack trace?#2021-02-0220:30danielnealyep#2021-02-0220:30danielnealjava.lang.ClassNotFoundException: com.sun.tools.javac.util.List
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invokeStatic(legacy_parser.clj:88)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invoke(legacy_parser.clj:66)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$source_info.invokeStatic(legacy_parser.clj:274)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$source_info.invoke(legacy_parser.clj:265)
at clojure.lang.Var.invoke(Var.java:384)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$source_info.invokeStatic(java.clj:144)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$source_info.invoke(java.clj:139)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$class_info_STAR_.invokeStatic(java.clj:223)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$class_info_STAR_.invoke(java.clj:214)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$class_info.invokeStatic(java.clj:261)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$class_info.invoke(java.clj:253)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$resolve_class.invokeStatic(java.clj:340)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$resolve_class.invoke(java.clj:331)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$resolve_symbol.invokeStatic(java.clj:371)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java$resolve_symbol.invoke(java.clj:357)
at cider.nrepl.middleware.stacktrace$analyze_fn.invokeStatic(stacktrace.clj:84)
at cider.nrepl.middleware.stacktrace$analyze_fn.invoke(stacktrace.clj:63)
at clojure.core$comp$fn__5807.invoke(core.clj:2569)
at clojure.core$comp$fn__5807.invoke(core.clj:2569)
at clojure.core$comp$fn__5807.invoke(core.clj:2569)
at cider.nrepl.middleware.stacktrace$analyze_frame.invokeStatic(stacktrace.clj:180)
at cider.nrepl.middleware.stacktrace$analyze_frame.invoke(stacktrace.clj:177)
at clojure.core$map$fn__5866.invoke(core.clj:2755)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5384.invokeStatic(core.clj:55)
at clojure.core$first__5384.invoke(core.clj:55)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invokeStatic(stacktrace.clj:168)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invoke(stacktrace.clj:164)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invokeStatic(stacktrace.clj:186)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invoke(stacktrace.clj:182)
at cider.nrepl.middleware.stacktrace$analyze_cause.invokeStatic(stacktrace.clj:290)
at cider.nrepl.middleware.stacktrace$analyze_cause.invoke(stacktrace.clj:281)
at cider.nrepl.middleware.stacktrace$analyze_causes$fn__3933.invoke(stacktrace.clj:315)
at clojure.core$map$fn__5862$fn__5863.invoke(core.clj:2742)
at clojure.core$take_while$fn__5913$fn__5914.invoke(core.clj:2901)
at clojure.lang.Iterate.reduce(Iterate.java:81)
at clojure.core$transduce.invokeStatic(core.clj:6883)
at clojure.core$into.invokeStatic(core.clj:6899)
at clojure.core$into.invoke(core.clj:6887)
#2021-02-0220:31danielnealthe class should be in tools.jar#2021-02-0220:31danielnealand tools.jar is there in $JAVA_HOME/lib#2021-02-0220:33dpsuttoncan you create an issue on https://github.com/clojure-emacs/orchard/ ?#2021-02-0220:33danielnealsure, any ideas what might be the problem?#2021-02-0220:33dpsuttonnone at all#2021-02-0220:33danielneal🙂#2021-02-0220:34dpsuttonsorry. but figuring out where sun utility classes are (and should be) is not something i have at my fingertips. would require looking up some stuff to see what expectations are, have they moved, etc.#2021-02-0220:51danielnealAdded an issue here https://github.com/clojure-emacs/orchard/issues/105#2021-02-0220:53Eamonn SullivanThat's a very similar stack trace to what I was getting. I have commented on https://github.com/clojure-emacs/orchard/issues/103. The workaround for me is to use Java 11, if that's an option for you.#2021-02-0221:05danielnealupgrading to java 11 didn't work for me, sadly#2021-02-0221:06danielnealoh wait, emacs is still seeing java 8#2021-02-0221:13danielnealaw man now I'm missing these guys
Caused by java.lang.ClassNotFoundException
javax.xml.bind.DatatypeConverter
#2021-02-0303:48blak3mill3rI have seen this one... though the details elude me#2021-02-0303:49blak3mill3rI switch between Java 8 and 11, having some clojure projects on each... and I can tell you that some dependencies are incompatible with one or the other, and this javax.xml.bind.DatatypeConverter is one that I had seen when I tried to use some dependency that only liked Java 8, with Java 11 (IIRC)#2021-02-0303:49blak3mill3rI was forced to upgrade or downgrade certain dependencies to get around these kind of issues, and to have cider work properly (with a single emacs config) with both java versions#2021-02-0303:50blak3mill3ryou might try updating some older dependencies and see if you can get Java 11 to work#2021-02-0403:20bmaddyEvery time I paste something in, my entire file is auto-indented. Does anyone know how to turn that off? I have aggressive-indent-mode turned off.#2021-02-0403:21bmaddyIf this isn't a cider thing, let me know and I'll ask over in #emacs.#2021-02-0403:53dpsuttonNot aware of anything in cider that would do that#2021-02-0407:11bozhidarMight be some advice to reformat on pasting.#2021-02-0407:12bozhidarIt's certainly not coming from CIDER, though.#2021-02-0411:35olyis there a way to jump to core library code in cider or library code ?#2021-02-0411:35olyso if my cursor is on db/query I want to peak the fn to see what its doing#2021-02-0411:48tvirolaiSure, cider-find-var does that.#2021-02-0412:23olyah cheers exactly what i want, who would have thought find var to find a function 😛#2021-02-0412:28borkdudeBound to M-. usually#2021-02-0412:29olyyeah I just added it to a hydra under ? and labelled it "Show src" else i will be back asking again in a few months 🙂#2021-02-0412:57craftybonesHello. I’m facing a problem similar to the one in this ticket: https://github.com/clojure-emacs/cider/issues/2237#2021-02-0412:58craftybonesHowever, I’m on
;; CIDER 0.25.0snapshot (package: 20200602.710), nREPL 0.7.0
;; Clojure 1.10.1, Java 14.0.2
#2021-02-0412:58craftybonesI’m using Spacemacs#2021-02-0413:00craftybonesI evaluate anything that throws an exception and the dialog shows up 1 second later, maybe more#2021-02-0413:01craftybonesI’ve accidentally ended up exiting emacs a few times as a consequence 🙂#2021-02-0413:02craftybonesDoes anybody have a suggestion other than upgrading packages? That is a last resort…#2021-02-0413:23craftybonesAh, alright, Ignore, I gave up and upgraded, the Cider version certainly seemed old. Seems to have fixed it#2021-02-0420:55LukasHello, I use emacs/cider and have a clojurescript project build with shadow cljs. I connected to the nrepl server, but I'm not able to send s-expressions to
the repl with C-c C-e like I normally do. Can anybody help me with this?#2021-02-0420:58dpsuttonwhat happens when you hit C-c C-e?#2021-02-0420:59Lukasnothing it just hangs#2021-02-0421:00Lukas#2021-02-0421:01LukasI use doom emacs if this helps#2021-02-0421:01Lukasjust to add I'm a emacs noob 😇#2021-02-0421:01dpsuttonis this a webapp? If so, evaluate (js/alert "HI") to prove you're actually in a cljs repl#2021-02-0421:03Lukasthis works after i switch the namespace (shadow.cljs.devtools.api/repl :app)#2021-02-0421:03Lukasbut C-c C-e still does nothing#2021-02-0421:04dpsuttonhow did you connect? cider-connect-cljs and then chose shadow-select?#2021-02-0421:05Lukascider-connect-cljs and then select host +port#2021-02-0421:06dpsuttonand how did you start shadow?#2021-02-0421:06Lukasshadow-cljs watch app#2021-02-0421:07dpsuttonand do you have cider-nrepl in your deps?#2021-02-0421:09Lukasi also get some errors on shadow start
[:failed-to-compare "^17.0.1" "17.0.1" #error {
:cause "Cannot invoke \"Object.getClass()\" because \"target\" is null"
:via
[{:type java.lang.NullPointerException
:message "Cannot invoke \"Object.getClass()\" because \"target\" is null"
:at [clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 97]}]
:trace
[[clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 97]
[shadow.cljs.devtools.server.npm_deps$make_engine invokeStatic "npm_deps.clj" 39]
[shadow.cljs.devtools.server.npm_deps$make_engine invoke "npm_deps.clj" 32]
[shadow.cljs.devtools.server.npm_deps$fn__15774$fn__15775 invoke "npm_deps.clj" 46]
[clojure.lang.Delay deref "Delay.java" 42]
[clojure.core$deref invokeStatic "core.clj" 2320]
[clojure.core$deref invoke "core.clj" 2306]
[shadow.cljs.devtools.server.npm_deps$fn__15774$fn__15777 invoke "npm_deps.clj" 52]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invokeStatic "npm_deps.clj" 219]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invoke "npm_deps.clj" 213]
[shadow.cljs.devtools.server.npm_deps$main$fn__15867 invoke "npm_deps.clj" 239]
[clojure.core$complement$fn__5669 invoke "core.clj" 1441]
[clojure.core$filter$fn__5893 invoke "core.clj" 2821]
[clojure.lang.LazySeq sval "LazySeq.java" 42]
[clojure.lang.LazySeq seq "LazySeq.java" 51]
[clojure.lang.RT seq "RT.java" 535]
[clojure.core$seq__5402 invokeStatic "core.clj" 137]
[clojure.core$seq__5402 invoke "core.clj" 137]
[shadow.cljs.devtools.server.npm_deps$main invokeStatic "npm_deps.clj" 241]
[shadow.cljs.devtools.server.npm_deps$main invoke "npm_deps.clj" 228]
[shadow.cljs.devtools.cli_actual$main invokeStatic "cli_actual.clj" 141]
[shadow.cljs.devtools.cli_actual$main doInvoke "cli_actual.clj" 132]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.core$apply invokeStatic "core.clj" 669]
[clojure.core$apply invoke "core.clj" 660]
[shadow.cljs.devtools.cli_actual$_main invokeStatic "cli_actual.clj" 219]
[shadow.cljs.devtools.cli_actual$_main doInvoke "cli_actual.clj" 217]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.core$apply invoke "core.clj" 660]
[shadow.cljs.devtools.cli$_main invokeStatic "cli.clj" 75]
[shadow.cljs.devtools.cli$_main doInvoke "cli.clj" 67]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]]}]
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.9.10 running at
shadow-cljs - nREPL server started on port 42499
shadow-cljs - watching build :app
#2021-02-0421:09Lukasmy shadow-cljs.edn
;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[reagent "1.0.0"]
[cljs-ajax "0.8.1"]
[re-frame "1.1.2"]]
:builds
{:app
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules
{:main
{:init-fn
:entries []}}
:devtools
{:http-root "public"
:http-port 8000}
:nrepl {:port 9000}}}}#2021-02-0421:11Lukas👆there is the :nrepl in the wrong position#2021-02-0421:11Lukasi tried some things before i ask#2021-02-0421:11Lukas;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[reagent "1.0.0"]
[cljs-ajax "0.8.1"]
[re-frame "1.1.2"]]
:builds
{:app
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules
{:main
{:init-fn
:entries []}}
:devtools
{:http-root "public"
:http-port 8000}}}
:nrepl {:port 9000}}#2021-02-0421:07dpsuttonalso, is this a :deps true type project?#2021-02-0421:07Lukasno but i have a deps project in the same folder#2021-02-0421:12dpsuttonso cider will start shadow up like this:
npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/cider-nrepl:0.25.8 server
and then in the repl after connecting:
shadow.user> (require '[shadow.cljs.devtools.api :as shadow])
nil
shadow.user> (shadow/watch :app)
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (174 files, 0 compiled, 0 warnings, 3.87s)
:watching
shadow.user> (js/alert "hi")
Syntax error compiling at (*cider-repl clojure/asg-ignite-app:localhost:58111(clj)*:17:14).
No such namespace: js
shadow.user> (shadow/nrepl-select :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user> (js/alert "hi")
nil
cljs.user>
#2021-02-0421:14Lukasi try this npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/cider-nrepl:0.25.8 server#2021-02-0421:15LukasOkay now cider ask me to select a clojure repl type#2021-02-0421:15Lukasshadow or shadow-select?#2021-02-0421:16dpsuttoni did cider-connect (not the cljs one). but try shadow-select and then choose your build#2021-02-0421:18LukasYou can mute this warning by changing cljr-suppress-middleware-warnings.shadow.user>
shadow.user> (require '[shadow.cljs.devtools.api :as shadow])
;; => nil
shadow.user> (shadow/watch :app)
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (216 files, 215 compiled, 0 warnings, 38.84s)
;; => :watching
shadow.user> (js/alert "hi")
Syntax error compiling at (*cider-repl workspace/listshare:localhost:9000(clj)*:26:14).
No such namespace: js
#2021-02-0421:19LukasBut I guess I have to change the namespace again?#2021-02-0421:19dpsuttonno you have to enter the cljs repl#2021-02-0421:19dpsuttonshadow.user> (shadow/nrepl-select :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user> (js/alert "hi")
nil
#2021-02-0421:19dpsuttonso you're telling shadow to watch :app (compile the cljs files and recompile if they change) and then select that repl (nrepl-select :app)#2021-02-0421:20Lukasyes that worked#2021-02-0421:20Lukasand I also can evaluate now#2021-02-0421:21LukasThanks a lot!!!#2021-02-0421:21dpsuttonglad you got it working!#2021-02-0421:21dpsuttonand my pleasure#2021-02-0421:23LukasAwesome. Took me a lot of time to finally come here and ask. You are a great person just helping randoms on the internet 🙏#2021-02-0421:24dpsuttonalways pop in to ask questions. I had forgotten how this stuff worked and it was helpful to go through it with you. And i was similarly confused earlier today trying to get up locally so you helped me simplify it and hopefully i can get it going toniight#2021-02-0421:29LukasGlad I could also help I guess#2021-02-0511:32rickmoynihanOne small issue I’ve been having with cider is that it seems to take a long time to display the *cider-error* buffer after an exception is raised… any ideas about what might be causing it?#2021-02-0512:33rickmoynihanoh just seen this is mentioned above#2021-02-0512:34rickmoynihanhttps://github.com/clojure-emacs/cider/issues/2237#2021-02-0514:07rickmoynihanI appear to have the same symptom, but not this issue. It was closed ages ago, and it looks like the cider stuff is now asynchronous to that, which means running the profiler as suggested doesn’t instrument it.#2021-02-0519:03jumarI had similar issues and it was also annoying to see get the popup so I disabled it and I only open it manually when needed #2021-02-0513:20twashingI can’t get cider-connect-clj to connect to nrepl.server/start-server.
Details are in this SO question. Anything that I’m missing?
https://stackoverflow.com/questions/66057626/cider-connect-clj-cannot-connect-to-nrepl-server-start-server#2021-02-0519:24bennyIs there a function that takes a string, inserts the string in the repl and evals it? I only found cider-interactive-eval which does the latter part so far#2021-02-0519:27dpsuttoncider-insert-in-repl is a Lisp closure in ‘cider-mode.el’.
(cider-insert-in-repl FORM EVAL)
Insert FORM in the REPL buffer and switch to it.
If EVAL is non-nil the form will also be evaluated. Use
‘cider-invert-insert-eval-p’ to invert this behavior.
#2021-02-0519:44benny@dpsutton thanks!#2021-02-0519:48dpsuttonnot sure if its in this function but there's a switch to repl option that i always disable as well#2021-02-0620:03Lukas👋 Hello, I use pprint C-c C-p all the time. It's one of my favorite features. But there are some objects that doesn't get formatted that well. For example a json string inside the http request map or the app-db in reframe. Does anyone have a workaround for these?#2021-02-0709:15solf@lukas.block
For long strings, nothing cider can do about it. You can check some emacs built-in modes though: toggle-truncate-lines and visual-line-mode.
For app-db, I'm not really sure what's the issue, a screenshot would be good. In general, if the object doesn't pprint nicely, I use cider-inspect (binded to C-c M-i by default)#2021-02-0710:48LukasThank you a lot. I didn't know about cider inspect this is a really helpful enhancement of my work flow 😊#2021-02-0714:30RollACasterHi 👋
I started a shadow-cljs project with:
shadow-cljs watch frontend --config-merge '{:closure-defines {vizards.nobil.core/APIKEY "123"}}'
which works fine but when I try to run cider-connect-cljs, cider tries to run
(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :frontend) (shadow/watch :--config-merge) (shadow/watch :'{:closure-defines {vizards.nobil.core/NOBILKEY "123"}}') (shadow/nrepl-select :frontend))
Is this a bug or do I need to call cider differently?#2021-02-0714:34dpsuttonI’m assuming you have a dir locals file that sets some values. There’s probably a cljs repl type and a startup form in there#2021-02-0714:41RollACasterYes thanks, I deleted my dir locals file and now I get a different error so at least there’s some progress 🙂
I initially tried to configure --config-merge via dir locals but failed to do so, do you know how to configure that properly?#2021-02-0714:51frozenlockIs there a way to make cider display a reagent component arguments? [my-comp arg1 arg2] (eldoc)#2021-02-0714:55dpsuttonWhy did you delete that file. It sounded like it had some goodies in it. But it looks like it’s calling watch twice which is no good#2021-02-0714:56dpsuttonLooks like you just need to tweak the custom cljs command#2021-02-0715:02RollACasterI tried soo many different configurations to make this work in the last hour that deleting the file felt really good 😄
I tried to overwrite the custom cljs command with
((clojurescript-mode . ((cider-shadow-cljs-command . "npx shadow-cljs --config-merge '{:closure-defines {vizards.nobil.core/APIKEY \"123\"}}'"))))
now shadow-cljs starts but closure-defines is not set#2021-02-0715:03dpsuttonah yeah that's no good#2021-02-0715:03dpsutton(setq cider-shadow-cljs-parameters "--config-merge '...'") should do it for you#2021-02-0715:04dpsuttonyou've set the executable to use with cider-shadow-cljs-command.#2021-02-0715:04dpsuttoni've got an issue open to kinda clean all this stuff up#2021-02-0715:04dpsuttonor document it so this is far easier.#2021-02-0715:05dpsuttonbut in general there are knobs for the-actual-executable some-options middleware stuff cider-does-stuff-here final-options-passed-in and you just want some final trailing options so that's what you want#2021-02-0715:07RollACasterBut cider-shadow-cljs-parameters is set to server if I replace it with parameters no supported shadow-cljs action is found#2021-02-0715:09dpsuttonyou custom set it to server?#2021-02-0715:10RollACasterNo server is the default (https://docs.cider.mx/cider/1.0/cljs/shadow-cljs.html)#2021-02-0715:11RollACaster(I also tried (setq cider-shadow-cljs-parameters "server --config-merge '{:closure-defines {vizards.nobil.core/APIKEY \"123\"}}'") but this is ignored as well)#2021-02-0715:11dpsutton(just a heads up your api key may be public above)#2021-02-0715:13dpsuttonok. give me one second to go see how shadow expects this. in the meantime some dir locals like the following should work
((nil . ((cider-default-cljs-repl . custom)
(cider-custom-cljs-repl-init-form .
"(do (require '[shadow.cljs.devtools.api :as shadow])
(shadow/watch :your-app {:config :here})
(shadow/nrepl-select :your-app))"))))#2021-02-0715:16dpsuttonok. i'm guessing you can't pass a config merge in to server as config is per build, not global?#2021-02-0715:18dpsuttonpossibly the easiest thing to do:
1. in a terminal run the exact watch command you want with the config-merge. ensure that cider/nrepl is on the command line -d cider/cider-nrepl "0.25.8". There should be an example at the top of repls of the jack-in command.
2. cider-connect-cljs and choose shadow-select and the watched build#2021-02-0908:03RollACasterI finally made it work with shadow-select thanks!
(I did not work work with the custom REPL since my REPL tried to evaluate my closure-defines variable which does only exist in the cljs REPL but not in the clj REPL. I tried to quote it but this resulted in closure-defines being ignored. But at least it works with shadow-select 🙂 )#2021-02-0715:27RollACasterNo I am still not able to make it work 🙈 Unfortunatly I have to leave now.
But I am sure it will work by following your instructions when I stop programming in anger and rechecking all my local setup 😁
Thanks so much for your help I will retry it tomorrow#2021-02-0722:59jobo3208hi all, i'm using cider-nrepl via vim-fireplace for cljs development. i'm having some trouble with commands that use the info op. basically when i have the following ns:
(ns my-ns.spec
(:require
[clojure.spec.alpha :as s :refer-macros [coll-of]]))
and i do an info op for coll-of, it works as expected:
send: {"ns": "my-ns.spec", "symbol": "coll-of", "op": "info", ...}
receive: {"status": ["done"], "doc": "Returns a spec..."}
however, when i don't refer coll-of directly, the info op fails for s/coll-of:
(ns my-ns.spec
(:require
[clojure.spec.alpha :as s :include-macros true]))
send: {"ns": "my-ns.spec", "symbol": "s/coll-of", "op": "info", ...}
receive: {"status": ["done", "no-info"], ...}
the problem only seems to happen for macros; it works fine for e.g. s/explain. i'm also able to eval code with s/coll-of with no problem. it just seems to be a problem with the info op.
am i doing something wrong?#2021-02-0810:58michalhey, a quick question (setq cider-test-show-report-on-success t) pops up test report on success, but disabling it hides any indication that test ended (if ended successfully). is there any way to get at least a green indicator below?#2021-02-0812:50borkdudeSince this morning I can't cider-connect to my REPL anymore :/#2021-02-0812:50borkdudeSymbol’s function definition is void: seq-contains-p
#2021-02-0813:01borkdudeUpgrading to emacs 27 worked (finally had a reason to do it)#2021-02-0815:44bozhidarUpdating the seq.el package will solve the problem as well.#2021-02-0815:45bozhidarI just assumed that most people update all their packages like me, when I made that change (to address a deprecation warning). Clearly I was mistaken. 😄#2021-02-0815:50borkdudeI tried this, but it didn't work#2021-02-0815:51borkdudebut it's solved now so I withdraw my complaint. running 27 now ;)#2021-02-0815:51bozhidarThat’s weird. The package in ELPA should even newer than the one in Emacs 27.#2021-02-0815:51borkdudeyeah, don't know#2021-02-0815:51bozhidarWell, yeah, I guess you got bonus features in the end.#2021-02-0912:28rickmoynihanAnother data point on the slow *cider-error* buffer I mentioned here:
https://clojurians.slack.com/archives/C0617A8PQ/p1612524777180800
… it’s also slow to popup if an exception occurs when running tests with cider and I click to inspect the stacktrace in the *cider-test-report*, that buffer takes maybe 10 seconds to open.#2021-02-0914:44dpsuttonpeople have chimed in with that and then upgraded and the issue has gone away. are you in a position where you can upgrade @rickmoynihan?#2021-02-0914:46rickmoynihanAs far as I know I’m on a pretty recent release cider/cider-nrepl {:mvn/version "0.25.2"} and in emacs cider , and emacs 27.1#2021-02-0914:52dpsuttoni think when people reported it they upgraded to 25.8 and it went away#2021-02-0914:53rickmoynihan👀#2021-02-0914:56rickmoynihanok didn’t realise there was a 25.8; but thought the issue was closed a few years back…
I’ll try upgrading anyway, thanks.#2021-02-0914:58dpsuttonsorry i don't have information about what the actual cause was. but people were noticing this and then saying it went away when upgrading is all i know 🙂#2021-02-0915:03rickmoynihanok that seems to have fixed it! Thanks @dpsutton 🙇#2021-02-0915:04dpsuttonit was someone else's fix 🙂 but glad it's back up to speed. slow buffers are such a pain#2021-02-0915:58bozhidarFYI - the actual fix is in Orchard 0.6.2 / cider-nrepl 0.25.6 (https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0256-2021-01-04)#2021-02-0915:58bozhidarI see this frequently comes up here, so I decided to give people a bit more context.#2021-02-0916:59rickmoynihanThanks @bozhidar 🙇#2021-02-1012:40jmckitrickIf I'm in a cljs file buffer connected to cider, but there's no browser cljs runtime, is there a fallback autocomplete that would work statically?#2021-02-1014:30dpsuttonLsp #2021-02-1020:53waffletowerI am trying to figure out if the there is a deps.edn accessible hook to start a CIDER friendly nrepl with initialization evaluation (like leiningen injections) via clojure CLI.#2021-02-1020:54waffletowerAlex Miller posted this helpful guide to injection like behavior: https://insideclojure.org/2020/02/11/custom-repl/#2021-02-1020:55waffletowerBut I am having difficulty figuring out how to do this and combine it with the nrepl middleware CIDER depends upon:#2021-02-1020:55waffletower:cider {:extra-deps {nrepl/nrepl {:mvn/version "0.7.0"}
refactor-nrepl {:mvn/version "2.5.0"}
cider/cider-nrepl {:mvn/version "0.25.1"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}#2021-02-1020:58waffletowerIs there some facility within nrepl.cmdline to provide an eval hook? Or am I just missing how to combine what Alex suggests with nrepl.cmdline? They seem mutually exclusive to me and don't work through alias chaining, as only the last clojure.main code will be evaluated.#2021-02-1106:03waffletowerI came up with a working PoC for injections using NREPL. Is there a more straight-forward way to accomplish this?#2021-02-1106:04waffletowerThe injection in this case is requiring pprint.#2021-02-1106:09waffletowerThe code is easily referenced in a deps.edn alias:
:inject {:extra-deps {waffletower/repl-eval {:local/root "../repl-eval/"}
nrepl/nrepl {:mvn/version "0.7.0"}
refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
cider/cider-nrepl {:mvn/version "0.25.1"}}
:main-opts ["-m" "repl-eval.nrepl"]}
While I could refactor this to instrument variable middleware and injection forms, is there some hook I am missing here? It was much much easier and cleaner to accomplish REPL initialization with leiningen.#2021-02-1312:40bozhidarI'm assuming by "injection" here you mean "evaluate some code on nREPL startup", right?#2021-02-1312:43bozhidarThere's nothing in the existing CLI UI, although it'd be easy to add something like --init or whatever. CIDER itself injects a bit of code via cider-repl-require-repl-utils-code.#2021-02-1112:57CarloUsually when I write a defn form in emacs, the docstring is rendered in a nicer style (italics, in my case). What should I modify if I want to get that when I use macros that replace the defn form, like >defn from guardrails?#2021-02-1214:34ghosttoasterI've managed to get cider in some sort of mode where its only showing my most recent input, the result, and the next prompt. I can't scroll back to see my repl history at all. Does anyone know how to restore my ability to scroll back?#2021-02-1218:41ACis your cider-repl-buffer-size-limit set to 0 (or something close to that)?#2021-02-1302:15ghosttoasterI've bumped it up to 1000 now, but according to my settings is was already set to 100. But I was getting more like 8.#2021-02-1309:59motformHow would one go about to use an add-tap to add the cider repl to the tap set? I find this amazingly handy in reveal, but I don't always have it running.#2021-02-1312:34bozhidar@cdimara Just saw your message on discord and responded there. 🙂 Basically that's characters, not lines. For everyone else - https://docs.cider.mx/cider/1.0/repl/configuration.html#auto-trimming-the-repl-buffer#2021-02-1312:46anonimitorafI have this in my emacs config:
;; Highlight particular macros similar to built-in stuff
;; For example, highlight ghostwheel's `>defn' similar
;; the same way as built-in `defn'
(add-hook 'clojure-mode-hook
'(lambda ()
;; Set some new syntax-highlighting rules.
(font-lock-add-keywords nil
;; So many escape codes! But we're really just saying:
;; Match the '(' character.
;; Match and group the string '>defn'.
;; Match some whitespace. \\s-+
;; Match and group some word characters. \\w+
'(("(\\(>defn\\)\\s-+\\(\\w+\\)"
;; The first regexp group is a keyword.
(1 font-lock-keyword-face)
;; The second regexp group is a name.
(2 font-lock-function-name-face))))))#2021-02-1312:47anonimitorafI can't get the docstring highlight (yet) though#2021-02-1312:59bozhidarThe docstring parsing is in clojure-mode's clojure-font-lock-syntactic-face-function.#2021-02-1313:00bozhidarIt's not just static rules for font-locking.#2021-02-1313:01anonimitorafRight, so is there a way to override the rules so >defn is treated the same as defn for example?#2021-02-1313:20bozhidarI guess something like (put '>defn 'clojure-doc-string-elt 2) will do the trick.#2021-02-1313:27anonimitorafAh, seems to work. Thanks (indentation is off, but that's a separate issue)#2021-02-1313:34anonimitorafIs there any way to extend the parser without this hacky method?#2021-02-1314:11bozhidarNot really.#2021-02-1314:12bozhidarIt relies on this metadata and somehow you need to supply it to it.#2021-02-1314:12bozhidarclojure-mode simply hardcodes the data for the common macros, that's why people don't notice this.#2021-02-1314:15bozhidarFor the indent try something like (put-clojure-indent '>defn :defn)#2021-02-1410:56Carlocan I open two repls in cider, one for shadow-cljs app and the other for the tests?#2021-02-1411:41dazldI’m using emacsclient, and having trouble figuring out where to define which JDK the clojure command uses when running cider-jack-in - I’ve tried fiddling with exec-path to include the jenv shims path, for example, but it always seems to drop back to the default system JDK (15 in my case), and ignores the global shim that jenv sets up. Any ideas on where to look?#2021-02-1411:49Eamonn SullivanWhich one does $JAVA_HOME point to in your environment?#2021-02-1411:55dazldappears to be unset?#2021-02-1412:07dazldI set JAVA_HOME manually with setenv - fortunately, its rare that I have to switch JDKs#2021-02-1412:07dazldjust for quil, in fact 🙂#2021-02-1412:28Eamonn SullivanI have to switch JDKs frequently at work (our Scala services are all still on 8, while stuff I do in Clojure is JDK 11). I use sudo update-alternatives --config java on Ubuntu, which I think sets $JAVA_HOME and it seems to work reliably. On the Mac, I use jenv, but that doesn't seem to work as well. I have to reset it now and again.#2021-02-1412:28Eamonn SullivanSo, does that work?#2021-02-1412:32dazldsetting it manually did indeed work#2021-02-1412:32dazldthere’s undoubtedly more elegant ways to do this - but know where to look now#2021-02-1412:32dazldthanks for help#2021-02-1413:10Eamonn Sullivan:thumbsup:#2021-02-1505:49ghosttoasterIs it possible to get a fresh prompt without deleting your current input? Like in bash, where if you hit ctrl-c before you finish the command, you immediately get a fresh prompt to type into?#2021-02-1507:16Yehonathan SharvitHow could we limit the size of cider REPL buffer?#2021-02-1507:16Yehonathan SharvitIn spacemacs, when the buffer is too big, emacs becomes irresponsive#2021-02-1507:17Yehonathan Sharvitor maybe there is a way not to write anything to the REPL buffer?#2021-02-1507:17Yehonathan SharvitOr other tips and tricks#2021-02-1507:20Yehonathan SharvitI am on MacOs#2021-02-1507:23Yehonathan Sharvitcider-repl-buffer-size-limit is set to: 100
#2021-02-1507:25Yehonathan Sharvitcider-repl-buffer-size-limit is set to: 100
cider-print-buffer-size is set to: 4096#2021-02-1509:59pmooserWhen an exception gets thrown in my clojure process, it takes "a while" (multiple seconds) for the cider exception window to pop up.#2021-02-1509:59pmooserAny idea what might cause this? It's ... unpleasant.#2021-02-1510:10pmooserOk, I went and updated to the most recent middleware and nrepl versions, and that seems OK.#2021-02-1510:10pmooserIt would be cool if there were an easy way to figure out what versions to use without reading project.clj files for each project.#2021-02-1511:30niveauverleihI have a question concerning pomegranate:
I added the following code in ~/.lein/profiles.clj:
{:user
{:dependencies [[clj-commons/pomegranate "1.2.0"]]
:injections [(defn add-dependency [dep-vec] (require 'cemerick.pomegranate) ((resolve 'cemerick.pomegranate/add-dependencies) :coordinates [dep-vec] :repositories (merge @(resolve 'cemerick.pomegranate.aether/maven-central)
{"clojars" "https://clojars.org/repo"})))]}}
(adapted from plexus' answer here: https://clojureverse.org/t/how-to-use-a-dependency-from-clojure-repl-without-starting-a-lein-project/1596/5
When I start a lein repl, the function is now available. In a cider repl however, it is not known in the user namespace. What am I doing wrong?#2021-02-1511:31iarenaza@pmooser As far as I know, if you don't force any particular versions yourself, CIDER requests the exact versions it wants when used with cider-jack-in-clj. It even shows you the exact command line it uses to launch lein, boot, clj or whatever tool you use to launch your environment, which includes the middleware an nrepl versions it's requesting.#2021-02-1517:29kaffeinhey folks!! I have a little issue using clj-refactor from within cider . Instead of jacking-in from cider, I am running a repl from the command line and then cider-connect from within cider to it.
As soon as I try to use clj-refactor though it keeps telling me that I might have forgotten to install the nrepl-refactor middleware. I had this in my ~/.clojure/deps.edn :
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.22.4"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
I thought that adding refactor-nrepl.middleware/wrap-refactor to the --middlewares would solve the issue but it seems that it is not ... can anyone help please ? thanks 🙏#2021-02-1517:31dpsuttonif you start a new project with an empty deps file and then cider-jack-in, it will show the jack in string its using. you can mimic that to ensure you're starting up the way CIDER needs to.#2021-02-1517:35kaffeinoh ok ... so that I can pick up the command line arguments you mean 👍 fair point!! thanks a lot @dpsutton I will give that a shot#2021-02-1517:36dpsuttonyeah. that shows what it would ideally look like. i suspect you need the refactor dep in your extra deps and then the middleware in the main opts#2021-02-1517:36dpsuttoni think that stuff tries to resolve middleware but ignores things it doesn't recognize. so if you just added the middleware to the middleware vector but not the jar which provides the middleware, it will just be ignored#2021-02-1517:37kaffeinoh right makes sense thanks for the tips#2021-02-1517:37kaffeinI will check that out#2021-02-1517:58kaffeinworked like a charm @dpsutton thank you so much 🙏😊#2021-02-1604:46jumarHow can I make the repl buffer (after cider-jack-in open on the right (vertical split of the current window) instead of at the bottom (horizontal split)?#2021-02-1605:17dpsuttoncider uses either display-buffer or pop-to-buffer which are C emacs functions. I don't see any information about how to affect it. From experience if the window is wide it will split vertically and if tall will split horizontally. I don't know if there's a way to force that or not#2021-02-1608:18jumarYeah, I'm using 27# monitor and Cider alwasys considers it "tall" enough to split horizontally#2021-02-1605:20dpsuttonhttps://stackoverflow.com/questions/20167246/emacs-open-buffer-in-vertical-split-by-default has some tricks to set the knobs for how the heuristics work#2021-02-1605:23dpsuttonthis works for me (let ((split-height-threshold nil) (split-width-threshold 0)) (pop-to-buffer (get-buffer-create "random"))). so you could make your own jack-in-function and instead of calling pop-to-buffer call cider-jack-in#2021-02-1605:23dpsuttonor if you think those are sensible defaults you could just set them in your config#2021-02-1608:19jumarIs there a way to switch the REPL buffer to a more leightweight mode (something like Fundamental) to improve performance, especially when writing a lot of text into the buffer (like big data structures or logs)?#2021-02-1612:43gdanovthe repl buffer (and emacs) have problem with long lines. when you need to dump big structures always use pprint which splits them into separate lines#2021-02-1612:44gdanovas long as the lines are not too long 4-5 thousand lines within ~10secs are not an issue#2021-02-1612:44gdanovthe nrepl also adds to the performance issues btw#2021-02-1608:50bozhidarIf you change the mode this will break everything in the REPL.#2021-02-1608:51bozhidarFor logs I've long advised to be written to files instead of to the REPL, at least during development. At some point I wanted to implemented some output redirection logic, but this was hard to do in combination with streaming so I abandoned the idea.#2021-02-1612:31jumarI do this for DEBUG logs, but I want INFO and stdout in the REPL so it's right in front of me instead of having to reach out to the terminal, copying useful values from logs, etc.#2021-02-1608:56bozhidarOne nuclear solution would be to redirect all output to some dedicated buffer, which you can achieve via cider-interactive-eval-output-destination.#2021-02-1612:30jumarYeah, having a dedicated buffer would be great.#2021-02-1608:56bozhidarIn my mind that's better than switch the REPL mode, as it least it won't affect your REPL.#2021-02-1608:57bozhidar(But this works only on interactive eval output, as I thought it'd be weird if REPL output went to a different buffer)#2021-02-1610:34bozhidarI've cut a small update to clj-refactor today. Nothing fancy, but at least you'll be getting refactor-nrepl with all deps updated to their current versions.#2021-02-1612:40gdanovI just got the hunch that Cider does not integrate with imenu. After looking in the documentation and googling I'm convinced there's no integration. Is this correct?#2021-02-1612:41gdanovas a background: I've been using cider for 4 years and always rely on imenu or helm-imenu and always thought Cider provides the symbols#2021-02-1613:36dpsutton@jumar one thing you can do is just not subscribe to out. Makes the repl a little less good but if you’re drowning in logs it can make the experience pleasant #2021-02-1709:21rickmoynihanHas anyone seen an error like this before in the nrepl middleware? Not entirely sure what causes it - but I think it happens when there’s an exception and cider tries to print it#2021-02-1709:21rickmoynihan#2021-02-1709:22rickmoynihanTrigger by evaling (throw (ex-info "foo" {}))#2021-02-1709:24rickmoynihanhmm looks like it might be a subtle env issue with jdk’s and JAVA_HOME etc… 👀#2021-02-1709:48rickmoynihanyeah ok that seems to have fixed it… JAVA_HOME was pointing to the system java rather than the one I was using… slight jabba misconfiguration#2021-02-1709:50rickmoynihanhmm odd I’ve just seen the exception again… looks like this hasn’t fixed it after all :thinking_face:#2021-02-1711:32kaffeinhey guys, has any of you experienced a weird behaviour while using clj-refactor where cider seems to be resolving to the wrong project type ?
I have a deps.edn-based project and it is supposed to handle refactoring commands pertaining to that particular type of project. Though when launching an add-project-dependency for e.g it tells me that it tried to lookup for a :dependencies key which means that somehow it considers the project as a leiningen-based one.
Debugger entered--Lisp error: (search-failed ":dependencies")
re-search-forward(":dependencies")
cljr--insert-into-leiningen-dependencies("mount" "0.1.16")
cljr--add-project-dependency("mount" "0.1.16")
cljr-add-project-dependency(nil)
funcall-interactively(cljr-add-project-dependency nil)
#<subr call-interactively>(cljr-add-project-dependency nil nil)
apply(#<subr call-interactively> cljr-add-project-dependency (nil nil))
(let ((ido-cr+-current-command command)) (apply orig-fun command args))
call-interactively@ido-cr+-record-current-command(#<subr call-interactively> cljr-add-project-dependency nil nil)
apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (cljr-add-project-dependency nil nil))
call-interactively(cljr-add-project-dependency nil nil)
command-execute(cljr-add-project-dependency)#2021-02-1711:57kaffeinnevermind, I debugged it using edebug and figured out that it was because I had a pom.xml inside the project (which was generated by clj-new)
(defun cljr--add-project-dependency (artifact version)
(let* ((project-file (cljr--project-file))
(deps (cljr--project-with-deps-p project-file)))
(cljr--update-file project-file
(goto-char (point-min))
(if deps ;; SO WHEN deps IS nil
(cljr--insert-into-clj-dependencies artifact version)
(cljr--insert-into-leiningen-dependencies artifact version)) ;; clj-refactor CONSIDERS THE PROJECT AS A lein-based ONE
(cljr--post-command-message "Added %s version %s as a project dependency" artifact version)
(when cljr-hotload-dependencies
(if deps
(back-to-indentation)
(paredit-backward-down))
(cljr-hotload-dependency)))))#2021-02-1711:35bozhidar@rickmoynihan If this started happening recently, it might be related to the fixes we've tried for https://github.com/clojure-emacs/orchard/issues/103#2021-02-1711:35bozhidarI'm assuming that something might be missing in your JDK 8 installation. Probably you won't get the error with JDK 11.#2021-02-1711:35rickmoynihan@bozhidar yeah I think it’s happened recently since I updated#2021-02-1711:36bozhidarMention your issue in the ticket, so Jeff's aware of this.#2021-02-1711:36bozhidarThe Java integration is one of the most frustrating things in CIDER, as things there constantly break...#2021-02-1711:37bozhidarNow I miss the days where each JDK took 5 years to ship. 😄#2021-02-1711:38rickmoynihanOk, interesting… I could possibly use jdk11, though it’ll mean I need to use two jdks for different services#2021-02-1712:48witekHello. I am missing a CIDER command: cider-toggle-ignore-next-form. It should either place or remove #_ at current cursor position.
What is the honorable thing to do? Just put it in my custom config? Pull-Request to the Spacemacs configuration layer? Pull-Request to CIDER?#2021-02-1715:16bozhidar@witek It should like something that should be in clojure-mode, as it doesn't require a REPL to work.#2021-02-1715:17bozhidarI'm just wondering that's the value of adding a command that adds or delete two characters at point. Probably that'd be more useful if it was applied to the preceding or containing form.#2021-02-1715:17bozhidar(as it saves you the extra movement)#2021-02-1716:02ennAny tips for troubleshooting a slow cider-connect? The ;; Connected to nREPL server - ... comment appears immediately, but it takes about 45 seconds for the user> to appear. I’m using cider-nrepl 0.25.9 and the CIDER snapshot {:tag :tel:_20210213115120210213.1151, :attrs nil, :content nil} on Emacs 27.1. I start the server with lein repl.#2021-02-1716:32bozhidar@enn https://docs.cider.mx/cider/1.0/troubleshooting.html#2021-02-1716:34dpsuttonfirst guess, its the state tracker populating the emacs side with all the known namespaces and vars#2021-02-1716:42enn@dpsutton that makes sense--this is a large project. Is there any way to pre-calculate this (something we could do in our build)?#2021-02-1716:44dpsuttonmy suspicion is its not the calculation of it but just sending to emacs, parsing, and storing in memory. so no good solution off hand that i can think of (if this is even the problem anyways)#2021-02-1716:44dpsuttoni think you can turn this off and you'll just lose a bit of syntax highlighting#2021-02-1716:49dpsuttonwow. i'm not actually seeing a way to not subscribe to this information#2021-02-1716:57bozhidarYeah, you can't. It should probably be configurable, but it's not as even basic things like the connection type are handled by it.#2021-02-1716:58dpsuttonyeah. i imagine the connection type always stays in there. just not the huge map of dictionaries of nses#2021-02-1716:59dpsuttoni remember someone having an issue with millions of keywords or something like that#2021-02-1716:59dpsuttonsurprised one result of that wasn't to turn off the tracking#2021-02-1716:55ennI tried enabling debug on quit and hitting C-g during the wait, as the troubleshooting guide that @bozhidar linked to suggests, but I don’t get any backtrace or any other information. so I’m not sure how to confirm your hypothesis.
for a given REPL process, if I disconnect and then reconnect, the second connection is instantaneous.#2021-02-1716:56dpsuttonyeah that's really about a hanging process#2021-02-1716:57dpsuttonstart profiling, cider connect, wait until it unfreezes and run profiler-report. note do not run profiler-stop. you'd think you start, stop, see results. but you can only see results of actively running profilers.#2021-02-1719:55ennprofiling output in thread#2021-02-1719:56enn- command-execute 9,655,949 73%
- call-interactively 9,655,949 73%
- funcall-interactively 9,655,949 73%
- counsel-M-x 9,655,949 73%
- ivy-read 9,355,822 70%
- ivy-call 7,208,547 54%
- counsel-M-x-action 7,208,547 54%
- command-execute 7,208,547 54%
- call-interactively 7,208,547 54%
- funcall-interactively 7,208,515 54%
- cider-connect 3,652,581 27%
- cider--update-host-port 2,435,135 18%
- cider-select-endpoint 2,435,135 18%
- cider--ssh-hosts 1,562,797 11%
+ eval 1,542,325 11%
+ seq-map 17,400 0%
+ version< 3,072 0%
+ cider--completing-read-port 373,606 2%
+ cider--completing-read-host 237,411 1%
+ cider--infer-ports 235,481 1%
+ seq-uniq 24,816 0%
split-string 1,024 0%
- cider-nrepl-connect 1,208,190 9%
- nrepl-start-client-process 1,208,190 9%
+ run-hooks 651,591 4%
+ #<compiled 0x1feb8b26da11> 477,204 3%
+ nrepl--init-capabilities 45,358 0%
+ nrepl--init-client-sessions 18,584 0%
+ nrepl-connect 7,181 0%
+ cider--update-project-dir 5,120 0%
- cider--check-existing-session 4,136 0%
+ sesman-current-sessions 4,136 0%
+ profiler-report 3,555,279 26%
profiler-start 655 0%
+ read-from-minibuffer 1,657,843 12%
+ ivy--reset-state 356,434 2%
+ ivy--update-prompt 3,104 0%
+ #<compiled 0x1feb870c8e1d> 1,056 0%
+ counsel--M-x-externs 300,127 2%
+ timer-event-handler 1,626,289 12%
+ nrepl-client-filter 833,280 6%
+ redisplay_internal (C function) 786,459 5%
+ ucs-normalize-hfs-nfd-pre-write-conversion 115,835 0%
+ linum-update-current 75,598 0%
+ ... 45,360 0%
+ ucs-normalize-hfs-nfd-post-read-conversion 41,344 0%
+ eldoc-schedule-timer 584 0%#2021-02-1719:56enndon’t really see any smoking gun here#2021-02-1719:58dpsuttondid you run this report after the 45 second freeze?#2021-02-1719:58dpsuttonmaybe run it during the 45 second freeze?#2021-02-1721:06ennI ran the report after (but it was profiling the whole time). I will try running the report during.#2021-02-1722:18FiVoIs there a way to run some snippet just after jack in? Similar to cider-custom-cljs-repl-init-form but just for clj.#2021-02-1808:17bozhidarThere's a cider-connected-hook.#2021-02-1808:18bozhidarThere's also cider-repl-init-code.#2021-02-1808:18bozhidar(defvar cider-repl-require-repl-utils-code
'((clj . "(clojure.core/apply clojure.core/require clojure.main/repl-requires)")
(cljs . "(require '[cljs.repl :refer [apropos dir doc find-doc print-doc pst source]])")))
(defcustom cider-repl-init-code (list (cdr (assoc 'clj cider-repl-require-repl-utils-code)))
"Clojure code to evaluate when starting a REPL.
Will be evaluated with bindings for set!-able vars in place."
:type '(list string)
:group 'cider-repl
:package-version '(cider . "0.21.0"))#2021-02-1812:44danielnealIs there a way of adding a breakpoint that will be hit when e.g. an http request is made, i.e. when a function is called indirectly rather than directly#2021-02-1814:03jumarThere should be no difference and your "breakpoint" should be triggered.
That said, I often times get into a state where no breakpoints are activated for some reason - restarting the REPL typically helps.#2021-02-1814:42danielnealhmm interesting. Is there more to it than doing cider-debug-defun-at-point in the function you want to debug, and then exercising the endpoint that calls the function?#2021-02-1814:44jumarI think that's it: Of course you can also use #dbg which can be convenient if you have a larger function or if you want to break only on a specific condition: https://docs.cider.mx/cider/debugging/debugger.html#conditional-breakpoints#2021-02-1814:49danielnealDo I need extra middleware apart from cider.nrepl/cider-middleware?#2021-02-1814:49jumarNo, I don't think so.#2021-02-1814:54danielnealthanks, I'll keep at it#2021-02-1814:58danielnealoh, it's working#2021-02-1814:58danielnealrestarting the repl worked#2021-02-1815:00jumarYeah, that's a PITA. I don't know why it sometimes happen but I hit this issue every now and then.#2021-02-1815:34danielnealthanks for your help 🙂#2021-02-1907:22bozhidarGuess you found some weird bug - probably the state of the debugger gets corrupted by something, otherwise I can't imagine the need for a restart.#2021-02-1910:53jumarIs there a way to “debug” such debugger issues 😀?#2021-02-2311:28rickmoynihanI stopped using the debugger years ago because the debugger was so temperamental debugging http requests.#2021-02-2409:24danielnealI think the debugger stops working after I quit the debugger with q after debugging an http request. I got this error: Execution error (NullPointerException) at cider.nrepl.middleware.debug/abort! (debug.clj:143), and then the debugger wouldn't start up again when debugging the same function and request.#2021-02-2409:45jumarInteresting observation - I didn't make a connection between these two things and I use q every now and then.
I'll try to reproduce this in my project...#2021-02-2409:48jumar@U051H1KL1 you're right! It would be worth to report this - I'd love to see this fixed.#2021-02-2409:49rickmoynihan@U051H1KL1 IIRC now you mention it that sounds suspiciously similar to what I witnessed a few years back too — I thought I’d reported it, but it was maybe just on the slack channel and not in a ticket.#2021-02-2409:50jumarIt calls Thread's .stop method which is known to cause problems - maybe that't the issue? https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/debug.clj#L143#2021-02-2409:53jumarMaybe a workaround is to press C to skip all the breakpoints? https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/debug.clj#L364
... Oh no, that doesn't work either - so just c?#2021-02-2409:53danielnealYeah, c works for me#2021-02-2409:59danielnealInterestingly, when debugging a function that is called indirectly via http, q doesn't appear on the list of options, and when pressed breaks the debugger going forward. When debugging a function called directly, q does appear on the list of functions, and when pressed, does not break the debugger.#2021-02-2410:05jumarAnother thing that seems to mess up the debugger state is t (trace)#2021-02-2411:59danielnealRaised https://github.com/clojure-emacs/cider-nrepl/issues/689#2021-02-2508:32bozhidar> Is there a way to “debug” such debugger issues #2021-02-2508:33bozhidarSame as with all other issues - monitoring the message exchange, instrumenting thing on the Elisp side and playing with the Clojure part of the debugger in the REPL.#2021-02-2508:35bozhidarIf someone wants to see this fixed any time soon they'll have to look into the problem themselves. As I've mentioned a few times - effectively no one but me is working on all the CIDER/nREPL related stuff these days, which means progress is slow and painful (if any).#2021-02-2508:36bozhidarThis is the most detailed overview of the internals of the debugger for those interested - https://drive.google.com/file/d/1YhnPBJOXbUzXfVOEojICFTwhCt_3u6Ss/view?usp=sharing#2021-02-2508:36bozhidar(it's simpler than most people would think it is)#2021-02-2611:02jumarCool, thanks for sharing! I'll have a look next week if this is something I could do.#2021-02-1821:06Eamonn SullivanAm I doing something wrong here? I want to use an http mocking library in my tests, but I obviously don't need this in the production version of the library, so I added the dependency (clj-wiremock) like this:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.2"}
clj-http/clj-http {:mvn/version "3.11.0"}
org.clojure/data.json {:mvn/version "1.0.0"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}
kelveden/clj-wiremock {:mvn/version "1.5.7"}}}
but I can't eval the buffer on a test file in CIDER (C-c C-k). It does work if I move clj-wiremock to the :deps section. Is that right, or am I just missing something silly? I might be misunderstanding what the :test alias is for...#2021-02-1821:08dpsuttondid you add the test alias when jacking in?#2021-02-1821:08Eamonn SullivanAh, do I have to do that? How do I do that?#2021-02-1821:09dpsuttoneasiest way, hit C-u before jacking in and add a -A:test right after the bin/.../clojure part#2021-02-1821:10Eamonn SullivanRight, thanks! I've gone this long without ever needing a test-only dependency...#2021-02-1821:12dpsuttonno worries. if you update to the latest version of CIDER i can walk you through some dir-locals stuff to make sure you are always using the test alias so you never have to worry if you remembered to add it or not. it'll always be there when using CIDER#2021-02-1821:15Max DeinekoAnything one should look at beside (cider-clojure-cli-global-options . "-M:test") ?#2021-02-1821:17dpsuttoni think that's correct. there was a little bit of flux and a clojure-cli-aliases or something like that recently#2021-02-1821:17dpsuttonstill needs to be documented and its still missing a way to pass things at the end of the string to supply ports and such. ( i think)#2021-02-1821:20Max Deinekoah, I see -- good to know!#2021-02-1821:14Eamonn SullivanThanks. I probably am using the latest (I use straight.el), but other half is yelling at me to get off the computer. Will look this up... And that did work, btw. Thank you again!#2021-02-2409:24danielnealI think the debugger stops working after I quit the debugger with q after debugging an http request. I got this error: Execution error (NullPointerException) at cider.nrepl.middleware.debug/abort! (debug.clj:143), and then the debugger wouldn't start up again when debugging the same function and request.#2021-02-1908:56CaseyCould someone kindly point me to the location in the cider docs that discusses how to teach it that some macro acts like defn or def ? Using mount's defstate like (defstate foo :start (do-foo)) cider reports that foo is an unresolved symbol and puts the red squiggle underneath#2021-02-1909:19solfCider doesn't put unresolved symbol squiggles, that's usually clj-kondo (either standalone or through clojure-lsp).
If it's indeed clj-kondo you're using, here's the docs for what you want:
https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#unrecognized-macros#2021-02-1911:04CaseyAh many thanks, it is clj-kondo indeed. Sometimes it's difficult keeping track of what is doing what as an emacs neophyte.#2021-02-1911:44CaseyI've used a config like this to popup the replon the right side.
(set-popup-rules!
'(
("^\\*cider-repl" :quit nil :side right :size 70)))
In projects where I have two repls (clj and cljs) open, the normal split window isn't working. Is it possible to have both repls visible on the right with a horizontal split?#2021-02-1913:08yuhanThis looks like a Doom emacs specific config, you might want to ask on their discord server instead#2021-02-2000:16jasmithI am trying to get a clojurescript environment set up on a macos machine.
I've been trying to get CIDER working. Highlighting works fine, but every time I try to jack-in I get the message could not start nREPL server: env: node: no such file or directory. And yes I do have node set up and on the emacs exec path.
Any suggestions? Thanks!#2021-02-2010:18teodorluCIDER doesn't know your setup in advance, so you might have to give it some help. This will depend on whether you're using Leiningen, deps.edn, shadow-cljs, or some combination. You might have to post more details to get good advice.#2021-02-2010:19teodorluAlso, Clojurescript REPLs are a bit more difficult to get started with than Clojure REPLs.#2021-02-2021:03jasmithshadow-cljs in this case. I was able to connect to the REPL from Cursive/IDEA (though I other problems with that setup), and had no trouble with VSCode + Calva.#2021-02-2021:05jasmith1. Emacs installed with homebrew, and CIDER with the usual packages-install etc.
2. Shadow-cljs project that has been working fine from the command like / browser so far.
Any other details I can provide? Thanks much!#2021-02-2208:29teodorluSounds like a good start :thumbsup:
I'm no expert in this. But under the hood, CIDER/Calva/Cursive run a normal command that starts up the REPL. I'd start by finding out what that command actually is. You should probably be able to find that from the Calva / Shadow-CLJS docs, or you might get a straight answer in #calva
🙂#2021-02-2014:03CaseyI'd like to bind a key to run my mount (restart) function in my user ns but from any clj buffer (not just the active repl). Is this possible, how might I achieve that?#2021-02-2014:11Michaël Salihi@ramblurr You can setup hooks in an .dir-locals.el Emacs project file.
See the doc : https://docs.cider.mx/cider/0.26/usage/misc_features.html#reloading-code
You can also find one of my example repo set up like that.#2021-02-2014:12Michaël Salihihttps://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/.dir-locals.el#L5#2021-02-2014:12dpsuttonYou can insert into repl (user/restart) and it would do what you need. Also that^#2021-02-2014:12Michaël SalihiMy repo use Integrant not Mount but you get the idea. 😉#2021-02-2014:23Michaël SalihiAfter that you can use cider-ns-refresh keyboard shortcut. For me on Spacemacs: , e n r#2021-02-2209:56Casey@admin055 thanks that works quite nicely.#2021-02-2209:56Casey@dpsutton is there a way to bind a key to insert+eval a pre-defined snippet into the repl?#2021-02-2316:11afleckanyone use lispy and cider? I’m having trouble with lispy--describe-inline , it throws with the error
Unhandled java.lang.IllegalArgumentException
Cannot open <nil> as a Reader.
io.clj: 288
io.clj: 288
io.clj: 69
io.clj: 102
io.clj: 86
RestFn.java: 410 clojure.lang.RestFn/invoke
analyzer.cljc: 4407 cljs.analyzer$parse_ns$fn__2802/invoke
analyzer.cljc: 4390 cljs.analyzer$parse_ns/invokeStatic
analyzer.cljc: 4369 cljs.analyzer$parse_ns/invoke
analyzer.cljc: 4380 cljs.analyzer$parse_ns/invokeStatic
analyzer.cljc: 4369 cljs.analyzer$parse_ns/invoke
repl.cljc: 604 cljs.repl$load_file$fn__6689/invoke
repl.cljc: 601 cljs.repl$load_file/invokeStatic
repl.cljc: 593 cljs.repl$load_file/invoke
repl.cljc: 761 cljs.repl$fn__6740$self__6742/invoke
AFn.java: 165 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 660 clojure.core/apply
repl.cljc: 745 cljs.repl$wrap_self$g__6719/invoke
piggieback_impl.clj: 287 cider.piggieback/do-eval/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 665 clojure.core/apply
core.clj: 1973 clojure.core/with-bindings*
core.clj: 1973 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
piggieback_impl.clj: 266 cider.piggieback/do-eval
piggieback_impl.clj: 265 cider.piggieback/do-eval
piggieback_impl.clj: 323 cider.piggieback/evaluate
piggieback_impl.clj: 321 cider.piggieback/evaluate
piggieback_impl.clj: 347 cider.piggieback/load-file
piggieback_impl.clj: 346 cider.piggieback/load-file
Var.java: 384 clojure.lang.Var/invoke
piggieback_impl.clj: 354 cider.piggieback/wrap-cljs-repl/fn/fn/fn
piggieback_impl.clj: 201 cider.piggieback/enqueue/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 202 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 201 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 748 java.lang.Thread/run
this is cider {:tag :tel:_20210213115120210213.1151, :attrs nil, :content nil} and lispy 20210121.926#2021-02-2321:45blak3mill3rI use those two things, but I'm not on the bleeding edge. However I feel like I've seen this exception before...
Question for you: Do you "jack in" or do you control your own classpath? I recall that lispy has some funny business with its own dependencies#2021-02-2321:46blak3mill3rI think it expects to have pomegranate provided, so that lispy (the clojure part of lispy) can update your classpath dynamically#2021-02-2321:46blak3mill3rto add compliment and me.raynes/fs#2021-02-2321:46blak3mill3rhere#2021-02-2321:46afleckjack in but overridden sometimes. I fixed plain clj projects not having pomegranate on the classpath, but it does not change the mixed clj/cljs project difficulties#2021-02-2321:47blak3mill3rhttps://github.com/abo-abo/lispy/blob/master/lispy-clojure.clj#L30-L44#2021-02-2321:47blak3mill3rI control the classpath, rather than using jack-in, and I know I had some snags with lispy#2021-02-2321:47blak3mill3rlike, if pomegranate isn't available, some of the lispy features break... pretty sure lispy-describe-inline is one that broke for me#2021-02-2321:48afleckhmmm okay. I know cljs has a separate dependency injection. so maybe I will try that.#2021-02-2321:48blak3mill3ralso rather than messing with the emacs debugger, you could try instrumenting the cljs part#2021-02-2321:49blak3mill3rlike from that stack trace it seems that it is trying to parse a ns form when it attempts to open nil#2021-02-2321:49blak3mill3rcould be that there's some subtle problem with one of your ns forms?#2021-02-2321:49blak3mill3rif you knew which namespace it's handling in that call to parse_ns on 4407#2021-02-2321:49blak3mill3rthat might point in the right direction#2021-02-2316:12afleckbeen trying to poke around the emacs debugger but don’t really have much experience#2021-02-2316:14dpsuttontry m-x nrepl-toggle-message-logging, try it again, and then open up the messages buffer created for these messages. you can see what its asking the nrepl server to evaluate and see if it makes sense#2021-02-2320:19afleckall it says is => nil. I’ve narrowed it down to being a problem with clj/cljs projects. it works fine in cljs buffers, returns nil in clj buffers, and throws with that error in cljc buffers#2021-02-2318:59Jimmy MillerAnyone else have any issues with cider-doc in a shadow-cljs? It is working fine in my clojure repl and in a different project that uses weasel. It isn’t even working for built-in clojure functions. Toggled messages and just see a ("done" "no-eldoc"). Any ideas?#2021-02-2409:47jumarIs there a way to jump to the "code at point" from the stacktrace printed in the REPL buffer using a keyboard shortcut?
I'm using spacemacs and , g d (should be the same thing as cider-find-var) works most of the time but not here - but mouse click works (opens the code in another buffer).#2021-02-2515:09blak3mill3rYou can actually interrogate emacs for this information C-h k (mouseclick) in the stacktrace buffer should tell you which function is called. Then check C-h m in the stacktrace buffer to see all key maps active in that buffer (so that you can see if something conflicts with ,gd)#2021-02-2515:09blak3mill3rThen bind ,gd to do what you want#2021-02-2515:09blak3mill3rThis confused me as well, I expected RET to work but it did not (probably because of something else in my setup)#2021-02-2409:48jumar#2021-02-2508:31bozhidar> Is there a way to jump to the "code at point" from the stacktrace printed in the REPL buffer using a keyboard shortcut?
#2021-02-2508:31bozhidarDoesn't RET work here?#2021-02-2607:58jumarNo it doesn’t; only mouse click#2021-02-2514:37danielnealDoes anyone know how to clear all the repl output so I get a brand spanking totally clear buffer? I tried C-c C-o but it just prints ;output cleared and leaves all the previous mess I printed.#2021-02-2514:44dpsuttonuse a prefix with that. C-u C-c C-o
> (cider-repl-clear-output &optional CLEAR-REPL)
> Delete the output inserted since the last input.
> With a prefix argument CLEAR-REPL it will clear the entire REPL buffer instead.#2021-02-2514:44danielnealperfect! Thank you 🙂#2021-02-2515:06iperdomoHi all, I would like to contribute a documentation change regarding cider-path-translations , the documentation refers to the "In the example above, the but the example is not correct. What's the best repo to open the issue and a pull request? https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/config/basic_config.adoc#translate-file-paths#2021-02-2515:09iperdomoI would also like to extend the example with the use of eval pseudo-variable to use (clojure-project-dir) instead of a fixed project path. This is useful when having the .dir-locals.el shared across a team that have the cloned repo in different locations#2021-02-2515:10dpsuttonyeah i wish there was a second dir-locals that could be gitignored that each person could use#2021-02-2515:11dpsuttonso that kind of thing could go in there. what's wrong with the example though? I thought it was right. root/.m2 and src/ should be translated to users/foo and users/foo/project#2021-02-2515:13iperdomoah! yeah, you're right, any /root/* will get translated to /Users/someuser/*#2021-02-2515:13iperdomoI'm more used to translate paths that are meaningful to the development, not any path under /root/#2021-02-2515:14dpsuttoni made that feature and it was pretty tailored to my then current work setup of working in a docker image. if you want to adapt it and make it more flexible/general go for it#2021-02-2515:14iperdomoafter checking https://github.com/clojure-emacs/docs.cider.mx I now understand that the actual documentation comes from cider main repo#2021-02-2515:14dpsuttoni had a very concrete problem at hand so there may be room for more generality#2021-02-2515:15iperdomoWe're using docker too, and a group of Linux and macOS devs, and came with this one - https://gist.github.com/iperdomo/88f3156dbb79fe99bc440d1700bb7162#file-dir-locals-el-L3-L8#2021-02-2515:17iperdomoin the case of linux users the reported user is not root but akvo ... what I'm proposing is a general example on how to use eval to get clojure-project-dir call working#2021-02-2515:17iperdomodoes it make sense?#2021-02-2515:18dpsuttonin docker i figured the user would be consistent. you are all presumably using the same docker configs#2021-02-2515:18dpsuttonand i think we ended up just making a template file that was committed and then having everyone make their own (git ignored) dir locals#2021-02-2515:18dpsuttonas i think eval runs on every new buffer rather than just once#2021-02-2515:19iperdomoI'm a basic emacs user (use it for CIDER only), so the whole eval and .dir-locals.el is new to me#2021-02-2515:21dpsuttonyeah. i'm not a big fan of it#2021-02-2515:22iperdomonote that eval is also mentioned in other config documentation - https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/config/project_config.adoc#project-specific-configuration#2021-02-2515:22dpsuttonyeah. its an option. we just went with the far simpler template and make your own dir locals#2021-02-2515:24iperdomodo you think it would be interesting/beneficial to contribute that approach of using eval?#2021-02-2515:31dpsuttonsure#2021-02-2515:33iperdomoI'll open an issue and a PR, thanks#2021-02-2515:51iperdomore-reading the documentation again, what confused me was this In the example above, the but the example is the root folder is mounted as the host's home folder#2021-02-2515:52iperdomoperhaps making explicit reference to /root/.m2 -> /Users/foo/.m2 makes that sentence less confusing?#2021-02-2515:56dpsuttonsure. fundamentally its just prefix matching. so whatever prefix you want, go for it#2021-02-2516:15iperdomoOk, issue and pr open - happy to change, improve it if needed - https://github.com/clojure-emacs/cider/pull/2989#2021-02-2515:08enn@danieleneal there’s also cider-repl-clear-buffer. I’m not sure if it’s bound by default but I have it bound to C-c M-o.#2021-02-2614:36ennGood morning CIDER folks. We recently switched from using lein to using clojure-cli, and I’m having trouble getting CIDER to be functional. I have limited interaction with the REPL, but C-c C-c , C-c C-k, running tests, etc., are not working, and when I try I get exceptions from the middleware in the REPL. Full stacktrace in thread.#2021-02-2614:37ennERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print clubhouse.dev-helpers.helpers/entity-map-aware-pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :op stacktrace, :session 3c2e42be-90d9-4a51-b1a2-7a7dd7f1bdb7, :id 9}
java.lang.ClassNotFoundException: com.sun.tools.javac.util.List
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2212)
at clojure.lang.RT.classForName(RT.java:2221)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java.legacy_parser$parse_java.invokeStatic(legacy_parser.clj:88)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java.legacy_parser$parse_java.invoke(legacy_parser.clj:66)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java.legacy_parser$source_info.invokeStatic(legacy_parser.clj:274)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java.legacy_parser$source_info.invoke(legacy_parser.clj:265)
at clojure.lang.Var.invoke(Var.java:384)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$source_info.invokeStatic(java.clj:144)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$source_info.invoke(java.clj:139)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$class_info_STAR_.invokeStatic(java.clj:223)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$class_info_STAR_.invoke(java.clj:214)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$class_info.invokeStatic(java.clj:261)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$class_info.invoke(java.clj:253)
at clojure.core$comp$fn__5826.invoke(core.clj:2573)
at clojure.lang.Iterate.first(Iterate.java:47)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5402.invokeStatic(core.clj:55)
at clojure.core$take_while$fn__5936.invoke(core.clj:2910)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$filter$fn__5912.invoke(core.clj:2813)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5402.invokeStatic(core.clj:55)
at clojure.core$first__5402.invoke(core.clj:55)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$member_info.invokeStatic(java.clj:306)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$member_info.invoke(java.clj:295)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$resolve_member$fn__74683.invoke(java.clj:349)
at clojure.core$map$fn__5885.invoke(core.clj:2759)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$filter$fn__5912.invoke(core.clj:2813)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.RT.seq(RT.java:535)
at clojure.lang.RT.nthFrom(RT.java:982)
at clojure.lang.RT.nth(RT.java:940)
at clojure.core$distinct$step__6430$fn__6431$fn__6433.invoke(core.clj:5037)
at clojure.core$distinct$step__6430$fn__6431.invoke(core.clj:5037)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$seq__5420.invoke(core.clj:139)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$resolve_symbol.invokeStatic(java.clj:374)
at cider.nrepl.inlined_deps.orchard.v0v6v5.orchard.java$resolve_symbol.invoke(java.clj:357)
at $clj_meta.invokeStatic(info.clj:76)
at $clj_meta.invoke(info.clj:65)
at $info_STAR_.invokeStatic(info.clj:147)
at $info_STAR_.invoke(info.clj:136)
at cider.nrepl.middleware.stacktrace$analyze_fn.invokeStatic(stacktrace.clj:78)
at cider.nrepl.middleware.stacktrace$analyze_fn.invoke(stacktrace.clj:63)
at clojure.core$comp$fn__5826.invoke(core.clj:2573)
at clojure.core$comp$fn__5826.invoke(core.clj:2573)
at clojure.core$comp$fn__5826.invoke(core.clj:2573)
at cider.nrepl.middleware.stacktrace$analyze_frame.invokeStatic(stacktrace.clj:180)
at cider.nrepl.middleware.stacktrace$analyze_frame.invoke(stacktrace.clj:177)
at clojure.core$map$fn__5885.invoke(core.clj:2759)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$map$fn__5889.invoke(core.clj:2761)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:713)
at clojure.core$next__5404.invokeStatic(core.clj:64)
at clojure.core.protocols$fn__8183.invokeStatic(protocols.clj:169)
at clojure.core.protocols$fn__8183.invoke(protocols.clj:124)
at clojure.core.protocols$fn__8138$G__8133__8147.invoke(protocols.clj:19)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
at clojure.core.protocols$fn__8170.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8170.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8112$G__8107__8125.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6833)
at clojure.core$into.invokeStatic(core.clj:6900)
at clojure.core$mapv.invokeStatic(core.clj:6908)
at clojure.core$mapv.invoke(core.clj:6908)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invokeStatic(stacktrace.clj:175)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invoke(stacktrace.clj:164)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invokeStatic(stacktrace.clj:186)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invoke(stacktrace.clj:182)
at cider.nrepl.middleware.stacktrace$analyze_cause.invokeStatic(stacktrace.clj:290)
at cider.nrepl.middleware.stacktrace$analyze_cause.invoke(stacktrace.clj:281)
at cider.nrepl.middleware.stacktrace$analyze_causes$fn__75190.invoke(stacktrace.clj:315)
at clojure.core$map$fn__5881$fn__5882.invoke(core.clj:2746)
at clojure.core$take_while$fn__5932$fn__5933.invoke(core.clj:2905)
at clojure.lang.Iterate.reduce(Iterate.java:81)
at clojure.core$transduce.invokeStatic(core.clj:6888)
at clojure.core$into.invokeStatic(core.clj:6904)
at clojure.core$into.invoke(core.clj:6892)
at cider.nrepl.middleware.stacktrace$analyze_causes.invokeStatic(stacktrace.clj:314)
at cider.nrepl.middleware.stacktrace$analyze_causes.invoke(stacktrace.clj:306)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invokeStatic(stacktrace.clj:323)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invoke(stacktrace.clj:320)
at clojure.lang.Var.invoke(Var.java:388)
at cider.nrepl$wrap_stacktrace$fn__2117.invoke(nrepl.clj:417)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_clojuredocs$fn__2175.invoke(nrepl.clj:511)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_undef$fn__2149.invoke(nrepl.clj:478)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_info$fn__2043.invoke(nrepl.clj:203)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_slurp$fn__1985.invoke(nrepl.clj:117)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_macroexpand$fn__2061.invoke(nrepl.clj:272)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__1024.invoke(interruptible_eval.clj:154)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.load_file$wrap_load_file$fn__1490.invoke(load_file.clj:81)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.session$add_stdin$fn__1140.invoke(session.clj:363)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_content_type$fn__1977.invoke(nrepl.clj:105)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.sideloader$wrap_sideloader$fn__1577.invoke(sideloader.clj:104)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_out$fn__2077.invoke(nrepl.clj:319)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_debug$fn__2019.invoke(nrepl.clj:159)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_enlighten$fn__2027.invoke(nrepl.clj:185)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_inspect$fn__2053.invoke(nrepl.clj:222)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__959.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_refresh$fn__2093.invoke(nrepl.clj:365)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__926.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at cider.nrepl$wrap_tracker$fn__2141.invoke(nrepl.clj:467)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.completion$wrap_completion$fn__1458.invoke(completion.clj:50)
at nrepl.middleware$wrap_conj_descriptor$fn__690.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__1125.invoke(session.clj:309)#2021-02-2614:37enn(that’s actually not the full thing but I’m hitting Slack limits trying to post it all)#2021-02-2614:38ennMy ~/.clojure/deps.edn is:
{
:aliases
{:cider
{:extra-deps {cider/cider-nrepl {:mvn/version "0.25.9"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}
}#2021-02-2614:38ennM-x cider-version yields: “CIDER 1.1.0snapshot (package: <tel:202102131151|20210213.1151>)”#2021-02-2614:38ennAny thoughts on what might be going wrong?#2021-02-2614:52dpsuttonI think there’s a ticket about this. It’s not finding the sun util list class. Which jvm are you on and do you switch jvms with a manager or something?#2021-02-2614:53ennopenjdk version "1.8.0_252"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.252-b09, mixed mode)
#2021-02-2614:54ennI don’t have any manager. That makes sense, though I’m not sure why I didn’t run into this with leiningen using the same JVM. Maybe lein packages tools.jar itself or something?#2021-02-2615:01ennI take that back--I guess there is some kind of version management done implicitly by MacOS based on the value of $JAVA_HOME.#2021-02-2615:03dpsuttonhttps://github.com/nrepl/nrepl/issues/206
https://github.com/clojure-emacs/orchard/issues/105
might point at some info#2021-02-2615:04dpsuttonone person downgraded nrepl and another downgraded CIDER. that downgrade of CIDER might have worked because of a lower version of nrepl#2021-02-2618:06ennthank you, downgrading cider-nrepl to 0.25.7 seems to have fixed that specific error (which I think related to printing exceptions)
I’m still seeing this other category of error, related to getting docstrings I think:
ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns clubhouse.job-executor.jobs.search-index-workspace, :sym run, :session c15dbb92-7c6c-4da9-bf7b-98c62e8a8f9d, :id 21}
java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.ClassLoader
at cider.nrepl.inlined_deps.orchard.v0v6v3.orchard.java.classpath$classloaders$fn__74135.invoke(classpath.clj:29)
at clojure.lang.Iterate.first(Iterate.java:47)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5402.invokeStatic(core.clj:55)
at clojure.core$take_while$fn__5936.invoke(core.clj:2910)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5420.invokeStatic(core.clj:139)
at clojure.core$filter$fn__5912.invoke(core.clj:2813)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.LazySeq.next(LazySeq.java:80)
at clojure.lang.RT.next(RT.java:713)
at clojure.core$next__5404.invokeStatic(core.clj:64)
at clojure.core$last__5446.invokeStatic(core.clj:270)
at clojure.core$last__5446.invoke(core.clj:269)
at cider.nrepl.inlined_deps.orchard.v0v6v3.orchard.java.classpath$modifiable_classloader.invokeStatic(classpath.clj:38)
at cider.nrepl.inlined_deps.orchard.v0v6v3.orchard.java.classpath$modifiable_classloader.invoke(classpath.clj:34)
at cider.nrepl.inlined_deps.orchard.v0v6v3.orchard.java.classpath$add_classpath_BANG_.invokeStatic(classpath.clj:75)
at cider.nrepl.inlined_deps.orchard.v0v6v3.orchard.java.classpath$add_classpath_BANG_.invoke(classpath.clj:69)#2021-02-2618:30richiardiandreaHi there, does anybody know what I am missing for having #break working?
I am getting:
#error {
:cause "Attempting to call unbound fn: #'cider.nrepl.middleware.debug/breakpoint-reader"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error reading source at (com/cohesic/acuity/infra2/tables/diagnostic_reports.clj:222:0)."
:data #:clojure.error{:phase :read-source, :line 222, :column 0, :source "com/cohesic/acuity/infra2/tables/diagnostic_reports.clj"}
:at [clojure.lang.Compiler load "Compiler.java" 7643]}
{:type java.lang.IllegalStateException
:message "Attempting to call unbound fn: #'cider.nrepl.middleware.debug/breakpoint-reader"#2021-02-2618:30richiardiandreabut
=> (require 'cider.nrepl.middleware.debug)
nil
works#2021-02-2618:33richiardiandreauhm ok I might be missing this
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/data_readers.clj#2021-02-2618:35richiardiandreanext step, this exists:
(io/resource "data_readers.clj")
#object[java.net.URL 0x6538fcf3 "jar:file:/home/cokap/.m2/repository/cider/cider-nrepl/0.25.7/cider-nrepl-0.25.7.jar!/data_readers.clj"]
#2021-02-2720:13WestHey guys, I’m trying to configure a workflow in .dir-locals.el.
What I do every single time is as follows:
• Sesman start
• Cider-connect-cljs
• localhost
• port 9000
• node-repl
So far my file looks like this: ((nil . ((cider-default-cljs-repl . shadow))))#2021-02-2720:19WestSo before I had to select shadow as my repl, but now I don’t, hence why it’s missing from the list of prompts.#2021-03-0322:27Alex Miller (Clojure team)would be great if anyone wants to test https://clojurians.slack.com/archives/C015AL9QYH1/p1614809717001400 with CIDER#2021-03-0322:30dpsuttonwill do. thanks!#2021-03-0414:23ElsoIs there any way to have the test-report buffer display strings as strings i.e. with quotation marks?#2021-03-0518:00CarloI'm debugging an issue with clojure indentation in emacs, and I'd like some pointers to continue the debugging. I found, using edebug, that my error
clojure-indent-function: Wrong type argument: number-or-marker-p, nil
comes from trying to do:
((= pos (1+ method))
where method comes from:
(let ((method (clojure--find-indent-spec))
Now, the question: I enabled edebug also for clojure--find-indent-spec, but the debugger doesn't step in that automatically! Why?#2021-03-0518:41CarloI'd like another pair of eyes to see how method can become nil in this code, from clojure-mode:#2021-03-0518:42Carlo(defun clojure-indent-function (indent-point state)
;; Goto to the open-paren.
(goto-char (elt state 1))
;; Maps, sets, vectors and reader conditionals.
(if (clojure--not-function-form-p)
(1+ (current-column))
;; Function or macro call.
(forward-char 1)
(let ((method (clojure--find-indent-spec))
(last-sexp calculate-lisp-indent-last-sexp)
(containing-form-column (1- (current-column))))
(pcase method
((or (pred integerp) `(,method))
(let ((pos -1))
(condition-case nil
(while (and (<= (point) indent-point)
(not (eobp)))
(clojure-forward-logical-sexp 1)
(cl-incf pos))
;; If indent-point is _after_ the last sexp in the
;; current sexp, we detect that by catching the
;; `scan-error'. In that case, we should return the
;; indentation as if there were an extra sexp at point.
(scan-error (cl-incf pos)))
(cond
;; The first non-special arg. Rigidly reduce indentation.
((= pos (1+ method))
(+ lisp-body-indent containing-form-column))#2021-03-0518:43Carlobasically, in the last but one line, I have (= pos (1+ method)) and method is nil there, but it wasn't nil in the let block in which it has been defined, and I'm not sure where else it could have changed!#2021-03-0518:59Carlomaybe @dpsutton ^?#2021-03-0519:00dpsuttoni don't have time to look at it atm. and these kinds of things just require stepping through. I doubt anyone has context on this low level stuff except at the time they've worked on it. its quite possible you know the most about it at the current time#2021-03-0519:00dpsuttonbut if you open an issue on clojure-mode it might get some eyes on it. and be a place for discussion that won't go away when the slack scroll limit is hit#2021-03-0519:02Carlothanks, yes, I'll probably do that. I stepped through that, hence my disbelief, since the only place in which it could have changed is:
(pcase method
((or (pred integerp) `(,method))
and I don't think that modifies method. Anyway, yes, I'll head for github#2021-03-0519:43Carlooh, no, there were known issues https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00172.html#2021-03-0519:46dpsuttonoof. sucks when its a language control flow issue you end up diagnosing#2021-03-0520:04Carloso, there was a PR here https://github.com/clojure-emacs/clojure-mode/pull/585/files following that discussion, but I tried to modify that locally, and the problem persists#2021-03-0520:05Carloit doesn't help that I don't understand why pcase (which is pattern matching) should ever overwrite the variable it's matching on. I'm trying to understand the semantics of pcase now that we restricted the problem#2021-03-0520:09Carlopinging @manuel since he knows more#2021-03-0520:12Carloah, no, my bad, it's not literally the same problem 👼#2021-03-0520:40Carloproblem solved 🙂#2021-03-0603:20macrobartfastI'm diving into the illustrious and awesome Biff framework. I'm not sure how I should be connecting to the terminal based repl that runs, in that framework, via ./task dev. I tried cider-connect-clj&cljs, chose shadow, then :app.
At that point:
• I can evaluate a form in either repl buffer
• I can evaluate a form in any clj buffer (via cider-eval-defun-at-point)
• I can evaluate a form in any cljs buffer (via cider-eval-defun-at-point) if I switch to clojure-mode
• However, if I evaluate a form in a cljs buffer using cider-eval-defun-at-point nothing occurs, either in the buffer or in either repl buffer
I recall having this issue before several times in non-Biff projects, so it's likely how I'm going about it all.
There are a myriad of permutations of how I could be connecting from Emacs... maybe I should be trying a different approach.
Any thoughts or things to try?#2021-03-0603:23macrobartfastIf I recall, using cider-jack-in-clj&cljs often would solve this sort of problem in the past, but here I think I need to actually connect because Biff's ./task dev is doing other things.
At any rate, doing so here produces
error in process sentinel: Could not start nREPL server: shadow-cljs - config: <path-to-project>/shadow-cljs.edn
shadow-cljs - connected to server
server already running
#2021-03-0603:34macrobartfastI just noticed that, whilst in a cljs file, when in clojurescript-mode I see
cider[not connected]
but if I switch to clojure-mode it shows as being connected.#2021-03-0603:35macrobartfastBut I do have a working cljs (as well as clj) repl buffer in all cases.#2021-03-0603:55dpsuttonthis might be a longstanding issue. when in the cljs buffer, focus the cljs repl and then focus the cljs buffer again. do not go into the clj repl. it only "sees" the last repl you were in#2021-03-0604:03macrobartfastAh, yes. That has worked in the past. Here, unfortunately, it doesn't. 😞#2021-03-0604:04macrobartfastactually, hang on while I monkey around with variations on that.#2021-03-0604:18macrobartfastWell, that fix not working this time.#2021-03-0604:18macrobartfastBut it's good to remember that one; it's helped in numerous occasions.#2021-03-0604:22macrobartfastThe project team primarily use piggieback and Vim, if that's any help.#2021-03-0604:37macrobartfastthe cljs repl says 'REPL[pending-cljs]' in the status bar, but does eval forms.#2021-03-0604:44dpsuttonCan you eval (js/alert “hi”)?#2021-03-0604:45dpsuttonI’m guessing it will say unknown namespace js#2021-03-0604:46dpsuttonIf so you need to connect to the js runtime as it’s still a clj repl. Load the webpage or run the node script #2021-03-0604:49macrobartfastyep...
Caused by: java.lang.RuntimeException: No such namespace: js
#2021-03-0604:50dpsuttonYeah. Is this a web app? If so load it up in the browser#2021-03-0604:50dpsuttonYou need a js engine#2021-03-0604:51macrobartfastIt is a web app... it is loaded in the browser... I just reloaded it without success.#2021-03-0604:51dpsuttonIs figwheel on your class path ? As a dependency somewhere#2021-03-0604:51macrobartfastlet me grep for that.#2021-03-0604:53dpsuttonSo to step back, you need an nrepl server that has cider and piggieback involved so that it can handle the js stuff for you#2021-03-0604:53macrobartfastokay...#2021-03-0604:54macrobartfastsearching for piggieback... the project creator is a Vim user, so I don't know if that completely crosses over... https://github.com/jacobobryant/biff#2021-03-0604:54macrobartfastI should just use Vim, but I'm so... addicted... to Emacs.#2021-03-0604:57macrobartfastHe does evaluate from within a cljs file in Vim in one of his demonstrations, for what it's worth.#2021-03-0604:57blak3mill3ryou can definitely use piggieback + emacs#2021-03-0604:57macrobartfastwhew.#2021-03-0604:58macrobartfastIf it works for him in Vimland... does that imply it has what I need as an Emacsoid?#2021-03-0604:59macrobartfastIt seems like he'd also need piggieback... but that's way over my head at this point.#2021-03-0604:59blak3mill3rI use piggieback+emacs+cider and it works wonderfully for me#2021-03-0604:59blak3mill3rbut, you mention that#2021-03-0604:59blak3mill3ryou have some clj buffers and some cljs buffers#2021-03-0604:59macrobartfastI do.#2021-03-0604:59blak3mill3rand, while I understand that this does work for some people, I haven't used it that way#2021-03-0605:00blak3mill3rI'm generally writing one or the other, in a particular instance of emacs#2021-03-0605:00macrobartfastthings eval in the clj and cljs repl buffers, and in clj files, and clj will eval in cljs buffers when in clojure-mode...#2021-03-0605:00blak3mill3rI think it should work fine with 2 nrepl connections#2021-03-0605:00blak3mill3ryes but when you are setting clojure-mode in your cljs buffer, are you sure it is evaluating clojurescript and not clojure?#2021-03-0605:00blak3mill3rCaused by: java.lang.RuntimeException: No such namespace: js
#2021-03-0605:00blak3mill3rlooks suspiciously like you are sending clojurescript code to your JVM clojure process#2021-03-0605:01macrobartfastI am guessing it is eval'ing clojure.#2021-03-0605:01blak3mill3ryeah so#2021-03-0605:01blak3mill3rwhat you want to do is use piggieback#2021-03-0605:01blak3mill3rto sort of switch modes...#2021-03-0605:01blak3mill3ryou can also have 2 active CIDER connections#2021-03-0605:01macrobartfastI wonder where I'd add that in to this framework (https://github.com/jacobobryant/biff) then...#2021-03-0605:01blak3mill3r2 repl buffers#2021-03-0605:02blak3mill3rI haven't seen this biff framework, I will take a look#2021-03-0605:02macrobartfastbecause the last I understood anything was in the glorious simple days of project.clj and so on.#2021-03-0605:02macrobartfastThen the clone wars happened, things got complicated, and all that.#2021-03-0605:02macrobartfastBiff is actually phenomenal. But it's what one would call a 'learning opportunity' for a simpleton like me.#2021-03-0605:03macrobartfastHere is his overview page: https://findka.com/biff/#introduction#2021-03-0605:04blak3mill3ryou are using figwheel; figwheel's cljs-repl supports (expects, I think) piggieback to be on your classpath#2021-03-0605:04blak3mill3rare you using leiningen?#2021-03-0605:05blak3mill3ris your name a play on Slartibartfast?#2021-03-0605:05macrobartfastI normally do, but here I run the framework's
./task dev
and I should try to find out what that is doing more.#2021-03-0605:05macrobartfastIt is composed of simple Clojure idioms, however.#2021-03-0605:07blak3mill3rhttps://github.com/jacobobryant/biff/blob/master/task#2021-03-0605:07blak3mill3rit's an extremely short bash script#2021-03-0605:07macrobartfasthaha... and yes, my name is indeed a play on Slartibartfast. 😀#2021-03-0605:08blak3mill3rI'd rather be happy than right, any day#2021-03-0605:08macrobartfast"Perhaps I'm old and tired, but I think that the chances of finding out what's actually going on are so absurdly remote that the only thing to do is to say, "Hang the sense of it," and keep yourself busy. I'd much rather be happy than right any day."#2021-03-0605:08macrobartfasthaha... our messages crossed, lol.#2021-03-0605:09blak3mill3rcider/piggieback {:mvn/version "0.4.1"}#2021-03-0605:09blak3mill3r^ add this to your ~/.clojure/deps.edn (or to your project's deps.edn)#2021-03-0605:10macrobartfastok, on it.#2021-03-0605:10blak3mill3rsorry that version is not up to date#2021-03-0605:10blak3mill3rthere are some other dependencies too which you may or may not already have#2021-03-0605:10blak3mill3r:aliases {:nrepl
{:extra-deps
{nrepl/nrepl {:mvn/version "0.8.2"}
cider/piggieback {:mvn/version "0.5.2"}}}}
^ these are recent, from the figwheel README#2021-03-0605:11macrobartfastit goes under :aliases?#2021-03-0605:11blak3mill3rI believe you need to configure figwheel to use cider/piggieback too#2021-03-0605:11blak3mill3rsee here https://github.com/bhauman/lein-figwheel#figwheel-server-side-configuration#2021-03-0605:11blak3mill3ryes :aliases is one way to do it#2021-03-0605:11macrobartfastBruce is straight out of Hitchhikers.#2021-03-0605:11blak3mill3rit depends if you think that figwheel is a personal development tool#2021-03-0605:12blak3mill3ror part of your projects dev dependencies#2021-03-0605:12blak3mill3ryou can put it in the project's deps.edn#2021-03-0605:12blak3mill3rif you want other users of your app to have it for sure#2021-03-0605:12blak3mill3ryour figwheel config probably wants to configure the nREPL middleware#2021-03-0605:12macrobartfastI'm putting it in globally.#2021-03-0605:12blak3mill3rsee where it says
Load CIDER, refactor-nrepl and piggieback middleware
#2021-03-0605:13macrobartfastpiggieback, that is.#2021-03-0605:13blak3mill3rwithout that it will sort of work in a crippled way (lots of CIDER features missing)#2021-03-0605:14macrobartfastok... trying to get that all in.#2021-03-0605:15blak3mill3rI am trying to catch up on what biff is doing when you run ./task dev#2021-03-0605:15blak3mill3rbut you do have figwheel running, right?#2021-03-0605:15blak3mill3rI have a function in my clojure dev namespace that first starts figwheel and then calls figwheel-sidecar.repl-api/cljs-repl#2021-03-0605:16blak3mill3rwhich converts the clojure nREPL connection to a clojurescript one, using piggieback#2021-03-0605:16macrobartfastI don't know if I do...#2021-03-0605:16macrobartfastthat is, if I have figwheel running.#2021-03-0605:16blak3mill3rok#2021-03-0605:17macrobartfastI once understood things... barely... then boot came along, then the successors...#2021-03-0605:17blak3mill3ris the code something you can share?#2021-03-0605:17blak3mill3ror, if I generate a new empty biff project and get emacs+cider+piggieback working would that help?#2021-03-0605:17macrobartfastomg, tremendously.#2021-03-0605:18macrobartfastI would also then be the rather dubious Biff Emacs integration expert, as well.#2021-03-0605:18macrobartfastPresumably I could write it up for the Biff docs.#2021-03-0605:20macrobartfastAnd eventually add it to the project, for the Emacsians. But I'd probably have folks here audit it first, lol.#2021-03-0605:21blak3mill3rI am fiddling about#2021-03-0605:21macrobartfastOK, I'll shut up.#2021-03-0605:21blak3mill3rhaha, not what I meant#2021-03-0605:21macrobartfastI know.#2021-03-0605:24blak3mill3rdid you say that you were using figwheel? because it seems like my newly generated biff project uses shadow-cljs#2021-03-0605:24blak3mill3rI see nothing indicating that it uses figwheel#2021-03-0605:26macrobartfastaha.#2021-03-0605:27macrobartfastI don't even know what I am using... I connect via cider-connect-clj&cljs from within Emacs.#2021-03-0605:27macrobartfastSo I don't know if that implies figwheel or not.#2021-03-0605:27dpsuttonhow are you starting the repl?#2021-03-0605:28blak3mill3rwith this arcane bash stuff in biff ... I am looking into what it does#2021-03-0605:28macrobartfastWell, in this case, the repl is started by the framework...#2021-03-0605:28blak3mill3rdev () {
if ! [ -e node_modules ]; then
init
fi
npx onchange -i tailwind.css -- ./task build-css-dev &
trap 'kill $(jobs -p) 2> /dev/null' EXIT
mopt="-A"
if clj -Sdescribe | grep -q repl-aliases; then
mopt="-M"
fi
BIFF_ENV=dev clj $mopt:cljs "$@" -m $MAIN_NS
}#2021-03-0605:28blak3mill3rthat's what it does ^#2021-03-0605:28blak3mill3rwhen you run ./task dev#2021-03-0605:28dpsuttonyeah. its crazy. yes. so are you calling ./task dev?#2021-03-0605:28macrobartfastthank you, was just about to paste it.#2021-03-0605:28macrobartfastI am.#2021-03-0605:28dpsuttonok. i'm not sure how you're even connecting to that. i don't see any nrepl getting started or involved#2021-03-0605:28blak3mill3rand, when I did this, I got some complaints about it not finding cider/nrepl and refactor-nrepl/middleware#2021-03-0605:29macrobartfasthang on, let me look.#2021-03-0605:29dpsuttoni'm confused why it even has an nrepl server. that's just calling clj -M:cljs -m example.core or whatever#2021-03-0605:29blak3mill3rright#2021-03-0605:29blak3mill3rperhaps they bake it in#2021-03-0605:30macrobartfastI'm digging around, but pretty slow on the uptake on this.#2021-03-0605:31macrobartfastwhen you run ./task dev, this is in the output in the terminal:
Downloading: cider/piggieback/0.5.2/piggieback-0.5.2.pom from clojars
#2021-03-0605:32blak3mill3ris that because you added piggieback as a dependency in your ~/.clojure/deps.edn perhaps?#2021-03-0605:32dpsuttonok. so shadow is in charge of the nrepl stuff. but there's no middleware so CIDER can't work with it. wont need piggieback in a shadow-cljs project#2021-03-0605:32dpsuttonso that's not an issue. its just getting shadow setup with the correct middleware#2021-03-0605:32macrobartfastI don't think so... you do finally get
shadow-cljs - nREPL server started on port 7888
#2021-03-0605:32dpsuttonand the main ns calls biff/start-system with its own map#2021-03-0605:33blak3mill3rcider docs have instructions on cljs jack-in with shadow-cljs here https://docs.cider.mx/cider/cljs/shadow-cljs.html#using-cider-jack-in-cljs#2021-03-0605:33blak3mill3r@macrobartfast I thought I understood you to say that you were using figwheel, but I think that is not the case... maybe I misunderstood#2021-03-0605:33macrobartfastI tried cider-jack-in-cljs but had issues...#2021-03-0605:34dpsuttonthis stuff is absolutely crazy and i can't see you getting it running with CIDER unless you're an expert#2021-03-0605:34dpsutton(nrepl/start-server :port 7888) is burried in biff.components and is called by biff/start-system#2021-03-0605:34macrobartfastwell, that's helpful to know...#2021-03-0605:35blak3mill3rhaha this framework looks ... deep ... I am trying to get it to work with jack-in-cljs#2021-03-0605:35blak3mill3rit looks cool but yeah, adding cider+cljs is not going to be super obvious#2021-03-0605:35macrobartfastI had thought it was just a matter of choosing the right cider command in Emacs or whatnot, lol...#2021-03-0605:36dpsuttonsome things you could do is pass :biff.init/start-nrepl false and be in charge of your own nrepl server. but the challenge is that all of this stuff is kinda twice removed from your own project#2021-03-0605:37dpsuttonso you need to tell it to not do anything and then do everything correctly yourself. but the css is watched in some random shell scripts, the nrepl and shadow started elsewhere, etc#2021-03-0605:37dpsuttoni don't care for this kind of thing. i much prefer you being in control of starting nrepl, and shadow.
(defn init [sys]
(let [env (keyword (or (System/getenv "BIFF_ENV") :prod))
unmerged-config (bu/catchall (edn/read-string (slurp "config/main.edn")))
config (some-> unmerged-config (merge-config env))
{:biff/keys [first-start dev]
:biff.init/keys [start-nrepl start-shadow]
:as sys} (merge sys config {:biff/unmerged-config unmerged-config})]
(let [start-nrepl (if (some? start-nrepl) start-nrepl (not dev))
start-shadow (if (some? start-shadow) start-shadow dev)]
(when (and first-start start-nrepl)
(nrepl/start-server :port 7888))
(when (and first-start start-shadow)
; Without this, I sometimes get the following when loading localhost:9630:
; java.lang.Exception: Unable to resolve spec: :edn-query-language.core/property
(require 'edn-query-language.core)
((requiring-resolve 'shadow.cljs.devtools.server/start!)))
sys)))#2021-03-0605:37macrobartfastyeah... that's what made me think I wouldn't be able to just jack in, as it were...#2021-03-0605:38dpsuttonhere's all the code in biff that does this stuff. so you need to smuggle all your middleware down through to here, etc#2021-03-0605:38macrobartfastgotcha, ok...#2021-03-0605:38blak3mill3rI have discovered something... I know why it complained about middleware not found when I started ./task dev#2021-03-0605:38dpsutton#:biff{:first-start first-start
:routes routes
:static-pages pages
:event-handler #(api % (:?data %))
:rules #'rules
:triggers #'triggers
:jobs jobs
:send-email #'send-email
:after-refresh `after-refresh}
and here's the knobs you have to thread all that stuff down#2021-03-0605:39blak3mill3rit's because, shadow-cljs.edn has :deps {:aliases [:cljs]} in it and that is an alias I have defined globally#2021-03-0605:39dpsuttonnah its because of this line from above: (nrepl/start-server :port 7888) no way to get middleware into there#2021-03-0605:39blak3mill3risn't there ... an edn file#2021-03-0605:40blak3mill3ryeah there is#2021-03-0605:40blak3mill3rcat ~/.nrepl/nrepl.edn
;; can be overridden locally with .nrepl.edn ... which replaces (not merges) those here
{:bind "localhost"
:middleware [cider.nrepl/cider-middleware
#_cider.piggieback/wrap-cljs-repl
refactor-nrepl.middleware/wrap-refactor]}#2021-03-0605:40dpsuttonoh yeah. i hate the idea of globally defined files for this stuff. that's system wide and expects random projects to have those deps#2021-03-0605:41blak3mill3rI mean, I agree with @dpsutton in spirit... I don't like too much magic around starting the system#2021-03-0605:41dpsuttonso many issues from old profiles.clj people have laying around#2021-03-0605:41blak3mill3rbut I still think I can make this biff + cider thing work with what's there#2021-03-0605:41macrobartfastI understand where you're coming from, @dpsutton.#2021-03-0605:42dpsuttonbut anyways, this is all designed if just connect to an nrepl port with no other requirements. cider will be very neutered in this thing.#2021-03-0605:43macrobartfastThis project is an effort to get a more turn-key thing going for people, but it fairly bound to a specific editor, at the moment, it seems, at least for inline eval'ing.#2021-03-0605:44macrobartfastThis has exposed my lack of comprehension of cider and figwheel in general... which is a good thing.#2021-03-0605:44macrobartfastIt's probably time for me to finally put more effort into understanding the repl magic I like so much.#2021-03-0605:46macrobartfastI kind of understood things when figwheel first came out (yay, flappy bird)... but things got increasingly complex for me to grok.#2021-03-0606:07blak3mill3rSo... while I am not sure exactly which features of cider+figwheel you loved, I want to point out that shadow-cljs is a very different way of working with clojurescript; I have not yet tried it, but I suspect that dpsutton is correct that a ton of useful CIDER stuff will be missing#2021-03-0606:07blak3mill3rit sounds like you can get some of the same features (live cljs recompilation, cljs repl)#2021-03-0606:08macrobartfastgotcha... mainly, I like being able to hit a db from within the code...#2021-03-0606:08macrobartfastas well as atoms...#2021-03-0606:08blak3mill3rhit a db ... from jvm clojure right?#2021-03-0606:08macrobartfastso I can refine my functions.#2021-03-0606:08macrobartfastWell, db from Clojure, atoms and remote calls from ClojureScript.#2021-03-0606:09macrobartfastThat's my general use, anyway.#2021-03-0606:09blak3mill3rok, good#2021-03-0606:09blak3mill3rthen you wont miss the rest of the CIDER features#2021-03-0606:09blak3mill3rI am still fiddling about#2021-03-0606:09macrobartfastI'd be cool probably without them.#2021-03-0606:10blak3mill3rthus far I have not gotten biff to start and have cider middleware#2021-03-0606:10macrobartfastok... massive gratitude, btw...#2021-03-0606:11blak3mill3rhappy to try#2021-03-0606:11blak3mill3rbiff does look interesting... it is far from the way I am used to working with clojurescript though#2021-03-0606:11macrobartfastBiff is a cool project in general, and so if I can get it to work I learn all about crux and so on, the things baked into the framework.#2021-03-0606:14macrobartfastIt also allows you to deploy a site to the very affordable Digital Ocean very quickly with a lot of features I want in a basic project... and I like to experiment so it's appealing.#2021-03-0606:19blak3mill3rooh it uses crux? very cool#2021-03-0606:20blak3mill3rwell I got a cider+piggieback cljs repl working in emacs with my biff project ... but I'm not there yet#2021-03-0606:22macrobartfastI'm as excited as a pomeranian on the back dash of a car who's just spotted its owner come out of a donut shop.#2021-03-0606:23blak3mill3runfortunately I think what I've done is not compatible with the way biff starts the repl though#2021-03-0606:24blak3mill3roddly it sounds like piggieback + shadow-cljs is not really a thing, even though the vim-fireplace code supposedly supports converting to a cljs repl with shadow-cljs, and calls this feature :Piggieback ... I think the relationship is in name only#2021-03-0606:25blak3mill3r@macrobartfast do you know if anybody is using biff without shadow-cljs?#2021-03-0606:25macrobartfastI don't think anyone is.#2021-03-0606:25macrobartfastI don't know, really...#2021-03-0606:26macrobartfastbut it's a fairly new project.#2021-03-0606:26blak3mill3rit is possible that the Right Way to accomplish this (cider+biff) is to provide an alternative that starts nREPL with cider middleware and then uses piggieback to turn it into a cljs repl#2021-03-0606:26macrobartfastthe framework creator would probably be super down for that...#2021-03-0606:27blak3mill3rthat is going to have the advantage of supporting all the amazing CIDER features;#2021-03-0606:27macrobartfastthey indicated curiosity about Emacs in general.#2021-03-0606:27blak3mill3rthe thing is, the selling points of shadow-cljs don't apply to everyone... this is the kind of thing that makes designing opinionated frameworks extremely challenging#2021-03-0606:27blak3mill3rIIUC#2021-03-0606:28blak3mill3rI mean I have always loved using figwheel and piggieback, and didn't mind that it was running JVM clojure for the cljs compilation. I am not an expert on shadow-cljs at all, but IIUC it is using the self-hosted CLJS compiler#2021-03-0606:29macrobartfastwell, the framework touches on one of the Clojure conundrums in general... how to get a greenfield project up and deployed with usual features in a short amount of time...#2021-03-0606:29macrobartfastand I guess I would go to another language for that sort of situation... but, of course, I'm not going to for all the reasons none of us would.#2021-03-0606:30blak3mill3rnah I must be wrong about that... clearly shadow-cljs is starting a clojure process here#2021-03-0606:31blak3mill3rI don't see anything fundamentally wrong with the idea of having another way to start biff that uses piggieback. I was able to make it work (but not loading the actual biff app's cljs sources)#2021-03-0606:31blak3mill3rI mean, I created a biff project, added the necessary middleware, and then I was able to get piggieback to work compiling something in the context of that project#2021-03-0606:34blak3mill3rthat is really far from the way biff has it working though, with shadow-cljs#2021-03-0606:34macrobartfastpomeranian actually shatters rear windshield#2021-03-0606:35blak3mill3rhttps://github.com/tpope/vim-fireplace/issues/322 refers to some CIDER doc that says that shadow-cljs provides its own middleware so maybe I am going about this totally the wrong way trying to use piggieback#2021-03-0606:37macrobartfastomg this is all deep... reading that now.#2021-03-0606:41blak3mill3rI do actually see some evidence that biff without shadow-cljs might be a thing already#2021-03-0606:44macrobartfastI just asked the Biff main author about this.#2021-03-0606:48blak3mill3rit seems like maybe the biff SPA only knows how to compile the cljs using shadow-cljs though#2021-03-0606:54macrobartfastbiff.core/default-mpa-components…#2021-03-0606:55macrobartfast:biff/start-shadow...#2021-03-0606:56blak3mill3ryeah I found that#2021-03-0606:57blak3mill3rbut without shadow, there's no clojurescript compiler included, unless I am missing something#2021-03-0606:57blak3mill3rhowever I did just get a cljs repl buffer in emacs that was connected to the browser which had my biff app loaded#2021-03-0606:57macrobartfasthttps://github.com/jacobobryant/biff/blob/58c43851393daa0020f27c407f9b2712944823a1/src/biff/core.clj#L37#2021-03-0606:57blak3mill3rbut wasn't able to get my emacs clojurescript-mode buffers to eval over this connection#2021-03-0606:58macrobartfastah ok#2021-03-0606:58macrobartfastI had a cljs repl... but I don't know if it was browser based... js/alert never worked IIRC#2021-03-0606:59blak3mill3rI have used cider-connect-cljs and connected successfully to the nREPL server started by ./task dev which is launching shadow-cljs#2021-03-0607:00blak3mill3rso I have a cider-repl buffer in emacs, in which (js/alert 1) works#2021-03-0607:00blak3mill3rwith the biff app in the browser#2021-03-0607:00blak3mill3rthis is pretty close to what you want#2021-03-0607:00blak3mill3rbut not quite#2021-03-0607:00blak3mill3rI don't understand yet why the clojurescript-mode buffer is not sesman-linked with the cljs repl connection#2021-03-0607:02macrobartfastgoogling sesman#2021-03-0607:02blak3mill3ran emacs dependency of cider#2021-03-0607:02blak3mill3rwhich allows it to have multiple nrepl connections simultaneously, and each buffer associated with one of them#2021-03-0607:03macrobartfastgotcha#2021-03-0607:03blak3mill3rthis is where the forms go when you cider-eval-last-defun for example (for each buffer, sesman associates it with an nrepl connection)#2021-03-0607:03blak3mill3rit seems like it should've been associated after I got cider-connect-cljs to work#2021-03-0607:03blak3mill3rwith the shadow-cljs option (`:app`)#2021-03-0607:03blak3mill3rbut it aint yet 😢#2021-03-0607:04macrobartfastright?#2021-03-0607:04macrobartfastall I wanted was a Pepsi.#2021-03-0607:06blak3mill3raha, the slack archives has a clue! https://clojurians-log.clojureverse.org/cider/2020-05-18#2021-03-0607:07macrobartfastperusing that.#2021-03-0607:08macrobartfastbut also the basics https://shadow-cljs.github.io/docs/UsersGuide.html#missing-js-runtime#2021-03-0607:12macrobartfastare you trying those newer versions?#2021-03-0607:18blak3mill3rbummer ... the symptom I am seeing now is identical to that person in the slack archive#2021-03-0607:20blak3mill3rI wanted to update the versions but ran into some troubles; there is presumably a transitive dependency on clojure/clojurescript from either shadow-cljs or from biff itself#2021-03-0607:20macrobartfastI am cleaning up my shadow-cljs situation... turns out I didn't have a top level shadow-cljs.edn, for starters...#2021-03-0607:20blak3mill3ranyway that version mentioned in the slack archive as "fixing" (somewhat mysteriously) the issue is old-ish today#2021-03-0607:21macrobartfastgotcha#2021-03-0607:21blak3mill3rI don't have a top-level shadow-cljs.edn either#2021-03-0607:22macrobartfastI had one in my Documents folder, lol, from another project.#2021-03-0607:22macrobartfastIt found it.#2021-03-0607:23macrobartfasthttps://shadow-cljs.github.io/docs/UsersGuide.html#user-config#2021-03-0607:23macrobartfastI am learning a ton right now.#2021-03-0607:26macrobartfastok, have a js/alert working from the cljs repl now myself, which is progress.#2021-03-0607:28blak3mill3rit seems like it is very very close to working, my own cider-repl buffer that came from cider-connect-cljs to the shadow-cljs nrepl is stuck in a state pending-cljs (even though it is clearly sending code to the browser itself, this prevents cider-eval-* from working in clojurescript-mode buffers)#2021-03-0607:28macrobartfastthat, after putting in a global shadow-cljs.edn in ~/.shadow-cljs/config.edn with the most recent cider-nrepl version.#2021-03-0607:28blak3mill3rmakes sense, that's something like what I did#2021-03-0607:28macrobartfastI have had that pending-cljs message too.#2021-03-0607:28blak3mill3rhttps://github.com/clojure-emacs/cider/issues/2456#2021-03-0607:29blak3mill3rtrack-state middleware...#2021-03-0607:31blak3mill3raha https://docs.cider.mx/cider/repl/configuration.html#repl-type-detection#2021-03-0607:31macrobartfast"Also - are all of you using the latest piggieback?"#2021-03-0607:32blak3mill3ryour pomeranian is gonna love this#2021-03-0607:32blak3mill3r🎉#2021-03-0607:32blak3mill3rtry the following#2021-03-0607:33blak3mill3reval this elisp (setq cider-repl-auto-detect-type nil)#2021-03-0607:33blak3mill3rthen with your pending-cljs repl active#2021-03-0607:33blak3mill3rexecute cider-set-repl-type and choose cljs#2021-03-0607:34blak3mill3rit is working for me#2021-03-0607:35blak3mill3rcider docs say this can happen "in rare cases such as a bug in shadow-cljs" (paraphrased)#2021-03-0607:35macrobartfastdoing it now#2021-03-0607:36blak3mill3rthe reality is that whatever the track-state middleware is supposed to do to allow cider to detect that the repl has become a cljs repl is broken (perhaps the way biff is running shadow-cljs simply does not load the track-state middleware, or it could be that it loads it in the wrong order, etc)#2021-03-0607:36blak3mill3rbut now I have cider+biff with cljs cider-eval-* and hot compilation of clojurescript (a la figwheel)#2021-03-0607:38macrobartfastom#g.#2021-03-0607:38blak3mill3rcider ?#2021-03-0607:38macrobartfastit works.#2021-03-0607:38blak3mill3rhooray#2021-03-0607:38macrobartfastdied. applying defibrillation paddles. back.#2021-03-0607:38blak3mill3rdrink some cider#2021-03-0607:39blak3mill3rand Don't Panic#2021-03-0607:43macrobartfasthahaha#2021-03-0607:38macrobartfasthahaha#2021-03-0607:39macrobartfastI've dodged the Vim bullet, again.#2021-03-0607:39macrobartfastwell, I do use evil mode in emacs, but don't tell anyone.#2021-03-0607:40blak3mill3ra ton of people do... I used vim for 12 years and before I switched to emacs#2021-03-0607:40blak3mill3ryou should make sure to write down how we got it working#2021-03-0607:41macrobartfastThis was epic. I am copying this entire session and having it engraved on a palladium plate.#2021-03-0607:41blak3mill3rI myself am a little tired and forgetful, though I think I know which bits were essential to my poking about#2021-03-0607:41macrobartfastI'm keeping it all. Because next week I'll be right at the start of it again.#2021-03-0607:42macrobartfasttwo palladium plates... one for launching beyond our solar system.#2021-03-0607:42macrobartfastI'm sure they'll be able to puzzle out our entire planet by studying that.#2021-03-0607:43macrobartfastgood lord, so grateful.#2021-03-0607:43macrobartfastsuper excited to dive into the various parts of this framework now (crux, etc).#2021-03-0607:44blak3mill3rsome cider features don't work...#2021-03-0607:44blak3mill3rTBH it's been a while since I clojurescripted and I am not sure how much of this is because it's using shadow-cljs ...#2021-03-0607:44blak3mill3rbut the basics work nicely, which is what you wanted!#2021-03-0607:45macrobartfastit's exactly what I wanted.#2021-03-0607:45macrobartfastI use very few features (unfortunately)...#2021-03-0607:45macrobartfastbut here the ignorance is an asset.#2021-03-0607:45blak3mill3rhaha, I'm glad I could help!#2021-03-0607:45macrobartfastI am ridiculously glad you could.#2021-03-0607:46macrobartfast😀#2021-03-0607:46blak3mill3rI am pretty sure I had cider-inspect working with cljs at some point and it is a nice feature, which it seems that the shadow-cljs nREPL server doesn't support even though the cider middleware is loaded#2021-03-0607:47macrobartfastI'm always on the verge of giving up software altogether, then an awesome person like you or @dpsutton or some other kind soul will step in and get my boat pointed in the right direction again.#2021-03-0607:47macrobartfastSo thank you again.#2021-03-0607:58blak3mill3rHere is some more info, this is important: https://github.com/thheller/shadow-cljs/issues/62#2021-03-0608:00blak3mill3ressentially it says that the way shadow-cljs works this way at all (i.e. without piggieback) is by emulating (some of) piggieback#2021-03-0608:08blak3mill3ralso relevant discussion here https://github.com/clojure-emacs/cider/issues/2239#2021-03-0608:26blak3mill3roh @macrobartfast I just noticed one other potential snag for people trying to use biff with cider+nrepl ... I had a global ~/.nrepl/nrepl.edn file configuring the cider.nrepl/cider-middleware and this appears to break whatever auto-configuration shadow-cljs is doing when it detects that cider-nrepl is on the classpath (as described here: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL)
That is, biff's shadow-cljs nREPL ONLY loads the cider middleware if I remove that ~/.nrepl/nrepl.edn file (which a lot of nrepl users will probably have lying around)#2021-03-0608:29macrobartfastok... so many gotchas.#2021-03-0608:30thhellerI'm happy to remove gotchas when someone tells me about them. I don't use cider-nrepl personally so I'm not aware of any issues it may have with shadow-cljs unless someone tells me.#2021-03-0617:05dpsuttonthis is all from trying to use biff, which tries to helpfully start everything up and prevents us from putting the necessary dependencies in place. its a bit like lein-shadow where it's trying to be helpful and that means its not super helpful#2021-03-0619:00macrobartfastI understand... my 'gotchas' was mainly about the whole process of getting biff to work in my setup...#2021-03-0619:02macrobartfasthopefully when my knowledge increases I might be able to contribute to biff by helping to make a startup option that would enable easier use with Emacs... or at least that seemed like an option that would work...#2021-03-0619:03macrobartfastfor someone like me biff offers a ton of value in being an integrated working system... I can see how all the parts fit together.#2021-03-0619:12macrobartfastnot to mention speed of deployment of ideas I want to explore. But I understand the tradeoffs of any integrated system.#2021-03-0608:35macrobartfastTotally... and no one could anticipate the issues from all the combinatorial possibilities of all the parts.#2021-03-0608:37macrobartfastWhat's crazy to me is how often this all just works.#2021-03-0708:39craftybonesI am working on something quil related that requires usage of jdk8. Once I do that, cider starts throwing errors on the REPL. Seems to specifically be around getting eldoc#2021-03-0708:39craftybonesERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns user, :sym clojure.core, :session 58ec4a68-f90e-4730-b48c-6ea94a8f23d8, :id 73}
java.lang.ClassNotFoundException: com.sun.tools.javac.util.List#2021-03-0708:43craftybonesI guess there’s an issue for it here: https://github.com/clojure-emacs/cider/issues/2732#2021-03-0710:40bozhidar@srijayanth Actually, that's the result of trying to fix this issue in https://github.com/clojure-emacs/orchard/issues/103 You can mention your problem in the comments there#2021-03-0710:50craftybonesThanks, will do. Meanwhile, is there anyway where I can connect to some existing repl running on JDK8 for quil and maybe a different repl on a different jdk where cider runs its middleware?#2021-03-0710:54craftybonesI could create multiple connections and maybe limit the repl execution to some package or directory#2021-03-0713:56yuhanIs there any way for Cider to differentiate between regular nil s and undefined vars / general errors in Clojurescript?#2021-03-1016:52niveauverleihHi. I get "No applicable method: sesman-start-session, CIDER" since I updated emacs and cider yesterday. I use spacemacs dev. Any ideas?#2021-03-1016:52dpsuttontry (require 'cider)#2021-03-1018:04chrisnIS there a recommended way to, from a repl session, terminate the repl server? I have finally got a clojure cider repl hosted by a python .exe working and at some point I might want to return control to the python executable.#2021-03-1019:30chrisn-- nm above. The easiest way is to start a repl server and save the server and then later call stop-server on it.#2021-03-1019:31dpsuttonwhat does save the server mean?#2021-03-1114:43chrisnI meant record the server into an atom and then call stop-server on that atom when I want to terminate the repl session.#2021-03-1214:27CaseyHow can I teach cider that https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljc#L131-L147 is like clojure.core/if-let (or perhaps rather like clojure.core/let ) ?#2021-03-1214:43bozhidarI see it already has indent metadata. What's the issue then?#2021-03-1215:16CaseyGeh, you're right. At first it wasn't indenting properly. Restarted emacs and it's behaving properly now 😕#2021-03-1215:18CaseyHm I wonder if it was a multiple repl thing. I've sometimes got several repls open, and it seems the cider-eval-* commands have an affinity for the last open repl window. Is there some sort of streamlined workflow for targeting a certain repl, without switching to its buffer and back?#2021-03-1215:22bozhidarThere are some issues with the multi-REPL handling right now. It's on my todo to fix them (and maybe bring back the old mode of operation when you could just assign a fixed REPL to which to route all evaluation commands), but I've been super busy lately.#2021-03-1301:22blak3mill3rMy favorite old feature... I have some dirty hack that emulates it#2021-03-1301:22blak3mill3rOne repl per emacs instance, the target of all evals#2021-03-1301:23blak3mill3rcider thank you, Bozhidar, for making such a power tool!#2021-03-1308:39bozhidarThanks! In hindsight I think that adopting Sesman was a huge mistake, but unfortunately it's not easy to undo it. It was supposed to make working with multiple REPL easier, but clearly it made it everything more complex. 😞#2021-03-1521:01blak3mill3rIt was a nice idea to be able to send forms to the right repl for eval... but I would sometimes cider-jump-to-def into some library code in a jar, then turn off read-only-mode and muck with it and eval it... and the introduction of sesman made it annoyingly tell me that it didn't know where I wanted to eval that, even when there was only one option#2021-03-1809:01bozhidarYep, in hindsight sesman created more problems than it solved. If I had more time on my hands I probably would have removed it by now.#2021-03-1306:24zaneAnyone have any idea what might be triggering this message when I launch a REPL?
Error killing transient buffer: (error Process nrepl-connection is not a subprocess)
#2021-03-1311:27yuhanyou could toggle debug-on-error and examine the stacktrace the next time it appears#2021-03-1321:07zaneSeems like it’s maybe a Doom thing.#2021-03-1322:49zaneConfirmed that this is an issue in Doom in particular.#2021-03-1322:50zaneIt’s being fixed upstream, but in the meantime this is a workaround:
(after! cider
(set-popup-rule! "^*cider-repl" :quit nil :ttl nil))
#2021-03-1318:55CarloI'm trying to understand some code in clojure-lsp . To do that, I have some test code in emacs instance A, and my checkout of a clojure-lsp server in emacs instance B. Both these emacs instances are connected to an underlying clojure-lsp server via nrepl . I can successfully redefine functions this way. What I would like to be able to do, is using cider-debug-defun-at-point, to see the calls to the functions as they happen. But if I try to invoke that I get errors to the tune of:
clojure.lang.ExceptionInfo: null
#:clojure.error{:phase :read-source}
at clojure.main$repl$read_eval_print__9110$fn__9111.invoke (main.clj:433)
clojure.main$repl$read_eval_print__9110.invoke (main.clj:432)
clojure.main$repl$fn__9119.invoke (main.clj:458)
clojure.main$repl.invokeStatic (main.clj:458)
clojure.main$repl.doInvoke (main.clj:368)
clojure.lang.RestFn.invoke (RestFn.java:1523)
nrepl.middleware.interruptible_eval$evaluate.invokeStatic (interruptible_eval.clj:84)
nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:56)
nrepl.middleware.interruptible_eval$interruptible_eval$fn__980$fn__984.invoke (interruptible_eval.clj:152)
clojure.lang.AFn.run (AFn.java:22)
nrepl.middleware.session$session_exec$main_loop__1048$fn__1052.invoke (session.clj:202)
nrepl.middleware.session$session_exec$main_loop__1048.invoke (session.clj:201)
clojure.lang.AFn.run (AFn.java:22)
java.lang.Thread.run (Thread.java:832)
Caused by: clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag dbg
is there any way to get what I want? How does cider-debug actually work?#2021-03-1718:18tomdHi 👋 recently I've started having trouble calling cider-repl-set-ns successfully for cljs namespaces. I get
WARNING: Use of undeclared Var cljs.user/in-ns at line 1 <cljs repl>
and
#object[TypeError: Cannot read property 'call' of undefined]
(<NO_SOURCE_FILE>)
but calling (in-ns 'whatever-namespace) always succeeds. how can I go about fixing this? I'm guessing it should be calling cljs.core/in-ns instead? I haven't changed cider version recently. Stuck on v0.25.0. Thanks for any help#2021-03-1718:29tomdjust noticed that setting cider-repl-require-ns-on-set to t was causing this. when set back to nil, i'm not getting this behaviour. apologies if this has been fixed since v0.25.0. If someone can verify it's broken in master, I'll gladly make a github issue.#2021-03-1720:14bozhidarThe behavior is still the same, although I can't imagine how you'd be getting this error, unless cljs.core is not required for some reason.#2021-03-1721:26tomdI guess the require isn't working as expected in cljs 🤷 - I'll make an issue. May find some time to see if I can replicate in a more vanilla clj/cljs setup. Cheers#2021-03-1721:31thhellerrequire and in-ns are special forms in the CLJS REPL so they don't work when wrapped in some other form or so#2021-03-1721:32thheller(do (in-ns 'foo.bar) (require 'foo.bar)) for example wouldn't work#2021-03-1721:35tomdah! that's great to know, thanks!#2021-03-1721:35tomdI reckon I could do a PR for this#2021-03-1722:21tomdsubmitted.#2021-03-1809:01bozhidarMerged. 🙂#2021-03-1821:15dcjWhen I attempt to cider-jack-in from within (not at top level, e.g src/foo/bar.clj) a deps.edn project, CIDER is not finding my deps.edn file, and then asks "do you want to start a REPL outside a project", and if I do, then it doesn't load my deps.edn file anyway, so #fail. If I jack in from the root of my project, that works ok. Since nobody else seems to have this problem, presumably it is specific to me and my .emacs config. I would welcome any suggestions/ideas about where I should look/investigate to debug/fix this.#2021-03-1821:25dpsuttonUpdate your clojure mode I suspect#2021-03-1821:25dpsuttonYou might be on a version that wasn’t aware deps.edn was a top level project file#2021-03-1917:52Endre Bakken StovnerWhen I try to start Cider I get the error: error in process sentinel: Could not start nREPL server: Exception in thread "main" Syntax error compiling at (/private/var/folders/ld/dnys24ds0612rkybkfyhcsnm0000gn/T/form-init16555678544737374798.clj:4353:33) ... Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context. Anyone has any Ideas about what might be wrong? Google was of little help 🙂#2021-03-1917:52Endre Bakken StovnerThe whole (probably uninformative) trace is here:
error in process sentinel: Could not start nREPL server: Exception in thread "main" Syntax error compiling at (/private/var/folders/ld/dnys24ds0612rkybkfyhcsnm0000gn/T/form-init16555678544737374798.clj:4353:33).
at clojure.lang.Compiler.analyze(Compiler.java:6808)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$HostExpr$Parser.parse(Compiler.java:1020)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7094)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7094)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7094)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: create in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler.resolveIn(Compiler.java:7413)
at clojure.lang.Compiler.resolve(Compiler.java:7357)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7318)
at clojure.lang.Compiler.analyze(Compiler.java:6768)
... 48 more
Subprocess failed
#2021-03-1918:00dpsuttonfrom a terminal in that project can you run the equivalent startup command? clj or lein repl? If so, then try to add the versions that include cider's nrepl stuff#2021-03-1918:00dpsuttonbut this first test would identify if this is cider's mistake or your projects#2021-03-1918:11Endre Bakken StovnerCannot run lein repl. Same error message. So the problem is with my project setup then... Perhaps another channel might be a better place to ask. Thanks btw 🙂#2021-03-1918:11Endre Bakken Stovnerclj works, so perhaps it is lein specific...#2021-03-1918:23dpsuttonwell if there's no deps.edn file clj will just start up a repl blissfully unaware of your project. i suspect you're loading something. also you might have stuff left over in profiles.clj in your home directory that might be playing havoc with you#2021-03-2015:38tianshuIs there a command to browse a spec with namespace alias, like ::a/foo ?#2021-03-2115:39Carlo@dpsutton is there a way to inject the cider-nrepl middleware after doing M-x cider-connect if I want to connect to a specific repl?#2021-03-2115:49dpsuttondon't believe so#2021-03-2115:49dpsuttonthat stuff needs to be registered at the beginning as far as i know#2021-03-2115:51Carlocould you give us some ideas for the last thread currently in #lsp @dpsutton? My intent is having the server that's opened by clojure-lsp to include the cider-nrepl middleware#2021-03-2115:52Carlohonestly I don't even understand how we can use the same server for both lsp and nrepl, but let's maybe unify the discussion theer#2021-03-2115:52dpsuttondo you understand how cider normally starts a project up?#2021-03-2115:53dpsuttonnrepl is just a port listening for instructions and executing in your program. it can exist in any arbitrary project, which is how nrepl works in all clojure projects#2021-03-2115:54dpsuttonit might be a bit difficult though. nrepl expects to be the "main". if lsp also expects to have its own main to do its own startup, it might be easier to just add a call to startup an nrepl server in lsp so there's no conflict on what the entry point is#2021-03-2115:54Carlohere's my understanding: when I issue cider-jack-in, cider opens an nrepl server with all the middleware I'm interested in, and an nrepl client which I activate from the emacs side#2021-03-2115:54dpsuttonyes. and if you do that and look at the top of the repl buffer you'll see the exact command that is run to accomplish this#2021-03-2115:55Carloright, and I can see that when I start a project that uses clojure-cli. It's something like:
[nREPL] Starting server via /run/current-system/sw/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} refactor-nrepl {:mvn/version "2.5.1"} cider/cider-nrepl {:mvn/version "0.25.9"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:cider/nrepl#2021-03-2115:56Carlonow though, @ericdallo suggests some steps to hack on clojure-lsp that involve issuing cider-connect on the port in which clojure-lsp has exposed an nrepl server used for debugging#2021-03-2115:57Carlothe point is that that doesn't inject the cider-nrepl stuff, so it seems that my option would be convincing clojure-lsp to create a server with that dependency in the first place#2021-03-2115:57CarloI think that should involve adding the dependency here https://github.com/clojure-lsp/clojure-lsp/blob/master/project.clj#L27#2021-03-2115:58Carloso that that line looks more like:
:debug ^:leaky {:dependencies [[nrepl/nrepl "0.8.3"]
[cider/cider-nrepl "0.25.9"]]}#2021-03-2115:59Carlobut this seems not to be enough to start the nrepl server with the extension (I'm issuing lein with-profile +debug bin)#2021-03-2116:00dpsuttoni would add the deps from the -Sdeps from that startup command to your .clojure/deps.edn and then set your clojure lsp startup command to clj -M:cider/nrepl:debug#2021-03-2116:03dpsutton{:aliases
{:cider/nrepl
{:deps {nrepl/nrepl {:mvn/version "0.8.3"}
refactor-nrepl {:mvn/version "2.5.1"}
cider/cider-nrepl {:mvn/version "0.25.9"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware"}}}
add this alias to your ~/.clojure/deps.edn file and then clj -M:debug:cider/nrepl and you should have what you need. again, with the caveat that you might need to manually "start" the lsp stuff since the nrepl will be the main instead of whatever clojure-lsp expects to be the main#2021-03-2116:05Carlodoes this work even if clojure-lsp is based on lein?#2021-03-2116:08dpsuttonno. this is just if you're using deps.edn which i think will be the easier way to do this. but clojure-lsp has a deps.edn file and now that the java is compiled i thought you said it works#2021-03-2116:09Carlono, @ericdallo explained that there's a WIP branch for clojure-lsp which will switch to clojure-cli, but currently clojure-lsp is a lein project#2021-03-2116:18dpsutton~/p/c/clojure-lsp ❯❯❯ clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.9"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
nREPL server started on port 59664 on host localhost - #2021-03-2116:18dpsuttonworks for me#2021-03-2116:19dpsuttoni just copied the normal cider startup command and ran it in clojure-lsp#2021-03-2116:20dpsuttonconnects, etc#2021-03-2116:21dpsuttondebugging:#2021-03-2116:22CarloI see I see, let me try 🤯#2021-03-2116:23bozhidarBtw, you can actually inject cider-nrepl into a running nREPL instance, but CIDER can't do this just yet.#2021-03-2116:24bozhidar(you can inject any middleware in a running nREPL server)#2021-03-2116:24dpsuttoni thought i remembered some functionality like that but i figured it would complicate things at this stage#2021-03-2116:24bozhidarThe functionality exists, but I never got to implementing the support for it in CIDER - I do know that some people played with it and it worked for them (on other editors).#2021-03-2116:24dpsuttoni had a patch to create the startup command and copy it for exactly these situations but i don't know where its gone. some gist, branch, or stash somewhere#2021-03-2116:25dpsuttonas of now have to crank up some test project, copy from the repl buffer, and then kill it, then start up a project from the command line and connect to it#2021-03-2116:25Carlo@dpsutton what happens when I start the command you pasted in the clojure-lsp directory is that a server starts, then I open the clojure-lsp codebase in my editor, cider-connect there,#2021-03-2116:25Carloand when I try to mark something for debug I get:#2021-03-2116:26Carlohttps://i.imgur.com/SRKTR2Q.png#2021-03-2116:27dpsuttondid you require that namespace first?#2021-03-2116:27dpsuttoni don't know what's going on at the moment. which function are you trying to instrument?#2021-03-2116:28Carloah no, ok, if I evaluate all the buffer first, I can correctly instrument it (I never understood when/if I have to load namespaces myself, and when it's done automatically)#2021-03-2116:28Carlostill though#2021-03-2116:29CarloI'm instrumenting the incoming function at clojure-lsp/src/clojure_lsp/feature/call_hierarchy.clj, and then I call that feature from an emacs command, and it doesn't stop at my breakpoint#2021-03-2116:30CarloI invoke the command M-x lsp-treemacs-call-hierarchy which is supposed to use incoming at some point#2021-03-2116:31CarloI suspect that happens because the running instance of the lsp server knows nothing about the server I created with the last command#2021-03-2116:31dpsuttoni suspect that you're running the clojure-lsp server in the terminal and your emacs also started its own clojure-lsp server for editing#2021-03-2116:31dpsuttondid you update the command that emacs uses ot create an lsp server?#2021-03-2116:32dpsuttonbut remember your goal is for emacs, when it starts up a clojure-lsp server, to start one that has an nrepl server you can connect to#2021-03-2116:32CarloI'm using:
(after! clojure-mode (setq lsp-clojure-custom-server-command '("bash" "-c" "/home/carlo/code/clojure/clojure-lsp/target/clojure-lsp")))
for that now, which probably isn't the one I want. Maybe this is the place for the command that we used before, not my shell#2021-03-2116:35dpsuttonyes. that's starting a clojure-lsp as normal, without any cider stuff involved#2021-03-2116:38Carloright, so I modified it to:
(after! clojure-mode (setq lsp-clojure-custom-server-command '("bash" "-c" "cd /home/carlo/code/clojure/clojure-lsp && clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.8.3\"} cider/cider-nrepl {:mvn/version \"0.25.9\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"]}}}' -M:cider/nrepl")))
but I can't start lsp-mode now#2021-03-2116:40dpsuttonright. because you've swapped out the mains. go see what clojure-lsp is doing at the beginning, cider connect, and call that#2021-03-2116:40Carlocould you explain what swapped out the mains means? What's a main in this context?#2021-03-2116:40dpsuttonthis is where it might be easier to just add an nrepl server with the right middleware to the main of clojure-lsp. it needs to start up its stuff#2021-03-2116:41dpsuttonmain-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[cider.nrepl/cider-middleware]\"] this is what is running at startup. its starting an nrepl server. it's NOT starting an lsp server.#2021-03-2116:42dpsuttonhttps://github.com/clojure-lsp/clojure-lsp/blob/master/deps.edn#L21 is what you need to call to start an lsp server#2021-03-2116:42Carloright#2021-03-2116:43Carloso, is just swapping nrepl.cmdline -> clojure-lsp.main enough?#2021-03-2116:43dpsuttonwell then you lose your nrepl server you want to connect to#2021-03-2116:44dpsuttonyou need to "start" two things. and you only have a way to automatically do one. so its probably easier to just add cider and stuff to clojure-lsp and have the main start up an nrepl server with the correct middleware#2021-03-2116:45Carlook, and I can accomplish this by modifying my https://github.com/clojure-lsp/clojure-lsp/blob/master/deps.edn#2021-03-2116:46Carlothe main-opts in run is where I will have to insert the nrepl-call, and the dependencies can go in debug?#2021-03-2116:46dpsuttonprobably not. you want to add an (nrepl/start-server ...) code in the main run in clojure-lsp#2021-03-2116:47Carlothat is here https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/main.clj#L412-L416#2021-03-2116:58CarloI don't know how to accomplish this, it's possible that the task is beyond my current understanding 😂#2021-03-2116:58Carlowhat should I read to bridge the gap?#2021-03-2117:01dpsuttonmy suggestion would be start a small simple project and figure out how to start an nrepl server in code and then connect to it. once you've got that, figure out how to get cider's middleware into it and connect to it. once that is finished figure out how to do that in clojure-lsp and then you're done#2021-03-2120:36BurinNot sure if this is specific to cider, or maybe just Emacs.
Is there a way to make sure that the ; in code does not get format to the right of the code in Clojure e.g.
If the comment string is ;; then the code in Emacs indent with the code before/after it but not with the single ; string#2021-03-2123:05WestAwww man, I've had a similar frustration with this as well, trying to add and delete ;; comments.#2021-03-2206:58bozhidarThe defaults follow the different semantics different comment levels have had historically. You can change this behaviour, though - https://github.com/clojure-emacs/clojure-mode#indentation-of-comments#2021-03-2207:07bozhidarSee also https://guide.clojure.style/#comments#2021-03-2304:55BurinThanks @U051BLM8F will take a peek at the code#2021-03-2304:58BurinThe reason is when I have to contribute to some project that they don't use Cider/Emacs the code will get reformatted on save which I don't want to introduce as part of my contribution.
Thanks again for your pointer.#2021-03-2307:31bozhidarYou're welcome!#2021-03-2210:00kirill.salykinhi
Is it possible to connect to cider via unix socket? (i was not able any mention of it, but maybe my google-fu is bad)#2021-03-2210:09bozhidarNot yet, as nREPL doesn't support UNIX sockets, but it should become possible soon.#2021-03-2210:10bozhidarSee https://github.com/nrepl/nrepl/pull/204#2021-03-2210:13kirill.salykinoke, thanks!#2021-03-2210:38solfWhat a timely question :d#2021-03-2210:49bozhidarIndeed - seems there's demand for UNIX sockets after all. 😄#2021-03-2210:49bozhidarThey were kind of problematic on Java, as the JDK didn't support them out of the box until a few days ago.#2021-03-2210:54lispyclouds@U051BLM8F we had built this thing based on OkHttp to fill this gap: https://github.com/into-docker/unixsocket-http
See if its of use to you if you'd wanna support older JDKs 😄
This was built mainly for the docker socket usecases in clj-docker-client#2021-03-2210:55bozhidarThere will be an optional fallback with a 3rd party library for people on older JDKs, but people will have to add the dep manually to their projects, as nREPL itself can't have hard deps to avoid collisions with user code.#2021-03-2210:56lispycloudsright#2021-03-2417:12vemvanyone around here actively uses the nubank/matcher-combinators lib? I'd like to know if it breaks your cider's clojure.test integration (of if it's only for me - I use an odd/old cider)#2021-03-2417:43ennYes, I do, and the ANSI color codes don’t render correctly. A coworker has a bit of elisp to fix it, let me find it.#2021-03-2417:44vemvfor me the biggest issue is false negatives: tests based on match? report success even if not passing#2021-03-2417:44ennhmm, I haven’t seen that.#2021-03-2417:44ennit might be an old cider issue, I’m on recent versions of cider and nrepl#2021-03-2417:50vemvthe weird thing is that ultimately matcher-combinators uses clojure.test, so when properly using clojure.test, things should just work :)
i.e. CIDER (old and new) is smart enough to integrate with arbitrary frameworks as long as they use clojure.test properly#2021-03-2417:50vemvappreciate much the confirmation anyway!#2021-03-2521:37hcarvalhoavesHi @U45T93RA6, for the false positives, you can check if the code isn't forgetting to assert the match (is (match? ...)) instead of just (match? ...) , I've been bitten by this in the past#2021-03-2521:59vemvhi, thanks for the response!
I tried again just now, no luck sadly#2021-03-2522:13vemvturns out:
* cider has its own report multimethod
* cider manually defines a custom defmethod for matcher-combinators:
https://github.com/clojure-emacs/cider-nrepl/blob/cd29bd761e58707d438b3373d7512c9e33ded865/src/cider/nrepl/middleware/test.clj#L177-L181
as mentioned in my OP, my cider is older than current.
Anyway honestly a few things seem off to me (why use a custom :matcher-combinators/mismatch dispatch value? why cider has to create its own API that doesn't leverage 3rd party clojure.test integrations automatically?)#2021-03-2503:21zendevil.ethis there a command to evaluate an expression and then copy the result?#2021-03-2508:05bozhidarThere's nothing built-in, but you can easily adapt some of the existing commands to add the result to the kill ring.#2021-03-2610:04zarkoneliked the new behavior of cider-inspect, i.e. switch to latest evaluated result (not sure how new it actually is) -- found it handy 👍#2021-03-2611:55stathissiderisI do cider-jack-in-clj&cljs so I get 2 REPLs that belong to the same session (one for server, one for frontend app). When I start my server, I can see its logging output in both REPLs, is that a bug or a feature??#2021-03-2611:58stathissiderisdoesn’t happen if I start clj and cljs in different sessions#2021-03-2819:42oxalorg (Mitesh)cide-jack-in-clj is not injecting the middlewares properly and I'm unable to figure out how to debug this. It's either blank or incomplete, but this happens only "sometimes". Here's a screenshot where I open two emacs, go to same project, and try to jack in.
On the first try jack-in created this unexpected command (notice the missing middleware list)
;; Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' -m nrepl.cmdline --middleware '[]'
On the second try jack-in created this expected command
;; Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.0"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor","cider.nrepl/cider-middleware"]'
Everything else is exactly the same. The project consists of a blank clojure file with ns, with a blank deps.edn. But I face this issue about once a day. Any hints on how should I try to debug this? Could this be an issue due to clojure-lsp? Any help would be super appreciated 🙌#2021-03-2821:26ericdalloI can guarantee that clojure-lsp has nothing related with a REPL issue 🙂 clojure-lsp is static analysis, nothing related with REPL#2021-03-2821:49oxalorg (Mitesh)Thank you! I was a bit suspicious because clojure-lsp was the most recent change I had made to my config. BTW love using clojure-lsp thanks for all your work!! 🙌#2021-03-2820:37blak3mill3rThat's mysterious. I wonder if there's something in your user ~/.clojure/deps.edn that is causing this. I suggest commenting out everything there and see if cider-jack-in-clj works.#2021-03-2820:37blak3mill3r@mitesh#2021-03-2820:38blak3mill3ralso there is a file called ~/.nrepl/nrepl.edn that can configure the nrepl middleware, if it is there#2021-03-2820:38blak3mill3rand possibly take precedence over cider's ... maybe ... I would hope that the --middleware CLI option would take precedence there but check if you have that nrepl.edn file#2021-03-2820:47dpsuttonits none of that. the startup command is emitted from vars in emacs. what ultimately is resolved at runtime might include those config files that but that literal string is constructed looking solely at emacs vars. The function doing all of this is cider-clojure-cli-jack-in-dependencies and you can see that the middleware is from (cider-jack-in-normalized-nrepl-middlewares). Evaluating just this should help you check this faster than waiting on all of the jvm startup. Everything is sourced from a variable called cider-jack-in-nrepl-middlewares. If that is set you should be good to go, otherwise it will be empty.#2021-03-2820:48dpsuttonI would look in your init or any dir locals files that might set this variable#2021-03-2821:51oxalorg (Mitesh)Yes I don't think those files are the problem here. I've tried to inspect the cider-jack-in-nrepl-middlewares variable and that is empty whenever this jack-in command misbehaves. But the problem is figuring out why is it empty only sometimes? :thinking_face:
This happens even when there are no .dir-locals.el file so that can't be the problem#2021-03-2821:54oxalorg (Mitesh)Also like I said if this were a configuration problem it should have been reproducible consistently, i.e. the middlewares should always have been empty. What I'm thinking is that maybe switching between multiple-projects somehow messes up the cider-jack-in-nrepl-middlewares state?#2021-03-2821:55dpsuttonIt never has for me. This smells like local shenanigans#2021-03-2822:00oxalorg (Mitesh)Thanks for the help! I'll try to somehow reproduce the issue properly. 🙂#2021-03-2822:01oxalorg (Mitesh)It most definitely does look like an issue from my end rather than from CIDERs end!#2021-03-2907:04bozhidarMight also be bad interaction between several packages. I'd this without clj-refactor.el, although it has been mostly dormant for years now and I don't remember when was the last time something related to the jack-in deps changed there.#2021-03-2907:04bozhidarStill - fewer packages are always better when debugging something in Emacs. 😄#2021-03-2907:05bozhidarHere's a classic example from the other day - https://github.com/clojure-emacs/cider/issues/2995#2021-03-2907:05bozhidar> Very weird bug. It turns out that loading dircolors.el breaks cider. I solved the problem by removing it. #2021-03-2916:51oxalorg (Mitesh)Thanks I'll try to debug this more, but since this happens so rarely it's hard to remove packages to check which is the culprit! 🙈#2021-03-2910:37David PhamIs there a support for tap> with cider? or something to navigate between cider-results over time?#2021-03-2914:54pinkfrogI am using cider-connect-cljs. In the cider-repl react/xxx buffer, when I run (js/alert “foobar”) indeed there would be an alert popping up in the app.#2021-03-2914:54pinkfrogHowever, emacs mode line shows cider not connected. and cider-sessions returns: No cljs REPLs in current session “react/rn-rf-shadow:localhost:53969”#2021-03-2914:58pinkfrogThe remote repl is run with: shadow watch :app . I guess I have to add some cider-nrepl stuff.#2021-03-2915:11pinkfrogYup. Problem solved.#2021-03-2915:17pinkfrogSay I imported with: (require ’[“react-native” :as rn]). Is it possible to jump to definition of rn/View ?#2021-03-2915:20vemvsilly q, when you cider-connect how much time does it take in your computer?
For me its something like 2s, it's acceptable but it makes me twitch. It sounds like a job that could be easily instantaneous
Might be specific to my emacs though#2021-03-2917:41bozhidarHaven't tried it in a while, but it should be almost instantaneous. There's a bit of a message exchange after the connect itself that might be causing this delay for you. You'll have to debug this.#2021-03-2917:42vemvYeah it was instantaneous and specific to my emacs
Sorry for the noise!#2021-03-3020:17bozhidarNo worries!#2021-03-2915:25dpsuttonIf you m-x nrepl-toggle-message-logging you can see the messages going back and forth with timestamps i believe. Might help you locate where the slowdown is. My quick guess is its the namespace tracker sending along all of the var information#2021-03-2915:27vemvthat's handy, thanks!#2021-03-3120:50Drew Verleewhen i pretty print the first part of the output now comes to the right of the expression. This is great for single line output. e.g (inc 1) ;;=> 2, but not great for multiline output e.g
(foo) ;;=> 1
;; => 2
etc...
how do i adjust this to its always just underneath?#2021-04-0105:13jumarBy having an empty line at the end of the file?#2021-04-0106:03blak3mill3rI don't experience this. What are you running exactly, cider-pprint-eval-defun-to-comment ?#2021-04-0106:03blak3mill3rThis could be an unintended interaction with another emacs package perhaps. There are cider settings as well, did you adjust any of those?#2021-04-0120:57Drew Verleecorrect cider-pprint-eval-defun-to-comment
could be some interaction, i just installed the clojure lsp server, though why that would cause an issue idk.#2021-04-0120:58Drew Verleeor well last-sexp#2021-04-0120:58Drew Verleeit's a minor thing.#2021-04-0200:20blak3mill3rI am guessing it's an interaction with another emacs package (unless you customized cider somehow)#2021-04-0200:20blak3mill3rwhich is annoying...#2021-04-0200:21blak3mill3rI usually solve these things by selectively eliminating packages, or starting from just cider basics and then adding my emacs packages back, until I binary-search in on the cause#2021-04-0111:10CarloQuestion: I can add a depency to my deps.edn file by using clj-refactor . However, given to the middleware not working with recent java versions, I can't also do the hot-loading of the dependency. In the github issue for this, pomegranate is mentioned as a stopgap measure https://www.eigenbahn.com/2020/05/06/fast-clojure-deps-auto-reload My question is: how many of you are actually using something similar to the pomegranate setup and how many just restart the repl? Second, I really like the completions for the package names when I use clj-refactor. Besides the hotload issue, is there a way to add the main module to the ns form? Maybe choosing it from a list of namespaces that a package supports?#2021-04-0116:31gonI'm using tools.deps.alpha as @seancorfield show in this video https://www.youtube.com/watch?v=gIoadGfm5T8 at about min. 15#2021-04-0119:57blak3mill3rI also do that with tools.deps.alpha ... although my repls start pretty fast now with tools.deps so many times I have just reverted to bouncing the repl process#2021-04-0119:58blak3mill3rStill a very nice feature to have, I grew accustomed to it back when all my lein repl processes took a very long time to load#2021-04-0214:31alasdairHi - I have spotted some odd behaviour and don't know how to get to the bottom of it, any ideas? Here is what I see: with Emacs 26.2 and CIDER 1.0.0 if I do nrepl-toggle-message-logging to enable logging then evaluate something at the repl I get nothing back but see "Symbol’s function definition is void: seq-contains-p" in the minibuffer. If I toggle message again (turning off) everything works ok. I also have Emacs 27.1 (which might be the problem), if I use Emacs 27.1 I don't see this behaviour. I have deleted the .elc files for seq-2.22 and recompiled using my Emacs 26.2, so I don't think it's a bytecode issue. I guess the obvious answer is "use 27.1, don't use 26.2" but I am curious to get to the bottom of this - any ideas?#2021-04-0214:33dpsuttoni would delete all elc files in your elpa directory and run emacs 26.2 and see what happens. i suspect it will work. i would then delete all elc files in your elpa directory and see what happens in 27. i suspect it will work. My off the cuff guess is that there's some incompatible bytecode between these two#2021-04-0214:34alasdairby "all elc files" you mean everything under .emacs.d/elpa? i.e. get rid of all of it from all packages?#2021-04-0214:34dpsuttonyes. if the suspected cause is invalid byte code a proper test would be removing all bytecode#2021-04-0214:34alasdairok, thanks, will give that a go#2021-04-0214:35dpsuttonand i wonder if its "compiled" under 26 if you'll have forward compatibility but you run into issues running 27 bytecode in 26#2021-04-0214:35dpsuttonbut maybe this isn't the problem anyways so who knows#2021-04-0214:44alasdair@dpsutton tried deleting all the .elc files but still seeing the same thing.#2021-04-0214:45dpsuttondelete them all again and delete seq (is that built in now?). let seq get resolved and downloaded and see what you get? dunno after that. should be supported in emacs 26.2 as far as i am aware#2021-04-0215:01alasdairthe .elc files were re-generated - does that mean my emacs is interpreting the .el files, or the .elc are in somewhere other than my .emacs.d directory? In any case, I will delete seq and see how it goes#2021-04-0215:10dpsuttonemacs will create them to speed things up.#2021-04-0215:11alasdairseq-2.20 is built-in, cider 1.0.0 requires 2.22#2021-04-0215:28alasdair@dpsutton thanks for the advice - I don't think there is anything else to do bar a clean install of everything. Given the problem doesn't come up with emacs 27.1 I don't think I am going to pursue this much further. It only cropped up as a side note on a bigger issue, but that's for another day I think. Thanks again. Alasdair.#2021-04-0215:34dpsuttonsounds good. sorry i couldn't help more#2021-04-0215:40alasdairno worries#2021-04-0215:40alasdaircheers#2021-04-0505:26yuhanHow do I deal with agents without breaking Cider's connection? Running (shutdown-agents) results in this error in the terminal, and I have to restart the REPL entirely:
Exception updating the ns-cache #error {
:cause Task clojure.lang.Agent$Action@45416446 rejected from java.util.concurrent.ThreadPoolExecutor@58b7be40[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 90]
:via
[{:type java.util.concurrent.RejectedExecutionException
:message Task clojure.lang.Agent$Action@45416446 rejected from java.util.concurrent.ThreadPoolExecutor@58b7be40[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 90]
:at [java.util.concurrent.ThreadPoolExecutor$AbortPolicy rejectedExecution ThreadPoolExecutor.java 2055]}]
:trace
[[java.util.concurrent.ThreadPoolExecutor$AbortPolicy rejectedExecution ThreadPoolExecutor.java 2055]
[java.util.concurrent.ThreadPoolExecutor reject ThreadPoolExecutor.java 825]
[java.util.concurrent.ThreadPoolExecutor execute ThreadPoolExecutor.java 1355]
[clojure.lang.Agent$Action execute Agent.java 90]
[clojure.lang.Agent enqueue Agent.java 268]
[clojure.lang.Agent dispatchAction Agent.java 255]
[clojure.lang.Agent dispatch Agent.java 241]
[clojure.core$send_via invokeStatic core.clj 2113]
[clojure.core$send_via doInvoke core.clj 2105]
[clojure.lang.RestFn applyTo RestFn.java 146]
[clojure.core$apply invokeStatic core.clj 673]
[clojure.core$send invokeStatic core.clj 2124]
[clojure.core$send doInvoke core.clj 2115]
[clojure.lang.RestFn invoke RestFn.java 490]
[cider.nrepl.middleware.track_state$make_transport$reify__5814 send track_state.clj 230]
[nrepl.middleware.interruptible_eval$interruptible_eval$fn__994$fn__1000 invoke interruptible_eval.clj 153]
[clojure.lang.AFn run AFn.java 22]
[nrepl.middleware.session$session_exec$main_loop__1062 invoke session.clj 206]
[clojure.lang.AFn run AFn.java 22]
[java.lang.Thread run Thread.java 830]]}#2021-04-0505:35dpsuttoni don't think that's something you should call unless you are ready for the process to end. you are stopping two global executors and CIDER uses those global threadpools#2021-04-0505:44yuhanHmm, I'm just learning about Agents and core.async, and tutorials mention the use of shutdown-agents to kill off running threads. I can't seem find any more fine-grained methods for doing so without affecting the entire global threadpool#2021-04-0505:46dpsuttonthat's generally to kill threads in preparation of shutting down#2021-04-0505:46yuhaneg. if I run a (go (while true (>! ch :msg))) there's now a process running indefinitely in the background, how do I stop it?#2021-04-0505:46dpsuttonif you need more cooperative "stop doing work" there are other means. closing channels#2021-04-0505:46dpsuttonthere's lots of ways but that's not a great thing to do if you ever want to stop it#2021-04-0505:47dpsuttona common thing to do is make that into a loop that can recur when the puts are successful, etc#2021-04-0505:48yuhanRight, this is just in the context of messing around with experiments in the REPL#2021-04-0505:49yuhanJust wanted to make sure if this was expected behavior for Cider#2021-04-0505:52dpsuttonyeah that would be expected. you stopped the agent executors, and then got an error that CIDER couldn't send a message to an agent#2021-04-0607:17bozhidarI've been wondering lately what to do with suitable (the cljs completion library), as it has been broken for shadow-cljs for ages and disable in cider-nrepl because of this. See https://github.com/rksm/clj-suitable/issues/15
Ideally familiar with shadow-cljs should fix this issue, but as one year has passed and no one has stepped forward I'm not holding my breath. I can also disable this conditionally for shadow-cljs only or I can potentially remove it completely from CIDER and go back to the way things were before suitable. (e.g. I can put the generic completion code in Orchard and drop the fancy suitable stuff).
As I don't use ClojureScript at all, I don't want to invest a lot of time in this, but it definitely frustrates me that things are the way they are. If someone here wants to help out with the clj-suitable issue that'd be greatly appreciated! If not - I'm leaning towards removing it from CIDER completely to simplify my life. The first option looks like less work for someone familiar with shadow, the second is what I know how to do. 😄#2021-04-0607:21thheller@bozhidar would it not be possible to have to his a completely separate opt-in library? I mean have a default auto-complete middleware and if loaded the suitable lib could just place itself in front of that and intercept/handle the messages like piggieback does?#2021-04-0607:23thhellerdoesn't change the problem but might ease your maintenance burden by keeping it out of your way#2021-04-0607:23bozhidarIt is possible but it seems like an overkill at this point, especially since we moved the basic completion code for ClojureScript there as well. It seems to me it'd be much better to just update suitable for the shadow changes.#2021-04-0607:23thhellerah ok, didn't know that. thought there was a fallback solution#2021-04-0607:24bozhidarIt has two completion sources - one that uses the cljs compiler state and always works and another one that inspects the runtime state and got broken.#2021-04-0607:27bozhidarThis is what was historically in cider-nrepl https://github.com/rksm/clj-suitable/blob/master/src/main/suitable/compliment/sources/cljs.cljc#2021-04-0607:29bozhidarNow that nREPL has a completion op built-in some completion should ideally come from piggieback and shadow directly, but I'm guessing it will take us a while to get there.#2021-04-0607:29thhellerare there some docs for the nrepl messages going over the network for this?#2021-04-0607:30thhelleralways easier to look at the protocol than trying to reverse engineer the code#2021-04-0607:32thhellerwell realistically I don't have time to dig into this anyways but I'd be happy to help out answering questions if anyone needs help regarding the shadow-cljs parts#2021-04-0607:32thhellerhappy to add more official API methods if needed as well. don't go digging deep into internals like suitable did. I make no guarantees they won't break again.#2021-04-0607:48bozhidarThe new ops that were added are https://nrepl.org/nrepl/0.8/ops.html#completions and https://nrepl.org/nrepl/0.8/ops.html#lookup#2021-04-0607:48bozhidarAnd here are some examples https://metaredux.com/posts/2020/06/15/nrepl-0-8-evolving-the-protocol.html#2021-04-0607:49bozhidarThe basic idea was that if more essential ops were supported out of the box fewer people would need additional setup/middleware.#2021-04-0607:50bozhidarIf shadow's middleware exposed those ops then shadow users would get some extra mileage without the need for cider-nrepl to be around.#2021-04-0607:52bozhidar(and at some point I'll likely stuff something similar in piggieback)#2021-04-0607:54Bingen Galartza IparragirreHi! I'm also having https://clojurians.slack.com/archives/C0617A8PQ/p1617373864130200 very same problem (`Symbol's function definition is void: seq-contains-p` when running cider-jack-in/`cider-connect`). I deleted the .emacs.d folder and reinstalled prelude, but it didn't help. I'm using Emacs 26.1 . Any idea what else could I try ?#2021-04-0608:15bozhidar@bingen.galartza You need to update the seq.el package to its most recent version.#2021-04-0608:21Bingen Galartza IparragirreIn my package list I see both seq 2.20 and 2.22 (which I guess is the latest). The first one is built-in and the seconds is installed by Prelude. Should I delete the old version? I'm quite a newbie with Emacs internals#2021-04-0608:26bozhidarNot sure that you can delete a built-in package, but I guess you can try.#2021-04-0608:30Bingen Galartza IparragirreOk, thanks, I will investigate#2021-04-0608:32bozhidarI've reverted CIDER to use the deprecated seq-contains just now. It seems it's better to have a deprecation message than to deal with all this breakage.#2021-04-0608:55Bingen Galartza IparragirreCool, thanks a lot#2021-04-0609:07Bingen Galartza IparragirreWorking like a charm. Thanks again#2021-04-0609:58bozhidarNot a problem. It broke CIDER's CI (lint error), so I replaced with member in the end. At least I remembered why I had changed the deprecated function in the first place. 😄#2021-04-0615:02dpsutton#2021-04-0616:27Karol WójcikEmacs for life! 😍:the_horns::skin-tone-4:#2021-04-0623:24richiardiandreawe 🪨#2021-04-0706:48Yehonathan SharvitSometimes, I need to require a namespace for its side-effects (e.g. defmethod declarations).
(ns foo
(:require bar))
But cider-refactor removes `bar` from the require list, as it “Remove any unused libspec vectors”.
Does anyone know a way to tell clj-refactor to keep `bar`?#2021-04-0707:09jumarI don't know how to instruct clj-refactor to do this but I tend to write a comment why it's supposed to be there and check diffs before I commit the changes (+ extra code review step which should catch that too).#2021-04-0707:12Yehonathan SharvitThat’s what I did. But I missed it during code review. And boom! My lib was corrupted.#2021-04-0707:13Yehonathan SharvitIt’s also hard to catch with unit tests because the namespace is loaded by some tests.#2021-04-0707:23jumarThe other thing is that I don't really encounter this issue much - which specific function from clj-refactor triggers this behavior?
I mostly use cljr-add-require-to-ns and that seems to work fine (that is doesn't touch the other, even unused, requires; just sorts them)#2021-04-0707:24jumarFor unused requires I simply remove them manually after quick inspection - relying on "linter errors" reported by clj-kondo#2021-04-0707:41Yehonathan SharvitThis one: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-clean-ns#2021-04-0707:49jumarYeah, I never use that.#2021-04-0712:21dpsutton(comment bar/keep-me)#2021-04-0712:21dpsuttonWe do this a lot at work#2021-04-0712:32Yehonathan SharvitYou really call the function keep-me ?#2021-04-0712:47dpsuttonYeah it doesn’t need to resolve, just show up as a use of the namespace. The keep-me makes it clear what it’s purpose is#2021-04-0713:00Yehonathan SharvitCool#2021-04-0717:09vemvWhat I normally do is placing a require below the ns form. There's no difference to the compiler - ns is just standardized syntax sugar over require
It's fairly easy to see why a top-level require is there so I generally don't even attach an explanatory comment to them#2021-04-0714:46bozhidarhttps://twitter.com/bbatsov/status/1379807491790344198?s=20#2021-04-0715:12tvaughanYes, many many times a day#2021-04-0717:18nivekuilI always use C-x C-e or C-c C-p but I might start using C-c C-e now that I know it exists. Is it an upgrade from C-c C-v? it would be for me on dvorak but seems worse for qwerty#2021-04-0720:13bozhidarWhether it's easier to press it debatable, but it seems like a better mnemonic to me, as it (e)val in its name.#2021-04-0720:14bozhidarAlso the keybinding in quesiton won't change much - it will become C-c C-e (C)-e.#2021-04-0720:15bozhidarThe only reason why C-c C-e and C-x C-e both are both mapped to the same command is to mimic SLIME - early on it seemed like a good idea, but as CIDER has way more commands than SLIME at some point I started to regret wasting keybindings in this fashion.#2021-04-0720:15bozhidarAnyways, I don't feel strongly about this, I was just wondering how attached people are to this. I've never used C-c C-e myself.#2021-04-0720:18tvaughanI won't mind if it's changed#2021-04-0806:19hkjelsI too use C-c C-e a lot, but I also don’t mind if it’s changed#2021-04-0714:46bozhidarMore context - I was considering to use C-c C-e for the eval keymap, as it'd be more convenient than C-c C-v.#2021-04-0714:46bozhidar(or at least it will be easier to remember)#2021-04-0714:50bozhidarMore on the subject - https://docs.cider.mx/cider/usage/code_evaluation.html#keybindings#2021-04-0810:36yuhanIs Cider supposed to font-lock local bindings any differently? I've noticed it scatters cider-local text properties everywhere, but doesn't seem to do anything in particular with them.#2021-04-0811:02bozhidar@qythium See cider--parse-and-apply-locals#2021-04-0811:02bozhidarI don't think we were ever doing font-locking for those, we were just marking them as locals.#2021-04-0811:06yuhanYeah, I was looking at that section of code and couldn't figure out /what/ it was doing, besides marking them#2021-04-0811:06bozhidarHmm, I see it's actually in the mode definition as well:#2021-04-0811:06bozhidar(setq-local font-lock-fontify-region-function
(cider--wrap-fontify-locals font-lock-fontify-region-function))#2021-04-0811:06yuhanfor future tooling to take advantage of, perhaps?#2021-04-0811:06bozhidarPerhaps this was working at some point and we broke it. I don't remember already. I see the code hasn't been touched in 5 years.#2021-04-0811:08yuhanI see, thanks - also noticed that the locals it's picking up are almost always wrong and bleeding in from neighboring forms#2021-04-0811:10yuhanI was basically trying to hack together an eldoc extension to show something useful in a recur form by picking up the nearest target's binding names, and saw that the locals code had quite a bit of relevant logic written already.#2021-04-0811:49yuhan#2021-04-0811:50yuhanAh, looks like it doesn't handle destructured bindings - I'll have to figure that out another time#2021-04-0815:18bozhidarMost likely it was the initial version of something that we didn't finish. Now with parse-clj it should be easier to do something like what you have in mind. This is one of the dream goal - file-level static analysis that's not depending on running external tools.#2021-04-0907:29yuhanThat does seem a lot nicer and less brittle than the regex / point moving approaches that are currently implemented!#2021-04-0907:32yuhanThough I'd be worried about performance, right now I basically have to choose between aggressive-indent-mode or clojure-indent-use-backtracking, otherwise editing on my laptop slows to an crawl on large forms... the indentation logic starts taking up 50% of the CPU and triggering GC pauses every few seconds#2021-04-0814:46Setzer22Hi! 😄 Is there a way I can set some code to run on every buffer eval?#2021-04-0814:46Setzer22I'd like to re-run spec instrumentation on every file reload#2021-04-0814:48Setzer22ok, I see there's cider-file-loaded-hook, I think that's exactly what I need. If anyone knows of some example code that'd be much appreciated#2021-04-0815:13bozhidarIt's as simple as (add-hook 'cider-file-loaded-hook #'cider--test-silently).#2021-04-0815:14bozhidarIn your case you'll be triggering some evaluation function of course, there are many of those.#2021-04-0815:32dpsuttonthis will run on each file loaded. Not sure why you're loading the buffer so much, but i'd probably put a (comment (require 'this-ns :reload)) and inside of that comment form the instrument call as well. I think i remember a patch to add evaluation from a register and that comes to my mind#2021-04-0815:33dpsutton;; ‘C-x r s <register-key>’ save to register
;; 'C-c C-j x <register-key' to send to repl
(defun cider-insert-register-contents (register)
(interactive (list (register-read-with-preview "From register")))
(let ((form (get-register register)))
;; could put form into a buffer and check if its parens are
;; balanced
(if form
(cider-insert-in-repl form (not cider-invert-insert-eval-p))
(user-error "No saved form in register"))))
(define-key 'cider-insert-commands-map (kbd "x") #'cider-insert-register-contents)
(define-key 'cider-insert-commands-map (kbd "C-x") #'cider-insert-register-contents)
(define-key cider-repl-mode-map (kbd "C-c C-j") 'cider-insert-commands-map)
i'd save the instrument form in a register and then send it to the repl#2021-04-0815:45Setzer22thanks @bozhidar , I kina managed to get it working 🙂#2021-04-0906:33Setzer22Hi again! Is there a similar hook for cider-eval-region/last-sexp, etc?#2021-04-0906:38bozhidarNope.#2021-04-0906:38dpsuttonthere's not. and hooks on every eval seem kinda tough to manage if you venture into other namespaces. i'd go with that register snippet i put above and send the command to instrument functions as needed#2021-04-0906:39bozhidarI was actually thinking of general eval hook, as it kind of makes sense, but there was never much demand for it.#2021-04-0906:39dpsuttonC-M-x to eval something and then C-c C-j x i to send your instrument form to the repl#2021-04-0906:39bozhidarThe reason why there's a hook for load-file as that we needed this for cider-auto-test-mode. Demand drives supply. 🙂#2021-04-0906:40dpsuttoni'm gonna add this to my local version of inf-clojure and test it out#2021-04-0906:40bozhidar@dpsutton What exactly is the use case for this register trick - you want to save some snippets of code so you can easily recall them in the REPL?#2021-04-0906:41dpsuttonyeah. exactly. for things of this nature, send (stest/instrument [insert-tree* delete-min* find-min*])` something you might keep in a register#2021-04-0906:42dpsuttoni'd add this to a register as well:
(do
(require '[clojure.string :as str])
(require '[clojure.core.server :as server])
(clojure.main/repl
:prompt (fn [] (printf "%s=> " (peek (str/split (str *ns*) #"\."))))
:read server/repl-read)
(require '[vlaaad.reveal :as reveal])
(add-tap (reveal/ui)))
#2021-04-0906:43dpsuttonand i have a function that calls (inf-clojure--send-string inf-proc "(apply require clojure.main/repl-requires)") but i could just toss that in a register and send it#2021-04-0906:44dpsuttonanother thing to keep in a register while working in the repl: (doto 'the-ns-test (require :reload) (clojure.test/run-tests))#2021-04-0906:47dpsuttonjust forms you might want to send repeatedly without scrolling around a bunch between a form calling your tests and the functions you are working on#2021-04-0906:58bozhidarI see.#2021-04-0907:49Setzer22Thanks for the suggestion @dpsutton. This register thing looks neat. But in my case I already have a dedicated keybinding to reinstrument my code which pretty much achieves the same purpose. The whole point of my question was to trigger this on every eval so that I wouldn't forget and uninstrument my code by mistake: I have a habit of re-evaluating defns with cider-eval-defun-at-point, but this right now removes instrumentation. I take from your comment that you consider this "run some code on every eval" to be a bad idea 😅, but I don't see why it would cause issues, as long as the code I'm sending does not assume a particular namespace (i.e. only uses fully-qualified symbols known to be available)#2021-04-0907:51Setzer22> I was actually thinking of general eval hook, as it kind of makes sense, but there was never much demand for it.
@bozhidar I, for one, would very much appreciate this 😄, but I also understand if you think it's a bad idea. I can always do some hack on my side to get this working for me#2021-04-0914:14dpsuttonthat's fair. sorry i pushed so hard for a different solution#2021-04-0914:24dpsuttonthings you could do while waiting to see if an eval hook shows up:
- add advice (advice-add cider-eval-last-sexp :after (lambda (&rest r) (that-function-you-already-have-to-instrument)) (i haven't tested this and have never used advice so not sure if this syntax is correct but the gist is there
- make a new function that calls cider-eval-last-sexpand then calls the other function. You could make a function personal/instrument that adds your new functions into the cider maps so that it is used everywhere and then a way to turn it off by replacing the standard bindings
- add advice to cider-interactive-eval to call your instrumenting function
- you could advice/redefine cider-interactive-eval-handler. couple places in there you could a) add a hook and use it, just call out and run your own function#2021-04-1104:31yuhanI got recur working with eldoc correctly 🙂
Here's the code if anyone wants to try it out: https://gist.github.com/yuhan0/21dca369afb8c7537554ce86b42b55b7
I'll use it for a while before making a PR, there's a couple of while loops in there that I'm not entirely certain won't lock up in an infinite loop#2021-04-1115:25wcalderipehey folks 👋
I'm having issues with cider-connect-cljs on a shadow-cljs project. I'm not sure this is the right channel to post my question, but I'm in the hope that someone else here would have faced the same issue before and will point me in the right direction or just say the right channel :)
I noticed that when I connect Emacs to a running nrepl using cider-connect-cljs, my REPL doesn't work the same way as it does when I use cider-jack-in-cljs for instance. To be honest, I don't know if cider-connect-cljs and cider-jack-in-cljs have different user experiences but I assume they don't.
I have recorded a video to try to explain the problem a bit better. What you can see is:
- Run shadow-cljs watch to have the app and a REPL running
- Use cider-connect-cljs to connect Emacs on the running REPL
- Try to execute some fn like cider-repl-set-ns, cider-eval-last-sexp, and cider-load-file but none seem to have any effect
- Use in-ns to check if the REPL is connected to the right project and working
The project you see on the video is here https://github.com/wcalderipe/cljs-playground (there's nothing special).
Versions:
macOS Big Sur 11.2.2
Emacs 27.1
Cider latest commit on master (I'm using straight.el)#2021-04-1115:47dpsuttonso there seems to be an issue going on:#2021-04-1115:47dpsuttonCIDER thinks that it is not connected. note the "pending-cljs". As far as CIDER is concerned, there is a clj repl that is in the process of becoming a cljs repl#2021-04-1115:48dpsutton(do (require '[shadow.cljs.devtools.api :as shadow])
(shadow/nrepl-select :hexagonal))#2021-04-1115:48dpsuttonthis is what CIDER runs when you connect. it require shadow's stuff and then nrepl-select's the build#2021-04-1115:56dpsuttonand it seems that you need CIDER's middleware present for CIDER to be aware that the cljs repl is ready#2021-04-1115:57dpsuttonif you add it to the startup command shadow-cljs -d cider/cider-nrepl:0.25.9 watch hexagonal or just cider-jack-in-cljs it will work#2021-04-1115:57dpsuttonwhen diagnosing this stuff i always try to do it by letting CIDER jack in, seeing what commands and dependencies it puts in place and then ensuring that the manually set way does the same#2021-04-1118:03wcalderipehey @U11BV7MTK the -d cider/cider-nrep:0.25.9 worked like a charm. thanks so much for sharing the solution and the rationale behind it!#2021-04-1118:22wcalderipeI wonder if I can do that without the --dependency option :thinking_face:#2021-04-1118:22wcalderipe(and outside the dependencies of the project, since not everybody uses Emacs)#2021-04-1118:25dpsuttoni don't know of any way to dependently put it in there besides the command line#2021-04-1118:25dpsuttoni think it would be fine to put it in there and the people who don't use cider wouldn't even notice it#2021-04-1118:39wcalderipeagree 🙂#2021-04-1118:39wcalderipethanks again#2021-04-1118:25nikolavojiciccider + shadow-cljs REPL does not highlight core functions...
(Functions defined in current namespace are highlighted properly)
Is that current behavior or I configured something wrongly?#2021-04-1208:00bozhidarAre the core functions highlighted correctly when using Clojure instead of ClojureScript? I want to narrow this down to configuration vs track-state.#2021-04-1208:21nikolavojicicYes, when using Clojure everything is highlighted correctly.#2023-07-2810:40vemvI believe this will be fixed with the next cider release (tech details: https://github.com/clojure-emacs/cider-nrepl/pull/785)
Feel free to try cider-nrepl 0.32.0 by setting it in your shadow-cljs.edn or by customizing Emacs cider-injected-middleware-version .
(if you see a repl warning about a version mismatch, it's safe to ignore)#2023-07-2821:56nikolavojicicI upgraded cider-nrepl to that version but it still doesn't highlight core fns. 🥺#2023-07-2822:57nikolavojicicI will create issue with more details.#2023-07-2904:33vemvLooking forward. Looking at your picture, there's a chance that everything's ok? I see clojure macros in pink, and clojure functions in black, while dispatch-async also is in black.
clojure.core functions don't have anything special that would make them deserve a different syntax coloring?
At least that has been my impression using cider over the years#2023-07-2909:52nikolavojicicCore fns should be blue, same as current-page.#2023-07-2910:32nikolavojicichttps://github.com/clojure-emacs/cider/issues/3385#2021-04-1207:39craftybonesCider seems to be evaluating and running tests in a specific namespace, but when I try running all tests, it says “No assertions (or no tests) were run….”#2021-04-1207:39craftybonesI loaded all the namespaces#2021-04-1207:39craftybonesbut it still seems to say the same thing#2021-04-1207:40craftyboneshowever, if I run tests for a specific namespace, it works#2021-04-1207:41craftybonesam I doing something wrong?#2021-04-1207:48craftybonesI am running the latest snapshot.#2021-04-1207:48craftybones1.1.0-20210408.1212#2021-04-1207:55craftybonesIt seems like the relevant namespaces are definitely present in all-ns#2021-04-1207:59bozhidarI don’t remember this part of the code well anymore, so without checking it’s hard to say how it is support to work. Which command exactly are you using to run the tests?#2021-04-1208:00craftybonestwo of them:
cider-test-run-all-tests
#2021-04-1208:00craftybonescider-test-run-loaded-tests
#2021-04-1208:04craftybonesWait, those are spacemacs ones#2021-04-1208:05craftybonesok, even running the cider ones causes the same.#2021-04-1208:13craftybonesHow does Cider determine what a project is? With Lein, I guess it uses project.clj. I am using tools.deps and just have a barebones deps.edn. Could this be the reason?#2021-04-1212:46bozhidarSee https://github.com/clojure-emacs/orchard/blob/master/src/orchard/namespace.clj#L50#2021-04-1212:47bozhidarPerhaps this doesn’t work with deps.edn indeed. I have to admit I’ve never used it - I’ve always been a Lein user and never had a reason to look for something else.#2021-04-1211:59bozhidarI’ll check this a bit later.#2021-04-1211:59bozhidarI don’t think we did anything with the project files, though - probably we just looked for a common ns prefix within all the loaded namespaces or something like this.#2021-04-1212:01bozhidarFYI - I’ve jut pushed cider-nrepl 0.25.11, that has a fix for the long-standing issue with the debugger state getting corrupted when debugging functions triggered by an HTTP request. We also have some important fixes lined up about working with Java sources and code completion with shadow-cljs, which we hope to ship with CIDER 1.1 in the weeks to come.#2021-04-1216:59craftybonesThanks @bozhidar#2021-04-1307:33bozhidar@srijayanth I think it might be handy to just add a project-level configuration variable that can be used to specify the project root ns. People would be able to use it in case the inference doesn’t work properly for one reason or another.#2021-04-1307:35craftybonesThat could work, though I am still surprised this isn’t working. The env property user.dir is set correctly#2021-04-1307:36craftybonesso it is set to project root#2021-04-1307:53bozhidarHmm, so I guess it’s something else. Might be a good idea to debug what’s happening exactly when you run the command. I’m on the road this week and my ability to debug anything is quite limited right now. You can also file a GH issue, so we won’t forget about this.#2021-04-1308:51vemvSounds good if I try to fix the https://github.com/clojure-emacs/refactor-nrepl build? No overlap w/ someone else?#2021-04-1308:54bozhidar@vemv Definitely! It’s safe to say that refactor-nrepl has been getting very little love lately, so it’s extremely unlikely to run into conflicts with anyone there. 🙂#2021-04-1308:55vemvcider !
Nice, I have some possible improvements to propose, especially cljr-slash perf improvements#2021-04-1309:44yuhanThat would be awesome :) cljr-slash is probably the most useful command in the library, but it causes a 1-2 second lag every time I use it on a fully qualified namespace.#2021-04-1309:57vemv1-2? you're lucky ;p I reduced it to 1-2 from ~8 or so, don't remember exactly the numbers.
I have ~900 .clj files in my largest work project
(oc it's also faster in non-humongous projects)#2021-04-1309:58vemv> every time I use it on a fully qualified namespace
good observation, this is part of my plan. there's a few edge cases where cljr-slash should be a no-op, which is the best possible optimization ^^#2021-04-1310:08yuhanlooking forward to it!#2021-04-1310:16yuhanLooks like it also triggers on fractions like 1/2, but that might be better fixed on the emacs package#2021-04-1320:52blak3mill3rSlightly tricky, the fractions... however the fact that symbols in Clojure cannot start with a number at least makes it possible to parse without backtracking#2021-04-1320:53blak3mill3rI love cljr-slash and the rest of refactor-nrepl ... but I disabled it a while ago because of some combination of lag and suspicion of buggy interactions 😞#2021-04-1404:41richiardiandreaThank you for fixing!#2021-04-1405:38bozhidar@UCPS050BV @vemv One more thing to consider in case you want to hack on refactor-nrepl and clj-refactor - a while ago we’ve decided to move the most useful parts of both of them that are not tied to the analyzer to clojure-mode/CIDER to simplify the maintenance and the setup. We didn’t do much on the front - basically our biggest achievement was move a bunch of simple refactoring functions to clojure-mode, but I hope we’ll revisit this down the road.#2021-04-1319:33Rusty ShacklefordHi all, is there a ready-made way to cider-connect to a running nREPL that does not have the cider middleware already loaded, and then inject that middleware dynamically, i.e. without having to alter the original code that exposes the nREPL?
My use-case: I'd like to hack around on clojure-lsp, which will start a "vanilla" nREPL instance if built with a debug flag. So I've built it locally with that flag, configured lsp-mode to use that build, fired up Emacs and lsp-mode, retrieved the port number the nREPL is exposing, and then would like to use Cider for debugging etc. as I mess around with the code. But when I cider-connect to the running nREPL I get WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!
If I'm reading the docs correctly, I believe I can add cider-nrepl to the project's deps.edn, find the code that starts the repl and add some parameters to include the cider middleware at startup, then rebuild, but I'm wondering if there's a built-in way to do this on the fly?
Reading through the nrepl docs, it looks like it does expose a wrap-dynamic-loader function that could do this, but I've having trouble putting all the pieces together for how that might be invoked directly from Cider (somewhat new to Clojure, coming from Java-land).#2021-04-1405:44bozhidar@horton.wh.dev You’re on the right track - indeed nREPL supports loading middleware dynamically, but this functionality hasn’t been implemented in CIDER yet. The idea was for this to replace cider-jack-in, as with the dynamic loader you can bundle some middleware with the editor that it can load after connecting.#2021-04-1422:35Rusty ShacklefordThanks, I got it working by updating the project's deps and manually adding the cider middleware where the repl is started, but good to know I wasn't totally off base. Would be a cool feature to have eventually!#2021-04-1405:45bozhidarBtw, even with the warning you’re seeing the basic CIDER features will work, especially you’re using nREPL 0.8. Depends on how much you need I guess.#2021-04-1418:43Steven KatzHi, im new to emacs…cider seems to be starting in a window at the bottom of emacs, it used to start to the right…any idea what changed and how I can change it back?#2021-04-1419:44bozhidarThe position by default depends on the size of the Emacs window. There’s some config to force where the REPL buffer should appear, but I can’t remember it off the top of my head.#2021-04-1419:45bozhidarIf you maximize the Emacs frame the REPL should appear on the right.#2021-04-1420:02Steven Katzit is maximized, and is appearing at the bottom#2021-04-1420:57Zoltan KalmarAFAIK it depends on the value of display-buffer-alist#2021-04-1421:41Steven Katzdont know what that means, sorry#2021-04-1423:33grazfatherit means you can configure that value. Try running M-x counsel-describe-value to query the setting#2021-04-1423:23jmckitrickI’m having a friendly debate with my boss at work 🙂 He’s showing me how IntelliJ/Cursive jumps into Java code in jaxson from the Clojure library wrapping it. I’m sure I can do that with Cider, I just don’t know how. Any tips or tricks?#2021-04-1423:24dpsuttoni believe there are ways to go one level in if the sources are on the classpath, perhaps some other setting as well. But once there you won't have navigation. interop with java is where Cursive will absolutely shine#2021-04-1423:37Alex Miller (Clojure team)there is conceptually no reason Cider could not match this level of support. all Maven artifacts published on Maven central (most of the Java libs you'd usually use) also are required to publish -source jars during publishing. So given a Maven library com.fasterxml.jackson.core/jackson-core 2.12.3, you can find the sources under the same GAV with the classifier "sources" (you can see this here https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.12.3/). IntelliJ/Cursive will ask you if you want to download the sources the first time you try to nav into it and it can't find them. afaik, it just downloads that sources jar and takes you to the java inside it.#2021-04-1507:28bozhidarIt does this even now, it’s just very few people realize they need to fetch the source jars.#2021-04-1507:29bozhidarMore details from a recent conversation on how to simplify this - https://github.com/clojure-emacs/orchard/issues/113#2021-04-1423:43cflemingThere’s a lot more than just downloading the sources though. You have to then index them so that you know where in the source the semantic elements are.#2021-04-1509:06bozhidarThat’s our Java source parser https://github.com/clojure-emacs/orchard/blob/master/src/orchard/java/parser.clj 🙂#2021-04-1423:44cflemingSo there’s conceptually no reason it couldn’t be made to work given that elisp is turing complete, but it’s probably a decent amount of work.#2021-04-1423:45Alex Miller (Clojure team)yep, for sure :)#2021-04-1423:54dpsuttonyes that level works. i meant navigating after you've hit your first java source#2021-04-1423:55cflemingAnd renaming Java elements from Clojure source and vice versa, and doing the same from Scala & Kotlin, etc etc… 🙂#2021-04-1500:00dpsutton> given that elisp is turing complete, but it’s probably a decent amount of work
lol that is a huge understatement. Just reimplement Idea in elisp haha#2021-04-1500:01blak3mill3rthat is pretty cool... I know I remember cider having some kind of jump-to-java support that I had working a while ago, with Java 1.8 and an older clojure. It only worked with certain jars though (`tools.jar` distributed with the jdk and clojure.jar) and I guess the java source code was included with the jars or cider knew how to find them#2021-04-1507:23bozhidarYeah, changes in JDK 9 and dynapath kind of broke this. It will be fixed soon after being broken for quite a while.#2021-04-1500:02blak3mill3rwas a nice feature... it stopped working for me at some point and I didn't miss it enough to dig into it#2021-04-1507:07ElsoI'm having issues with find-var since the latest cider update, but I'm struggling to make sense of the error message:
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 0)
xref-find-definitions()
(if (and (cider-connected-p) (cider-var-info sym-name)) (if (eq (quote symbol) (type-of (cider-find-var nil sym-name))) nil (xref-find-definitions)) (xref-find-definitions))
spacemacs/clj-find-var("ring.middleware.defaults")
funcall-interactively(spacemacs/clj-find-var "ring.middleware.defaults")
call-interactively(spacemacs/clj-find-var nil nil)
command-execute(spacemacs/clj-find-var)
what happened here? did xref-find-definitions just change its signature? where does this come from? I guess this is probably a version mismatch, but I'm uncertain how to resolve it properly#2021-04-1507:19yuhanLooks like the Spacemacs command is calling the function wrongly#2021-04-1507:21yuhanI just checked the source, xref-find-identifer hasn't changed since 2014#2021-04-1507:21bozhidarAnd CIDER never used this API. 🙂#2021-04-1507:21bozhidar(which is something that people often complain about, but it’s unrelated to the problem at hand)#2021-04-1507:23yuhanhttps://github.com/syl20bnr/spacemacs/commit/7740fea4e1ec2d13b4aceff87be5daa3dc9a6c2a#diff-9ed33bb854231c689581f5d2ac86883ccf93ddcafd54ec9dc1aa688d9ab47f02R219 heh#2021-04-1507:24Elso👍 thanks for the info#2021-04-1507:27yuhan@UU5KDUCBT submit an issue/PR to Spacemacs if you can, I don't use it#2021-04-1507:30Elsowill do if it turns out to be an actual issue, still trying to figure out how this came about though, because it used to work
and it seems like quite the obvious bug to just introduce like that#2021-04-1507:24bozhidar@jmckitrick It’s funny you mentioned this just now, as recently @vemv has been helping to fix this https://github.com/clojure-emacs/orchard/issues/113#2021-04-1507:25bozhidarCIDER has (almost) aways supported this functionality, but it could add only the JDK sources automatically itself (and this broken in JDK 9 due to changes related to the new module system that affected dynapath). For the rest of the sources - I guess the majority of the people don’t realize that they have to add them to the classpath in whatever way they prefer.#2021-04-1507:27bozhidarAnyways, soon we’ll remove the legacy classpath manipulation logic from Orchard completely and we’ll promote a tool built by @vemv to setup the sources conveniently. It won’t match the experience created by @cfleming, but I think it will be enough for the needs of most of people.#2021-04-1509:06bozhidarAnd in case someone’s interested - here’s the Java source parser that we’ve developed for CIDER and friends https://github.com/clojure-emacs/orchard/blob/master/src/orchard/java/parser.clj#2021-04-1509:07bozhidarAs you can see it requires JDK 9+ and we have a different parser for JDK 8. This painful transition between JDK8 and 9 made me appreciate the stability of Clojure more than ever. 😄#2021-04-1511:30jmckitrick@bozhidar Well, that's perfect timing! Is there anything I can do to help?#2021-04-1605:33bozhidarI don’t think we need more help with this particular issue, but there are always other issues one can tackle. 😄#2021-04-1614:55jmckitrickI really need to do that. Let me see what I can find.#2021-04-1619:58macrobartfastwhat is the cider command that lets me evaluate a function under the point in the minibuffer, supplying arguments?#2021-04-1619:58macrobartfastor an equivalent.#2021-04-1619:58macrobartfastI’m constantly typing out functions in my buffer with arguments so I can evaluate them then deleting them.
So, if I made
(defn foobar [x]
(* 2 x))
I would then write
(foobar 8)
below it and run a cider eval on it, then delete it.
Alternately I suppose I could copy paste it into the repl, but that would take as much time.#2021-04-1620:01macrobartfastaha, found it: cider-read-and-eval-defun-at-point#2021-04-1620:02macrobartfastI remember now. I also remember I was getting errors and that’s why I had stopped using it and thus forgotten it.#2021-04-1620:03macrobartfastI’ll put the error in a thread…#2021-04-1620:07macrobartfastwhen running cider-read-and-eval-defun-at-point on
(defn foobar [x]
(* 2 x))
I get
Show: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (24 frames hidden)
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling *cider-repl past/someproject:localhost:3333(clj)* at (1:1)
#:clojure.error{:phase :compile-syntax-check,
:line 1,
:column 1,
:source
"*cider-repl past/someproject:localhost:3333(clj)*"}
1. Caused by java.lang.RuntimeException
Unable to resolve symbol: foobar in this context
Util.java: 221 clojure.lang.Util/runtimeException
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 458 clojure.main/repl/fn
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
AFn.java: 22 clojure.lang.AFn/run
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 748 java.lang.Thread/run#2021-04-1620:08macrobartfastcider-eval-defun-at-point works fine, however.#2021-04-1620:08macrobartfastto define the function in the buffer, that is.#2021-04-1620:09macrobartfastThis is a cljs file in a Reagent project, by the way, running in a browser.#2021-04-1620:14macrobartfastI am also open to better approaches… basically, I write a function that takes a few arguments that would be normally supplied by a calling function; I want to try it out with some fake arguments without having to write it out in my file with those arguments. Currently, I write it in the buffer with the mock arguments so I can call cider-eval-defun-at-point or cider-eval-last-sexp#2021-04-1703:16yuhan@U0X9N9ZK5 what about using comment forms?#2021-04-1703:22macrobartfastWell, I have in the past… but that just clutters my code overall and makes it less readable… and I have to type it all out. When cider-read-and-eval-defun-at-point worked, it was literally just a matter of the binding that triggered the function, tap in a couple arguments when it appeared in the minibuffer, and enter and voila.#2021-04-1703:47yuhanRight, that's understandable - I've never used that command before but it seems useful.
What I sometimes do is take advantage of the fact that (#'foo x) calls the function in the var - so I'll do a quick wrap-round and forward-sexp
((defn foobar [x]
(* 2 x)) 10)
try out a couple of arguments without having to go back and forth with the minibuffer + history, then raise the defun when I'm done to get rid of the args.#2021-04-1703:55yuhan(this is particularly useful when you're debugging some function definition on a fixed set of arguments - cider-eval-defun from anywhere in the form re-defs the function and calls it in one go)#2021-04-1705:04macrobartfastThat is really interesting… I’ll give those approaches a try.#2021-04-1705:11macrobartfastdo you use something to toss the wrap-around on and remove it quickly?#2021-04-1705:12macrobartfastI know there are things in Emacs that do that, but I do it semi-manually with paredit.#2021-04-1705:30yuhanI use lispy(ville) but paredit or any other structural-editing package should work fine once you get it into muscle memory 🙂#2021-04-1705:36yuhanfor me it's
ESC (evil normal state),
{ (start of defun)
M-9 (wrap in parens)
M-a (goto end of form and enter evil insert state)
then at the end, navigate to the right spot and M-r to raise#2021-04-1902:29macrobartfast@UCPS050BV thanks!#2021-04-1620:14macrobartfastI am also open to better approaches… basically, I write a function that takes a few arguments that would be normally supplied by a calling function; I want to try it out with some fake arguments without having to write it out in my file with those arguments. Currently, I write it in the buffer with the mock arguments so I can call cider-eval-defun-at-point or cider-eval-last-sexp#2021-04-1620:15macrobartfastI then delete it.#2021-04-1620:24macrobartfastI do this with most functions I define, so dozens of times a day. Probably my doing this is the result of a bad approach… not sure.#2021-04-1709:17bozhidarIt seems to me your problem is quite simple - you haven’t evaluated the defun in question when before doing read-and-eval.#2021-04-1709:18bozhidarI normally do tests like the one you described in a REPL or a scratch buffer, but that’s just me.#2021-04-1800:42macrobartfastDo you mean by first evaluating it with cider-eval-defun-at-point ?#2021-04-1800:52macrobartfastI do run that to define it right after writing it… that’s a habit; cider-eval-defun-at-point on
(defn foobar [x]
(* x 2))
I can then evaluate it with
(foobar 2)
in my buffer once I’ve typed it out. But when I run it with cider-read-and-eval-defun-at-point
I get
Show: Project-Only All
Hide: Clojure Java REPL Tooling Duplicates (24 frames hidden)
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling *cider-repl scratch/project:localhost:3333(clj)* at (1:1)
#:clojure.error{:phase :compile-syntax-check,
:line 1,
:column 1,
:source "*cider-repl scratch/project:localhost:3333(clj)*"}
1. Caused by java.lang.RuntimeException
Unable to resolve symbol: foobar in this context
Util.java: 221 clojure.lang.Util/runtimeException
core.clj: 3214 clojure.core/eval
core.clj: 3210 clojure.core/eval
main.clj: 437 clojure.main/repl/read-eval-print/fn
main.clj: 458 clojure.main/repl/fn
main.clj: 368 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
AFn.java: 22 clojure.lang.AFn/run
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 748 java.lang.Thread/run#2021-04-1800:59macrobartfastI got really addicted to evaluating forms in this way so it’s hard to live without, now, lol.#2021-04-1801:01macrobartfastAnother clue to whatever I’m doing wrong: if I run cider-read-and-eval and type out (foobar 2) in the minibuffer at the prompt, I get the same error.#2021-04-1819:11bozhidarYou might open some ticket about this, as when I try both commands they work for me, so I assume you're not using them exactly as I do.#2021-04-1801:03macrobartfastIt’s all partly because I’m learning a lot so I have to check almost every function in isolation; I spend at least 30% of my coding time typing out these functions, running them in isolation with fake arguments, then deleting them or commenting them out.#2021-04-1801:43dpsuttonI would guess it’s a namespace thing#2021-04-1801:54macrobartfastThat’s what it looks like to me. Unfortunately, I don’t know how to figure how to resolve it.#2021-04-1803:58dpsuttonEval “ns” and see what it reports#2021-04-1900:38macrobartfastdo I (ns) int the cljs reple, or?#2021-04-1900:45macrobartfastthe cljs repl prompt is cljs.user> if that’s useful.#2021-04-1900:52macrobartfastI was able to switch my prompt to the namespace foobar is defined in and type it in with an argument and that worked.#2021-04-1900:53macrobartfastmy cljs.user> prompt, that is.#2021-04-1804:23dpsuttonThat got bolded trying to type the asterisks in +ns+ not meant to shout :)#2021-04-1900:40macrobartfasthaha, didn’t think you were shouting… but, for the record, any of you can shout at me all day long… you all are angels so you can do no wrong.#2021-04-1810:48otfromHi. I have the following set for cider
cider-repl-result-prefix ";; "
cider-eval-result-prefix ";; "
and when I do C-x C-e I get the ;; in the overlay, but when I do C-u C-x C-e the results in my buffer aren't commented out. Can anyone recommend what variable I need to set to get this?#2021-04-1818:25bozhidarI think there's no variable for this, but there's another command to insert the result as a comment.#2021-04-1818:26jumarExactly, that’s what I use all the time - There’s a variant with pretty print too#2021-04-1818:28bozhidarTry C-u C-c C-p.#2021-04-1818:58otfrom@bozhidar @jumar thx! That gets what I want via another means 🙂#2021-04-1818:59otfromthat does a good job of keeping lsp and kondo from working too hard#2021-04-1904:54macrobartfastI really like cider-clojuredocs as someone who’s learning; however, in a cljs file one gets 'cider-clojuredocs' doesn't support ClojureScript so I have to change the mode to clojure-mode for the buffer then it will work; however, almost all the symbols I am looking up are not specifically cljs ones… is there a way to get it to work for those symbols without having to change the buffer mode to clj and back?#2021-04-1906:21bozhidarI might remove this error at some point - the problem is that ClojureDocs really lists only Clojure namespaces and as some are named slightly differently (e.g. cljs.core) I didn't want to put a translation map between them.#2021-04-1906:22bozhidarAt this point I tend to agree it'd better to just give errors about missing symbols than some blanket error statement. Feel free to open a ticket about this. It's trivial to change it.#2021-04-1906:30bozhidarI see on the backend that we resolve the symbols as Clojure syms, which I assume won't work when routed via a ClojureScript REPL, and this is probably the actual reason for the error message.#2021-04-1906:57macrobartfastAh, ok. Sweet!#2021-04-1906:58macrobartfastSince a lot of people are coming into Clojure via ClojureScript and the community docs are so much more helpful for people new to Clojure this’ll be awesome.#2021-04-2107:38piyerI am struggling to get the logging show in cider. I can see the logging in nrepl-server buffer but not in the cider-repl.#2021-04-2107:38piyerany pointers?#2021-04-2107:44bozhidar@munichlinux See https://docs.cider.mx/cider/usage/code_evaluation.html#change-the-output-destination#2021-04-2107:45bozhidarPerhaps you're not using cider-nrepl or you've set the output redirection to nil?#2021-04-2107:46bozhidarThe problem that you're experiencing is that the logger's output got bound to nREPL's terminal output stream.#2021-04-2107:46bozhidarIf you take a look in CIDER's issue tracker, you'll see many related conversations.#2021-04-2108:22piyerThis is my profile
{:user {:plugins [[cider/cider-nrepl "0.25.11"]
[refactor-nrepl "2.5.1"]
[lein-pprint "1.3.2"]
[lein-cprint "1.3.3"]
[lein-kibit "0.1.8"]
[lein-ancient "0.7.0"]
[jonase/eastwood "0.4.0"]
[lein-nsort "0.1.14"]]
:dependencies [[nrepl "0.8.3"]
[org.clojure/tools.namespace "1.1.0"]
[org.clojure/tools.reader "1.3.5"]]
:env {:squiggly {:checkers [:eastwood :kibit]
:eastwood-exclude-linters [:unlimited-use]}}}
:repl {:dependencies [[alembic "0.3.2"]
;; [acyclic/squiggly-clojure "0.1.5"]
]}
:dev {:dependencies [[lambdaisland/kaocha "1.0.829"]
[ring/ring-devel "1.9.2"]
[ring/ring-mock "0.4.0"]]
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"]
:repl-options {:init-ns user}
:source-paths ["env/dev/clj"]
:plugins [[lein-marginalia "0.9.1"]]
:aliases {"kaocha" ["run" "-m" "kaocha.runner"]}}}
#2021-04-2110:30euccastroI'm getting this trying to install cider-nrepl 0.26.0 snapshot. I'm asking in other channel how to get the latest release instead, just FYI
error in process sentinel: Could not start nREPL server: Downloading: cider/cider-nrepl/0.26.0-SNAPSHOT/maven-metadata.xml from clojars
Downloading: cider/cider-nrepl/0.26.0-SNAPSHOT/cider-nrepl-0.26.0-20210418.130850-4.pom from clojars
Downloading: org/clojure/clojure/maven-metadata.xml from clojars
Downloading: org/clojure/clojure/maven-metadata.xml from central
Downloading: org/clojure/clojure/maven-metadata.xml from maven-central
Error building classpath. Malformed \uxxxx encoding.
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
at java.util.Properties.loadConvert(Properties.java:574)
at java.util.Properties.load0(Properties.java:390)
at java.util.Properties.load(Properties.java:341)
at org.eclipse.aether.internal.impl.TrackingFileManager.read(TrackingFileManager.java:56)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.read(DefaultUpdateCheckManager.java:511)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkMetadata(DefaultUpdateCheckManager.java:250)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolve(DefaultMetadataResolver.java:302)
at org.eclipse.aether.internal.impl.DefaultMetadataResolver.resolveMetadata(DefaultMetadataResolver.java:181)
at org.apache.maven.repository.internal.DefaultVersionResolver.resolveVersion(DefaultVersionResolver.java:213)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:282)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:207)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:262)
at clojure.tools.deps.alpha.extensions.maven$get_artifact.invokeStatic(maven.clj:122)
at clojure.tools.deps.alpha.extensions.maven$get_artifact.invoke(maven.clj:116)
at clojure.tools.deps.alpha.extensions.maven$eval1084$fn__1086.invoke(maven.clj:137)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at clojure.tools.deps.alpha$download_libs$fn__811$fn__812.invoke(alpha.clj:462)
at clojure.tools.deps.alpha.util.concurrent$submit_task$task__502.invoke(concurrent.clj:34)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#2021-04-2110:41bozhidar@euccastro I can't reproduce this and I can think of no recent changes that might have caused this.#2021-04-2110:41bozhidarPerhaps the artefact got corrupted for you or something like this.#2021-04-2112:51Alex Miller (Clojure team)The stack trace indicates the encoding error is encountered while reading a Java properties file while doing an update check while downloading the pom file. I’d wonder about Java version (Unicode support gets bumped periodically), and maybe your platform encoding (although I think Java always uses UTF-8 for prop files), but file corruption is a reasonable guess too. I’ve never seen this error before#2021-04-2116:44euccastrojava version is
es@chu:~$ java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)
locale is
es@chu:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=gl_ES.UTF-8
LC_TIME=gl_ES.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=gl_ES.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=gl_ES.UTF-8
LC_NAME=gl_ES.UTF-8
LC_ADDRESS=gl_ES.UTF-8
LC_TELEPHONE=gl_ES.UTF-8
LC_MEASUREMENT=gl_ES.UTF-8
LC_IDENTIFICATION=gl_ES.UTF-8
LC_ALL=
I'm on Ubuntu 20.04, using spacemacs. this happened after a spacemacs upgrade#2021-04-2116:48euccastrothe version I upgraded from is CIDER 1.1.0snapshot (package: , and that works fine#2021-04-2116:55Alex Miller (Clojure team)the only properties file I can think of are the ones like ~/.m2/repository/org/clojure/clojure/resolver-status.properties#2021-04-2116:56Alex Miller (Clojure team)or I guess maybe ~/.m2/repository/org/clojure/clojure/1.10.3/_remote.repositories#2021-04-2117:01Alex Miller (Clojure team)from looking at the code, it's probably a resolver-status.properties file#2021-04-2117:02Alex Miller (Clojure team)not sure if that got corrupted or maybe something troublesome could be written into that if you had a bad repository id#2021-04-2117:05Alex Miller (Clojure team)I was able to repro the stack trace by modifying one of those files and forcing it to be read. I'd be kind of curious what it looks like if you track down which one is bad#2021-04-2120:08piyer@bozhidar I figured the problem, might save someone's time. It was c3p0 that was messing with the logging.#2021-04-2120:08piyermchange-log.properties
com.mchange.v2.log.MLog=com.mchange.v2.log.FallbackMLog
com.mchange.v2.log.FallbackMLog.DEFAULT_CUTOFF_LEVEL=WARNING
#2021-04-2212:24bozhidarFYI - https://github.com/clojure-emacs/cider/releases/tag/v1.1.0#2021-04-2212:26bozhidar(yeah, a new release is out! Cheers! cider )#2021-04-2217:49bozhidarLet me know if there's no release on MELPA Stable in the next day or two. I named one branch 1.1.0-antora and I wonder if this might have broken MELPA for some reason.#2021-04-2220:49peterdeeI am not too knowledgeable about how cider integrates with shadow-cljs, but my application is hanging on jack-in with cider 1.1.0 and also the melpa release from a few days ago. There isn’t anything in Messages but when I run shadow-cljs from a shell /usr/local/bin/npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/piggieback:0.5.2 -d cider/cider-nrepl:0.26.0 watch main I get#2021-04-2316:01peterdeeThings work with shadow-cljs 2.11.11, but not 2.12.5. For the time being, I’m going to have to live with it.#2021-04-2220:49peterdeeCompilerException Unexpected error macroexpanding if-ns at (cider/piggieback.clj:22:1). #:clojure.error{:phase :macroexpansion, :line 22, :column 1, :source "cider/piggieback.clj", :symbol if-ns}.#2021-04-2220:51peterdeeDoes running that way even make sense? Prior to this, there is a message shadow-cljs - socket connect failed, server process dead? so maybe this the problem macroexpanding is misleading???#2021-04-2220:55peterdeePS I think this answers @bozhidar’s question about 1.1.0 being on MELPA; it is.#2021-04-2220:56peterdee…oops. Maybe not. I’m running <tel:202104221353|20210422.>802#2021-04-2306:24bozhidarI pushed one extra tag (1.1.0.1) in the hope to appease MELPA.#2021-04-2306:24bozhidarIt seems that this has worked, as now I see CIDER 1.1 on http://stable.melpa.org.#2021-04-2315:58futuroWith the cider debugger, what does it mean to force-step, such as if you hit O or H?#2021-04-2315:59futuroAh, reading a bit further in the docs I see
> Out: Same as o, but skips breakpoints in other functions.#2021-04-2316:00futuroSo it turns out I didn't need to dig into the source after all 😆#2021-04-2420:14Drew VerleeHow would I configure it so get expound formatted spec error messages in the cider-error buffer rather then the long form spec messages?
I have ran set up my project this way so far:
....
(:require [expound.alpha :as expound]
[clojure.spec.alpha :as s])
(binding [s/*explain-out* expound/printer]
(s/assert :example.place/city 1))
(set! s/*explain-out* expound/printer)
#2021-04-2617:13nonrecursiveHey y'all, I noticed that when a REPL op takes a long time to complete, a neat little activity indicator appears in my minibuffer. I was wondering if that's powered by cider or nrepl somehow, and if so, could direct me to the code? I'm using doom emacs and the latest cider#2021-04-2619:02dakraThe indicator itself is powered by the spinner package https://github.com/Malabarba/spinner.el#2021-04-2619:35nonrecursivethat answers my question, thank you!#2021-04-2707:27bozhidarI think we've had this indicator for at least 5 years, btw. 😄#2021-04-2707:29bozhidarHere's where the CIDER integration code begins https://github.com/clojure-emacs/cider/blob/5bbb890b533fe8ca4f580f257045f6c87c9c9780/cider-client.el#L44#2021-05-0415:55nonrecursivethanks man 🙂#2021-04-2800:03Alexis Vincent#2021-04-2808:56bozhidarI have some memory that dynapath was breaking this. You might try disabling it as documented here.#2021-04-2808:56bozhidarhttps://github.com/clojure-emacs/orchard#configuration-options#2021-04-2800:03Alexis Vincent@bozhidar Any chance I can get you to weigh in on ^#2021-04-2805:18Matti UusitaloSome problem with eval defun functionality. In some namespaces I can’t properly do repl based development as CIDER doesn’t seem to “see” anything I have declared and loaded already. Evaling the buffer works fine, but as soon as I eval region or defun, it doesn’t see things in the same namespace.
I turned nrepl logging on and I see for the working one
(-->
id "28"
op "eval"
session "375f7ae0-c60a-417a-a9d8-cc4b9e442d65"
time-stamp "2021-04-28 08:09:47.045094000"
code "(defn oracle-db-config [config]
(if
(common.env/dev-mo..."
column 1
file "/Users/matti.uusitalo/projektit/allu/valvira-allu-konversio/..."
line 28
nrepl.middleware.print/print "cider.nrepl.pprint/pr"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? nil
ns #("konversio.db" 0 12 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
)
but for the ones not working I get
(-->
id "30"
op "eval"
session "375f7ae0-c60a-417a-a9d8-cc4b9e442d65"
time-stamp "2021-04-28 08:10:12.564574000"
code "(defn next-lupanumero [target-db used-numbers licence-type]
(loop [candidate nil]
(if-not (or (nil? candidate) (used-numbers candidate))
candidate
(recur
(format
\"%s%06d\"
licence-type
(:nextval (db/query target-db (format \"SELECT nextval('rekisteri.licence-number-%s\" licence-type))))))))
"
column 1
file "/Users/matti.uusitalo/projektit/allu/valvira-allu-konversio/..."
line 15
nrepl.middleware.print/print "cider.nrepl.pprint/pr"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? nil
ns "user"
)
So it looks like it doesn’t understand the namespace correctly, as the ‘ns’ identifier points to “user” in the non-working namespace. The files are both in the same project and folder.
What could cause CIDER to get confused about the namespace like this?#2021-04-2805:22Matti Uusitalo(cider-current-ns) seems to return the wrong namespace for the non working ones. It returns “user”#2021-04-2805:29Matti UusitaloI figured this out. I had a space before the ns declaration. Cider doesn’t find the namespace declaration in that case#2021-04-2808:57bozhidarI think that's a known bug and it's actually in clojure-mode, but as it was pretty rare I didn't pay it much attention.#2021-04-2905:21Matti UusitaloMy apologies. I misinterpreted it to being cider-related. I was navigating the code in Emacs and didn’t realize i’d switched to a different package.
I reported an issue about it to Cider repo yesterday. https://github.com/clojure-emacs/cider/issues/3009
I just close the issue then. Sorry for extra hassle.#2021-04-2821:29Drew VerleeGiven a project that
1. starts both a server
2. and manages the frontend cljs code
3. has a cljc code
i'm not sure of how to achieve the common goal of being able to evaluate expression for both context (clj & cljs) forms.
Here is the project in question
https://github.com/drewverlee/garlic
I'm guessing these cider docs contain most of the information I need https://docs.cider.mx/cider/usage/managing_connections.html.
It seems likely that I want to somehow group files by FrontEnd (FE) and BackendEnd (BE) code. What does cider consider a "project?" I have always thought it looks at the directory with the .git folder. How are .cljc files treated? is it dependent on the context? As in i should put them in their own library and import them into the FE or BE project?
If i do split the project, then I assume it would be just a matter of running `cider-jack-in-(clj or cljs)` respectively. Alternatively, is there a way to keep clj and cljs in the same files and use cider-jack-in-clj&cljs? the backend code is responsible for starting a webserver: servering assets, responding to api calls, etc... The front end code, if i understand figwheel-main correctly, needs to either launch a new (or should it be sibling) nrepl server, with piggieback middleware (because i can't run cider-jack-in here).
What I have tried is firstly (different from the github link) to temporarly moving all my alias deps to :deps
com.bhauman/figwheel-main {:mvn/version "0.2.11"}
cider/piggieback {:mvn/version "0.5.1"}
org.clojure/clojurescript {:mvn/version "1.10.764"}
to avoid extra complications with alias and my .dir-locals.el as i'm worried this second clojurescript-mode expression isn't valid
(
(clojure-mode . ((cider-clojure-cli-aliases . "-A:cljs")))
(clojurescript-mode . ((cider-clojure-cli-aliases . "-A:fig")))
)
Then
1. cider-jack-in-clj, correctly starts nrepl clj server. then starting my server.
2. cider-connect-sibling which produces another Nrepl buffer. However trying to evaluate anything results in a "nrepl-send-sync-request: sync nREPL request timed out).
At this point i feel my further guesses would be somewhat random and i'm hoping someone can give advice.#2021-04-2905:39Matti UusitaloNormally I just cider-jack-in-clj&cljs and everything “just works”. I need to navigate my browser to the app for the cljs repl to become responsive though#2021-04-2914:24tvaughanWe have a backend in clojure and frontend in clojurescript in one repo with a lot of shared cljc source code between the two. The frontend has its own alias in deps.edn, but otherwise there's no separation between the two. I use jack-in to start a clojure repl, and connect to a running cljs repl started by shadow-cljs. Cider uses the "most recent" repl when evaluating buffers or s-expressions where "most recent" is whichever had focus most recently.#2021-04-2915:36Drew Verleethanks. cider-jack-in-clj&cljs unfortanltly doesn't just work.#2021-04-2915:36Drew Verleehopefully looking at this fresh today makes it clear#2021-04-2821:33Drew Verleei guess my next step is breaking the project into two projects and see if that just works.#2021-04-2907:35Jim NewtonI’m not a cider expert, but I’m trying to use it. I have a repl running in the repl buffer and I can type expressions and evaluate them#2021-04-2907:36Jim Newtonand I’ve opened a file.clj file.#2021-04-2907:36Jim Newtonbut the .clj file seems to not be connected#2021-04-2907:37Jim Newtonso commands such as C-M-x have no effect#2021-04-2907:37Jim Newtoncan someone explain what I’m doing wrong?#2021-04-2908:00yuhanIs your clj file in the same folder as the project that you started the repl?#2021-04-2908:01gonis the file in the project class-path where you have started the cider repl ?#2021-04-2908:09Jim Newtonno, it’s in a different directory. It is in a directory of files where I’m preparing a presentation. The presentation slides are not inside the clojure project.#2021-04-2908:11Jim NewtonBTW, how do I know what directory the repl was started from? I didn’t directly start the repl, rather I used M-x cider-jack-in, but then that’s a completely different off-topic question.#2021-04-2908:15gonwell, that's is the reason, clj files must be on the class-path, just extend the classpath over it and restart the repl#2021-04-2908:15Jim Newtonhow do I do that?#2021-04-2908:16gonwhat kind of project are you using ? lein or clj tools ?#2021-04-2908:16Jim Newtonlein#2021-04-2908:17Jim Newtonisn’t there a way just evaluate code from a file without incorporating a file into my project. I don’t really want the file in my project. the project does not depend on the file, rather the file depends on the project#2021-04-2908:18Jim Newtonof course I could fork the project just for the presentation, and remember never to merge the branch.#2021-04-2908:21gonin project.clj editing this key should do the trick :resource-paths ["your-path-here"]#2021-04-2908:22Jim Newtondoes the path interpreter understand “~/” ?#2021-04-2908:23gonto evaluate code in a sparse file I think you could achieve it loading the file and evaluating it, not that is just your shell that expands it#2021-04-2908:25Jim Newtonthe flow of my presentation is that I’ll cursor through the file, evaluating each top level form, looking at the printed result and talking to the audience about what happened or why certain errors occurred. the file is not loadable, as it contains intentional errors for pedagogical reasons#2021-04-2908:25Jim Newtonthat’s reasonable, right?#2021-04-2908:26Jim NewtonI was considering just copy-pasting into the repl, but that makes for ugly indentation….#2021-04-2908:31gonOne solution could be just comment the intentional errors so as the reader does not parse them, another one could be using Emacs literate programming... that seems to fit neatly to you needs....#2021-04-2908:32gonor using cider scratch buffer#2021-04-2908:32gonmaybe this third alternative is the simpler...#2021-04-2908:35Jim Newtonnice suggestions, all.#2021-04-2908:35gonin the cider scratch buffer you should be able to paste code and evaluate it and pretty print results either on the repl or following the code declaration... easy to follow for an audience#2021-04-2908:36Jim Newton1. for literate programming, does the file need to be in the project?#2021-04-2908:36Jim Newton2. how can I go the scratch buffer direction? I know about the elisp scratch buffer#2021-04-2908:37Jim Newton#2 is probably the easiest solution for my needs, as you said#2021-04-2908:39gonmaybe scratch buffer is the easiest, literate programming involve more stuff...#2021-04-2908:39gonUsing a Scratchpad
CIDER provides a simple way to create a Clojure scratchpad via the M-x `cider-scratch` command. This is a great way to play around with some code without having to create source files or pollute the REPL buffer and is very similar to Emacs’s own `*scratch*` buffer.#2021-04-2908:43Jim Newtoncider scratch is cool#2021-04-2908:45Jim NewtonC-M-x prints the result ephemerally with a => result which vanishes when I move the cursor. thats EXCELLENT#2021-04-2908:51yuhan@jimka.issy you could also use sesman-link-* commands to tell cider to connect buffers which aren't in the project directory#2021-04-2917:24Drew VerleeGiven a deps file with the aliases:
{:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.11"}}
:extra-paths ["target" "test"]}...
and a dir-locals.el file (and a clean restart):
((clojurescript-mode . ((cider-clojure-cli-aliases . "-A:fig"))))
when i run 'cider-jack-in-cljs` i expect figwheel -main to be available, but it isn't.#2021-04-2919:55Drew Verleeand now it is.#2021-04-2919:55Drew Verleehuh, maybe when i hit the command i wasn't in the cljs buffer?#2021-04-2920:05Drew Verleeok fantastic, maybe all my woes are because i wasn't running cljs jack in the right right. I had considered the specific file mattered. That or something else wasn't aligned the way it is now.#2021-04-2920:06Drew VerleeThough i suppose this differs from the main project in that there is no server code to speak of.#2021-04-2920:07dpsuttonYou put the alias under clojurescript mode. So the mode of the file matters when jacking in. I’d change it to just nil so it’s always available #2021-04-2921:53hugodIs it possible to disable the tracking in the cider-nrepl middleware?#2021-04-3009:23bozhidarCurrently it's not, unless you regenerate the middleware vector manually.#2021-04-3009:24bozhidarI've been planning for a while to make it "opt-in"/"opt-out", which is just a matter of adding one more flag, but I never got to doing so.#2021-04-3009:55hugodThanks. The tracking gets very slow on large projects, I think mainly due to the size of the nrepl messages it generates.#2021-04-3005:00macrobartfastwhenever I cider-connect-clj&cljs I get
WARNING: CIDER 0.24.0 requires cider-nrepl 0.24.0, but you're currently using cider-nrepl 0.25.9. The version mismatch might b\
reak some functionality!
More information.WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
I’m guessing I have to upgrade Cider in Emacs, right? While I’m doing this should I be also figuring out how to update cider-nrepl? I use shadow-cljs via create-cljs-app and I’m now lost as to where I even set the cider-nrepl version at this point.#2021-04-3009:25bozhidarYeah, you have to update CIDER's Emacs package.#2021-04-3009:25bozhidar> I use shadow-cljs via create-cljs-app and I’m now lost as to where I even set the cider-nrepl version at this point.#2021-04-3009:26bozhidarI recall that shadow had some project file with deps in it, so it should be there. I don't do ClojureScript programming myself, but I'm sure that plenty people here can help with this question.#2021-04-3009:27thhellercider-nrepl will either be in shadow-cljs.edn or deps.edn. not sure what create-cljs-app generates either 🙂#2021-04-3009:27thhellerif its not in either of those you might have preconfigured in ~/.shadow-cljs/config.edn#2021-04-3019:08richiardiandreaHi there I am triggering this command and there is a warning I cannot explain
clojure -A:reveal:dev -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.26.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,vlaaad.reveal.nrepl/middleware]"]}}}' -M:cider/nrepl
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
not urgent but I was just wondering#2021-04-3019:11richiardiandreaDoes GDK_SCALE=2 work on linux as well? I see very minutes characters there 😄#2021-05-0122:11macrobartfastand just enabled cider’s auto completion… crying tears of joy and crying that I didn’t do this long ago.#2021-05-0122:12macrobartfastIt’s so good it’s unreal. Thank you. I now have everything I want in an editor.#2021-05-0123:17Carlodoes cider-inspect work for clojurescript for you?#2021-05-0123:23Carloin alternative, which tool do you use to visualize interactively large data?#2021-05-0203:02Drew VerleeWhat do you mean by data? Vectors and hash maps?#2021-05-0203:27Drew VerleeBut regardless, a query language is ideal so you don't have to deal with a large set of data.#2021-05-0212:06CarloI mostly mean nested data that I want to explore interactively; I guess like reveal but integrated in emacs#2021-05-0212:41Drew VerleeThere is "cider inspect"#2021-05-0217:22Drew VerleeOh you mentioned it, I can't recall if it works in cljs.#2021-05-0203:26Drew VerleeGiven a project that contains clj, cljc and cljs. One where the need to start a backend server and a figwheel server. I'm I correct in assuming the best way to do this is to setup my dir locals file so it triggers starting both servers and then running cider jack in clj&cljs?
What I'm currently doing is jacking in twice, a new cljs (not a sibling) as the other way to throws an error, I believe about missing middle ware.#2021-05-0514:30Matti UusitaloJack in clj&cljs should “just work”. Is it a leiningen , boot or deps.edn project#2021-05-0519:36Drew Verlee@matti deps.edn a rum project with figwheel
https://github.com/drewverlee/garlic#2021-05-0516:30Michael LanHow can I eval the surrounding form? Not the top form nor the atom at point, for example here:
(comment
(+ 1 2)
)
#2021-05-0516:31dpsuttonyou want to treat (+ 1 2) as the toplevel form rather than the whole comment form?#2021-05-0516:32dpsutton(setq clojure-toplevel-inside-comment-form t) and then eval top level form as normal anywhere inside the (+ 1 2) or right after it. otherwise you can always put your cursor at the close of the paren after the 2 and eval last sexp#2021-05-0516:34Michael Lanthat is a nice feature, i will keep that in mind. thank you!#2021-05-0604:45mbertheauWhen I have two cljs repls connected to the current project (one web, one react-native), how do I switch between them? I.e. how do I determine which repl cider-eval-last-sexp goes?#2021-05-0604:49dpsuttonit's based on which one last had point in it (the cursor). so focus the one you want and then all forms will be evaluated there#2021-05-0605:23yuhanI'm in a .cljs file trying to cider-connect-cljs, but Cider tells me that there's an existing clj repl and I should connect a sibling, so I run cider-connect-sibling-cljs but it throws an error "no cljs REPLs in current session".
Am I missing something? That's the whole reason for trying to connect a sibling#2021-05-0605:38yuhanOk, I figured out that I have to be in a .clj buffer in order to connect a cljs sibling, and vice versa (if the session only has a cljs repl, I have to navigate to a cljs file and then connect-sibling-clj).
Is this the right mental model? I find it quite unintuitive, especially if there are no files of the other type at all#2021-05-0605:39dpsuttonfile a ticket about that. that sounds quite weird#2021-05-0605:54bozhidarAgreed. Seems like a bug.#2021-05-0605:55bozhidarAt this point the session management code is definitely the most problematic part of CIDER's code.#2021-05-0605:55bozhidarIt needs a lot of love.#2021-05-0606:10yuhanAlso, is there any indication of errrors when evaluating Clojurescript forms? I'm not expecting full stack traces like with the JVM, just anything to distinguish it from the evaluation returning nil#2021-05-0718:03yendaI don't see any log statements in my repl after a cider-ns-refresh. Here is what I see in the *nrepl-message:
15 is a regular repl command, the response out is a log statement that is printed in the repl
17 is a refresh, the response out is a log statement that is not printed in the repl
(-->
id "15"
op "eval"
session "b0f68092-94b9-45ff-8d25-240ec25c0fad"
time-stamp "2021-05-07 19:46:03.113738702"
code "(log/info :in ::-main :msg \"Let there be light!\")"
column 24
file "*cider-repl ~/my-program:localhost:9676(clj)*"
line 48
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
ns "my.main"
)
(<--
id "15"
session "b0f68092-94b9-45ff-8d25-240ec25c0fad"
time-stamp "2021-05-07 19:46:03.158979206"
out "2021-05-07T17:46:03.128 [nREPL-session-b0f68092-94b9-45ff-8d...}
"
)
(-->
id "17"
op "refresh"
session "b0f68092-94b9-45ff-8d25-240ec25c0fad"
time-stamp "2021-05-07 19:46:37.404720694"
after "com.stuartsierra.component.repl/start"
before "com.stuartsierra.component.repl/stop"
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
)
(<--
id "17"
session "b0f68092-94b9-45ff-8d25-240ec25c0fad"
time-stamp "2021-05-07 19:46:37.424945520"
out "2021-05-07T17:46:37.406 [nREPL-session-b0f68092-94b9-45ff-8d..."
)
I don't understand why the second out doesn't print in the repl (it doesn't print anywhere but in the nrepl-message, after I enabled them)#2021-05-0718:25yendaok I figured, they go to a cider-ns-refresh-log buffer#2021-05-0818:54peterdeeWhen I start clojurescript from a shell with clojure -M:middleware/cider-cljs where deps.edn is
{:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.773"}
nrepl/nrepl {:mvn/version "0.8.3"}
cider/cider-nrepl {:mvn/version "0.26.0"}
cider/piggieback {:mvn/version "0.5.2"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
I get:#2021-05-0818:55peterdeeError while decrypting with "/usr/local/bin/gpg":
gpg: encrypted with RSA key, ID E51098C4EAF8AE71
gpg: public key decryption failed: No secret key
gpg: decryption failed: No secret key
Any ideas what that is about?#2021-05-0819:17dpsuttonCan you start debugging? Start removing deps to see if you can reproduce without cider?#2021-05-0820:47peterdeeHi @U11BV7MTK. I think you have the right idea here. The gpg error was a step along the way to debugging what I intend to be a cljs-compatible library. It could be a quirk I could live with, since cider-jack-in-cljs works.
The library loads okay in my client and I can check out a few things using it that way (cider-jack-in-clj-cljs). But of course that’s a slow workflow if the problem is with cljs-compatibility of the library. I think I’ll have to get the shadow-cljs.edn figured and then come back to this.#2021-05-0820:48dpsuttoni don't know what you're trying to say here#2021-05-0821:03peterdeeSorry about that. I’m saying in essence that I need to learn shadow-cljs better and stop bothering the cider folks with this gpg error!#2021-05-0821:10dpsuttonOh no worries. Do you have any reason to suspect this is a cider issue?#2021-05-0821:10dpsuttonThat’s why I was suggesting recreating without cider to see if it was related#2021-05-0821:37peterdeeThank you. Regarding your question about it being a cider issue: There might be a cider issue, since I get the same thing about gpg when I start (also from a shell) using
:middleware/cider-clj
{:extra-deps {nrepl/nrepl {:mvn/version "0.8.3"}
cider/cider-nrepl {:mvn/version "0.26.0"}}
:main-opts ["-m" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"]}#2021-05-0821:37peterdeewhich is, of course, not pulling in clojurescript or cider/piggyback#2021-05-0822:10dpsuttonAnd what if you totally exclude cider?#2021-05-0822:18peterdeeI am still trying to find a way to run shadow-cljs on a library (something without a main) without cider.
I’ve just read that shadow-cljs “has its own nREPL middleware and doesn’t rely on piggyback at all”. So the deps I posted originally are wrong!#2021-05-0822:23dpsuttonJust run “shadow-cljs cljs-repl” and see what happens. That will start up a cljs repl with your project and no cider involved#2021-05-0822:38peterdeeshadow-cljs cljs-repl :main gives me a repl prompt, but when try to change to a project ns, I get No available JS runtime.#2021-05-0823:05dpsuttondid you open the app in teh browser or run the js file if its a node project?#2021-05-0823:12peterdeeIt is a library, not an app. I have :target :node-library in shadow-cljs.edn, which seems to be the right thing. Keep in mind I’m doing this for the first time today! (I’ve used clj for a few years, but cljs an shadow are new.) So while we were corresponding, I’ve been able to cider-jack-in-cljs, and, in fact, things are working (with about 100 warnings!). So the remaining problems are (1) the gpg error and (2) the No available JS runtime both when I start from a shell prompt. I think I have the wrong deps.#2021-05-0823:17peterdeeI didn’t answer your question. I didn’t run anything except (in-ns ’some-ns) from the prompt I got when I started.#2021-05-1623:01peterdeeRemove ~/.authinfo.gpg and this problem goes away.#2021-05-0912:26AleHello, I'm having some issues with cider starting a krell nrepl.
I can run the app correcly, and can open a working cljs repl issuing
clj -M -m krell.main -co build.edn -r
at the command line.
However, when I try to start the repl from cider or calva, I get this error
ReferenceError: Can't find variable: cljs
full stack trace here: https://gist.github.com/laynor/4944b74a36691b8c3be7bb852818fe87
The full project repo is here https://github.com/laynor/krelltest
I previously asked for help in #beginners and #nrepl, and the project appears to work at least on @pez machine, who helped me a lot to troubleshoot this issue.
As a result of this issue, the cider repl is stuck at the user => prompt (clojure/java repl if I understand correctly) and never reaches the cljs.user => repl.
Strangest thing, when I was troubleshooting this issue, I made a copy of the project in another directory.
By mistake, while the app was running on the simulator from the second copy of the project, I jacked in with cider from the first copy, and I got a half working cljs.user => repl (I could execute code in the running application, but cljs.pprint.pprint was undefined so I was getting errors in the cider repl).
Here are my system details:
Os: Arch linux
Emacs: recent version compiled from sources (master). native comp enabled
Cider version: "CIDER 1.1.0 (package: 20210422.802) (Plovdiv)"
clojure --version: Clojure CLI version 1.10.3.822
java version:
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
Node version 14.3.0
Any clue?#2021-05-1017:24andrea.crottidoes anyone know what's the best way to add another middleware to the options of cider/nrepl?#2021-05-1017:24andrea.crottiI just have to add another middleware before all the others without really changing anything from the rest of the config#2021-05-1200:44mafcocincoNewb question: Are there cross file search capabilities which resolve namespace aliases as part of the search within CIDER (or emacs generally)?#2021-05-1200:52dpsuttonCan you give an example of what you mean?#2021-05-1201:08mafcocincoFor example, in the context of a directory and its child directories, I would like to find all uses of foo.bar namespace, including places it is aliased to f.b.#2021-05-1201:27dpsuttonI think there’s something like m-x cider-find-usages#2021-05-1214:18aptMaybe this is too simplistic, but what about a text search on the ns name (recursively on the dir you are interested in)?
If you do this, you can at least collect all files that use the ns. Then, you’d have to look one by one what’s being used.
You could algo use LSP, but AFAIK there’s the concept of find usages for vars, but not for namespaces#2021-05-1216:29ericdallohttps://clojure-lsp.github.io/clojure-lsp/ support find references of a var or ns as well#2021-05-1216:36aptdidn’t know about ns references, noice#2021-05-1301:05macrobartfastI’ve created a project with create-cljs-app, which is awesome. However, now I’ve enabled the server option in shadow-cljs.edn, which allows me to add routes, and I want to send data from the front-end to the back. To send a map, I would have to turn it into a string or JSON, right? Two questions (I think): what format is best to send and receive it in? And, assuming I’m right in that I have to wrap the Ring or Compojure routes, how and where do I do this in an app created with create-cljs-app? I don’t have a familiar instance to wrap, as create-cljs-app is a little different than what I set up myself. In my shadow-cljs-edn I have:
:dev-http {8080 {:root "public"
:handler app.handler/handler}}
and my handler ns requires are:
(ns app.handler
(:require [crux.api :as crux]
[compojure.core :refer :all]
[compojure.route :as route]
[muuntaja.middleware :as mw]
;; [ring.middleware.json :as json]
[ :as io]))
and my handler is
(defroutes handler
(GET "/about" [] "<h1>Hello World</h1>")
;; (POST "/test" req (prn (read (:body req))))
(POST "/test" req (:body req))
(route/not-found "<h1>Page not found</h1>"))
which returns the request at /test. I need to be able to send a map from the front end and send it off to Crux.#2021-05-1301:06macrobartfastI’m open to total changes in approach… whatever I have here is just from my thrashing along.#2021-05-1301:07dpsuttondid you mean to put this in #cider?#2021-05-1301:07macrobartfastthe front end is using cljs-http.#2021-05-1301:07macrobartfastomg.#2021-05-1301:07dpsuttonha 🙂#2021-05-1301:07macrobartfastso absolutely sorry.#2021-05-1301:07dpsuttonno worries at all#2021-05-1301:07macrobartfastwhat a catastrophe, sorry cider people.#2021-05-1301:07dpsuttonnot a problem 🙂#2021-05-1505:51zackteoWhat Clojurescript repl type do people usually use? :o#2021-05-1505:55zackteoReally don't quite understand the cider clojurescript workflow - if any#2021-05-1506:01zackteoEvaluation within Emacs won't work unless I use weasel is that correct ?#2021-05-1506:11dpsuttonDon’t think weasel is really a thing#2021-05-1506:29dpsuttonthere are largely three ways to go about this. figwheel (deprecated but still widely used), figwheel main and shadow-cljs. Clojurescript is a clojure library that compiles cljs files into js files. Evaluating code requires a js context, as clojurescript can only emit code, not evaluate it. This is where figwheel-main and shadow come in. They have all of the filewatchers to keep recompiling, and open websockets to update the javascript environment with the latest code.#2021-05-1506:30dpsuttonfor the purposes of CIDER, a cljs repl is a regular clj repl that gets "upgraded". you start a clj repl, and call functions in either figwheel main or shadow that move evaluation from the jvm and into the js context#2021-05-1506:30zackteoHmmm, I'm using shadow-cljs but not sure if im supposed to be able to be able to evaluate code inside cider. I am able to get hot-reloading by saving#2021-05-1506:31dpsuttonyou absolutely should be able to. m-x cider-jack-in-cljs should prompt you for a few things. pick shadow and then choose your build and it should just work#2021-05-1506:32zackteoAm i supposed to have a project.clj ? Am wondering if it is because I only have shadow-cljs.edn with ..
;; shadow-cljs configuration
{:source-paths
["src"]
:dev-http {8081 "public"}
:dependencies
[[reagent "1.0.0"]
[re-com "2.13.2"]
[binaryage/devtools "1.0.3"]]
:builds {:app {:target :browser
:output-dir "public/scripts/"
:asset-path "/scripts/"
:modules {:main {:init-fn ura.frontend.core/run}}}}}#2021-05-1506:32dpsuttonthat will start a shadow process npx shadow-cljs ... and then at the repl it calls (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/nrepl-select %s)) for you where the %s is replaced with your build#2021-05-1506:32dpsuttonyou only need a project.clj file if you need a lein process#2021-05-1506:33dpsuttontotally fine to just have just a frontend#2021-05-1506:33zackteohmmmm#2021-05-1506:34dpsuttonthe equivalent for figwheel main is (do (require 'figwheel.main) (figwheel.main/start %s)), basically the same api#2021-05-1506:36zackteolet me try again#2021-05-1506:37zackteothis call: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/nrepl-select %s)) should be done by cider right ?#2021-05-1506:38dpsuttoncorrect#2021-05-1506:39dpsuttonjust jack-in-cljs#2021-05-1506:39dpsuttonand hopefully just follow the prompts#2021-05-1506:44zackteoIs it supposed to change from shadow.user> to cljs.user>#2021-05-1506:45dpsuttonYeah once you open the browser to your app#2021-05-1506:46dpsuttonLocal host 8081 for you according to your file above#2021-05-1506:48zackteoI think I have this issue https://shadow-cljs.github.io/docs/UsersGuide.html#missing-js-runtime#2021-05-1506:50dpsuttonHave you opened the browser to your site and seeing your app?#2021-05-1506:53zackteoYeapp. But it doesn't watch the app. Doesn't hot reload. Need to manually start the watch#2021-05-1506:54thhellerhonest question: can shadow-cljs do something different that makes this easier to understand? seems like A LOT of people struggle with this in cider?#2021-05-1506:55thhellerthis question never comes up for cursive but somehow the cider jack-in process seems to make this complicated? why?#2021-05-1506:56dpsuttonI think it opens the browser automatically. I don’t understand#2021-05-1506:56zackteomaybe it is because most start with the clj experience and the cljs experience is very foreign to most ?#2021-05-1506:57dpsuttonBut the symptoms here are strange. If it’s not watching the app. If you change some string In your files does it reload the app and show a bit of ui from shadow?#2021-05-1506:57zackteoOh it opens the browser and the app is there but ill get shadow-cljs - Stale Output! Your loaded JS was not produced by the running shadow-cljs instance. Is the watch for this build running?#2021-05-1506:58zackteoLet me try again... hmm#2021-05-1506:59dpsuttonI think I remember seeing that when the browser opens before compilation has finished. The repl should show compiling and then when it finishes#2021-05-1506:59dpsuttonAnd then just hit refresh in your browser#2021-05-1507:05zackteoNow i seem getting sync nrepl timeout. If I do (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app)) myself, it seems to work . Like on save it will say [:app] configuring build. [:app] Compiling ...#2021-05-1507:05zackteobut doesn't actually update the app#2021-05-1507:06dpsuttonthat sounds like a configuration problem. did you read through how to set up the init and after-refresh functions?#2021-05-1507:06codeasone@zackteo here's how I set things up with deps.edn in case it provides some pointers https://github.com/codeasone/starter-cider-tools-deps-shadow#2021-05-1507:07zackteowait. Emacs setup or shadow-cljs.edn?#2021-05-1507:07dpsuttonyou can try this repo here: . just clone, npm install and then cider-jack-in-cljs, choose shadow, and the app build, then open localhost 3000#2021-05-1507:07codeasoneI found the cider session handling confusing.#2021-05-1507:08thhellerhttps://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html#2021-05-1507:14zackteohaving some issues with npm install @dpsutton can't seem to find this tho semver.simplifyRange is not a function#2021-05-1507:15dpsuttonwhen doing npm install?#2021-05-1507:15zackteoyeap#2021-05-1507:15dpsuttonweird. for me ran just fine, added 114 packages#2021-05-1507:16zackteo189 verbose stack TypeError: semver.simplifyRange is not a function
189 verbose stack at Advisory.[calculateRange] (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:191:16)
189 verbose stack at Advisory.load (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/advisory.js:148:28)
189 verbose stack at Calculator.[calculate] (/usr/lib/node_modules/npm/node_modules/@npmcli/metavuln-calculator/lib/index.js:59:14)
189 verbose stack at async Promise.all (index 0)
189 verbose stack at async Map.[init] (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:177:7)
189 verbose stack at async Map.run (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/audit-report.js:105:7)
#2021-05-1507:16zackteohmmmm#2021-05-1507:18dpsuttonlooks like that's in the audit report. there are some advisories in these deps but it doesn't matter for demo purposes#2021-05-1507:18dpsuttonmight be fine to just ignore and continue#2021-05-1507:21zackteonot sure why my nrepl sync keeps timing out now but probably might be resolved with a restart hmm#2021-05-1507:22dpsuttonone thing you can try is npx shadow-cljs compile app and then try everything. if its timing out due to compilation taking a while, you can kinda help it out#2021-05-1507:22dpsuttondon't know if compilation can cause a timeout or not but something to try#2021-05-1507:39zackteoOkay it works so it is my app config#2021-05-1507:39zackteocould i ask what is ["react-modal" :as Modal]#2021-05-1512:56pithyless@zackteo if working with any npm code, it is good to be aware of the different ways you can translate JS requires to CLJS. There is a useful Table 1: ES6 Import to CLJS Require in this section: https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages#2021-05-1512:58zackteoOooo! Thank you! So using a string like so is the standard for npm packages?#2021-05-1512:59pithylessAs an aside, @U05224H0W - I've had to reference and point to that table many times; any chance you can add a page id so one can link to the table directly? It's not immediately "obvious" when you link to the section, because it's below the page fold.#2021-05-1513:03pithyless@zackteo yes; the strings are used only for external JS imports#2021-05-1507:50zackteoyeah evaluation works with your project too#2021-05-1507:51thhellerthat is a require for the react-modal npm package, what exactly that does I don't know 😉#2021-05-1508:05zackteothe hot reload seems to work already. But evaluation still does not work for my project ... hjmmm#2021-05-1508:25zackteoOkay cool it works now#2021-05-1819:48agWhat's the best way of "normalizing" ns declarations?
i.e., I have something like this:
(:require [foo
[core]
[utils]])
;;; I want to convert that into:
(:require [foo.core]
[foo.utils])#2021-05-2014:36Sam RitchieEmacs keyboard macro!#2021-05-2014:41dpsuttonclojure-lsp can do this as well as clj-refactor. My coworker wrote a lein plugin that will check and print a correct one in #2021-05-2020:00ghadiI'm having a weird issue where I type in a simple expression like :foo and the spinner at the bottom of the screen takes forever#2021-05-2020:01ghadiI am using latest CIDER 1.1.0.1, on homebrew installed emacs-plus@27#2021-05-2020:02ghadiDoes anyone know how to troubleshoot that?#2021-05-2020:08dpsuttonm-x nrepl-toggle-message-logging and watch the nrepl traffic. In theory that just spins while waiting on the done handler for the id of the form you evaluated. So watching the traffic could help shed some light#2021-05-2020:09dpsuttonthe code to stop spinning is simply
(defun cider-eval-spinner-handler (eval-buffer original-callback)
"Return a response handler to stop the spinner and call ORIGINAL-CALLBACK.
EVAL-BUFFER is the buffer where the spinner was started."
(lambda (response)
;; buffer still exists and
;; we've got status "done" from nrepl
;; stop the spinner
(when (and (buffer-live-p eval-buffer)
(let ((status (nrepl-dict-get response "status")))
(or (member "done" status)
(member "eval-error" status)
(member "error" status))))
(with-current-buffer eval-buffer
(when spinner-current (spinner-stop))))
(funcall original-callback response)))#2021-05-2020:16ghadithanks. I will try that @dpsutton.#2021-05-2020:16ghadiIt happen most often when I am screensharing with someone 🙂#2021-05-2020:17ghadi(but not exclusively)#2021-05-2020:20dpsutton(i'm surprised to see you using nrepl)#2021-05-2020:34ghadiold habits die hard#2021-05-2112:48bozhidarAnd Emacs never dies! 😉#2021-05-2112:48bozhidar(just like Cobra Kai)#2021-05-2112:50bozhidarAt any rate - I can't think of any recent changes that might have affected this. I'd be curious to learn what your investigation of the problem will unveal.#2021-05-2520:55quollRecently, I’ve been using Emacs and Cider a bit more, so I’ve been wondering about clearing a warning that I get when I try cider-jack-in for a leiningen project, and allow cider to start leiningen:
> WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (https://docs.cider.mx/cider/1.1/troubleshooting.html#cider-complains-of-the-cider-nrepl-version)
Note, I don’t know much about either emacs, or Cider.
Emacs has Cider 1.1.1 installed.
The “More information” link is for the troubleshooting subsection: CIDER complains of the `cider-nrepl` version. This is a similar, though different, warning. But assuming that it’s about right, then I’m thinking that the subsection I’m interested in is:
> https://docs.cider.mx/cider/1.1/troubleshooting.html#you-see-not-installed-or-nil-and-youre-starting-the-repl-with-cider-jack-in You see `not installed` or `nil`, and you’re starting the REPL with `cider-jack-in`
• cider-inject-dependencies-at-jack-in is set to t
• My project uses Clojure 1.10.3
• Leiningen is 2.9.6
There is also the suggestion of configuring cider-nrepl myself (my understanding was that this should be brought in automatically though, is that right?). Anyway, I added into my :plugins section:
:plugins [[cider/cider-nrepl "0.26.0"]]
However, I continue to get the warning. Does anyone have a suggestion of where I can learn enough to address this please?#2021-05-2521:05dpsutton@quoll at the start of the repl should be a startup form. can you paste that here (love your work by the way)#2021-05-2521:05quoll;; Startup: /usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.26.0\"\] -- repl :headless :host localhost
… and thank you 🙂#2021-05-2521:07dpsuttoncan you see what (apropos "cider") returns?#2021-05-2521:07dpsuttonidentifying the source of the error: either it's correctly not seeing cider-nrepl or it's incorrectly saying cider-nrepl is not available when it is available#2021-05-2521:08dpsutton(any chance you have a locally installed version of cider-nrepl? ie, lein install from a local copy of it?)#2021-05-2521:09quollI doubt it, but if I did it would have been from years ago#2021-05-2521:09quollwhat would I be looking for?#2021-05-2521:10quollBTW, the result of the apropos was: ()#2021-05-2521:11dpsuttonok so it seems like cider-nrepl is not around. if you copy that startup script, run it from a terminal, can you try to cider-connect to it and see if you get the same warning?#2021-05-2521:11quollIt took a while because after updating to Cider 1.1.1 (I was on an older one until 30 minutes ago), my cider repl no longer includes clojure.core nor clojure.repl. Very annoying, but I can work around it#2021-05-2521:13dpsuttonvery weird#2021-05-2521:14dpsuttonhere i used that same startup command (without the headless and host part) and checked if cider was around#2021-05-2521:14dpsuttonwhat do you mean it no longer includes clojure.core nor clojure.repl?#2021-05-2521:15dpsuttonlike evaluating (defn foo []) reports an error that defn is undefined?#2021-05-2521:15quollOK… after connecting I get the same warning#2021-05-2521:15quolland yes#2021-05-2521:15dpsuttonok. that part sounds like you did (in-ns 'some-namespace-not-required-yet) but not positive#2021-05-2521:16quollAfter the cider-connect I have access to clojure.core#2021-05-2521:16dpsuttonany chance you have a profiles.clj file in your lein directory in your home dir?#2021-05-2521:16quollyes, I do#2021-05-2521:16dpsuttondoes it have some old junk laying around, maybe a conflicting version of cider-nrepl?#2021-05-2521:17quollno… but I just realized that I have :implicit-middleware false#2021-05-2521:18dpsuttonthat sounds ... like a likely culprit but i've never heard of it before lol#2021-05-2521:18quollI removed it and it worked! Yay!#2021-05-2521:18dpsuttonif you restore it and add the plugin directly into your project.clj i suspect it will work?#2021-05-2521:18quollI put it in blindly a long time ago when some other package wanted it for some reason#2021-05-2521:18dpsuttonnot sure where you security preferences are now if you want that enabled, but if so, i bet you can get around it#2021-05-2521:19dpsuttonawesome. well sounds like that feature works 🙂#2021-05-2521:19dpsuttoncongrats on your strange loop talk!#2021-05-2521:19quollWhen it was in I was explicitly include cider-nrepl and that wasn’t helping#2021-05-2521:19dpsuttonyeah that's a bit strange to me#2021-05-2521:19quollThank you. I’m only panicking a bit so far#2021-05-2521:20dpsuttoni wonder if there's a bug when you "implicitly" include a plugin if it denies that plugin from being used, even if you directly depend on it as well#2021-05-2521:20dpsuttonyour last talk on graph databases went really well so i'm sure you'll do really well again 🙂#2021-05-2521:20quollI don’t know. I can’t tell you which package suggested that I configure this too#2021-05-2521:20quollOh, the :clojureD talk?#2021-05-2521:21dpsuttonyeah. i built a repl history that would collect all forms and throw them into asami with your help#2021-05-2521:21dpsuttonso you could query for all history that used a particular form, etc#2021-05-2521:21quolloh, cool 🙂#2021-05-2521:21dpsuttonyou did all the heavy lifting 🙂#2021-05-2521:21quollI’m finding Asami is helping me with lots of things now 🙂#2021-05-2521:24quollSomeone wanted to load a pcap file (packet capture) in JSON format, but his edn was failing due to some attributes having spaces in them. I’ve removed data checking now, so you can just load raw JSON if you want. So then I could do queries to find all the attributes, and filter them (in the query) by regex to give me the ones with spaces.#2021-05-2521:24quollMaybe it’s because I’m used to graph thinking now, but I found it much easier to query the data than to process seq of maps that were embedded to arbitrary depth!#2021-05-2521:25quollIt feels icky to have string attributes, but… hey, it works! 🙂#2021-05-2521:26dpsuttonyeah. at some point you need a proper query. sounds really cool#2021-05-2521:34quoll(require '[asami.core :as d])
(require '[cheshire.core :as json])
(def conn (d/connect "asami:"))
(def tx @(s/transact conn {:tx-data (json/parse-string (slurp "/path/to/file.json"))}))
(d/q '[:find (count ?a) . :where [?e ?a ?v]] conn)
(d/q '[:find [?a ...] :where [?e ?a ?v] [(re-find #" " ?a)]] conn)#2021-05-2521:35quollThose last 2 queries told me how many attributes were in his json, and which ones had strings with spaces in them#2021-05-2521:35dpsuttonlovely#2021-05-2521:36dpsuttoni had need of a triple store in cljs recently. a really simple no-logic-engine, just assert triples and missed having something like this around#2021-05-2521:36quollmy colleagues were constantly creating convenience functions that accepted connections and called d/db on it before sending it to the query. So now queries accept connections and do that step implicitly#2021-05-2521:36quollWell, it’s free. 🙂#2021-05-2521:36quollAnd if anything goes wrong, I know a woman who can help#2021-05-2521:40quollI think I discovered why I couldn’t access clojure.core a few minutes ago#2021-05-2521:41quollI think I used C-c M-n M-n to set the namespace in my repl, but I had not used C-c C-k to load it#2021-05-2521:42dpsuttonyup#2021-05-2521:43dpsuttonwhich does an in-ns before require#2021-05-2521:43dpsuttonmy muscle memory got used that one quit#2021-05-2521:43dpsuttonquick#2021-05-2521:43quollThank you for all the help. I’d just have been as stuck as ever#2021-05-2521:44dpsuttonabsolutely my pleasure#2021-05-2521:25quollThank you so much for the help!#2021-05-2606:25bozhidarBtw, I forgot to mention this - but a couple of days ago I released CIDER 1.1.1. It features only a few small bug-fixes, but it's a version number that's truly special. 😄#2021-05-2615:22quollI upgraded to this while trying to sort my problems yesterday. I had no idea that I had serendipitously picked up a brand new release, and an auspicious one at that!#2021-05-2619:15jcdIs there a command to remove all breakpoints in a buffer?#2021-05-2619:16dpsuttonjust reevaluate the buffer#2021-05-2619:16dpsuttoninstrumenting just reevaluates the code with extra code around each form to step through. if you just evaluate the form these are gone#2021-05-2706:36bozhidarYeah, that's the way to do it.#2021-05-2708:14LukasHey, I've got a shadow cljs project running to which I connected via cider-jack-in-cljs this works fine so far (e.g. typing in the repl buffer (js/alert "hello") works). But sending a Form to the repl with C-c C-e does not work :thinking_face:. Do I need any special middleware for that? Or did I miss something else? Any pointers are greatly appreciated#2021-05-2708:16Lukasmy shadow-cljs.edn
;; shadow-cljs configuration
{:deps {:aliases [:dev :app]}
:nrepl {:port 9000}
:dev-http {8083 "public"}
:builds
{:app {:compiler-options {:output-feature-set :es8}
:target :browser
:modules {:main {:init-fn }}
:output-dir "public/js"
:asset-path "js"}}}#2021-05-2713:40Elsoif you're using sesman you can have a look at the sesman-browser -> maybe your repl is not properly linked#2021-05-2713:40Elsothat sometimes happened to me when running both cljs and clj repls#2021-05-2722:18blak3mill3ryeah, try sesman-link-with-buffer (I think)#2021-05-2808:57LukasTy for your answers 🙏#2021-05-2711:39Elsofor some reason cider-pprint-eval-last-sexp is no longer opening up a pop-up buffer with the results - is there a config var for this?#2021-05-2711:43Elsoweirdly, directly calling (cider-popup-buffer "test") pops up and to me it seems that then pprint should too#2021-05-2715:51bozhidarNothing related to this command has been changed recently.#2021-05-2717:08jmvhey all, does the :style/indent specification work with protocols?#2021-05-2816:16jumar[might be spacemacs specific]
I'm puzzled by the behavior of cider-format-* functions.
Here using try+ example - when I define-clojure-indent with (try+ 1) then formatting functions, as expected will use 2-space indentation:
(try+
(let [a ...
But when I'm typing and enter a new line it gets 4 spaces:
(try+
(let [a
What could be reason for that? Is somebody else having the same problem?#2021-05-2816:35futuroWhat function does enter run?#2021-05-2816:35futuroC-h k ENTER#2021-05-2818:54bozhidarcider-repl-return 🙂#2021-05-2818:59futuroThanks bozhidar! And thank you for cider!#2021-05-2818:48bozhidar@jumar The format functions run cljfmt, they have nothing to do with Emacs's own indentation engine.#2021-05-2818:49jumarWhat does that mean? That the indent style I specify is not expected to have an effect on that?#2021-05-2818:52bozhidarYes.#2021-05-2818:52bozhidarSee https://docs.cider.mx/cider/1.1/usage/misc_features.html#formatting-code-with-cljfmt#2021-05-2916:027e27I’m trying to connect to a shadow-cljs nrepl server, by calling
(cider-connect-cljs
'(:host "localhost"
:port "1111"
:cljs-repl-type shadow))
is there a way to pass in the shadow-cljs build ID?#2021-05-2916:09dpsuttonI think if you just bind the correct variable it will work. It is not passed in#2021-05-2916:09dpsuttonApropos for cider shadow build or something along those lines#2021-05-2916:147e27My documentation must be outdated, when I apropos for either shadow or build, I come up empty (i.e. nothing shadow-cljs related at all). The online cider doc only seems to mention setting a build ID via .dir-locals.el .#2021-05-2916:207e27Ahh found it, you are right the variable is cider-shadow-default-options . Thanks:)#2021-05-2916:23dpsuttonyeah that's a terrible name. i was expecting it to be cider-shadow-build-id or something#2021-05-3007:00bozhidarKeep in mind that we have to be careful not to go overboard with the granularity of the config options (we can end up with many of them, individual options are more likely to change, etc). That's why from time to time I favor such "bulk" arrangements, even if I acknowledge they are not ideal.#2021-05-3007:21dpsuttonfair point. sorry about that 🙂#2021-05-3106:32agwhat's the best way of clearing nrepl buffer without having to re-connect/re-start the REPL?#2021-05-3106:36dpsuttonthe repl buffer or the server buffer?#2021-05-3106:36dpsuttonif the nrepl server buffer i think comint-clear-buffer. if the repl buffer cider-repl-clear-buffer#2021-05-3106:51agperfect. comint-clear-buffer is the one I was looking for#2021-05-3110:15Nom Nom MousseI'm trying to learn repl-driven programming. I've done cider-jack-in and successfully connected to my running luminus-app (I think). However, when I try to change my running program by overwriting the function in the repl, it does not seem to register the change. Am I doing something wrong?#2021-05-3110:17Nom Nom Mousse(I am learning REPL-driven programming because I want to avoid having to reload my webserver for every time I make a change to the app, but instead send the changes to the running program)#2021-06-0109:13magraJust a guess: When you call a ring-server with a stack of handlers this gets built when you first call it. Changing the handlers afterwards will not change the ring-stack which has already been built. One way to resolve this at dev-time is to use start the ring-server with #'handlers instead of handlers so repl changes take effect.#2021-06-0109:15Nom Nom MousseI did not try to change the handlers, but rather some backend code for data processing.#2021-05-3110:59bozhidarPerhaps your REPL is not in the same ns as the original definition that you're trying to change?#2021-05-3111:31Nom Nom MousseI've tried (require my-ns) and then (in-ns my-ns). I might have gotten some errors in the REPL. Will check.#2021-05-3111:34Nom Nom MousseIt seems like cider-jack-in starts a new nrepl-server at . I expected it to connect to localhost:7000 where my process is running.#2021-05-3111:39bozhidarYou need cider-connect to connect to a running nREPL server.#2021-05-3111:39bozhidarhttps://docs.cider.mx/cider/1.1/basics/up_and_running.html#connect-to-a-running-nrepl-server#2021-05-3111:39Nom Nom MousseI've also tried cider-connect, but then I get these error messages:
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.0 and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
Despite me having added [refactor-nrepl "2.5.0"] to my ~/lein/profiles.clj.
Thanks for the help btw 🙂#2021-05-3112:03bozhidarProbably you didn't put it in the right sector there, as it seems it's not detected at all.#2021-05-3112:04bozhidarSee https://docs.cider.mx/cider/1.1/basics/middleware_setup.html#using-leiningen#2021-05-3112:05bozhidarIf you just add it as a regular dep that won't be enough, as the middleware won't be activated.#2021-05-3112:12Nom Nom MousseThis is my entire ~/.lein/profiles.clj:
{:user
{:plugins [[luminus/lein-template "4.06"]
[lein-midje "3.2.1"]]
:repl {:plugins [[nrepl/lein-nrepl "0.3.2"]
[cider/cider-nrepl "0.25.5"]
[refactor-nrepl "2.5.0"]]}
:dependencies [[com.bhauman/rebel-readline "0.1.4"]
[hashp "0.2.1"]]
:injections [(:require 'hashp.core)]
:aliases {"rebl" ["trampoline" "run" "-m" "rebel-readline.main"]}}}#2021-05-3112:20bozhidarI think you need to put :repl is a top-level profile (like :user). Maybe :dev will work as well, I don't remember.#2021-05-3112:21bozhidarI'm surprised you're not getting some warning about cider-nrepl missing as well.#2021-05-3112:21bozhidarMost likely you don't need lein-nrepl - it was a transitional plugin for users of old Lein releases.#2021-05-3112:37Nom Nom MousseI tried moving it to the top-level, like :user, but I get the same error. Might be something with my Doom Emacs Clojure setup. Will investigate.#2021-06-0109:17Nom Nom MousseAre we supposed to add cider-nrepl to the project.clj of the project we want to use CIDER for?#2021-06-0109:18Nom Nom MousseIs there a way to use jack-in to start my luminus webapp? I get jack-in to work, but it does not connect to my running program.#2021-06-0109:40bozhidar> Are we supposed to add cider-nrepl to the project.clj of the project we want to use CIDER for?
Only if you're not going to use cider-jack-in.#2021-06-0109:40bozhidar> Is there a way to use jack-in to start my luminus webapp? I get jack-in to work, but it does not connect to my running program. (edited)
I guess you should start your Luminus app from CIDER's REPL after cider-jack-in.#2021-06-0109:44Nom Nom MousseClever. Would not have thought of this 🙂#2021-06-0110:38bozhidarThat's how I develop nREPL from nREPL. 😄#2021-06-0109:40bozhidarI haven't used Luminus in ages, but this worked fine in the past.#2021-06-0109:57Nom Nom MousseIt is working! What an incredible feeling it is to change your running program lambdalove#2021-06-0110:07Nom Nom MousseI've set (setq cider-repl-display-in-current-window t) in my .doom/config.el. Still, the Cider REPL opens in a horizontal window on the bottom. Any hints on how to debug?#2021-06-0110:39bozhidarDid you evaluate this or restart Emacs after adding it to your config?#2021-06-0110:40Nom Nom MousseI think I tried restarting too. But it might be that doom interferes with something.#2021-06-0110:59Nom Nom MousseUpdated my old doom emacs and it is still not working. Not that important though, but would be nice to have a vertical window as messages are sent to the REPL.#2021-06-0111:42Nom Nom MousseWould be cool with an ns-prev and ns-next like (`buffer-prev` and buffer-next) to quickly switch between namespaces.#2021-06-0120:49Drew VerleeI run cider-jack-in-clj&cljs and it prompts me for my clojurescript repl. I pick figwheel-main and the environment dev, this correctly starts a figwheel repl server. i go to eval an expression in my .cljs file and it says i'm not connected to a repl. i try connect-sibeling and it saysn "dev" is already running. which is true. So, how do i connect? why isn't it connected?#2021-06-0120:55dpsuttoncan you post the exact message it displays?#2021-06-0121:09Drew VerleeI will when I get back, but it's the message you get when you eval something and you have no connected repl.#2021-06-0121:10Drew VerleeAs in, there is no error. It's the lack of a connection that I'm confused about.#2021-06-0123:32Drew VerleeSo my goal is to two be able to eval clj and cljs. I think this project presents something of a learning opportunity here for me. (which is how i have to phrase it to stay sane).
What i'm seeing is that it starts figwheel in the repl: https://github.com/oakes/odoyle-rum-todo/blob/master/dev.clj
(figwheel/-main "--build" "dev")
So my first thought is that ill at least need to start that in the background. So i wrap it in a future, comment out the deps file where it calls main-opts to call that ns, and add piggieback (so i can connect a sibling cljs connection). The nprel server start, then i call the main fn, which firs up a figwheen server, so everything is fine. But I can't join a cljs repl.
Cider-connect prompts me for the repl type and build then tells me that build is already running (bc it is).
cider connect sibling seems to start a clj nprepl then errors out because "dev" is already running.
I feel like i'm off the happy path but i'm not sure how to get back on. I would love to have a structured tour of repl land around this problem but i'm guesing no one is up for that...#2021-06-0123:46Drew Verleeerr ok. so if i cider-jack-in-clj&cljs. Then run the main funciton to run the server. it complains the address is already in use (which i'm sure will make sense to me in a moment) and then if i refresh the browser the assets (html and css) are properly fetched.#2021-06-0123:55Drew VerleeWell cider-jack-in-clj&clj starts two repls and their both marked as clj. when i run start the ring server the command seems to get sent to both which is why one is complaining the address is already in use.#2021-06-0123:55Drew Verleemaybe i should just run that command directly in one of the repls to avoid that.#2021-06-0123:56Drew Verleedireclty rather then evaling from the file.#2021-06-0203:10jumarI switched to JDK16 I see these errors every now and then.
I'm not sure what exactly it means - I haven't noticed anything really broken (running my apps in the REPL works fine)
Is that a known issue? What cider features it can affect?#2021-06-0203:43dpsuttoni believe that's related to javadocs and you probably won't notice it#2021-06-0203:44dpsuttonthere's a ticket with some discussion on it#2021-06-0410:45andrea.crottirecently every time I open a clojure buffer I have now the progress bar going back and forth continuosly#2021-06-0410:45andrea.crottianyone else having this isssue?#2021-06-0413:48Elsocljr-find-usages is failing in a project because
java.util.concurrent.ExecutionException: clojure.lang.ExceptionInfo: Record construction syntax can only be used when *read-eval* == true
{:type :reader-exception, :ex-kind :reader-error, :file ..., :line 97, :col 85}
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$future_call$reify__8454.deref(core.clj:6974)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at refactor_nrepl.find.find_symbol$find_symbol.invokeStatic(find_symbol.clj:239)
at refactor_nrepl.find.find_symbol$find_symbol.invoke(find_symbol.clj:230)
at clojure.lang.Var.invoke(Var.java:384)
at refactor_nrepl.middleware$find_symbol_reply.invokeStatic(middleware.clj:86)
at refactor_nrepl.middleware$find_symbol_reply.invoke(middleware.clj:85)
at refactor_nrepl.middleware$wrap_refactor$fn__53536.invoke(middleware.clj:196)
at nrepl.middleware$wrap_conj_descriptor$fn__49828.invoke(middleware.clj:16)
at cider.nrepl$wrap_info$fn__52439.invoke(nrepl.clj:204)
at nrepl.middleware$wrap_conj_descriptor$fn__49828.invoke(middleware.clj:16)
at cider.nrepl$wrap_apropos$fn__52389.invoke(nrepl.clj:125)
at nrepl.middleware$wrap_conj_descriptor$fn__49828.invoke(middleware.clj:16)
at cider.nrepl$wrap_test$fn__52521.invoke(nrepl.clj:438)
...
It points to a record which is created via a reader tag syntax #http://some.org.Record{:a :b}
Not quite sure what to make of it.
Weirdly,
user> *read-eval*
true
I guess the stack trace suggests there is a lot going on in different threads, is there a way to bind read-eval for those?#2021-06-0505:36bbssI needed to use different versions of Java on macOS so I used jenv and brew to install and switch between them, however I now noticed cider keeps trying to use jvm 11. I tried changing the $JAVA_HOME env variable but it doesn't seem to effect it. If I start a terminal in emacs and run the clojure command that I execute with C-u C-c C-x j j - jack-in command then it does run the right jvm.#2021-06-0505:37bbssWhat is causing cider to start with the wrong jvm?#2021-06-0506:06bbssI fixed it by uninstalling jenv, still strange that jack-in has the issue, but shell usage from emacs did not.#2021-06-0506:25dpsuttonI believe that it will use emacs environment when jacking in since it’s a sub process. Probably best to cider connect to ensure everything is working correctly#2021-06-0516:15bbssyes, so even if I started clojure from the same terminal window I start emacs from it would use the right jdk. Oh well, everything working as usual now without jenv 🙂#2021-06-0800:29blak3mill3rFWIW, a tool like jenv, whose intended use-case is to switch which JVM you're using from the command-line, not only sets $JAVA_HOME but also modifies $PATH to put the correct java binary first. It sounds like you were already using exec-path-from-shell to make emacs inherit the environment you configure for the shell. I wonder if whatever jenv was doing to modify $PATH was incompatible with something in cider (like, maybe there's a jenv directory on the $PATH with symlinks to actual java binaries on it?)#2021-06-0800:31blak3mill3rI've experimented with this myself on Debian because I didn't want to "switch" the global default JVM statefully using e.g. sudo update-java-alternatives -s adoptopenjdk-8-hotspot-amd64#2021-06-0800:32blak3mill3rand I discovered that I can launch a Clojure subprocess with any of the installed JVM versions, giving the same effect as update-java-alternatives but isolated to one process AOT a global stateful "default"#2021-06-0800:32blak3mill3r@bbss#2021-06-0800:32blak3mill3rall I had to do to execute that Clojure subprocess with a particular JVM version was setting $PATH and $JAVA_HOME#2021-06-1004:13bbssthanks for the jenv info, yeah I am macOS but not quite a master of emacs, so when the shell in emacs and cider seem to do something differently I don't really know where to go, also tried digging through the cider source a bit but couldn't get any wiser. Oh well, it works without jenv anyway.#2021-06-0914:04Daniel SlutskyHi.
Assume that I want to send some information to the CIDER REPL before every evaluation.
More concretely, I want to extend CIDER so that it will send to the REPL process the whole contents of the currently edited buffer (as a String), just before any piece of code is evaluated.
• Is it a bad idea for some reason?
• Is there a hook for doing something before every evaluation? (couldn't find one)#2021-06-0918:35jumarThat sounds like you’re typing into the repl buffer instead of typing into the file buffer which is usually recommended #2021-06-0921:56Daniel SlutskyThanks @U06BE1L6T! I'm typing into the file, but want the REPL to know about the exact file contents.#2021-06-1003:09jumarWhy not just evaluate the whole buffer?#2021-06-1007:28Daniel SlutskyOh, I need to create an up-to-date html page that shows the code of the whole namespace, every time we the user evaluates anything (working on the next version of the Notespace tool).#2021-06-0918:25bozhidarI don't think there's a hook for this, but there's some functionality that auto-evals the ns form before eval, that you can potentially copy/extend for your purposes.#2021-06-0918:26bozhidarSee https://docs.cider.mx/cider/1.1/usage/code_evaluation.html#basic-evaluation#2021-06-0921:57Daniel SlutskyThanks @bozhidar! I'll look.#2021-06-1002:56Chris KHello I'm using doom emacs and cider for clojure
and for some reason, if I run cider on certain directories, emacs will go crazy and use 100% of my cpu, the cider repl will also not open#2021-06-1005:33bozhidar@sunchaesk It's best to start here https://docs.cider.mx/cider/troubleshooting.html and try to get more information about the nature of the problem.#2021-06-1005:34bozhidarLikely you've encountered some bug in the jack-in logic, but we need more info to identify it.#2021-06-1012:31daemianmacki make heavy use of cider-switch-to-repl-buffer with the universal argument to change the CIDER REPL namespace to the namespace of my current CLJ buffer, then move cursor to the REPL.
the other day i did something in emacs without meaning to that did the inverse -- my REPL namespace was foo and i was displaying CLJ buffer bar but i hit some mystery keystroke by accident that moved the cursor to the CLJ buffer representing the bar namespace.
i can't find any CIDER fn that purports to do this. did i just imagine it? is there such a facility built-in?#2021-06-1020:01jcsimsmaybe cider-switch-to-last-clojure-buffer? In the repl, that's bound to the same C-c C-z keybinding that cider-switch-to-repl-buffer is bound to in a clojure buffer#2021-06-1100:23daemianmackbut in this scenario, buffer A (the last clojure buffer) is displaying a different namespace. cider-switch-to-last-buffer jumps to that buffer, not the buffer displaying the namespace the REPL is in.#2021-06-1307:15robert-stuttafordwhat could cause the *cider-error* (https://docs.cider.mx/cider/1.1/usage/dealing_with_errors.html) to take a long time to display? the issue is printed to the repl / log immediately, but the error buffer takes 5-10 seconds to show.
i'm on the latest emacs package and 0.26.0 middleware#2021-06-1316:39jumarMaybe a large error structure?
I had been dissatisfied with cider error popup latency so I turned it off a long time ago. I now only bring it up if I need to see more details #2021-06-1318:26robert-stuttafordit's pretty slow no matter what#2021-06-1318:26robert-stuttafordyou're right though, not often that i actually read its contents. will disable#2021-06-1321:45blak3mill3rI've been seeing the same issue. Unfortunately I am not sure when it started. Using a very recent build from master and 0.26.0 middleware also#2021-06-1406:28bozhidarIf someone manages to get some profiling data about the issue that’d be great. Usually such delays are caused by errors/timeouts.#2021-06-1406:28bozhidarI can’t think of any recent changes that would cause some regressions there, though.#2021-06-1406:29bozhidarSee https://docs.cider.mx/cider/1.1/troubleshooting.html#profiling-cider-commands#2021-06-1517:57bartukado we have support for goto-definition of java libraries?#2021-06-1803:30vemvyes the work is there and correctly implemented AFAICT.
It's only a matter if adding the JDK sources (if missing) and the dep tree's "sources" artifacts.
I have work in this area that we hope will make it to CIDER soon enough :)#2021-06-1819:56bartuka@U45T93RA6 the JDK sources are added through the variable cider-jdk-src-paths , correct? But how about java libraries used as dependencies?#2021-06-1915:42vemv1) I guess so! https://github.com/clojure-emacs/cider/blob/8f51546c0efb36226c4bae7d65465b0e0aa8c06f/cider-util.el#L808
2) via https://github.com/threatgrid/clj-experiments/tree/master/resolve-java-sources-and-javadocs . It works just fine today, have used it the whole year. But before advertising it I'll want to move it to clojure-emacs and maybe tweak this and that. Will be done in 2 weeks#2021-06-1921:59bartuka😮 this is amazing. Thanks for this work @U45T93RA6#2021-06-1603:20blak3mill3rI saw that work once ages ago, I don't have it now#2021-06-1616:37ribelois there any way to limit the amount of information spit out to the repl, or to the code buffer after eval?#2021-06-1619:21iarenazaI think this is what you are looking for: https://docs.cider.mx/cider/1.1/usage/pretty_printing.html#limiting-printed-output#2021-06-1619:46ribelothx!#2021-06-1616:38ribelosometimes I unintentionally eval a function or object that is mega long and big and I hang emacs#2021-06-1619:21iarenazaI think this is what you are looking for: https://docs.cider.mx/cider/1.1/usage/pretty_printing.html#limiting-printed-output#2021-06-2111:30zackteoHello, is there a way to require dependencies on the fly instead having to restart the repl (that is already built into cider)? Like in the case of using cider-scratch I would have to add to my global project.clj to be able to test something out. (p.s. I know there a library for this but i also forgot what it is called/how it works)#2021-06-2111:40hkjelshttps://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L202#2021-06-2111:41zackteoHow does this work with cider? :o After adding it to my deps.edn. I know cider injects it in but what do I call to require the new libraries#2021-06-2111:44zackteoAlso I might already be using cljr-refactor and seems like that might work#2021-06-2113:10hkjels(comment
(do
(require '[clojure.tools.deps.alpha.repl :refer [add-libs]])
(add-libs '{some/library {:mvn/version "RELEASE"}})))
#2021-06-2113:12hkjelsI guess you could also do it from deps.edn file to not loose track#2021-06-2111:36zackteoRight pomegranate#2021-06-2210:41lepistanehello
i can't seem to find the command that i found very interesting in calva.
Since calva is built on top of cider i assumed it would be there.
Calva has ctrl +alt + enter which in threaded expression does this (look at the image).
i haven't been able to find this for cider. Is there a command for this?
edit
is it C-c C-v z?#2021-06-2210:48tvirolaiDo you mean cider-eval-sexp-up-to-point (C-c C-v C-o)?#2021-06-2210:50lepistaneyes it seems to be that!
let me ask u this. Why do i get same behavior with C-c C-v z cider-eval-defun-up-to-point and command u suggested ?#2021-06-2210:56tvirolaiIf I'm not mistaken, the latter is more specific, operating only for functions, while the former is more generic and it should evaluate any form up to the point.#2021-06-2210:56lepistanemakes sense.
thank you!#2021-06-2212:12bozhidardefun in CIDER simply means a top-level form.#2021-06-2212:12bozhidarIt doesn’t necessarily have to be a definition of any kind.#2021-06-2212:13bozhidarSee also https://docs.cider.mx/cider/1.1/usage/code_evaluation.html#2021-06-2214:37pezThe defun up to point is interesting. I assume you’ll have to close all open brackets in order for it to evaluate, @U051BLM8F? (Yes, planning to steal this one too. 😃 )#2021-06-2214:42bozhidarYep, the command appends the missing parens prior to sending this out to be evaluated.#2021-06-2214:42bozhidarI finally needed to implement the classic stack exercise of balancing parentheses for a practical purpose. 😄#2021-06-2214:42pezFor clarity about built from CIDER. That has two aspects to it. One is quite literally built on CIDER/Orchard infrastructure as I explain a bit in this presentation: https://www.youtube.com/watch?v=NIk5hVzA_fY The other is “heavily inspired from” which goes for a lot of the static services, to which the feature in OP, perhaps surprisingly, belongs. (Even if cider-nrepl is used for carrying out the evaluation, grabbing the right things to evaluate is a static thing, for which Calva has its own infrastructure.#2021-06-2214:44pez> I finally needed to implement the classic stack exercise of balancing parentheses for a practical purpose.
Thanks. I was just about to ask. 😃 I might go that route too.#2021-06-2214:46pezI have that functionality, as it happens. For the rainbow parens. But I think I might find it hard to tease it out of there. But, then again, maybe not. We’ll see.#2021-06-2416:32waffletowerI am getting the following error via list-packages for cider on melpa-stable:
Install package 'cider-1.1.0.1'? y
Contacting host:
package--with-response-buffer-1: : Not found
The melpa-stable version number mentioned on github is 1.1.1. Not sure if this is related to the issue#2021-06-2416:36waffletowerwget
does succeed so I imagine the issue is the version number given by list-packages#2021-06-2419:06bozhidarYour local package database is outdated - a M-x package-refresh-list should fix this.#2021-06-2816:32waffletowerThanks package-refresh-contents fixed it for me#2021-06-2419:52Joshua SuskaloIs there an issue filed or has there been work to fix the bug with the debugger where shadowed vars used in function position call the var and not the shadowing binding?#2021-06-2420:31bozhidarI don't remember.#2021-06-2421:22Joshua SuskaloI'll take a peek in the issue tracker and submit one if I can reproduce this on the latest cider and there isn't a tracking issue already.#2021-06-2515:12Endre Bakken StovnerAre there any linters that can help me catch stupid errors like these:
(swap! my-map key val) ;; missing assoc in pos 2!
#2021-06-2616:54timvisherI think that https://github.com/clj-kondo/clj-kondo is the current gold standard but I may be wrong. :)#2021-06-2812:54tvaughanhttps://github.com/jonase/eastwood#2021-06-2812:55tvaughanhttps://github.com/jonase/kibit (sort of)#2021-06-2812:56tvaughanThe current momentum definitely favors clj-kondo#2021-06-2616:54timvisherI think that https://github.com/clj-kondo/clj-kondo is the current gold standard but I may be wrong. :)#2021-06-2616:59timvisher👋 I'm seeing an issue when passing nil to < where the printer seems to get caught throwing an NPE and losing any useful stack trace (see the brief discussion starting https://clojurians.slack.com/archives/C03S1KBA2/p1624725785482400).
In summary:
Evaling
(doall (map (partial < 1000) (conj (into [] (range 1000 1002)) nil)))
at a plain REPL gets me
user=>
(doall (map (partial < 1) [1 2 nil]))
Execution error (NullPointerException) at user/eval158 (REPL:1).
null
(note the user/eval158 bit which I think indicates the actual source of the error information)
whereas in CIDER (`CIDER 1.1.1 (Plovdiv)`) whacking M-x cider-eval-last-sexp RET yields
1. Unhandled java.lang.NullPointerException
(No message)
with the following messages in *Messages*
error in process filter: cider-stacktrace-render-frame: Format specifier doesn’t match argument type
error in process filter: Format specifier doesn’t match argument type
Does this sound like a bug to anyone else? I'm happy to open an Issue if it does.#2021-06-2617:01timvisherActually a much shorter reproduction case is just
(< 1 nil)
#2021-06-2617:03dpsuttonThat’s a bug in elisp I think. It’s in the buffer trying to render the frame#2021-06-2617:05timvisherI'd buy that. :)#2021-06-2617:05dpsuttonThe error message you are posting there is an emacs logged message, not from clojure#2021-06-2617:06timvisherYou mean from *Messages*?#2021-06-2617:06dpsuttonThere’s a jvm argument to not omit stacktraces on npe. Wondering if you could add that and see#2021-06-2617:06timvisherI'm more than happy to add JVM arguments. :)#2021-06-2617:07timvisherNeed to look up how to do that in deps.edn. I'm just in a simple one file project with a deps.edn file and cider jack in.#2021-06-2617:07timvisherLooks like :jvm-opts in the map.#2021-06-2617:08timvisher@dpsutton Do you happen to know the option off the top of your head?#2021-06-2617:08timvisherLooks like maybe -XX:-OmitStackTraceInFastThrow#2021-06-2617:09dpsuttonYeah I think so#2021-06-2617:10timvisher💥#2021-06-2617:10timvisherThat did it.#2021-06-2617:11timvisherWell actually this is interesting. I guess the JVM is doing some kind of syslog style exception compression since after a couple of evals I get back to getting No message. There's gotta be an option that disables that feature altogether.#2021-06-2617:13timvisherActually it sounds like maybe I'm just straight up not passing the option down to the JVM.#2021-06-2617:18timvisherI certainly don't see it on the CL as per pgrep -fla java.#2021-06-2617:20timvisherYep. I need to make an aliases map.#2021-06-2617:27timvisherLOL. This feels slightly less than fully documented…#2021-06-2617:40timvisherOOOOK finally got it.
$ cat deps.edn
{:deps
…
:aliases {:dev {:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]}}}
Followed by M-0 M-x cider-jack-in RET and appending :dev to the CL like
jack-in command: /usr/local/bin/clojure … -M:cider/nrepl:dev
`
finally yields the option in pgrep
$ pgrep -fla java
99854 /usr/bin/java -XX:-OmitStackTraceInFastThrow …
and gets me the full stack trace every time I trigger the exception. Whooooo boy that's fun.#2021-06-2617:45dpsuttonOk so that’s an issue to open. Cider barfs on errors where the stack trace is omitted#2021-06-2617:47timvisherOn this board, yes? https://github.com/clojure-emacs/cider/issues#2021-06-2618:09timvisherhttps://github.com/clojure-emacs/cider/issues/3022#2021-06-2802:55zimabluehi, I asked this question in Calva but it's probably better suited here as it's more about the underlying tools => in calva, it is only possible to debug a form which has been explicitly reevaluated with breakpoints in it, but with cider itself is there any way to save the breakpoints into the file, so that just importing the module as normal and then calling a function defined in it would hit the breakpoint?#2021-06-2803:45dpsuttonThere are reader tags for this#2021-06-2804:59solfI don’t think the reader tags help in @U63D7UXJB specific use case, as he wants to debug a function without using cider-eval-* functions. Requiring a file or calling cider-load-buffer won’t trigger the debug tags.#2021-06-2803:46dpsuttonhttps://docs.cider.mx/cider/1.1/debugging/debugger.html#conditional-breakpoints#2021-06-2803:47dpsuttonhttps://docs.cider.mx/cider/1.1/debugging/debugger.html#understanding-breakpoints might be better actually#2021-06-2805:41zimabluethank you, I will read said documents and get back#2021-06-2805:58zimablueI have read those documents before, and am still not sure of the answer. I think @dromar56 understand my question/the problem, for context my question is to do with wanting to develop some custom tooling, not just a stupidly finnicky workflow requirement#2021-06-2806:00zimablueif requiring a namespace containing reader conditionals doesn't cause it to be instrumented, and one wanted to instrument anything with those reader conditionals, then a workaround would be (at outermost-tool-level) to push every namespace through nrepl (???)#2021-06-2806:01zimablueor if it was simpler to do at a lower level, that sort of behaviour (instrument everythig with readers, across "requires") could be enabled/implemented in cider/orchard?#2021-06-2806:01zimablueI'm not confident any of these assertions are right, I'm just trying to communicate my current mental model#2021-06-2902:52theeternalpulseHi, i'm working on a cljs project via shadow, and I am creating a client/server *.cljc file but having trouble evaluating my custom code within it. I can evaluate simple (+ 1 1) etc, but when I try to make a defn within the file and evaluate that, it doesn't seem to work. In the console some time I get a timeout while waiting for a result when evaluating a defn, but calling it I just get that the symbol isn't found.#2021-06-2912:13Gleb PosobinI am getting "Inspector error" when I try to eval any cljs code and inspect its result in cider. E.g. evaluating {:hello :world} gives Inspector error for: {:hello :world}.
What could be the reason for this? No further error is given.#2021-06-3002:08chadharringtonI am working on a project which has both a Clojure client and a Clojure server. I want to run two REPLs, one for the server and one for the client. I can start and connect to the two REPLs just fine. When I evaluate code in the server.clj buffer, I want it to go to the server REPL. When I evaluate code in the client.clj buffer, I want it to go to the client REPL. Unfortunately, this seems to be hit and miss. The "Manging Connections" docs (https://docs.cider.mx/cider/usage/managing_connections.html) talk about sessions and various commands, but don't understand how to associate a specific REPL with a specific code buffer. I have tried to use the "recency" concept discussed in the docs, by switching to the appropriate REPL and evaluating a trivial expression. I assume this means that REPL is now the most recent REPL. Then I switch to the appropriate code buffer and hit C-c M-z. Sometimes, the code is evaluated in the "recent" REPL and sometimes it's evaluated in the other REPL. This is very frustrating to me. It seems like there should be a simple command to define the desired association; I am probably just not understanding how this is supposed to work. Has anyone done this? Any examples?#2021-06-3002:39dpsuttonI'm not familiar with two repls of the same type. The recency thing is usually for when the repls are clj and cljs, and CIDER gets confused. I'm not familiar with what happens when there are two repls of the same type. If you could file an issue ideally with a repro it would be helpful. I think bozhidar has mentioned he's not a fan of the session management code in CIDER at the moment (lovingly called sesman). I suspect that that will be gutted sooner or later#2021-06-3007:09bozhidarWith two REPLs of the same type, the most recently used will be preferred.#2021-06-3007:09bozhidar(or at least it should be)#2021-06-3007:10bozhidarThere's currently no way to map a buffer a REPL like it was possible to do in the past - buffers are mapped to sessions and within the sessions source buffers are mapped to connections (REPLs) using sesman's logic (most relevant type, then most recent).#2021-06-3007:13bozhidarAs for the future of sesman - that mostly depends on whether I'll find the time and the desire to tackle bigger changes. I don't think that the idea of sessions is fundamentally bad (especially if you have both types of connections for some project), I mostly want to remove the complex session mapping that sesman does with something more straightforward (or at the very least restore static session mapping as an option).#2021-06-3016:00chadharringtonThanks for the replies. Unfortunately, as mentioned, the recency concept is unreliable with two clj repls. I am in the middle of a big project w/ a deadline, so I can't spend more time on this right now. I will try to log an issue with a reproduction in the future.#2021-06-3016:00chadharringtonStatic session mapping would be great. Simpler is better, right?#2021-06-3016:02dpsuttoni think so. inf-clojure has this notion and it is quite nice. In some places it might be less convenient but having the ultimate predictability has its benefits#2021-07-0319:00daemianmackFWIW i just found this thread looking for this same functionality -- two sibling CLJ REPLs, each "bound" to a different CLJ buffer, such that cider-switch-to-repl-buffer in CLJ buffer A moved cursor to REPL A, and in in buffer B moved cursor to REPL B.
currently i find myself having to switch namespaces a lot more than i'd like.#2021-07-0606:19zimablueI have this question for two nrepls connected to the same buffer but not in the cider part, don't understand the nrepl part => does nrepl "broadcast" by default if two people connect to the same socket?#2021-06-3007:02vinursi hava a java file HelloJava.java in src/java/main
package com.dieya.testjava;
public class HelloJava {
public static String greetMe() {
return "Hello, this is Java calling!";
}
}
and set :java-source-paths ["src/java"]
then in core.clj
(:import
(com.dieya.testjava HelloJava)
)
but ,when i cider-jack-in-clj, it outputs
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
Exception in thread "main" Syntax error compiling at (app/core.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7652)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6856.invoke(core.clj:6115)
at clojure.core$load.invokeStatic(core.clj:6114)
at clojure.core$load.doInvoke(core.clj:6098)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5897)
at clojure.core$load_one.invoke(core.clj:5892)
at clojure.core$load_lib$fn__6796.invoke(core.clj:5937)
at clojure.core$load_lib.invokeStatic(core.clj:5936)
at clojure.core$load_lib.doInvoke(core.clj:5917)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$load_libs.invokeStatic(core.clj:5974)
at clojure.core$load_libs.doInvoke(core.clj:5958)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$require.invokeStatic(core.clj:5996)
at clojure.core$require.doInvoke(core.clj:5996)
at clojure.lang.RestFn.invoke(RestFn.java:703)
at user$eval140$loading__6737__auto____141.invoke(user.clj:1)
at user$eval140.invokeStatic(user.clj:1)
at user$eval140.invoke(user.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7181)
at clojure.lang.Compiler.eval(Compiler.java:7170)
at clojure.lang.Compiler.load(Compiler.java:7640)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:368)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
at clojure.lang.RT.doInit(RT.java:486)
at clojure.lang.RT.init(RT.java:467)
at clojure.main.main(main.java:38)
Caused by: java.lang.ClassNotFoundException: com.dieya.testjava.HelloJava
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:433)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:586)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:466)
at clojure.lang.RT.classForName(RT.java:2212)
at clojure.lang.RT.classForNameNonLoading(RT.java:2225)
at app.core$eval1595$loading__6737__auto____1596.invoke(core.clj:1)
at app.core$eval1595.invokeStatic(core.clj:1)
at app.core$eval1595.invoke(core.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7181)
at clojure.lang.Compiler.eval(Compiler.java:7170)
at clojure.lang.Compiler.load(Compiler.java:7640)
... 34 more
#2021-06-3010:42jumarDo you have the class in the src/java/com/dieya/testjava directory?#2021-06-3016:31vinursno, in src/java/main, and file HelloJava.java#2021-06-3016:45jumarSo that's perhaps the problem? 😉#2021-06-3017:00vinursso ,the package name should be ?#2021-06-3017:00vinurspackage testjava;?#2021-06-3017:09vinursi put the file in src/java/main/com/dieya/testjava, named HelloJava.java, and in project.clj :java-source-paths ["src/java"]#2021-06-3017:09vinursoh, is that i should remove the main directory?#2021-06-3017:13vinursi put the file in src/java/com/dieya/testjava, and in HelloJava.java
package com.dieya.testjava;
#2021-06-3017:13vinursbut, the same error#2021-06-3017:45jumarThe thing is that the package name should follow the directory structure.
That is if you have java sources in src/java/ your HelloJava class is in the package com.dieya.testjava then
the file should be src/java/com/dieva/testjava/HelloJava.java
There might be some other problem but this is the basic convention that's followed in Java projects.#2021-06-3017:58vinursstrange, if i comment the
(:import (com.dieya.testjava HelloJava))
and cider-jack-in-clj, then uncomment the import code, it works#2021-06-3007:03vinursbut in lein repl, it works ok#2021-06-3017:55timvisherIs Cognitect actually not sponsoring CIDER or do I just not know how to list the sponsors properly?
I'm asking because Calva lists Cognitect's sponsorship quite prominently on https://calva.io/ which makes it feel very official. :)#2021-06-3018:26Alex Miller (Clojure team)Cognitect is sponsoring at least Bozhidar, maybe others doing stuff for CIDER, see https://github.com/orgs/cognitect/sponsoring#2021-06-3018:27Alex Miller (Clojure team)that's not a complete list, there are also a few under nubank org and on Patreon#2021-06-3018:29Alex Miller (Clojure team)I'll feature CIDER in a future sponsorship spotlight on the Deref, feel free to tell me what the best list of people/projects is there#2021-06-3018:32timvisher@alexmiller As always you're the best! :)
I only noticed this because I jokingly posted in my shop whether anyone had considered moving away from Emacs now that Calva's out and VS Code is eating the world and someone immediately pointed out that Calva's sponsored by Cognitect as a serious plus and I went to go prove that CIDER was sponsored as well and came up empty. ¯\(ツ)/¯#2021-06-3018:32Alex Miller (Clojure team)we also buy a lot of IntelliJ Cursive licenses :)#2021-06-3018:33timvisherMakes sense but I wouldn't even jokingly imply that someone would consider moving from Emacs to IntelliJ… xD#2021-06-3018:33Alex Miller (Clojure team)I did :)#2021-06-3018:34dpsuttonThere’s a wealth of open source and proprietary clojure tooling. I am particularly happy when paid products can sustain people. Glad Colin has built such a great product#2021-06-3018:34timvisher(If it's not clear I've got no beef with any set of tooling so long as it supports RDD. I'm being lighthearted here. :) )#2021-06-3018:35Alex Miller (Clojure team)seriously though, I do a lot of Java interop and impl and IntelliJ is so good that it's worth it for that#2021-06-3018:35pezCalva is destilled CIDER. Just sayin' 😎#2021-06-3018:36timvisherThe first Clojure shop I ever worked had some decently serious Java components and we literally kept Eclipse around full time just for the job. I'm lucky (?) enough to write very little Java these days so on the very rare occasion that I jump into that space I still feel mostly happy from Emacs. I think if I did really serious work there I wouldn't have the option to stay away from an IDE. ¯\(ツ)/¯#2021-06-3018:46Alex Miller (Clojure team)many years ago, Cognitect funded Counterclockwise too :)#2021-06-3018:49Alex Miller (Clojure team)personally, I enjoyed Clojure on Netbeans the most, don't even remember what that was called now#2021-06-3018:49timvisherThese are deep cuts, Alex. :)#2021-06-3018:50Alex Miller (Clojure team)Enclojure!#2021-06-3018:58dpsuttonEmacs as a dev environment and a production ready lisp we’re what got me into clojure. Now I’m on the simplest inf-clojure setup. Just a few handy keybindings to call repl-provided tooling like doc and source#2021-06-3019:03timvisher@dpsutton Did you ever give monroe a go?#2021-06-3019:03dpsuttoni have not. i'l look into it#2021-06-3019:03dpsuttonah, it's nrepl. i'm staying away from nrepl this year. maybe i'll be back but digging it so far#2021-06-3019:03timvisherI heard about years ago at this point from someone who said that CIDER had obfuscated one too many issues for them.#2021-06-3019:04timvisherNice.#2021-06-3019:04timvisherWhat repl are you running in the inferior buffer?#2021-06-3019:06dpsuttonsocket repls err day. Absolutely lovely to connect locally to the repo or to a production jar and the tooling is identical#2021-06-3019:07dpsuttondownload a released jar, check out the code from that commit, socket repl java -jar the.jar with a socket repl command line addition#2021-06-3019:08timvisher:grinning_face_with_star_eyes: Dev teaching you skills that directly translate to prod :grinning_face_with_star_eyes:#2021-06-3019:10dpsuttoni think it is more built in tooling from Clojure is everywhere#2021-06-3019:10dpsuttonand using the rich tooling built into the language and not relying on more means a jar and a repo are effectively the same dev environment#2021-06-3019:11dpsuttonhow amazingly awesome that a production jar is queryable#2021-06-3019:12timvisherStunningly amazing. :)#2021-07-0105:22bozhidarI've said before many times, but still - when I was a Java dev I was also using IntelliJ. 😄 It's just so much better than anything else, plus at the time there was some serious stagnation in java-mode and related Emacs tools.#2021-07-0105:23bozhidarI think Java and Scala were the only languages that I didn't use Emacs for.#2021-07-0119:44blak3mill3rI miss having the ability to jump to java sources from clojure sources with cider#2021-07-0119:45blak3mill3rIs there a modern version of that tooling? I remember having it a long time ago with java 8 or maybe even 7#2021-07-0121:51theeternalpulseI have my cider session connected to a clj&cljs shadow project. I wanted to know in a .cljc file, if I want to test out a reader conditional for both clj and cljs how do I switch it so that cider-eval-last-sexp runs in either of those two modes? I thought the cider-connect-sibling-cljs would do it, but it runs this particular code and always hits the clj condition#2021-07-0215:27bmaddyHas anyone seen errors like this when running cider-test-run-ns-tests?
Exception in thread "nREPL-session-3617ec79-0596-4ce9-b55b-c34ff8f26ba5" java.lang.IllegalArgumentException: no conversion to symbol
at clojure.core$symbol.invokeStatic(core.clj:598)
at clojure.core$symbol.invoke(core.clj:591)
at cider.nrepl.middleware.test$report_fixture_error.invokeStatic(test.clj:193)
at cider.nrepl.middleware.test$report_fixture_error.invoke(test.clj:183)
...
ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns user, :sym nrepl.middleware.session$session_exec$main_loop__1062.invoke, :session 3617ec79-0596-4ce9-b55b-c34ff8f26ba5, :id 12}
java.lang.ClassNotFoundException: com.sun.tools.javac.util.List
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2212)
at clojure.lang.RT.classForName(RT.java:2221)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invokeStatic(legacy_parser.clj:88)
at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invoke(legacy_parser.clj:66)
When that happens, my repl freezes until I run sesman-restart.
Here's my setup.
deps.edn:
{:paths ["test"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases {:cider-clj {:extra-deps {nrepl/nrepl {:mvn/version "0.8.3"}
refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
cider/cider-nrepl {:mvn/version "0.25.8"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}}}
test/foo-test.clj:
(ns foo-test
(:require [clojure.test :refer :all]))
(deftest bar
(testing "scope"
(let [a (/ 1 0)]
(is (= a 0)))))
(comment
;; these work as expected and display a Divide by zero exception in a test output format
(bar)
(run-tests)
)#2021-07-0215:49bmaddyAlso, here's my CIDER and java versions:
;; CIDER 1.1.0snapshot (package: 20210127.640), nREPL 0.8.3
;; Clojure 1.10.3, Java 1.8.0_141
#2021-07-0216:01bmaddyI should probably also mention, I'm starting it with clj -M:cider-clj and connecting with cider-connect-clj#2021-07-0508:16blak3mill3rCheck for exceptions in your fixture(s)#2021-07-0508:16blak3mill3rhttps://github.com/clojure-emacs/cider/issues/2783#2021-07-0720:11bmaddyThanks for the response. I did see that one, but I'm not using any fixtures. It does seem very similar. The code I posted is all that's needed to cause it. Perhaps let bindings are treated as fixtures somehow? 🤷#2021-07-0920:07blak3mill3rWhat version of Java are you using?#2021-07-0920:07blak3mill3rcom.sun.tools.javac.util.List
I think changed in some way between 8 and 9#2021-07-0920:08blak3mill3ryour deps.edn does not peg a version of orchard#2021-07-0920:08blak3mill3rI wonder where your orchard dependency is coming from#2021-07-0920:08blak3mill3rare you using the "jack-in" approach (even though you have the cider-nrepl stuff declared explicitly)?#2021-07-0920:09blak3mill3rthe stack trace shows that cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java is trying to use this class that changed between java versions#2021-07-0920:09blak3mill3rso perhaps you are using a new orchard with an old JVM#2021-07-0920:09blak3mill3r@U067Q76EP#2021-07-1203:27bmaddyUpgrading java completely fixed it! I have no idea what version of orchard is being used. I tried looking at the dependency graph with tools.deps.graph, but orchard didn't show up. 🤷 Still, it all works with java 11. Thanks so much for your help @UC681SR17!! 😄#2021-07-0312:17Carlocan I convince somehow cider-format-buffer to break a very long line containing a function?#2021-07-0604:13zimablueHi, I am having a similar issue to earlier - connecting to the same nrepl server twice using socket-level connections (not Emacs-Cider). I'm confused about how message routing works- messages sent back which are seen in the first socket don't seem to be seen in the second, and ls-sessions returns an empty list (!?) even though the first session has successfully called clone#2021-07-0614:43zimabluereading further (I posted this on nrepl too), I think this is just how nrepl works, I didn't realize, and you'd need to use something like "concerto" to create what I thought would be the default behaviour#2021-07-0614:50dpsuttonyou had an expectation that if two sessions were connected, if you evaluated something in one session it would send the result messages to both sessions?#2021-07-0701:35zimablueyeah, I'm not saying the expectation made sense#2021-07-0703:03zimabluetbf it's not insane to think that there might be some sort of subscription mechanism in there#2021-07-0704:04dpsuttonYeah I agree. I wasn’t trying to point out it was an unreasonable expectation but it’s just not the way it works. Each incoming message essentially creates the transport back from where it came#2021-07-0712:07Jim NewtonI'm back to clojure after many months away. I can't remember how to do static syntax checking inside cider. I recall there was an emacs package with a funny name. can someone remind me??? I seem to remember turning it off because of too many false errors.#2021-07-0712:10Jim Newtonfound it. I was looking for clj-kondo#2021-07-0712:14lispyclouds@U010VP3UY9X if you're experiencing too many false errors, let us know at #clj-kondo, we would wanna know how to make it better 🙂
cc @U04V15CAJ#2021-07-0712:32borkdudeI think Jim’s errors were related to in-ns back then and there is still an issue open for this #2021-07-0910:40Jim NewtonAlso I make heavy use of macros, and since kondo doesn't evaluate macros, I found it very distracting.#2021-07-0911:39borkdudeMacro usage can be configured #2021-07-0912:46Jim Newtondo I remember correctly though that macro usage cannot be conifigured along with the macro definition? It has been a long time since I looked at this.#2021-07-0913:15borkdude@U010VP3UY9X Macro config cannot be configured with the macro, but it can be packaged along with the library, so when others use your library, then the config is automatically picked up#2021-07-0919:56blak3mill3rthis is an insanely awesome feature of clj-kondo, the ability to extend it to lint macro usages correctly (very precisely!) and then distribute that config along with the library that supplies the macro#2021-07-0919:57blak3mill3rwithout that feature it would be distinctly less useful for us#2021-07-0811:18Tomas BrejlaHello. There was this question in #shadow-cljs: https://clojurians.slack.com/archives/C6N245JGG/p1625656017490600 and someone replied that it might be better to ask here in #cider. I'm not sure, whether the question fits more into cider, shadow, or even some other place, so sorry if it's not cider-related.
Any idea if those NPM JS modules' exports can get offered by cider? If so, what's needed to make that working? Or does anything needs to be developed first (eg. some sort of middleware)? If so, what and where?#2021-07-0819:27SchmohoI'm not really deep in this, but if you want to dig into the nuts and bolts of it you'd probably look at clj-suitable#2021-07-0819:23zendevil.ethWhen I start shadow-cljs with cider, I see the following error:
Execution error (AssertionError) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:30).
Assert failed: (keyword? repl-env)
What is this error and how do I fix it?#2021-07-0819:26thheller(from the shadow-cljs side it is telling you that you called the function incorrectly, don't know how you called it though)#2021-07-0819:30SchmohoI'm trying to achieve something like this in Emacs to bind system-setup-stuff to keys etc:
(let ((b (cider-scratch--create-buffer)))
(with-current-buffer b
(insert "(prn \"side effect some stuff\")")
(goto-char (point-max))
(cider-eval-last-sexp)))
without the massive stupidity of this approach ...
in particular, I'd like to set a namespace too and all
I've been thinking of using nREPL directly for this, but I figured there must be a smarter way to do it and hoped someone here could give me a nudge#2021-07-0819:33dpsutton@ps can you try m-x nrepl-toggle-message-logging and then try it again? It should create a buffer that has all nrepl traffic so you can see what's going back and forth. Also, can you give us the steps you are taking? ie, cider-jack-in-cljs choose shadow and then choose a build?#2021-07-0819:34zendevil.ethyeah when I choose shadow everything works, including 8081, but when I choose browser I was getting that error#2021-07-0819:43dpsuttonwhat is "choose shadow" and "choose browser"?#2021-07-0819:44dpsuttonyour shadow-cljs.edn file doesn't list those as builds:
{:nrepl {:port 7002}
:builds
{:app
{:target :browser
:output-dir "target/cljsbuild/public/js"
:asset-path "/js"
:modules {:app {:entries []}}
:devtools {:watch-dir "resources/public"
:preloads [re-frisk.preload]}
:dev {:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}}
:release {}}
:test {:target :browser-test
:test-dir "target/test/"
:autorun true
:devtools {:http-port 8081
:http-root "target/test/"}}}
:lein true}#2021-07-0819:44dpsuttonneed to be precise so i know what you are choosing#2021-07-0819:50zendevil.ethduring cider startup there’s an option to choose browser, figwheel, shadow, figwheel-main etc.#2021-07-0820:04dpsuttonalways choose shadow#2021-07-0820:04dpsuttonwhen you are using shadow#2021-07-0820:31zendevil.ethafter choosing shadow, there’s an option to either choose :test, :app, :browser-repl or :node-repl. :browser-repl and :node-repl don’t make sense to me, so I choose one of the other two. But emacs doesn’t let me jack-in-cljs twice so I can’t choose both :test and :app simultaneously. How to run them simultaneously?#2021-07-0820:32dpsuttonbrowser-repl and node-repl are built in helpful tools of shadow. the other two are your builds#2021-07-0820:33dpsuttonignore the simultaneous problem for now. do both profiles work individually?#2021-07-0820:33zendevil.ethyes#2021-07-0820:34zendevil.ethbut I need it simultaneous because it takes very long to start and stop the repls#2021-07-0820:35dpsuttonok so your question is not about what build to choose or anything else, it's about running two simultaneous cljs repls?#2021-07-0820:35dpsuttonboth of your builds work correctly#2021-07-0820:38zendevil.ethnow yes#2021-07-0820:39zendevil.etherror in process sentinel. shadow-cljs server already running#2021-07-1205:16robert-stuttafordusing cider 0.26 when i connect to my shadow-cljs 2.14.5 repl, (clojure.java.classpath/classpath) returns only a single entry; that of my jdk installation:
(#object[java.io.File 0x1a06dc2d "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home/lib/src.zip"])
when i call the same function from the shadow-cljs repl in terminal directly, i get the full classpath i'm expecting to see. how do i go about debugging this?
we're using https://github.com/TimoFreiberg/bultitude to find ring routes dynamically, and i can't test changes to this code via repl because of this issue.#2021-07-2517:02vemvIf you use the dynapath library (directly or indirectly; Orchard bundles it) the classpath can be interfered with
See https://github.com/clojure-emacs/orchard/tree/70e42b52962572602c6bbbcfe1c7f547f2ab8a9e#configuration-options#2021-07-2915:55robert-stuttafordthanks for this, i'll see if it makes a difference!#2021-07-2916:36vemvit really should, LMK if it doesn't :)#2021-07-1207:56djmcider-inspector-def-current-val seems to work without doing ins(p)ect or (l)ocals, but it’s only bound to d in *cider-inspect* buffers. Is there a reason it isn’t bound to d as soon you hit a breakpoint?#2021-07-1208:05zackteoHello I am getting A CIDER session with the same connection parameters already exists.. Are you sure you want to create a new session instead of using 'cider-connect-sibling-clj(s)' ? For my clj+cljs project. However when I try the suggested command, it doesn't seems to work - Does this mean that my shadow.cljs and project.clj are not configured correctly?#2021-07-1307:30robert-stuttafordhow do i get pretty printing in *cider-result* for clojure*script* repls? it's already working in my clojure repl.#2021-07-1321:01ennI see that at one point there was a cider-repl-print-length customize variable, but it doesn’t seem to exist any longer.
With Leiningen, it was possible to set this value in project.clj. The suggested (by Alex Miller) means of doing the same thing with deps.edn is {:main-opts ["-e" "(set! *print-length* 100)"]} . However, this doesn’t work with CIDER for me, presumably because the nREPL server is running in a different thread than the one in which that set! is run.
Any tricks for getting this set by default in my CIDER REPLs?#2021-07-1321:06dpsuttoni see this in the docs: https://docs.cider.mx/cider/1.1/usage/pretty_printing.html#print-options#2021-07-1321:12ennah, interesting, thanks for the clue. we don’t use one of the standard pretty printers, so it would be nice if there were a way to manipulate *print-length* itself, but maybe I can figure out a workaround.#2021-07-1321:12enn(we use a pretty printer which plays more nicely with Datomic entity maps)#2021-07-1422:31kazuwalHi 👋 I was curious if anybody knows how I can send code from my file to my REPL and have it be evaluated. cider-eval-last-sexp-to-repl is the closest thing I can find but it requires me to move into the repl and hit enter?
I asked the question in ClojureVerse also but no real feedback: https://clojureverse.org/t/cider-eval-to-repl-new-prompt/7796
I'm using Doom emacs.... I think Spacemacs has this functionality and certain Cursive does 🤷#2021-07-1422:36dpsuttonthere's a lovely map that does just this. C-c C-j is the prefix for the insert into repl buffer keymap. there you can do C-c C-j d for top level defun, C-c C-j e for last expression#2021-07-1422:38dpsuttonthere are three helpful options for you here
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
(setq clojure-toplevel-inside-comment-form t)
these do:
1. eval automatically when you insert things in the repl. the default was to just put them in the repl but not eval
2. don't switch to the repl during this, just eval it and stay where you are
3. helpful, but it is useful for when you are in (comment ...) blocks to not treat the whole comment block as the top level form, but each form inside it as "top level". Kinda a natural helper with this endeavor#2021-07-1422:43dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider-mode.el#L207-L219
https://github.com/clojure-emacs/cider/blob/master/cider-mode.el#L496#2021-07-1422:43dpsutton(i had the wrong keybinding, updated now to C-c C-j#2021-07-1509:00kazuwalThanks @dpsutton simple_smile#2021-07-1913:01robert-stuttafordhappy 9th birthday CIDER 🍻#2021-07-1921:05the2bearsHi All,
I recently updated my emacs, to 27.2, and got a fresh pull of prelude. Installed rust-parinfer and I think it was working, but now I'm not sure. Anyway, doing some Clojure today and parinfer:smart mode is enabled, but emacs is completing the parentheses pair whenever I type an open one. Not what I want, but I have no idea where to go about looking for what mode might be causing this.
It's very frustrating as I don't see any "slurp/barf" enabled either.#2021-07-1921:08dpsuttonyou can find out what function is running when you enter ( by typing C-h c ( (read this key combination as [help] [character] (#2021-07-1921:08dpsuttonfor me, ( runs the function paredit-open-round#2021-07-1922:58the2bearsInteresting, "( runs the command self-insert-command)" which I think is a default for any key not bound elsewhere. Ugh.#2021-07-2009:42jasminHello there,
I installed a fresh version of linux on my laptop and I can't seem to make cider-jack-in work.
It claims The lein executable isn't on your 'exec-path' even though it exists in /usr/bin/ which is listed in the exec-path variable.
I've tried googling for the last 2-3 hours but found nothing to remedy this.#2021-07-2009:43jasminCan someone help me? 🙂#2021-07-2012:12Christopher MilesDouble-check and make sure the script is executable, you may have to do that by hand. sudo chmod +x /usr/bin/lein#2021-07-2012:22jasminThank you for replying!
ls -l /usr/bin | grep lein
-rwxr-xr-x 1 root root 4500 Dec 26 2019 lein
#2021-07-2013:21dpsuttonCan you run lein repl from a terminal?#2021-07-2013:22jasminYes, and I can connect to that repl with the cider-connect command and giving it the port number#2021-07-2013:23dpsuttonOpen up an eterm buffer for emacs and try running it there#2021-07-2013:28jasminwith M-x shell and running lein repl there gives me sh: lein: command not found#2021-07-2013:28jasminis that what I was supposed to do?#2021-07-2013:39dpsuttonthat's the issue. emacs cannot see it#2021-07-2013:39dpsuttonthere's a var called exec-path which has a path for emacs to search for executables#2021-07-2013:40dpsuttonhttps://github.com/purcell/exec-path-from-shell and this lovely library can help with lots of that#2021-07-2013:40jasminthat's true, exec-path lists /usr/bin/#2021-07-2013:40jasminand lein is there#2021-07-2013:42jasminit seems that I already use that library. I got it from the clojure for the brave and true book's customization files#2021-07-2013:46dpsuttoni'm not sure what steps to take then#2021-07-2014:07jasminthank you for your time 🙂#2021-07-2014:11dpsuttonyou are welcome. not sure why you can't see it in eshell but whatever is preventing that is also preventing cider from running it. that problem is basically emacs cannot find or cannot run your executable#2021-07-2014:12jasminthere's was something I did yesterday evening, but then I went to sleep and in the morning I couldn't replicate it, and I'm struggling the whole day.#2021-07-2014:16dpsuttonthat's really frustrating. i'm sorry to hear that#2021-07-2014:17jasminthank you for your empathy 🙂#2021-07-2111:39jasminFixed it finally!
Since I installed emacs 27.2 through flatpak it didn't exist as a runnable command in my terminal. So when I started it through the app menu, it ran in a different environment (don't know which).
So the fix was to delete that emacs, and install the newest possible (26.3) through my software manager and everything worked smoothly#2021-07-2111:40jasminecho $PATH in emacs was showing a different value than echo $PATH in my terminal#2021-07-2012:25jasminAdditional things that could bring more info to the table:
clojure version 1.10.3.855
lein version 2.9.1 on Java 11.0.11 OpenJDK 64-Bit Server VM
cider version 1.1.1
emacs version 27.2
I've also copied the whole .emacs.d folder from my previous installation to the new one (I have a feeling this might be the culprit)#2021-07-2012:40Quentin Le GuennecIs there a way in cider to treat a macro as defn like cursive does?#2021-07-2013:24dpsuttonFor indentation?#2021-07-2013:35Quentin Le Guennec@dpsutton also for avoiding highlighting things like symbols as flycheck errors#2021-07-2013:37dpsuttonAh. So the error checking is most likely clj-kondo and or lsp. But for indentation clojure mode allows you to set indentations. Also you can use meta data to achieve the same purpose#2021-07-2013:38borkdude@quentin.leguennec1 for ignoring clj-kondo warnings you can use #_:clj-kondo/ignore before the form.#2021-07-2013:39Quentin Le GuennecYeah exactly that's clj-kondo#2021-07-2013:40dpsuttonhttps://docs.cider.mx/cider/config/indentation.html has indentation setting information#2021-07-2013:41Quentin Le GuennecIs there any way to ignore errors on particular forms? Like all (custom-defn ..) forms?#2021-07-2013:42dpsuttonyou can configure clj-kondo to understand the effect of the macro#2021-07-2013:42Quentin Le GuennecI see, thanks#2021-07-2013:42borkdude{:lint-as {foo.custom-defn clojure.core/defn}}#2021-07-2013:42borkdudehttps://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md
https://github.com/clj-kondo/clj-kondo/blob/master/doc/linters.md#2021-07-2013:42Quentin Le Guennecnice#2021-07-2013:44dpsuttonhere's a lovely project with some advanced configuration for a few popular libraries: https://github.com/clj-kondo/config/tree/master/resources/clj-kondo.exports/clj-kondo#2021-07-2013:45dpsutton(I didn't know that you could write functions to parse the forms at runtime and seem to return an annotated ast)#2021-07-2013:45borkdudehttps://github.com/clj-kondo/clj-kondo/blob/master/doc/hooks.md#2021-07-2013:45dpsuttonor perhaps it is macroexpanding#2021-07-2013:46borkdudeit's similar to macro-expansion, but a bit different since you're not working with s-expressions directly but a richer format (rewrite-clj nodes)#2021-07-2015:10ericdalloif using lsp, there is a code action resolve macro assimilar to cursive, which add that clj-kondo config for you.#2021-07-2114:54lassemaattaassuming I have a leiningen project with local java classes (ie. stuff under :java-source-paths): does cider (or perhaps clojure-lsp?) support navigating to those classes (and/or displaying documentation) when I import/reference them in my clojure namespaces? I can access the documentation (`C-c C-d C-d`) for e.g. the JDK classes and other java sources in the dependencies (after tinkering with the resolve-java-sources-and-javadocs plugin), but for some reason I can't figure out how to do this for local java sources. (Disclaimer: I'm very much a beginner in emacs/cider)#2021-07-2115:02ericdalloclojure-lsp doesn't support it, but there is an open issue for that feature, it'd need changes on clj-kondo probably#2021-07-2517:00vemvThis is solved https://github.com/clojure-emacs/enrich-classpath and a public alpha will be released as soon as Clojars solves an administrative issue#2021-07-2517:01ericdallooh, I didn't know about that lib, does it plays well with clj-kondo?#2021-07-2517:03vemvMaybe. It helps tools (like deps.edn or Leiningen) to add items to the classpath. It's not a runtime library.#2021-07-2517:04ericdalloyeah, @U04V15CAJ that may help with that idea of supporting java source on clj-kondo/clojure-lsp ?#2021-07-2517:24vemvbtw @U0178V2SLAY I read too quickly your question and didn't notice you mentioned resolve-java-sources-and-javadocs (which is the former name of enrich-classpath). Happy you're giving it use and seeing some success.
I think you're mentioning a different use case ("local" java sources). I assume this refers to .java files located within your project? That seems a slightly different use case.#2021-07-2517:25lassemaattayeah, exactly#2021-07-2517:27vemvnice :)
I think you can open an issue in https://github.com/clojure-emacs/cider-nrepl explaining the issue in detail (and mentioning that you already are using this plugin). Will be happy to give it a read. Not sure if it's something that should be solved by the plugin, or by cider#2021-07-2517:30lassemaattasure, I can try to write up what I was trying to achieve. As I'm quite new to both cider & lsp, I was mostly pondering if this is a functionality that's already provided by some component, but which I haven't configured properly.#2021-07-2517:31vemvBecause this plugin is new and there practically wasn't a solution for this problem in the preceding years, I think this is not a very often explored area. People are used for Java integration to not work at all.
So it wouldn't surprise me if you found a genuine edge case!#2021-07-2517:34borkdude@UKFSJSM38 clj-kondo already supports linting arities for static methods on built-in Java classes. Guess how many times this has helped me in the last two years? 0 times :)
So linting for Java interop doesn't add a lot of value imo, but being able to navigate to them, could surely be useful.#2021-07-2517:36ericdalloAgreed, I think navigation is the priority indeed, you are right#2021-07-2517:37vemvAs for linting, Eastwood lints for arities (static and instance methods), deprecations, etc from arbitrary Java deps (without requiring the .java sources to be present). It helps from time to time
As always, I'm perfectly fine with the two most prominent linters having different areas of focus. In the average project I'll run both clj-kondo and Eastwood (the former fail-fasting the second for a nicer feedback loop, in CI)#2021-07-2517:39borkdude> (without requiring the .java sources to be present).
yeah, I implemented the static arity info first using the javadoc stuff, but later on I realized that can just be done using reflection facepalm
I have an issue to revisit that, but when the actual sources are available, then the javadoc approach might still have value as the mapping between source and Java class/methods can be made#2021-07-2517:42borkdudeI think clj-kondo could provide arity info + analysis info for navigation based on analyzing the source. I just wonder if there is a better analyzer than the javadoc stuff that is also compatible with graalvm native-image. I haven't tried running the javadoc stuff at runtime#2021-07-2517:43borkdude@U45T93RA6 how does eastwood know what class is being called using an instance call, does it always know also in the presence of reflection? how?#2021-07-2517:44vemv> I just wonder if there is a better analyzer than the javadoc stuff that is also compatible with graalvm native-image. I haven't tried running the javadoc stuff at runtime
Orchard has a variety of parsers and fallbacks. I think some of them work better in concert with https://github.com/clojure-emacs/enrich-classpath#2021-07-2517:45borkdudecan you be more specific?#2021-07-2517:46vemv> how does eastwood know what class is being called using an instance call, does it always know also in the presence of reflection? how?
it doesn't know in face of reflection. In the codebases I generally work on reflection is a no-go and will have 0 reflection warnings. The https://github.com/jonase/eastwood#reflection linter emphasizes this ideal so hopefully it will be no-go for more people (increasing Eastwood accuracy as well for the instance call linting)#2021-07-2517:47vemv> can you be more specific?
There's parser and legacy-parser https://github.com/clojure-emacs/orchard/tree/70e42b52962572602c6bbbcfe1c7f547f2ab8a9e/src/orchard/java#2021-07-2517:48borkdudeah ok, it uses the same stuff clj-kondo uses: https://github.com/clojure-emacs/orchard/blob/70e42b52962572602c6bbbcfe1c7f547f2ab8a9e/src/orchard/java/parser.clj#L15#2021-07-2517:49borkdudePerhaps that stuff works in GraalVM though, never tried#2021-07-2517:49borkdudeif it does, then when its given an "enriched" classpath, there might be some gains to be made, also with respect to instance methods#2021-07-2517:51vemvthere's https://javaparser.org/ btw, seems simpler than parsing javadoc#2021-07-2517:52borkdudecool#2021-07-2517:55borkdudehttps://github.com/clj-kondo/clj-kondo/issues/1330#2021-07-2611:40lassemaattaI attempted to document my original question under https://github.com/clojure-emacs/cider-nrepl/issues/700#2021-08-0206:54pranav.g@U0178V2SLAY Let me know if this works for you.
https://github.com/clojure-emacs/cider-nrepl/issues/700#issuecomment-890479971#2021-08-0206:55lassemaattathanks, I'll check it out later 🙂#2021-07-2221:49Daniel CraigHi all, I reinstalled NPM and node and now when I want to jack into my CLJS project, I get The npx shadow-cljs executable isn't on your 'exec-path' have you seen this error before? How can I resolve it?#2021-07-2222:01Daniel CraigI've tried running sudo chmod +x /Users/e140687/.nvm/versions/node/v14.17.3/lib/node_modules/shadow-cljs/cli/runner.js#2021-07-2300:53Daniel CraigI've started to get a handle on this issue; when I start emacs from my shell everything works flawlessly, so I'm narrowing it down#2021-07-2308:15simonkatzTake a look at https://github.com/purcell/exec-path-from-shell#2021-07-2715:26Daniel CraigThanks that's worked like a charm!#2021-07-2302:55Kevin DepueHey folks, I'm curious if it's possible for cider to font-lock Java types / symbols inside of Emacs#2021-07-2302:57dpsuttonIn a Java buffer or interop in a clojure buffer?#2021-07-2302:58Kevin DepueIn a Clojure buffer that references java symbols#2021-07-2302:59Kevin Depueaka, stuff like (GLFW/glfwWindowHint GLFW/GLFW_REFRESH_RATE (.refreshRate vidmode))#2021-07-2302:59Kevin DepueThere, GLFW is a Java import, .refreshRate is a Java getter, GLFW_REFRESH_RATE is a symbol, etc.#2021-07-2302:59Kevin DepueNone of them are font locked though#2021-07-2303:02dpsuttoni'm not sure. there are a few options for CIDER to font lock some different things but i don't think interop is in there#2021-07-2303:02dpsuttoni dont' think there's any reason it couldn't though#2021-07-2303:18Kevin DepueI haven't found anything suggesting this is possible just yet, curious if anyone else has any leads 🙂#2021-07-2303:22dpsuttonI meant possible to code it to work, not necessarily that something exists now#2021-07-2303:52Kevin Depueyeah haha 😉#2021-07-2303:53Kevin DepueInterestingly, intellisense isn't working for java getters either (aka., .refreshRate)#2021-07-2319:15ghosttoasterIs it possible to have cider log and print (at least a summary) every evaluation?#2021-07-2406:52pavlosmelissinosWhat do you need it for?#2021-07-2408:43djmhttps://docs.cider.mx/cider/debugging/tracing.html ?#2021-07-2319:16ghosttoasterin the repl area.#2021-07-2609:43zimabluehey guys, I think someone identified a bug based on an error I was getting, where cider-nrepl overrides print-method because there's a variation on what this command displays, seen in this picture by @vemv. The issue is that it creates an invalid symbol with three slashes which blows up edn serialization of metadata. The original thread was here: https://app.slack.com/client/T03RZGPFR/C0617A8PQ/thread/C03S1KBA2-1627233840.296600#2021-07-2609:51vemvGood summary of the issue. I think you meant two slashes though
It seems good to me to create an issue in the adequate repo, sounds like it has a reasonably easy fix#2021-07-2618:26Jim NewtonI have a macro which expands fine in the cider repl, and expands fine at the lein repl, But refuses to expand using cnt-c-RET.#2021-07-2618:27Jim NewtonI get a message in the *Messages* buffer: nrepl-send-sync-request: Sync nREPL request timed out (op macroexpand expander macroexpand-1 code#2021-07-2618:27Jim Newtonany ideas what that is trying to tell me?#2021-07-2618:27Jim Newtonother macros expand without problem.#2021-07-2618:29Jim NewtonHere is an example of the macro expansion, which may be a lot of code, but macroexpand finishes in half a second
(let* [or__5501__auto__ (and (member q sink-states) (not draw-sink))] (if or__5501__auto__ or__5501__auto__ (clojure.core/or (clojure-rte.cl-compat/cl-cond (:else (when (:accepting q) (cl-format *out* " q~D [shape=doublecircle] ;~%" (:index q)) (cl-format *out* " X~D [label=\"~A\", shape=rarrow]~%" (:index q) ((:exit-map dfa) (:index q))) (cl-format *out* " q~D -> X~D ;~%" (:index q) (:index q))) (when (:initial q) (cl-format *out* " H~D [label=\"\", style=invis, width=0]~%" (:index q)) (cl-format *out* " H~D -> q~D;~%" (:index q) (:index q))) (doseq [[next-state transitions] (group-by second (:transitions q)) :let [type-desigs (map first transitions) labels (if abbrev (for [td type-desigs] (cl-format false "t~a" (abbrevs td))) type-desigs) label (str/join "," labels)]] (cl/cl-cond ((and (member (xym/state-by-index dfa next-state) sink-states) (not draw-sink))) (:else (cl-format *out* " q~D -> q~D [label=\"~a\"];~%" (:index q) next-state label)))))))))
#2021-07-2618:34Jim Newtonof course I can prepare a test case, but just wondering whether there's something obvious going wrong???#2021-07-2618:46dpsuttonnothing that i see. one debugging tool that helps is to turn on m-x nrepl-toggle-message-logging and try your action again. and then check the buffer that is created with all nrepl traffic in it#2021-07-2618:47dpsuttonhttps://docs.cider.mx/cider/1.1/troubleshooting.html#debugging-the-communication-with-nrepl#2021-07-2619:54Jim Newtonthanks. the message was very helpful.#2021-07-2619:54Jim Newton(<--
id "80"
session "170ac8a8-6e7f-4f1c-8e25-072c26cc6753"
time-stamp "2021-07-26 21:53:05.597508000"
err "java.lang.Exception: No namespace: clojure-rte.dot found
at..."
ex "class java.lang.Exception"
pp-stacktrace ((dict "class" "java.lang.Exception" "message" "No namespace: clojure-rte.dot found" "stacktrace"
((dict "class" "clojure.core$the_ns" "file" "core.clj" "file-url" "jar:file:/Users/jnewton/.m2/repository/org/clojure/clojure/1.10.0/clojure-1.10.0.jar!/clojure/core.clj" "flags"
("clj")
"fn" "the-ns" "line" 4162 "method" "invokeStatic" "name" "clojure.core$the_ns/invokeStatic" "ns" "clojure.core" "type" "clj" "var" "clojure.core/the-ns")
I was trying to macro expand in a buffer, but I'd never loaded the actual file into VM#2021-07-2619:55dpsuttonis that repeatable? IE, you never get an error message back?#2021-07-2619:55dpsuttonif so that's a good CIDER bug. Perhaps the error handling isn't hooked up to the macroexpand stuff?#2021-07-2619:55Jim Newtononce I loaded the code, the macro expansion works correctly.#2021-07-2619:56dpsuttonright. i'm interested in why you didn't get this error message immediately and could easily diagnose your problem. that is a CIDER bug#2021-07-2619:56Jim Newtonyes I'd expect a better error message reporting, indeed#2021-07-2619:56dpsuttonand you experienced nothing? it just would eventually say it timed out?#2021-07-2619:57Jim NewtonI guess the macro expansion created code with namespace notation such as clojure-rte.dot/some-function-name and then tried to read that back in in order to format or pretty-print the output. but reading failed because of missing namespace ?#2021-07-2707:29Jim Newton@dpsutton I'm not sure what your speciality is, but do you have some interest that this cider bug be fixed? Should I try to come up with a simple/minimal test case and submit it?#2021-07-2713:58dpsuttonYes if you can find a simple macro expansion that will demonstrate this and create a ticket I’d love to help improve it#2021-07-3012:38markgdawsonDoes anyone know how/where cider sets the little "spinner" that is in the repl modeline? I'd like to notify tooling outside of emacs when the repl is busy... But I can't seem to find the appropriate elisp hooks/functions.#2021-07-3012:41markgdawsonFor some context, I use doom-modeline and I get REPL[clj] showing in the modeline, but when the repl is blocked on a task it changes to REPL[===]. I can't find the piece of code that does that. I want to hook something similar up to tell the polybar (an OS-level status bar) about the busy/not-busy status of the repl so I can always see it even from another buffer...#2021-07-3012:41markgdawsoni.e. I'm looking to run some code when the repl starts and stops an eval (to set a flag in a process outside of emacs).#2021-08-0112:42bozhidarSee the usages of https://github.com/clojure-emacs/cider/blob/af140ced2286ff646471b067b94c2b18d42616df/cider-client.el#L73#2021-08-0112:42bozhidarhttps://github.com/clojure-emacs/cider/blob/af140ced2286ff646471b067b94c2b18d42616df/cider-client.el#L94#2021-08-0112:43bozhidarThe spinner is an external package that we simply hook into the evaluation.#2021-08-0207:46markgdawsonA reply directly from the expert! 🙂
Thanks @U051BLM8F. That's exactly what I was looking for. 🙂#2021-07-3015:05Steinerhey, I haven't use clojure for a long time, why I can't print variable which has evaluated in repl ??#2021-07-3015:09dpsuttonyou are in the namespace core. solution-1 is a var that is defined in the namespace problem-1. There is no var project-euler.core/solution-1 and the error message is saying exactly that#2021-07-3015:28Steineroh, shit. thank you for your help 🙂#2021-07-3115:07Steinerhey, I copy this code from tutorial,
(ns project-euler.problem3
(:use [clojure.contrib.lazy-seqs :only (primes)])
(:use [clojure.contrib.math :only (sqrt)]))
but there is something wrong
1. Unhandled java.io.FileNotFoundException
Could not locate clojure/contrib/lazy_seqs__init.class,
clojure/contrib/lazy_seqs.clj or clojure/contrib/lazy_seqs.cljc on
classpath. Please check that namespaces with dashes use underscores
in the Clojure file name.
#2021-07-3115:12dpsuttoni don't recognize those files and neither does clojure. what library are you using?#2021-07-3115:13SteinerI learn from this tutorial https://github.com/mishadoff/project-euler/blob/master/project.clj#2021-07-3115:16dpsuttondid you add the org.clojure/clojure-contrib "1.2.0" to your project.clj file and restart your repl?#2021-07-3115:18Steinersorry, I forget it#2021-07-3115:20Steiner@dpsutton by the way, how do I now the latest version of clojure-contrib ??#2021-07-3115:21dpsuttonThat repo is not active and it has been broken out into several constituents#2021-07-3115:21dpsuttonBut I usually just go to the project repo and check the documentation#2021-07-3115:32Steiner@dpsutton may I ask more about it, how can I find the repo for org/clojure/clojure-contrib?#2021-07-3115:32dpsuttonI just googled it and it was the second or third result#2021-07-3115:32dpsuttonWhatever tutorial you are using is a bit old though#2021-07-3115:36dpsutton is the repo#2021-07-3116:02Steinerhow to import sqrt into clojure, I failed with this code
(ns project-euler.problem3
(:use [java.lang.Math :only [sqrt]]))
#2021-07-3116:19dpsuttonYou can’t do that with methods from Java like that#2021-07-3116:19dpsuttonI think at this point you should ask questions in #beginners as the CIDER part seems largely solved#2021-08-0115:13diego.videcoI've got a dependency issue between shadow-cljs , cider and deps.edn. I have a project that depends on another local project, but one new dependency in my local-lib is not being recognized when I run the project using cider.
local-lib/
deps.edn
src/
...
my-project/
deps.edn
shadow-cljs.edn
src/
...
The thing is that recently I added a new dependency to local-lib and I am not being able to build the project using cider-jack-in-cljs , as I am getting this error: The required namespace "com.gfredericks.exact" is not available, it was required by "erv/cps/core.cljc".
Now, this is not the first dependency that I add to my local-lib , but it's the first time this happens to me. If I run the project on the command line npm run watch:browser , then it compiles correctly and I am able to use this new dependency, but I can't seem to be able to do it with cider.
I am not sure if this is a shadow-clj problem or a cider one, but any help could be greatly appreciated.#2021-08-0115:17diego.videcoMy deps.edn files look like this:
;; erv a.k.a local-lib
{:deps {org.clojure/clojure {:mvn/version "1.10.0"}
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
time-time {:local/root "../time-time"}
overtone {:mvn/version"0.10.6"}
com.taoensso/timbre {:mvn/version"4.10.0"}
com.gfredericks/exact {:mvn/version"0.1.11"}}}
;; my-project
{:paths ["src"]
:deps {thheller/shadow-cljs {:mvn/version "2.11.4"}
reagent {:mvn/version "1.0.0-alpha2"}
erv {:local/root "/home/diego/sc/overtone/erv"}}}
#2021-08-0115:23diego.videcoOh, just tried changing the "unnamespaced" dependencies to namespaced and it seems to have finally worked. I.e. I changed time-time to time-time/time-time and so on... I know the unnamespaced version is deprecated... but does anyone understand what was happening, and why might it have stopped working when I added a new dependency?#2021-08-0115:35dpsuttonyou made it into an invalid deps.edn file and i suspect it used a cached version that lacked the new dependency#2021-08-0116:19diego.videcoI see#2021-08-0320:14jmckitrickWhat's the trick to getting docs from imported Java libraries to appear in eldoc or with C-c C-d C-j or similar (show javadoc?)#2021-08-0320:35Jelle LichtIf I understand your question correctly; having the sources-jars as dependencies usually does the trick for me (with leiningen, at least)#2021-08-0320:37Jelle LichtE.g. [bla/bla "1.0.3"] and
[bla/bla "1.0.3" :classifier "sources"]#2021-08-0321:23jmckitrickSo the :classifier option is required to make it work?#2021-08-0321:56Jelle LichtDisregard what I said, I was thinking of C-c C-d C-d instead; sorry!#2021-08-0322:04Jelle LichtSo instead of “sources”, you should specify “javadoc” as the classifier. You might still have issues with your browser setup in Emacs, but I just verified that browse url is called with a jar:file:/home/Jelle/…/bla-javadoc.jar!/some/random/Class.html#2021-08-0322:43vemvWe're on it :) https://github.com/clojure-emacs/enrich-classpath
I find it amazing (in a good way) how this gets asked about every other week on this channel
I released an alpha for feedback the other day, anyone's input will be greatly valued#2021-08-0323:07Jelle LichtVery cool @U45T93RA6! This still leaves the “how can I open these nice x-javadoc.jar files” question as the final piece of the puzzle, correct?#2021-08-0323:11vemvNot sure. CIDER and Orchard, when perceiving these javadocs in the classpath, should simply do their magic. They do parse javadocs as part of their functionality.
If you mean opening them under a browser, I have no idea about what's there. Emacs has no Chromium whatsoever so there's a limited choice of features one can possibly implement AFAIK.#2021-08-0400:54jmckitrickThanks, @U45T93RA6!#2021-08-0322:43vemvWe're on it :) https://github.com/clojure-emacs/enrich-classpath
I find it amazing (in a good way) how this gets asked about every other week on this channel
I released an alpha for feedback the other day, anyone's input will be greatly valued#2021-08-0402:03jmckitrick@vemv The docs say it's a library as well. How would it be used with tools/deps (without Leiningen)?#2021-08-0402:07vemvI have an issue open for that
It's doable, I have a plan. I should just get to it some weekend.
Feel free to nudge me over the issue tracker if too much time passes#2021-08-0402:14vemvbtw PR welcome if anyone wants a deps.edn adventure... it's kind of low-hanging fruit
I actually use deps.edn frequently / at work. My workaround is slurping deps.edn from Leiningen. I like all my tooling lein-based even when using deps.edn#2021-08-0411:27jmckitrickI'm curious to know how you do that. I've always used Leiningen, but my new job uses deps.edn. I haven't dug into the interop. Once I got CIDER working with front and back end, I moved on....#2021-08-0411:44vemvI use this generic project.clj that will work with most deps.edn files out there. There can always be edge cases though :)
https://gist.github.com/vemv/7239033e8a16f2cc24b32f637bf42959
This approach is superior to the plugins you can find out there IMO. If something goes wrong you can add a println and fix it immediately
I have a bash wrapper for lein that will copy this file to $PWD if no project.clj was found#2021-08-0412:21jmckitrickPretty slick! I'll have to try it out....#2021-08-0610:43mhcatIs it possible to fully unload cider after a buffer has loaded, such that inf-clojure will work without collisions? Or is it best to just find a way to avoid loading cider in the first place, in the clj files for which you want to use inf-clojure?#2021-08-0613:02dpsuttonI’ve got something for this. Let me find it#2021-08-0613:31dpsuttoni can't find the snippet any longer. It was largely (remove-hook 'clojure-mode-hook #'cider-mode) to prevent buffers from pulling up cider, and then you can loop over the buffers in the buffer list and when they have cider mode active remove cider#2022-01-1816:02mhcatahahaha thanks for that, I just logged in for the first time since I wrote this question 🙂 But that's a good answer, so thank you#2022-01-1816:05dpsutton(defun personal/unhook-cider ()
(seq-doseq (buffer (buffer-list))
(with-current-buffer buffer
(cider-mode -1))
(remove-hook 'clojure-mode-hook #'cider-mode)))#2022-01-1816:05dpsuttonjust found it#2022-01-1816:05mhcatamazing!#2022-01-1816:06dpsuttonthe remove-hook can probably be spit out of the seq-doseq looking at it now#2022-01-1816:09mhcatdefinitely, but harmless as is#2022-01-1816:09mhcatthanks again#2022-01-1816:10mhcatI guess for switching back to CIDER, the same thing with inf-clojure!#2022-01-1816:10mhcatassuming it follows the same pattern (which coming from the same stable etc..)#2022-01-1816:11dpsuttoni haven’t found the need to write that version yet 🙂#2022-01-1816:11dpsuttonbut yeah it should be similar#2021-08-0611:23Jakub ŠťastnýThat's a good question, I'd also like to know the answer (in my case, I'm interested in running socket REPL in some scenarios, for instance so I can have nested sessions to be used essentially as a debugger (and yes, I know cider has got an actual debugger, I just prefer this).#2021-08-0611:24Carlohey, where's the variable that holds the default command for cider-jack-in?#2021-08-0612:08djmThere isn’t a single one. But if it’s a lein project, it’ll use cider-lein-command, cider-lein-parameters, cider-lein-global-options, cider-jack-in-dependencies, cider-jack-in-lein-plugins, and probably some others#2021-08-0612:09djmDoes that help?#2021-08-0613:33Carlothanks @U015KH5ENEM, it's not a lein project, I'm trying a projectless workflow, and my repl is invoked via the clojure cli tools. The one I usually have (and can edit via the universal argument) is:
/run/current-system/sw/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl/refactor-nrepl {:mvn/version "2.5.1"} cider/cider-nrepl {:mvn/version "0.25.9"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
but I want to add a couple more flags automatically#2021-08-0613:35CarloI can find 3 setting mentioning clojure cli:
cider-clojure-cli-global-options -> nil
cider-clojure-cli-command -> clojure
cider-clojure-cli-aliases -> nil
So I'm unsure where the big command is#2021-08-0613:38djmSome of the ones I mentioned aren’t lein-specific#2021-08-0613:39djmOh, maybe just one of them: cider-jack-in-dependencies#2021-08-0613:40djmIt looks like cider-jack-in-lein-plugins is used for cli too#2021-08-0613:42Carloin the end I was able to get what I wanted via cider-clojure-cli-global-options! Thanks @U015KH5ENEM 🎉#2021-08-0613:43djmGreat! No problem#2021-08-0715:08CarloI was using the cider debugger, via C-u C-c C-c when evaluating a form. I noticed that on the clojure.core.match/match forms the debugger struggles to show the exact place of the evaluation. How are macros handled in the cider debugger? Could one add explicit support for clojure.match?#2021-08-0715:38vemvrelating compiled code to the macros that generated it is kind of a usual problem for tools to have... e.g. clj-kondo or tools.analyzer can show slightly incorrect line/column info when macros are involved
for a debugger, I reckon that the debugger can't instrument something that was executed already at macroexpansion time?
don't quote me on that though :)#2021-08-0817:30vemvI have this custom feature that will show a defn's source (relative to POINT) into the echo area. Super handy for understanding code without jumping as much.
Is it already in CIDER/elsewhere?
Might contribute it otherwise#2021-08-0817:30vemv#2021-08-0905:59djmThe closest thing I know of is lsp-ui-peek-find-definitions (Although it’s a popup rather than the echo area).#2021-08-0906:54vemvdoes it work with clojure-lsp?#2021-08-0906:58djmYes#2021-08-0907:26djmBut don’t let that stop you from contributing your version - I’d love to have that in CIDER#2021-08-0907:28vemv:) yeah not at all, it simply piqued my curiosity#2021-08-0909:41bozhidarYeah, there's nothing like this in CIDER, so feel free to contribute it. I recall some people asked for something similar in an overlay, which also makes sense to me.#2021-08-0916:13Drew VerleeIs there a way to have the emacs client install the matching version on its side on a per project basis? I understand typically you think to sync the other way to avoid these errors:
WARNING: CIDER 1.2.0-snapshot requires cider-nrepl 0.26.0, but you're currently using cider-nrepl 0.22.0-beta4. The version mismatch might break some functionality! (More information)
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.1 (package: 20210628.1154) and 2.5.0-SNAPSHOT, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
But sometimes it feels safer to use the same setup as the project/author.#2021-08-0917:27vemvIt would be pretty rare for a project to depend on a specific CIDER feature...
normally I place cider-nrepl in my ~/.lein/profiles.clj so that it will take precedence#2021-08-0917:28vemvtrying to answer to your q, a hardcore way would be to remove cider as an elpa dep, and use a git submodule instead. And one would switch tags as one switches projects#2021-08-0920:13bozhidarTo me it seems easier to just have some shared profile with the nREPL deps for all your projects. I assume those warnings are coming because some deps are added to each project or something along those lines, as with jack-in CIDER would have just added the optimal versions.#2021-08-1008:41Ben SlessDoes CIDER have a mechanism to interact with taps? A default tap?#2021-08-1010:15bozhidar@ben.sless No.#2021-08-1010:16Ben SlessWould you like me to contribute something like that to the inspector? along the line of cider-inspect-taps?#2021-08-1214:23jmckitrickWhen developing with both clj and cljs, I find I often switch back and forth between the 2 connections via the repl buffers. I just start typing -repl which narrows the choice down. Then I can go back to the buffer I'm working in, and all the CIDER functionality is there. Is there a simpler way to do this?#2021-08-1214:59afleckdo you mean something like cider-switch-to-other-repl ? i was looking for this too but i’m not sure it exists (yet)#2021-08-1215:06jmckitrickother repl of other type, yes#2021-08-1217:24jmckitrickI'm experimenting with cider-enlighten-mode and I have it working when enabling the minor mode in the buffer. But I cannot seem to enable it on a function using #light as the docs seem to indicate. Is this feature still current?#2021-08-1219:27linus_gvHi 👋, I recently configured magit forge and use authinfo.gpg to store token. Since then when I connect to clojure REPL using cider (cider-connect-clj), emacs tries to decrypt authinfo.gpg.
Any idea why cider-connect needs access to authinfo.gpg ? Anyway to disable it?#2021-08-1220:30richiardiandreaI have the same issue and I think it's trying to check if there is some user+pass in case of ssh connection. I am not aware of a way to disable it#2021-08-1220:41linus_gvOk. Thanks for your reply.#2021-08-1417:29anonimitorafHi guys, I get
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
despite having
:plugins [[cider/cider-nrepl "0.25.5"]]
in my project.clj
I run nREPL on a remote machine and connect to it locally via cider-connect. I've also set
cider-required-middleware-version to "0.25.5"
Any ideas why?#2021-08-1503:30anonimitorafProgrammatically via
(nrepl-server/start-server :port port)
#2021-08-1503:44vemv@nicdaoraf Are you sure that nrepl-server has the cider-nrepl middleware in it?
They're different concepts, have to be composed together. See https://github.com/clojure-emacs/cider-nrepl/blob/6d3934eb665574af891e81ef5c11cf9c2b4e1d65/src/cider/nrepl.clj#L548#2021-08-1503:47anonimitorafIs it enough to have
:plugins [[refactor-nrepl "2.5.1"]
[cider/cider-nrepl "0.25.5"]]
in my project.clj?#2021-08-1503:50vemvclient-side yes, server-side they have to be :dependencies and you have to add the middleware by hand
(...given that you're building a server programatically. Lein plugins don't go as far as mutating the code you write)#2021-08-1503:51anonimitorafHmm, what do you mean by client side?
My local emacs that's connected (via cider-connect ) to the remote nREPL server?#2021-08-1503:52vemvyes
Emacs injects those :plugins for you if not present, so they're optional
(but you'd need them explicitly if connecting from the terminal)#2021-08-1503:55anonimitorafHow does Emacs inject these :plugins if they're not present? As part of cider-connect?#2021-08-1503:59vemvahh I said something partly incorrect, it's cider-jack-in the one command that injects :plugins
long story short, if you intend to build a nrepl -server programatically, make sure to pass a custom :handler to it, namely (refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-nrepl-handler)
and cider-connect (the client side) doesn't need a :plugin whatsoever#2021-08-1503:59anonimitorafOoooh, I'll try that out now, thanks#2021-08-1504:01vemvIt should work. I use such a setup every day, here's the (very contrived) code if that helps at all https://github.com/reducecombine/.lein/blob/e05d6a2d22c0990a88a660c25fe8c5e51a3c6b1a/scripts/vemv/nrepl.clj#L46-L66#2021-08-1504:06anonimitorafYes that somewhat helps 😄#2021-08-1504:30anonimitorafCool, it works 😄. Thanks heaps#2021-08-1503:46anonimitorafI'll reply on a thread 🙂#2021-08-1713:28donavanDo indent specifications have anyway to treat a form differently if it’s on the same line of the symbol? Like the following:
(comment "some documentation on the same line"
(some-form)
(some-form))
(comment
(some-form)
(some-form))
I can obviously do one or the other but not both specifications at the same time.
(BTW I don’t use two space indent everywhere so I guess I’m asking is can I do two space indent for just one macro?)#2021-08-1713:32donavanAh right, it’s just :defn, problem solved!#2021-08-1807:39Jim NewtonI was trying to run my test (`clojure.test`) from cider. After waiting a long time, I finally discovered the *nrepl-server ..* buffer. Shouldn't the emacs-lisp end of this operation notice that the lisp job has failed and make some sort of notification?#2021-08-1809:46bozhidarThat's terminal output from the server process that's decoupled from the normal message exchange that CIDER uses to talk to it. It's quite hard to map output in the terminal to operations performed by CIDER.#2021-08-1919:29Drew VerleeHow would i get a Nrepl to a shadow-cljs build that's targeting a node-library:
{:exports-var blah
:target :node-library
:output-dir "out/backend/"
:output-to "out/backend/main.js"}
I tried connecting via cider-connect-cljs shadow-cljs and node, both said the connected by neither let me eval ed the code.#2021-08-1919:32dpsuttonshadow always starts an nrepl server right? It should just be there. just cider-jack-in and select the build you care about and it should just work#2021-08-1919:35Drew Verleethere is a project script that starts the shadow and the repl i can connect to. I was able to use cider-connect-cljs for the frontend part but not the backend. I tried the node and shadow connection option. The node one throws an execution error:
;; ClojureScript REPL type: node
;; ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))
;;
Execution error (AssertionError) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:30).
Assert failed: (keyword? repl-env)
#2021-08-1919:37dpsuttondon't choose node#2021-08-1919:37dpsuttonchoose shadow-cljs. and then choose the build name you care aobut#2021-08-1919:37dpsuttonthe node option starts a cljs.main repl who's repl env is cljs.repl.node
> (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))
#2021-08-1919:42Drew Verleethanks. Also, in case it's part of the issue. What is the difference between "shadow" and "shadow-select"?#2021-08-1919:45Drew Verleetrying to connect with with repl type: shadow gives me a no build id: app. Which is confusing because neither my /.shadow-cljs/config.edn or my project-cljs.edn mentions a build with id app.
1. Unhandled clojure.lang.ExceptionInfo
no build with id: :app
{:tag :shadow.cljs.devtools.config/no-build, :id :app}
config.clj: 156 shadow.cljs.devtools.config/get-build!
config.clj: 154 shadow.cljs.devtools.config/get-build!
the only mention of an app is the modules key e.g :modules {:app {....#2021-08-1919:45dpsuttoni think shadow-select is the "connect" version of connecting to a running shadow instance#2021-08-1919:45dpsuttonbut not sure#2021-08-1919:53Drew Verleehmm maybe a dir-locals configuration is getting picked up.#2021-08-1919:55dpsuttonyeah clear those out. absolutely should be given a list of choices. and it parses your shadow-cljs.edn file to list the available builds#2021-08-1919:56Drew VerleeYea. that must be it, as your right, it wasn't giving me a choice of build. I'm perplexed because there isn't a dir-locals file in the project.#2021-08-1920:01dpsuttondo you set one in your init?#2021-08-1920:03Drew Verleei'm not sure what you mean. This is the information i'm reading on my end:
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
;;
Execution error (ExceptionInfo) at shadow.cljs.devtools.config/get-build! (config.clj:156).
no build with id: :app
[:frontend] Configuring build.
[:frontend] Compiling ...
[:frontend] Build completed. (229 files, 0 compiled, 0 warnings, 1.14s)
shadow.user>
shadow.user> (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :backend) (shadow/nrepl-select :backend))
To quit, type: :cljs/quit
[:selected :backend]No available JS runtime.
See available JS runtime.
The no js runetime error makes sense to me backend targets a node-library#2021-08-1920:05thhellerno build with id: :app. the build id appears to be :frontend or :backend?#2021-08-1920:06thhellerthe error text seems to be missing a newline https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting#2021-08-1920:07thhellerif you want to REPL into :backend you need to actually start it yourself. meaning the actual node process.#2021-08-1920:08Drew Verleeas in, i can't cider connect?#2021-08-1920:09dpsuttonnode the-file-i-said-to-output.js#2021-08-1920:09thhellercan't comment on any cider related things but I think no. you still connect to shadow-cljs as normal#2021-08-1920:09thhellerbut you backend needs to be started and then that one will also connect to shadow-cljs which will then let you talk to that one in the REPL#2021-08-1920:10thhellerif you don't actually need any of this use the built-in node-repl. don't know how you do that for cider but that one manages the node process for you#2021-08-1920:11thhellercan't explain it any better than I attempted in the docs 😛#2021-08-1920:11dpsuttoncider allows you to choose that build. it looks at all of the builds in the shadow-cljs.edn and also includes browser and node repls#2021-08-1920:13dpsuttonand i believe what @thheller is saying is that if you use the node-repl included repl, shadow will start the node process for you. If you are using :npm-lib, shadow will compile your stuff into a js file (`:output-to` i think) and then you need to manually run node that-file.js and then your repl will have its runtime. The same way you need to load your webapp before you can use the frontend repl#2021-08-1920:15Drew Verleeah, makes sense. something called nodemon is calling the outputed js file.#2021-08-1920:16thheller:node-library outputs are not meant to be called directly by anything? they are meant to be imported by something else? hence the "library" name?#2021-08-1920:16dpsuttongood point 🙂#2021-08-1920:16Drew Verlee🙂#2021-08-1920:17thheller:node-script is for actual "application" type things#2021-08-1920:18thhellerbut again: if you just want a node REPL use node-repl, not :backend. you can still start your backend from there just fine, but you don't have to manage your node process?#2021-08-1920:20thhellerbut I don't know what you are doing so backend might be the correct one#2021-08-1920:21Drew Verleethe build id is :backend.#2021-08-1920:21thhellerthink of node-repl being the same as clj or lein repl#2021-08-1920:22thhellerwhere as the REPL for :node-script or :node-library is a REPL embedded in your-actual-program, like starting your own nrepl server or something (not really, just for comparison sake)#2021-08-1920:22thhellernode-repl is not tied and does not care about a build id. it is standalone and generic, just like clj or lein repl#2021-08-1920:23thhelleryou can still load your code in that of course#2021-08-1920:23thhellerreally need to find a better way to explain this ... it really isn't all that complicated 😛#2021-08-1920:24Drew Verleeone point of confusion is your talking about node-repl like thats a script/program i should be aware of. As where i thought what we were saying is that i was going to run node somefile.js and then tell my nrepl server to connect to it with a node protocol.#2021-08-1920:25thhelleragain .. I don't have the slightest clue what cider/emacs looks like these days. I'm talking about it in terms of shadow-cljs and what the docs there talk about (hopefully).#2021-08-1920:26Drew Verleeok there is a shadow/node-repl command.#2021-08-1920:26thhelleras in shadow-cljs node-repl or shadow-cljs cljs-repl backend (I would assume there is a comparable option for those in emacs but don't know)#2021-08-1920:27dpsuttonand the only thing that CIDER ever does is this command, parameterized over the build name
(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))#2021-08-1920:27dpsuttonthen its just nrepl connection to shadow's nrepl server#2021-08-1920:27thhellerso there is no node-repl support?#2021-08-1920:27dpsuttonthere is. let me go find exactly what it does#2021-08-1920:28thheller(shadow/node-repl) I'd assume#2021-08-1920:30dpsuttoni think it's actually (shadow/nrepl-select :browser-repl) or :node-repl#2021-08-1920:30dpsuttonso exactly as above just with the watch omitted#2021-08-1920:31thhellerthat can't work? needs to be started first?#2021-08-1920:31dpsuttoni actually haven't started up CIDER in a while now. let me go see exactly what it does#2021-08-1920:37dpsutton;; Startup: /usr/local/bin/npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/piggieback:0.5.2 -d cider/cider-nrepl:0.25.9 server
;;
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/node-repl))
#2021-08-1920:37dpsuttonso you were correct#2021-08-1920:37dpsuttonand CIDER still isn't smart enough to not add piggieback when using shadow#2021-08-1920:38thhellerdoesn't matter these days and is actually required (not used still, just got tired of trying to "fake" it)#2021-08-1920:39dpsuttonoh it is? i knew you had a superior mechanism#2021-08-1920:40thhellerfaking it was just too problematic, now its just added as normal but the shadow-cljs middleware places itself before piggieback. so that never actually does anything but is still there to make cider happy and stuff#2021-08-1920:41dpsuttonsorry about that 😕 thanks for being so patient#2021-08-1920:41Drew Verlee@dpsutton what did you run to get it to run shadow/node-repl?#2021-08-1920:42dpsuttoncider-jack-in-clojurescript then choose shadow then choose node-repl#2021-08-1920:43Drew Verleei must have some global configuration somewhere that's setting things. ugh.#2021-08-1920:44dpsuttonyes. that's what i said before about you probably setting it in your init#2021-08-1920:46dpsuttonbut no matter. it seems like you can just call (shadow/node-repl) yourself when it throws an error with trying to do :app#2021-08-1920:55Drew VerleeThat seems to work. thanks a lot. Will shadow watch/recompile a node target like it does a browser one? I realize were in the cider channel 🙂#2021-08-1920:55thhelleryes, although reloading is often a bit trickier. depends on how much state you keep in those nasty node callbacks and such 😉#2021-08-1920:56dpsuttoni added the server startup commands and the cljs repl startup commands at the top of the repl so you'd see you just get a regular clj repl and then use shadow's api commands to "upgrade" the repl into a cljs repl.#2021-08-1920:57dpsuttonthere's no magic. it's just getting a clojure repl and running (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/node-repl)) that's just clojure code#2021-08-1921:31Drew VerleeThe offending configuration problem was coming form my spacemacs/emacs-custom-settings in my init file. I don't recall it every causing this type of issue before. i just removed it as it's auto generated.#2021-08-1921:41dpsuttonif you've always wanted the :app build in the past i'm sure it was a conveinience#2021-08-2011:57anonimitorafHi guys, anyone getting the same error for CIDER's company completion previews? I wasn't getting this error before. Not sure what changed#2021-08-2012:19bozhidarTo my knowledge there's only 1 commit that added the previews and that's it.#2021-08-2012:19bozhidarI have to admit I've never tried those fancy icons.#2021-08-2012:27anonimitorafOh, I can try removing the icons. Do you mind linking me that commit @bozhidar?#2021-08-2012:27bozhidarSee https://github.com/clojure-emacs/cider/pull/3024#2021-08-2012:29anonimitorafActually, could it be the fact that I don't have cider-nrepl running in my server?
I had to disable it because it was causing my AWS t2.small instance to use up 100% CPU constantly#2021-08-2012:29djmThey used to work for me, when I used company (icons and all). It looks like you’re using Doom. It may have changed since I last used it, but I think I needed (company +childframe) in my ~/.doom.d/config.el get get previws.#2021-08-2012:29anonimitorafYep I've got that too#2021-08-2012:32anonimitorafI can also try rolling back CIDER to an older commit#2021-08-2013:05anonimitorafTo clarify, the commit you linked @bozhidar adds these right?#2021-08-2013:47bozhidarNope, it adds the icons in front of the candidate names.#2021-08-2013:48bozhidar> Actually, could it be the fact that I don't have cider-nrepl running in my server?#2021-08-2013:48bozhidarDepends on the version of nREPL you're using. Newer versions of nREPL offer some built-in completion that should work more or less the same, but you might have hit some edge case with that completion system.#2021-08-2014:00anonimitorafOh, weird. I rolled back CIDER but still have those icons :thinking_face:
Ah thanks, good to know. I'll try out the newest nREPL#2021-08-2015:46anonimitorafBTW, found out that it is indeed because I don't have cider-nrepl installed#2021-08-2016:31bozhidarHmm, that's weird. I wonder if the docstring is missing from the nREPL response. Hard to tell without the full backtrace, though.#2021-08-2017:02anonimitorafThe backtrace disappears when I move my mouse/press a key. Is this screenshot helpful?#2021-08-2017:08solfYou can turn on nrepl logging via M-x nrepl-toggle-message-logging#2021-08-2017:09solfAh sorry, disregard my message, it’s not nrepl logging that you’re looking for#2021-08-2017:11anonimitorafOh right. I tried it out nonetheless and got this:#2021-08-2105:15bozhidar(-->
id "35"
op "lookup"
session "80f17f7f-6dbd-49e6-9b01-6e7669cf6cfe"
time-stamp "2021-08-21 03:12:31.431575916"
ns #("integration.eventbrite" 0 22 (fontified nil help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
sym #("taoensso.timbre/*context*" 0 1 (type "var" ns nil))
)#2021-08-2105:16bozhidarI wonder if those fontified strings are not causing some problem.#2021-08-2105:17bozhidarNormally they shouldn't be, but I definitely have to strip those properties.#2021-08-2108:02anonimitorafOh right. Weird, seems to all work fine when cider-nrepl is installed for me 🙂#2021-08-2018:30bendlasI'd like to connect to an nrepl on a unix domain socket (the --socket option), but cider-connect seems to expect host and port. has anybody done this setup?#2021-08-2105:28bozhidar@bendlas The unix sockets were just added to nREPL, so CIDER doesn't support them yet. I assume the necessary change will be simple, as it affects only the connection logic and nothing else.#2021-08-2105:31bozhidarThis will require changes to cider-connect and the underlying functions.#2021-08-2713:15bozhidarRandom note - Slack channel bookmarks are pretty cool https://slack.com/intl/en-bg/blog/productivity/whats-new-in-slack-simplified-search-channel-bookmarks 🙂#2021-08-2818:41vemvI've released https://github.com/clojure-emacs/enrich-classpath 1.4.1 with a bugfix for one of the very few issues we've detected in it through the whole year.
It allows CIDER (Orchard in particular) to jump to Java sources, and also to display better autocompletion info for Java methods (since said sources are parsed if present)
All feedback welcome, it will be useful prior to bundling this along CIDER in future releases cider#2021-08-3014:35bartukathis works perfectly! Thanks.#2021-08-3014:49vemvCheers, feel free keep an eye on the Cider integration, any missing little feature related to autocompletion would be a good issue to report in Orchard#2021-08-3016:46bartuka@U45T93RA6 would be great to have a unified api to handle deps and lein projects. Reading the code seems like the add function depends on (:dependencies project) value. what do you think about a little refactor to split the add function and have a "deps preparation" phase that returns a list of [{:deps-name "", :deps-version "", ..}] then will be easier to create an alias in deps.edn projects to run a function that will generate this datastructure and call add. wdyt?#2021-08-3016:46bartukathis is a first thought on the problem, but you got the idea hehe#2021-08-3016:56vemvI'm really looking forward to make the project deps-compatible more easily. I did take a first step by not hardcoding any leiningen.core dependency
I'm tracking the task at https://github.com/clojure-emacs/enrich-classpath/issues/2 . I have a pretty clear idea of the intended API, the only bottleneck is time 😬
if you can contribute that would be absolutely welcome#2021-08-3016:59vemv(I do use deps.edn at my day job, but work around it by wrapping deps.edn with some Lein hack... that's far from a universal solution!)#2021-08-3021:44bartukaI can try to contribute to that this week.. time is always the limited factor hehe. I will keep you posted when I start#2021-08-3022:07vemvcider ! Let's see, would be awesome. I've updated the GH issue with some impl notes of what I have in mind.#2021-08-2820:28sun-oneI'm getting unhandled nrepl failures during autocompletion from CLJS. Below is the nrepl logs. The error seems to be coming from this pre-clause check failing https://github.com/clojure-emacs/clj-suitable/blob/223f890ce6af23e764276c5d26303564a8cafd86/src/main/suitable/compliment/sources/cljs/analysis.cljc#L257 .
Any insight here would be greatly appreciated. Quick note I am using the same nrepl session for both CLJS and CLJ via cider-jack-in-clj&cljs command.
(-->
id "30"
op "complete"
session "1888129b-91b7-4f34-a2ef-35e312c0b024"
time-stamp "2021-08-28 13:17:36.662267000"
context ":same"
ns #("gen-fhi.frontend.core" 0 21 (fontified nil help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
prefix "mat"
)
(<--
id "10"
session "1888129b-91b7-4f34-a2ef-35e312c0b024"
time-stamp "2021-08-28 13:17:36.677222000"
err "ERROR: Unhandled REPL handler exception processing message {:op complete, :ns gen-fhi.frontend.core, :prefix mat, :context :same, :session 1888129b-91b7-4f34-a2ef-35e312c0b024, :id 30}
"
)
(<--
id "10"
session "1888129b-91b7-4f34-a2ef-35e312c0b024"
time-stamp "2021-08-28 13:17:36.678457000"
err "java.lang.AssertionError: Assert failed: (symbol? ns)
at cider.nrepl.inlined_deps.suitable.v0v4v0.suitable.compliment.sources.cljs.analysis$ns_meta.invokeStatic(analysis.cljc:257)
at cider.nrepl.inlined_deps.suitable.v0v4v0.suitable.compliment.sources.cljs.analysis$ns_meta.invoke(analysis.cljc:257)
at cider.nrepl.inlined_deps.suitable.v0v4v0.suitable.compliment.sources.cljs$ns_candidates$iter__69346__69350$fn__69351.invoke(cljs.cljc:82)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5419.invokeStatic(core.clj:139)
at clojure.core$concat$cat__5512$fn__5513.invoke(core.clj:736)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:713)
at clojure.core$next__5403.invokeStatic(core.clj:64)
at clojure.core.protocols$fn__8181.invokeStatic(protocols.clj:169)
at clojure.core.protocols$"
)#2021-08-2908:30vemvI've reported the issue at https://github.com/clojure-emacs/clj-suitable/issues/22 , feel free to chime in#2021-08-2916:14sun-oneLooks good the only thing I would add would be it still is erroring when allowing strings to go through the ns-meta pre check (happens later in the code). But these errors are getting caught somewhere in the code (this avoids one of the biggest issues I was having which is my nrepl buffer getting huge error stack traces from unhandled Exceptions).
Alteration I made:
(defn ns-meta
[ns]
{:pre [(or (symbol? ns) (string? ns))]}
(if (string? ns)
{}
(meta (clojure.core/find-ns ns))))
Sample of my current output:
(-->
id "34"
op "complete"
session "8553fbad-e282-4cd6-b499-8e4a27d817a4"
time-stamp "2021-08-29 08:32:54.854319000"
context ":same"
enhanced-cljs-completion? "t"
ns #("gen-fhi.frontend.core" 0 21 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
prefix "zxcvzxxcv"
)
(<--
id "34"
session "8553fbad-e282-4cd6-b499-8e4a27d817a4"
time-stamp "2021-08-29 08:32:55.158890000"
err "java.lang.IllegalArgumentException: No such namespace: @auth0
at clojure.lang.Var.find (Var.java:146)
clojure.core$find_var.invokeStatic (core.clj:2024)
clojure.core$find_var.invoke (core.clj:2019)
cider.nrepl.inlined_deps.suitable.v0v4v0.suitable.compliment.sources.cljs.analysis$macro_meta.invokeStatic (analysis.cljc:266)
Maybe a filter around string namespaces earlier would be better solution as a temporary fix? Just avoid running any of this analysis code when encountered.#2021-08-2916:34vemvThanks!
Feel free to complete the GH issue with as many 'vulnerable' defns that have to be patched for them to return no errors.#2021-08-3110:02jumarI'm not sure what's going on but recently cider-jack-in-clj started to fail for me:
Caused by: Syntax error macroexpanding clojure.core/defn at (clojure/spec/alpha.clj:85:1).
at clojure.lang.Compiler.checkSpecs(Compiler.java:6972)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6988)
at clojure.lang.Compiler.macroexpand(Compiler.java:7075)
...
at clojure.main$loading__6721__auto____8974.invoke(main.clj:11)
at clojure.main__init.load(Unknown Source)
at clojure.main__init.<clinit>(Unknown Source)
... 55 more
Caused by: java.lang.Exception: #object[clojure.spec.alpha$and_spec_impl$reify__1057 0x459f703f "clojure.spec.alpha$and_spec_impl$reify__1057@459f703f"] is not a fn, expected predicate fn
lein repl works fine#2021-08-3110:15vemvsounds like -Dclojure.spec.skip-macros=false would be a temp workaround#2021-08-3110:17jumarLooks like cider update + spacemacs develop branch update helped, at least for one of my projects.#2021-08-3110:17jumarHmm, but I still get the same error for another one 😮#2021-08-3110:18jumarAnd that one fails with lein repl too so that makes more sense 🙂#2021-08-3117:21bozhidarI can't think of any recent change that might have caused this.#2021-08-3121:44fedregHi all, can someone share an example of how to customize the cider debugger print length?
This doesn’t seem to work and can’t tell what the exact value I need to set:
(setq cider-print-options '(("length" 500)))
I believe cider-debug-print-length is deprecated? Thx!!!#2021-09-0114:09plexus@bozhidar do you think it's already possible to drop these legacy support statements?
(if (find-ns 'clojure.tools.nrepl)
(do
(require
'[clojure.tools.nrepl.middleware.interruptible-eval :refer [*msg*]]
'[clojure.tools.nrepl.middleware.session :as session]
'[clojure.tools.nrepl.misc :refer [response-for]]
'[clojure.tools.nrepl.transport :as transport])
(import 'clojure.tools.nrepl.transport.Transport))
(do
(require
'[nrepl.middleware.interruptible-eval :refer [*msg*]]
'[nrepl.middleware.session :as session]
'[nrepl.misc :refer [response-for]]
'[nrepl.transport :as transport))
(import 'nrepl.transport.Transport)))
#2021-09-0114:09bozhidarYeah, removing them is fine at this point.#2021-09-0114:13vemv@plexus @bozhidar could we not? I still use tools.nrepl for legacy reasons
In fact I want to restore them in other places where they were dropped
I know it sucks, but breaking changes suck just as much and hinder my transition from $forked_stuff to cider latest#2021-09-0114:15plexusthe thing is that we are starting run into things that are now part of nrepl that aren't in clojure.tools.nrepl.#2021-09-0114:16vemvif it's too complicated I'm willing to move on
ideally nrepl/nrepl would be simply a superset of tools.nrepl and would not complicate things much
would undestand if that's not the case#2021-09-0114:17dpsuttoncouldn't you just use an older cider-nrepl in those projects?#2021-09-0114:18vemvit's fairly delicate, nrepl, Lein, cider, refactor-nrepl all have to play in concert
I've had a frozen/forked setup for a couple years, it works well for me#2021-09-0114:18vemvthere were some compat layers at some point, they were removed later#2021-09-0114:18vemvthat wasn't fortunate IMO#2021-09-0114:19dpsuttonyeah it was rough for a bit for sure. for a while i had to ensure to use lein 2.7.3 for a work project. it was not fun#2021-09-0114:20plexusok I may not need to remove any more than were already removed previously 🙂 I somehow had managed to check out an ancient version#2021-09-0114:22vemv:) yeah honestly I thought that was removed everywhere already
I have it in the radar to propose restoring it... if it doesn't break builds#2021-09-0114:30bozhidarI also thought I had removed it everywhere.#2021-09-0114:31bozhidarIn general I don't think keeping it helps much, as most clients rely on some newer nREPL features are unlikely to work with tools.nrepl properly anyways.#2021-09-0114:33bozhidarI just saw I had deleted everything related to tools.nrepl in Jan 2019. 😄#2021-09-0115:19plexusFor interested folks, we're pretty close to being able to upgrade a plain nREPL connection to cider-nrepl https://github.com/clojure-emacs/cider/issues/3037#2021-09-0116:26richiardiandreaOh this is really cool stuff thanks @plexus!#2021-09-0208:59Dimitar UzunovIs cider-jack-in a reference to the Matrix? https://matrix.fandom.com/wiki/Jacking_in#2021-09-0211:26bozhidar@dimitar.ouzounoff More like Neuromancer, but close enough https://metaredux.com/posts/2019/11/02/hard-cider-understanding-the-jack-in-process.html#fn:1 🙂#2021-09-0211:36Dimitar Uzunovthis is awesome! Thanks!#2021-09-0320:24JonRHi channel, I'm using doom-emacs with cider for a clj and cljs project. I'm wondering if anyone knows of a way to have the buffer automatically switch to the appropriate repl based on if I'm in a cljs or clj file? Otherwise, any tips on managing this issue in general?#2021-09-0414:56anonimitorafHi guys, is there a way to navigate back-and-forth within cider-inspect? operate-on-point seems to be the forth but I've not found a back#2021-09-0501:19anonimitorafAh found it, cider-inspect-pop it seems#2021-09-0815:09Joshua SuskaloWhen using the cider debugger's eval, is the "current" value stored anywhere accessible? Like if I've got a value in a breakpoint and I want to save it in a def for later inspection?#2021-09-0815:11djmp then d?#2021-09-0815:14Joshua SuskaloThanks!#2021-09-0903:52stardiviner[SOLVED] How to navigate and walk through in CIDER inspected complex and very long variable data structure?#2021-09-0909:15plexusFor something like this I can highly recommend Portal (https://github.com/djblue/portal)#2021-09-0910:38stardivinerThis is very nice for my purpose. Thanks a for recommendation.#2021-09-0922:09anonimitorafThere's also cider-inspect BTW#2021-09-1012:15stardivinerYes, but seems not very handful for large data. thanks @UR37CBF8D#2021-09-1309:42plexusif it's medium sized then a cider-pprint-eval-last-sexp is also really handy#2021-09-1208:47BenjaminHow do I add sources for cider lookup for my project? (I have some jars as deps and I have the java sources of them in a separate jar) (edited)#2021-09-1209:57vemvare the sources third-party or from your own java sources?#2021-09-1210:39vemvtldr if the former https://github.com/clojure-emacs/enrich-classpath/, if the latter, https://github.com/clojure-emacs/cider-nrepl/issues/700#issuecomment-917609536#2021-09-1211:02prncVery nice! Is there an example of using this with a deps.edn based project? Thanks!#2021-09-1211:04prncOh! I see an open Issue about this, sorry ;)#2021-09-1211:09vemvand open PR :)
I'd recommend subscribing to it, probably it's a bit early to bother the author of that PR with support requests#2021-09-1211:11prncDone. Thanks 🙂#2021-09-1419:13Carsten BehringI have the impression that "cider-load-file" always prints the evaluation result of the last expression in a buffer into the echo area of emacs.
If this is "large", emacs crashes for sure.
I did not find a way to disable this. Is there one ?#2021-09-1501:19lispers-anonymousI think there is a defcustom that controls this behavior: cider-use-overlays defaults to both which prints to the echo area and an overlay. If it's just set to t it doesn't print in the echo area. I think cider uses that for cider-load-file eventually.#2021-09-1501:19lispers-anonymousAnother solution is to put a nil at the end of the file being loaded.#2021-09-1508:51Carsten BehringI tried to set "cider-use-overlays", but it does not change anything for "cider-load-file".
It works for "cider-eval-sexp" and company#2021-09-1508:54Carsten BehringIt might be that this was never noted as a big problem. In most clojure files, the last expression is a function definition.
We do data analysis in clojure using notespace and we have sometimes top level expressions which generate large vega specs.
Typically they get rendered in browser via specific functions, but if I press by mistake "C-c C-l" on such a file, emacs dies directly.#2021-09-1508:56Carsten BehringBut only if the last expression by coincidence is a plot specification.....#2021-09-1512:48lispers-anonymousWell, I thought cider-use-overlays might be it, I looked through some of the cider emacs lisp and didn't see any other defcustom vars that might be controlling that behavior.#2021-09-1608:04Carsten BehringI created an issue: https://github.com/clojure-emacs/cider/issues/3052#2021-09-1423:20sova-soars-the-soracider-jack-in hangs and if I hit enter it shows me a nil> prompt.#2021-09-1423:20sova-soars-the-sora;_;#2021-09-1423:23sova-soars-the-soraHow do you configure with nrepl cider uses?
Mine is using 0.9.0-beta2
and the little [===] equals signs loading indicator just goes on and on, well after the messages buffer says [nREPL] server started on 50068#2021-09-1423:27sova-soars-the-soracry#2021-09-1508:15bozhidarYou'll have to update cider-jack-in-dependencies, although I don't think that nREPL 0.9 should be causing any problems.#2021-09-1508:27BasileHey everyone, beginner here! It seems like I’ve got an nREPL issue.
This `shadow-cljs` project I’m working on is starting fine and I can get Calva to both connect or jack-in. From there, I can eval in line or print to the REPL window.
In emacs with `cider`, however, there’s no eval happening.
Would that be something that rings a bell?#2021-09-1508:37bozhidarCan you share with us some error messages/logs? See https://docs.cider.mx/cider/1.1/troubleshooting.html#2021-09-1508:51Basile*nrepl-messages* is empty, aside from the commands I run from the repl buffer.
*nrepl-server* appears to be happy (aside from a couple of mranderson warnings)#2021-09-1509:04bozhidarI guess you can run the interactive Emacs debugger and see where exactly process gets stuck.#2021-09-1510:21Basilethis is my first time using this tool so I don’t feel super comfortable.
however, walking through the execution of cider-eval-last-sexp doesn’t error, and takes me back to the buffer I was running the command from#2021-09-1608:08Benjamin#2021-09-1608:43vemvdoes it work from iTerm or such?#2021-09-1609:08Benjaminactually this issue was because I tried wierd things with the context class loader.
now I have this error instead, the moment I try to connect with cider:
will try with iTerm
ERROR: Unhandled REPL handler exception processing message {:op init-debugger, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :session 91c8935c-7ea3-48b7-836f-00c929e739d7, :id 6}
Syntax error compiling at (cider/nrepl/inlined_deps/orchard/v0v7v1/or#2021-09-1609:11vemvwhat's the complete error message above? You trimmed the interesting part ^^#2021-09-1609:12vemvAnyway the stacktrace says orchard and you mention classloaders so I'd recommend disabling dynapath https://github.com/clojure-emacs/orchard/#configuration-options#2021-09-1609:13Benjaminah sorry what is the interesting part because it's very long xD#2021-09-1609:14vemvfeel free to create and link to a Gist with it#2021-09-1609:16Benjaminhttps://gist.github.com/benjamin-asdf/f8b4535f5b981e849ceabdf197422111#2021-09-1609:16Benjaminsome error with java doclet sounds interesting.#2021-09-1609:16vemvso yeah disable Dynapath, the stacktrace confirms it#2021-09-1609:17vemvnext cider-nrepl release will get rid of it, it's given us a bunch of problems#2021-09-1609:49Benjaminok now orchard.use-dynapath is false but I have the same error. can it be that it runs java runtime but it needs to run jdk or sth? Because Caused by: java.lang.ClassNotFoundException: jdk.javadoc.doclet.Doclet Or I need to add jdk to the classpath somehow?#2021-09-1610:00vemvare you sure orchard.use-dynapath is set to false before cider-nrepl (and therefore orchard) have been required for the first time?
i.e. make sure it's set up at JVM startup time, not at runtime#2021-09-1610:04Benjaminyou might be right. I'll try#2021-09-1609:28plexusbuilding cider-nrepl is taking really long for me, a make clean install takes about half an hour on a relatively beefy machine... Mainly mranderson seems to be taking a lot of time. Pretty sure I've recently done builds that went much faster. Does this ring a bell for anyone?#2021-09-1609:33vemvtried it just now (cider-nrepl master), couldn't repro 😞#2021-09-1609:40plexusmunge source files of compliment artifact on branch [] exposed false.
munge source files of toolscli artifact on branch [] exposed false.
munge source files of toolstrace artifact on branch [] exposed false.
munge source files of arrangement artifact on branch [] exposed false.
munge source files of diffutils artifact on branch [] exposed false.
munge source files of javaclasspath artifact on branch [] exposed false.
munge source files of corerrb-vector artifact on branch [] exposed false.
munge source files of fipp artifact on branch [] exposed false.
munge source files of puget artifact on branch [] exposed false.
munge source files of suitable artifact on branch [] exposed false.
munge source files of toolsreader artifact on branch [] exposed false.
munge source files of rewrite-clj artifact on branch [] exposed false.
this is the part that slows down... will try some things#2021-09-1609:48plexusjstack 2451182 | grep clojure-agent-send-off-pool | wc -l
218
that's a lot of threads... seems at any one time there are between 20 and 100 RUNNABLE#2021-09-1609:50plexusSeems it may be Java 16...#2021-09-1609:50plexusran in 33 seconds on Java 11#2021-09-1609:53plexusmaybe something to do with this
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
#2021-09-1609:59plexushttps://github.com/benedekfazekas/mranderson/issues/57#2021-09-1611:50bozhidarWhat about the new LTS Java 17? Is it affected by the problem as well?#2021-09-1611:52vemvRelated, cider-nrepl doesn't exercise 16 in CI. Will give it a quick go#2021-09-1705:27plexushaven't tried 17 yet...#2021-09-1716:49jmckitrickHey all, I'm trying to install refactor-nrepl into a project using deps.edn . I have it in the :extra-deps section just below cider-nrepl and I see it loading during startup, but...#2021-09-1716:49jmckitrick'user-error: The refactor-nrepl middleware isn’t available! Did you remember to install it?'#2021-09-1720:22vemvhi! one thing is adding the dep, another is starting a nrepl server with the cider-nrepl middleware and refactor-nrepl middleware in it
have you tried something like that? Or is your use case different?#2021-09-1721:00vemvbtw I cut https://clojars.org/refactor-nrepl/versions/3.0.0-alpha1 just now. It bundles all these: https://github.com/clojure-emacs/refactor-nrepl/blob/1399da2029c2e875d450af4caa347302f55fa965/CHANGELOG.md#unreleased
they're all much-needed performance and reliability improvements, no new features / breaking changes. I'd much recommend using this one.#2021-09-1721:37jmckitrickThanks for the help! First question: since I'm using deps.edn and mostly maven artifacts, how long does it take to propagate?#2021-09-1721:37jmckitrickI have CIDER working just fine, with the cider-nrepl middleware working very well.#2021-09-1721:38vemvI've never perceived a propagation delay for regular Maven dependencies#2021-09-1721:38jmckitrickBut I have not done anything in code to start the refactor-nrepl#2021-09-1721:38jmckitrickMy mistake, I changed the wrong version number 😉#2021-09-1721:39vemv> I have CIDER working just fine, with the cider-nrepl middleware working very well.
how do you start cider / cider-nrepl?#2021-09-1721:40jmckitrickI run the app from the command line, then in emacs cider-connect-clj#2021-09-1721:40jmckitrickWARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.1 (package: 20210628.1154) and n/a, respectively.
#2021-09-1721:41jmckitrickThat's the message I get in the repl after connecting#2021-09-1721:42vemvin case it helps, the typical pattern is
(let [handler (refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-nrepl-handler)]
(nrepl.server/start-server :port port :handler handler))
#2021-09-1721:42vemvthe WARNING can be ignored, it's normal that they're out of sync (you are precisely using a custom version)#2021-09-1721:59jmckitrickSo starting the app with clojure -M:dev gives an error:#2021-09-1722:00jmckitrick`Syntax error (ClassNotFoundException) compiling at (my-project-name/dev.clj:36:17).
refactor-nrepl.middleware`#2021-09-1722:01vemvtrying, give me 3m#2021-09-1722:02jmckitrickHowever, if I comment out the offending code, start the app, then C-c C-c the file in cider, it compiles ok.#2021-09-1722:03jmckitrickI'll have to dig into it a bit later, and let you know what I find.#2021-09-1722:05vemv$ clj
Downloading: refactor-nrepl/refactor-nrepl/3.0.0-alpha1/refactor-nrepl-3.0.0-alpha1.pom from clojars
Downloading: refactor-nrepl/refactor-nrepl/3.0.0-alpha1/refactor-nrepl-3.0.0-alpha1.jar from clojars
Clojure 1.10.3
user=> (require 'refactor-nrepl.core)
nil
#2021-09-1722:50vemv> ClassNotFoundException
gonna state the obvious, you have to require these namespaces. my snippet was maybe a little too terse#2021-09-1801:57jmckitrickThat’s probably it. When experimenting on code, I often just use the full namespace at the place of reference until I decide I want to keep the code. I guess that causes problems here.#2021-09-1802:04jmckitrickI’ll try and report back later.#2021-09-1802:46vemvdone https://clojars.org/refactor-nrepl/versions/3.0.0-alpha10 (edited with a good release version)#2021-09-1804:28vemvafter many attempts, alpha10 is finally a decent release.
I also recommend setting:
(cljr-ignore-analyzer-errors t)
if using Emacs. Feel free to report away any found stacktraces (those are typically printed to *messages*), can fix quite quickly#2021-09-1812:49jmckitrickOk, I’ll give that a shot.#2021-09-2012:25jmckitrickI'm up and running! I needed refactor-nrepl.middleware in the require section.#2021-09-2018:11vemvcool! happy to hear!
I have some alphas to release this week, since some features remain with the same quirks they have over the years. It's partly easy - a matter of upgrading our awesome https://github.com/clj-commons/rewrite-clj dep :)#2021-09-1808:32Ben SlessWhat's the mechanism by which *cider-inspect*'s content change when I call cider-eval-last-sexp?
edit: found it, cider-auto-inspect-after-eval in cider-eval#2021-09-1808:48Ben SlessAnyway, @bozhidar I'm bringing back my suggestion to add tap support to the inspector, turns out it's only a few lines of code#2021-09-1808:49bozhidarPR welcome!#2021-09-1809:21Ben Slessshould I split it between cider-nrepl and cider?#2021-09-1809:39Ben Slesstracking it here https://github.com/clojure-emacs/cider/issues/3055#2021-09-2015:58respatializedCan I configure CIDER to print the annotations generated by forms like (clojure.test/testing "xyz" ...) in the REPL?#2021-09-2018:13vemvI have this in a helper ns somewhere
(defmacro testing [string & body]
`(binding [clojure.test/*testing-contexts* (conj clojure.test/*testing-contexts* (doto (str (clojure.string/trim (str ~string)) "\n")
println))]
~@body))
(alter-var-root #'clojure.test/testing (constantly @#'testing))
(originally I created it for inserting a "\n". Sneaked a println to satisfy your requirement)#2021-09-2018:13vemvIt works well, make sure to reload any test namespaces#2021-09-2018:18vemv...You can always create/use your own testing btw if you're fully in control of your codebase. I monkeypatch because I want to use it in places outside my control#2021-09-2110:06plexussomething I brewed up to help with all the nrepl/cider work I've been doing lately https://github.com/lambdaisland/nrepl-proxy#2021-09-2110:07plexuspretty basic but I've wanted something like this for a long time. Eventually I think this may get a proper UI but for now this is a good starting point, just customize to get the output you care about.#2021-09-2916:13thhellercan confirm that something like that is immensely useful to make sense of nrepl. I have something similar to this in shadow-cljs. just never made a lib out of it 😛 https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/nrepl_debug.clj#2021-09-2117:03Benjamin:aliases {
:dev {:extra-deps {org.clojure/test.check {:mvn/version "0.9.0"}}}}
if I put sth like this in my deps.edn how do I start cider with dev ?#2021-09-2123:14lispers-anonymousI put something like this in a file called .dir-locals.el inside the project directory I'm working with
((clojure-mode . ((cider-clojure-cli-global-options . "-A:dev:another-alias"))))
#2021-09-2308:02Benjaminyea that is nice thanks#2021-09-2416:39JonRAnyone know of a hotkey/command to cycle repl buffers?#2021-09-2418:25tvaughanI switched to https://github.com/karthink/popper recently and I like it#2021-09-2721:24JonRNice, thanks @U0P7ZBZCK. I'll give it a try#2021-09-2515:00dergutemoritzHeya, I'm connecting to an embedded remote REPL server (as in: nrepl.server/start-server with cider.nrepl/cider-nrepl-handler) via M-x cider-connect which works fine except for one problem: The main process is a server which writes (a lot of) log output to stderr. This all gets redirected into my REPL buffer, often grinding my Emacs instance to a halt. Is anyone aware of a way to deal with this? I could live with only having stdout redirected, for example.#2021-09-2519:28vemvThe usual thing I do is disabling stdout/stderr logging in my app by tweaking my app's Logback (or Timbre, or what have you) config
I make it log to log/dev.log instead which I can tail -f if necessary
(bonus tip, less +F is awesome https://www.brianstorti.com/stop-using-tail/ )#2021-09-2611:29dergutemoritzHey @U45T93RA6, thanks for your reply (and the nice bonus tip :D). However, logging to files is something I would prefer to avoid since that means having to take care of log rotation, compaction and purging, as well. I'd rather leave that concern to journald 😄#2021-09-2611:46vemvThe trick is that you only tweak logging in your dev env, where rotation is not a concern
Sometimes (but not necessarily) I (File/delete "log/dev.log") on app startup, mostly so that old logs don't confuse me when debugging#2021-09-2614:05dergutemoritzAh yeah, I am actually talking about REPLing into a production server for purposes of doing some runtime state inspection.#2021-09-2614:39vemvGot it
So I have a snippet that should help:
(let [silently--old System/out
silently--pw (java.io.PrintWriter. "/dev/null")
silently--ps (java.io.PrintStream. (proxy [java.io.OutputStream] []
(write
([a])
([a b c])
([a b c d e]))))]
(binding [*out* silently--pw
*err* silently--pw]
(try
(System/setOut silently--ps)
(System/setErr silently--ps)
;; do your thing here...
(finally
(System/setOut silently--old)
(System/setErr silently--old)))))#2021-09-2614:39vemvthe snippet is oriented for use in e.g. test suites but you can trivially adapt it for repl usage (e.g. binding -> set!)#2021-10-0223:54sova-soars-the-soragood ol' dev/null#2021-09-2910:37yefoakiraHi, I seem to be having an issue running tests on cider. I have setup a :once use-fixtures. When running directly lein test, the test that needs the fixture passes, but when running cider-tests it doesn't. Adding a println line within the fixture I can see cider actually printing it, so not 100% sure what is going on, and the documentation doesn't make any reference.#2021-09-2910:39vemvin what way does the test fail?#2021-09-2910:40vemva somewhat usual suspect is that under the Lein runner, *ns* is always user . In an interactive CIDER session it can easily change#2021-09-2910:46yefoakiraThe fixture setups dynamodb-local. So it fails because it thinks dynamodb-local hasn't been setup (actually because the table cannot be found). The fixture and the test are on the same namespace. The table and the dynamo local are being taken care of in the fixture after the (f) call.#2021-09-2910:57vemvYou can always try (clojure.test/run-tests) from the CIDER repl. That might narrow down things
Otherwise place assert s strategically for ensuring whatever assumptions you have about the test setup hold true#2021-09-2911:05yefoakira(clojure.test/run-tests) works when switching into the namespace (which is why I was expecting). Will need to investigate a bit more about the behaviour of cider.#2021-09-2911:11vemvfeel free to share the test failure itself over here#2021-09-2911:46yefoakiraThe specific error returned is {:type com.amazonaws.dynamodb.v20120810#ResourceNotFoundException, , :Message Cannot do operations on a non-existent table ...
(i am using cognitec.aws)
The setup of the fixture is like
(setup dynamo-process)
(reset! client (aws/client ...))
(aws/invoke @client ... :CreateTable ...)
(f)
(aws/invoke @client ... :DeleteTable)
(reset! client nil)
(stop dynamo-process)
Somehow I am thinking that the (f) is executed out of order ... or is it possible that the fixture gets called, but the test is not run inside the http://fixture.ee#2021-09-2911:48vemvare you sure aws/invoke is a sync/blocking operation? Maybe CIDER is running things too fast?
either way println and assert are your friends, this way you can get an idea of what is going on (in what order)#2021-09-2912:33yefoakiraAh, awesome, so the issue is that the client, for some reason, can't access the process (it is done through an http endpoint). The order of calls was fine. The server created using (.exec (Runtime/getRuntime ...) is not accessible on Cider. Ok, now that smells like I am not doing something I need to do#2021-09-2912:46yefoakiraThere is an async version of invoke, but is on a different namespace. I will keep looking at it.#2021-09-2911:50Toni TuominenI have a problem connecting to a clojurescript repl. If I run cider-connect-cljs from a clojure project I get the following error: helm-M-x-execute-command: Symbol’s function definition is void: parseclj-alist. It works fine if I run it from non clojure project file. Any ideas?#2021-09-3008:14Toni TuominenTurns out it was a bug in cider/parseclj. I updated to parseclj 1.0.4 and it fixed the problem.#2021-09-2915:51diego.videcoHello, got a problem but I am not sure whether it's due to emacs, prelude or cider. The problem is that every now and then something happens that starts activating something in the minibuffer that starts asking for a Lisp Expression, which I can apparently cancel with C-g or just by typing something into it. But after that happens the first time it continues to happen whenever I type a few characters. I have no idea how I am activating it, but it happens often and the only solution I have found is to restart emacs. Any ideas why this happens and how can I deactivate it once it gets started?#2021-09-2915:51winsomeI see this occasionally, you can deactivate it by turning off company-mode#2021-09-2915:54winsomeI don't know a good actual fix, though#2021-09-2916:01diego.videcoThanks @U028BUU1P3R#2021-09-2920:58Carsten BehringI have that quite often lately....
Did not find an other way the quitting cider or even restart emacs. Any workaround is welcome.#2021-09-2920:59Carsten BehringI use doom, so even an other Emax distribution#2021-09-3004:40yuhan@U7AMPCPU2 try M-x toggle-debug-on-error and it should give a stack trace the next time you C-g out of the prompt#2021-09-3013:52diego.videcothanks @UCPS050BV I'll try that#2021-10-1307:49Carsten Behring@U7AMPCPU2 Did you find anything ?
I have this issue very often , and it is very annoying.
It seems to be related to "company mode". Or at least "from time to time " 2 things happen to me,
company mode gets crazy (popup is loosing focus, completions via 'tab' does not do anything anymore)
After some random pressing of "C-g" and "C-c C-c" then I get the "Lisp expression" issue.
For me only emacs restart solves it so far#2021-10-1315:24diego.videcohmm, not really, but disabling company-mode has been the best so far#2021-09-3008:58plexusIf anyone is getting a Symbol’s function definition is void: parseclj-alist then let me say that I'm very sorry, we bungled the release of parseclj/`parseedn`. The issue should be addressed now so if you make sure parseclj and parseedn are at 1.0.4 then you should be good.#2021-09-3018:10murtaza52@U07FP7QJ0 the error I have posted below, is it connected to the above release ?#2021-09-3018:02murtaza52I get this error -
`Starting new CIDER session ...
parseclj-lex--leaf-token-value: Symbol’s function definition is void: :number`#2021-09-3018:05murtaza52I am using spacemacs, and when I updated it today, cider broke.
These are the versions that show up for parseclj and parseedn respectively when I use pkg-info-pck-version - 20210930.540
20210930.542#2021-09-3018:10murtaza52I have reinstalled cider, parsecl and parseedn to no avail.#2021-09-3018:31bozhidarIf you're with all the latest versions you should be okay, provided you're not running Emacs 25.#2021-09-3019:40murtaza52Yup have latest versions, have tried multiple times .. but still getting the error parseclj-lex--leaf-token-value: Symbol's function definition is void: :number #2021-09-3019:55murtaza52Thanks everyone for the help, deleting cider, parseedn, parseclj and then installing again did the trick#2021-10-0108:51lassemaattaI noticed this morning that my app isn't working. After some debugging I found out that any time I use clojure.tools.logging for logging I get a StackOverflowError, which (if I'm reading it correctly) seems to hint at cider.nrepl.middleware.out. Any idea what might cause this? Or is this even related to cider at all?#2021-10-0108:51lassemaatta[java.io.PrintWriter write "PrintWriter.java" 542]
[jdk.internal.reflect.GeneratedMethodAccessor3 invoke nil -1]
[jdk.internal.reflect.DelegatingMethodAccessorImpl invoke "DelegatingMethodAccessorImpl.java" 43]
[java.lang.reflect.Method invoke "Method.java" 566]
[clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 167]
[clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 102]
[cider.nrepl.middleware.out$forking_printer$fn__55622 invoke "out.clj" 59]
[cider.nrepl.middleware.out.proxy$java.io.Writer$ff19274a write nil -1]
[java.io.PrintWriter write "PrintWriter.java" 542]
#2021-10-0108:53lassemaattaIt's a leiningen project and if I run it through lein repl -> everything works. But if started from emacs/cider I get the overflows.#2021-10-0108:55lassemaattacider-version in emacs reports CIDER 1.2.0snapshot (package: , if that's any help#2021-10-0109:02lassemaattaand cider.nrepl.version/version-string evals to "0.27.0"#2021-10-0109:25vemvDoesn't ring a bell to me, seems dense enough to justify creating a GH issue in cider-nrepl#2021-10-0109:41lassemaattaok, I tried my best to describe this in https://github.com/clojure-emacs/cider-nrepl/issues/716#2021-10-0110:22bozhidarClearly it's a regression, but we'll have to figure out which commit caused this exactly.#2021-10-0121:20mjmeintjesHow can I set cider's evaluation in cljc files to only evaluate against the clojure repl, not the clojurescript one?#2021-10-0214:47macI am using the CIDER profiler to do some basic profiling and it has already proven quite useful, but I am struggling a bit with the outputted table. The format is not easy to sort / filter because of the embeded units etc. Any ideas? I have looked at variuous emacs tools like table mode and org-mode, but I am not really getting anywhere.#2021-10-0219:45Ben SlessDo you mean the emacs built in profiler?#2021-10-0219:50macNo, I meant the CIDER Profiler: https://docs.cider.mx/cider/debugging/profiling.html#2021-10-0219:54Ben SlessI have been using cider for 3 years and never knew this existed 😯#2021-10-0220:02Ben SlessYou could use the underlying library directly, I think, and get the raw data#2021-10-0220:08macYeah, I was hoping for an easier approach, but thanks 🙂#2021-10-0510:44vemvℹ️ last weekend we released cider-nrepl / cider.el fixing an issue related to *out* that had been bugging users for the last couple months.
Likewise, clj-refactor.el / refactor-nrepl have been updated, delivering a whole lot of bugfixes and performance/reliability improvements.
Finally, clojurescript autocompletions (aka clj-suitable) also got a few bug fixes delivered.
You can grab all of this by making sure cider.el + clj-refactor.el are @ latest, per the MELPA snapshots. cider#2021-10-0510:49vemvI'm particularly excited for clj-refactor.el, we worked steadily on it this year and the results are finally showing.
Old favorites like clj-slash and cljr-add-missing-libspec should perform much faster, especially for large projects.
There are still bugfixes in the roadmap, keep an eye on things and feedback welcome 👀#2021-10-0510:57FiVoI am using io.pedestal.log for logging and in one project the coloring of the different log levels works in another it doesnt. Is this something cider does? How can I figure out why it does not work in one project?#2021-10-0510:59vemvI'd start by running both projects in a terminal, and observing the coloring they get.
That might confirm/deny some things#2021-10-0511:00FiVoI think it's my logback config#2021-10-0515:03bartukauhmm.. since I updated cider I am receiving the warning about refactor:
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.5.1 and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.
My project is using leiningen and this was the cmd:
[nREPL] Starting server via /opt/homebrew/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0-beta3\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.0.0-alpha12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.27.2\"\] -- with-profile dev,enrich repl :headless :host localhost
#2021-10-0515:38vemvclj-refactor.el should be at latest too#2021-10-0515:58bartukait is, the latest commit is 23743432c39be9b62630f3f6468ac36ebc12aaff#2021-10-0516:04bartuka@U45T93RA6 weird thing.. I jack-in into a deps project and no warnings appeared, but in a brand new lein new my-app I see the warning and no refactor middleware is injected#2021-10-0516:07vemvSounds like I should bump https://github.com/clojure-emacs/clj-refactor.el/blob/23743432c39be9b62630f3f6468ac36ebc12aaff/clj-refactor.el#L10 then. Not super familiar with package.el intricacies myself.
Either way, a mismatch is 100% harmless I can guarantee that. No breaking changes have been introduced, the 2->3 numbering change was pretty spontaneous.#2021-10-0516:08vemvSo You can mute this warning by changing cljr-suppress-middleware-warnings. is sound to follow#2021-10-0516:09vemvLack of injection sounds weird. This is the logic being followed: https://github.com/clojure-emacs/clj-refactor.el/blob/23743432c39be9b62630f3f6468ac36ebc12aaff/clj-refactor.el#L4184-L4194#2021-10-0520:54vemvFor anyone else reading the thread (which we continued over DM), our conclusion was there was a glitch in the published .jars which has been fixed in both clj-refactor.el and refactor-nrepl.#2021-10-0718:00Mikko KoskiI got the same warning after upgrading Doom. Pinning clj-refactor to the latest commit on master seemed to fix it. 3.0.0-alpha13 seems to work fine. https://github.com/hlissner/doom-emacs/pull/5594#2021-10-0516:33ericdallois it possible to eval and copy the result to clipboard?#2021-10-0516:33ericdallosometimes I just want to eval, get the result and paste somewhere else#2021-10-0516:34ericdallosome command for that would be really useful#2021-10-0516:36bartukacider-interactive-eval seems like other eval functions rely on this one.. and the dispatch is sent to a callback function.. seems like your request might be easy to implement using it#2021-10-0516:37ericdalloyeah, if there is nothing built-in I'll probably hack with that, thanks!#2021-10-0516:41bartukaDon't forget to share here your fn 🙂#2021-10-0516:41ericdallosure :D#2021-10-0517:26vemvif it helps at all simpleclip has been my trusty tool for clipboard tasks for a number of years, no complaints :)#2021-10-0518:19jjttjjHi I keep getting a *cider-result* popup buffer every time I cider-eval-defun-at-point. What's the setting to change this again? I tried cider-use-overlays but that's not it#2021-10-0521:02vemvcider-interactive-eval-output-destination perhaps?#2021-10-0604:26didibusAnyone getting:
> nrepl-send-sync-request: Sync nREPL request timed out (op macroexpand expander macroexpand-1 code ...
After upgrading to latest Cider?#2021-10-0606:02vemvResolution was to use cider-nrepl latest (0.27.2), it fixes this and other nasty issues related to *out* handling#2021-10-0606:02vemvResolution was to use cider-nrepl latest (0.27.2), it fixes this and other nasty issues related to *out* handling#2021-10-0609:36lambdamHello,
I set up Emacs and Cider on a new computer and I can't figure how to activate the feature that when typing a short version of a namespace that has been already declared in another file (example [myproject.utils :as utils] ), the require entry is automatically added to the ns form.
I looked into the clojure refactor options, found an entry for common namespaces (like io) but not for namespaces specific to the project.
Thanks#2021-10-0611:12vemvThe answer has two parts :)
For well-known aliases such as io , the list is static and the feature is controlled by these two variables:
https://github.com/clojure-emacs/clj-refactor.el/blob/9e1f92033449a4abc6218ce31670d89e3e6a4dc5/clj-refactor.el#L67-L91
Personally I expand cljr-magic-require-namespaces with a few more entries of my liking#2021-10-0611:16vemvNow, for dynamic alias completion depending on a specific project's used aliases, the feature is called cljr-slash . As the name suggests, it's good to bind it to the / keyboard shortcut if it's not already#2021-10-0715:55lambdamThanks for the info.
The cljr-slash doesn't seem to work on my fresh Spacemacs install. When I type a short version of a namespace and the M-x cljr-slash , the slash is added but the namespace is not added to the ns form, while it is on my older Emacs installation (on my laptop).#2021-10-0716:27vemvwhat versions of clj-refactor.el and refactor-nrepl are you running?#2021-10-0716:38lambdamclj-refactor: 20211004.908
refactor-nrepl: 3.0.0-alpha12#2021-10-0716:38lambdamFresh install#2021-10-0716:39vemvLein or deps.edn?#2021-10-0716:40lambdamdeps.edn#2021-10-0716:42vemvWhat does this return in a clojure repl? (@(requiring-resolve 'refactor-nrepl.ns.libspecs/namespace-aliases))#2021-10-0716:48lambdam{:clj
{sh (clojure.java.shell),
t (tick.core clojure.test),
x (net.cgrand.xforms),
set (clojure.set),
d (datomic.api)
... (namespaces from my project and more)
},
:cljs
{x (net.cgrand.xforms),
set (clojure.set),
p (promesa.core),
... (namespaces from my project and more)
}}#2021-10-0716:48lambdamThe correct list of namespaces#2021-10-0716:55vemvSo the 'backend' looks good
Most likely the 'frontend' has an issue. Here is the list of recent commits https://github.com/clojure-emacs/clj-refactor.el/commits/master , you'll note there are a couple ones touching clj-slash
Personally I'm maintaining the backend, but run a forked version of clj-refactor.el so my knowledge doesn't apply directly there.
I would check if this condition successfully returns a truthy value:
https://github.com/clojure-emacs/clj-refactor.el/blob/9e1f92033449a4abc6218ce31670d89e3e6a4dc5/clj-refactor.el#L2018-L2027
i.e., place the cursor right after a slash, press M-: (per https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html), and paste that (and ... sexpr. What does it return for you?#2021-10-0717:13lambdamI did C-x C-e after the and parenthesis (to eval inline).
It indeed returns an error :
Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
substring(nil 0 0)
replace-regexp-in-string("\n" " " nil)
cljr--keywordp(nil)
cljr--in-keyword-sans-alias-p()
...#2021-10-0717:15lambdamAlso, thanks for the debugging time.#2021-10-0717:15vemvsame :) you don't know how valuable this is for all of us cider#2021-10-0717:17vemvso it seems easy at this point, is it for you? cljr--in-keyword-sans-alias-p appears to be the culprit, surely you can make it "nil-safe".
I'd guess (cider-symbol-at-point) returning nil?#2021-10-0717:43vemvI have to log off. My suggestion would be to replace (cider-symbol-at-point) with (thing-at-point 'symbol) , re-eval the surrounding defun and see if that works.
Regardless of the outcome, feel free to share the problem / your findings over a GH issue. Most likely we'll commit a fix that would be made available very quickly.#2021-10-0808:36lambdamHello @U45T93RA6
I also had to log off yesterday night.
I tried (cider-symbol-at-point) and it seems to work well. It returns the symbol at point surrounded with quotes:
student|
;; M-: (cider-symbol-at-point)
returns
"student"
(cljr--in-keyword-sans-alias-p) returns nil#2021-10-0808:37lambdamDo I open an issue with those informations or are there more things to check?#2021-10-0808:48lambdamArff, I updated the packages since I saw that there was a new version of clj-refactor and now helm is broken
Error (use-package): helm/:config: Invalid read syntax: ")"
I'll use my .emacs.d from my laptop meanwhile and check later if the clj-refactor bug is still there.#2021-10-0809:02lambdamArff again. The version of Emacs is not the same so Spacemacs reinstalls all the packages at their latest version.
😞#2021-10-0620:46Frederico BenevidesHi all. I'm getting this error Error: Does anyone know about this error? (nrepl-connected-hook): Error running hook "cider--connected-handler" because: (cl-no-applicable-method map-into ((right-margin 80)) hash-table)#2021-10-0620:51deletedsee also here https://github.com/clojure-emacs/cider/issues/3029#2021-10-0621:26Frederico BenevidesThank you. It worked!#2021-10-0707:57pmooserWhat makes CIDER decide something is a particular project?#2021-10-0707:57pmooserI have two separate repls (connected to two separate processes) and it doesn't think they're in the same project (C-c M-o doesn't work as a result).#2021-10-0708:01pmooserHmm, what it actually says is "No other REPL in current session" ... so maybe both connections need to be to the same port or something.#2021-10-0708:05pmooserI'm reading the "managing connections" part of the manual ...#2021-10-0708:09pmooserOk, figured it out! My fault for using cider-cljs-connect instead of cider-cljs-sibling-connect.#2021-10-0708:25ElsoI'm having the issue that my CLJS REPLs always stay in pending state - only related issue I found is this:
https://github.com/clojure-emacs/cider/issues/2849
but it does not seem to apply, as there are no invalid ns declarations in the project.
I'm using cljs-connect after starting a shadow watch job on the command line which starts the nREPL on 7002.
CIDER then asks me to select either shadow or shadow-select, where I choose shadow and then am prompted to choose a build.
The weird thing is, after the REPL buffer comes up, when I connect to the app, I can actually issue (js/alerts) and access the app state, but the REPL buffer never associates to the code buffers and the buffer name always has the pending-cljs in it#2021-10-0708:38Elsosomewhat interestingly, when I start the REPL with jack in and shadow everything works out fine -> so maybe I am doing with the connect wrong?#2021-10-0708:59vemvThanks for the report! It doesn't sound like low-hanging fruit so feel free to forward the issue over GH#2021-10-0709:08Elsouh damn - I was hoping someone was having a related issue at some point and knew some likely targets, but I'll see if I can set up a minimal example#2021-10-0810:41Benjaminwhy can ciders fonitification break with some .deps.edn? (I mean the function name fontification of e.g. println specifically)#2021-10-0810:44Benjaminorg.clojure/alpha.spec {:git/url "" :sha "c087ded910b3532a938b37e853df79fc3b9c48c1"}
adding this seems to break it#2021-10-1105:41tatutupdated cider to 20211003.947 and now jacking in to a leiningen project fails with "Unable to resolve var: cider.nrepl/wrap-apropos in this context"#2021-10-1106:02tatutit is injecting cider-nrepl 0.27.2, and it isn't coming from anywhere else#2021-10-1106:22tatutas a workaround I can add the cider-nrepl to dev dependencies, run lein repl and use cider-connect#2021-10-1108:22vemvCan you report this as an issue? Will take a look later#2021-10-1113:53tatuthaven't had time to isolate a minimal failing case yet, we have multiple lein projects and this only seems to fail in one of them#2021-10-1113:53tatutthe failing one is the only one that uses lein-git-down plugin to use deps.edn dependencies from git, I'm suspecting that could have something to do with it, need to try it out#2021-10-1115:06vemvRepro certainly appreciated, if it's an excessive task feel free to skip it
I really like l-g-d btw but it can be flaky, sometimes errors go away simply by retrying#2021-10-1115:07vemvstill we'd appreciate a GH issue, maybe we can fail more transparently when other plugins get in the way (if that's what's happening?)#2021-10-1210:25tatuthttps://github.com/clojure-emacs/cider/issues/3070#2021-10-1210:43vemvCheers cider please also post the found workaround#2021-10-1211:24tatutthat workaround didn't actually work...#2021-10-1116:59bruno.bonacciHi all,
does anyone know if it is possible to enable the image rendering in the popup buffer (aka: C-c C-p)?
the setting described here: https://docs.cider.mx/cider/repl/configuration.html#displaying-images-in-the-repl
(setq cider-repl-use-content-types t)
only works for the REPL buffer.#2021-10-1207:44Sampo ToivaHi, any idea on what might cause an error:
Error running hook "clj-refactor-mode" because: (error Given parent class xref-location is not a class)
When opening a .clj file.
More specific stacktrace points that this comes from cider :
Debugger entered--Lisp error: (error "Given parent class xref-location is not a class")
error("Given parent class %S is not a class" xref-location)
eieio-defclass-internal(xref-etags-location (xref-location) ((tag-info :type list :initarg :tag-info) (file :type string :initarg :file :reader xref-location-group)) (:documentation "Location of an etags tag."))
...
require(etags)
...
require(cider-common)
...
require(cider-client)
...
require(cider)
...
clj-refactor-mode()
...
#2021-10-1209:47Sampo ToivaAllright, recompiled everything and now I'm getting:
Symbol's value as variable is void: xref-etags-location#2021-10-1210:04vemvNot really familiar with this stuff but either a require is missing or xref-etags-location does in fact not exist anymore?
Sadly breaking changes aren't uncommon in .el libs 😞#2021-10-1210:17Sampo ToivaOk figured it out. I need to investigate a bit more but I'll write here a thorough explanation soon.#2021-10-1210:34Sampo ToivaOk, cider-common.el requires etags here: https://github.com/clojure-emacs/cider/blob/master/cider-common.el#L31
That's required only for function find-tag-marker-ring (https://github.com/clojure-emacs/cider/blob/master/cider-common.el#L154). That's obsolete since emacs 25.1 , but I think finally emacs 28 removed it completely.
The correct way should be, to my knowledge, to first (require 'xref) and then use xref-push-marker-stack instead of find-tag-marker-ring.
Here's a similar issue in haskell-mode: https://github.com/haskell/haskell-mode/issues/459#2021-10-1210:36vemvSounds reasonable! GH issue appreciated#2021-10-1210:43Sampo ToivaYep, writing one.#2021-10-1210:48Sampo Toiva@U45T93RA6 there you go: https://github.com/clojure-emacs/cider/issues/3071#2021-10-1210:49Sampo ToivaI patched my own cider with those changes and things seem to work.#2021-10-1317:44Sampo ToivaI wrote a PR fixing this: https://github.com/clojure-emacs/cider/pull/3073#2021-10-1317:46vemv✅ it lgtm but that's not my area of expertise either. Let's see if a reviewer pops up else feel free to bump the thread over gh.#2021-10-1318:08Sampo ToivaNot my area of expertise either 😉
However, the code is essentially identical:
• find-tag-marker-ring was a variable alias for xref--marker-ring
• xref-push-marker-stack is implemented as:
(defun xref-push-marker-stack (&optional m)
"Add point M (defaults to `point-marker') to the marker stack."
(ring-insert xref--marker-ring (or m (point-marker))))
• That's identical with the old code in cider-common (minus the optional m param)#2021-10-1208:33plexusdoes cljs-repl-type 'shadow actually work for people? I don't remember it ever working, and have always had a custom setup for it. This is what I get:
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :main) (shadow/nrepl-select :main))
;;
Execution error (ExceptionInfo) at shadow.cljs.devtools.server.runtime/get-instance! (runtime.clj:11).
shadow-cljs has not been started yet!
In embedded mode you need to call (shadow.cljs.devtools.server/start!) to start it.
If you have a shadow-cljs server or watch running then you are not connected to that process.
#2021-10-1208:44plexusit also seems there's no built-in support for adding the shadow-cljs middleware? I feel like a jack-in-clj&cljs should just work at this point but it seems some key pieces are missing...#2021-10-1208:48plexusI should mention I'm using clojure-cli to start the process#2021-10-1212:24dpsuttonIt does. I’m guessing you are using deps edn with it?#2021-10-1212:24dpsuttonThere’s an issue that explains how the middleware can end up there.#2021-10-1213:41plexusyou are saying it is supposed to work? because I don't find any mention in the cider code base of the shadow middleware#2021-10-1213:42plexusGot it to work by adding this:
(add-to-list 'cider-jack-in-nrepl-middlewares (list "shadow.cljs.devtools.server.nrepl/middleware"
:predicate #'cider--shadow-cljs-repl-p))
(defun cider--shadow-cljs-repl-p (_spec)
(eq 'shadow cider-default-cljs-repl))
and adding a call to (shadow.cljs.devtools.server/start!) to the cljs repl init code. It seems the current code assumes that when cljs-repl-type is shadow, that your cider-preferred-build-tool is also shadow#2021-10-1213:55dpsuttonah that would be problematic#2021-10-1312:18vemvℹ️ Good moment to upgrade cider.el to its latest snapshot! Its bumped parseedn dependency can fix various glitches in CIDER and clj-refactor alike.#2021-10-1617:04rafalwHi, I have project setup with deps.end and shadow-cljs.edn, every source and test file is an .cljc file. I'm able to start clj repl and do normal workflow with cider and run unittests C-c-t n etc.
I'm also able to run shadow-cljs version of the workflow "connect" with browser, connect with cider-cljs, but in this setup running unitests shows error message - it cannot connects to the clj repl - which makes sense because only cljs repl is running (and cider is already connected to it).
My question is - how to make cider to run unitests in already running and connected cljs repl?#2021-10-1618:47chaosI don't think cider supports running cljs tests; you can though run your tests individually from the cljs repl as`(my.namespace/test-name)` or using one of the test functions (such as run-ns as documented at http://bensu.github.io/clojurescript-docs/cljs.test-api.html#2021-10-1713:43rafalwok, thanks#2021-10-1815:49Drew VerleeI wanted to run another command when starting shadow, so according to these docs https://docs.cider.mx/cider/cljs/shadow-cljs.html#configuration i thought i could just add that command to my cider-shadow-cljs-command like so:
((nil . (
(cider-shadow-cljs-command "npm run feature-flags && npx shadow-cljs")
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "dev")
(cider-shadow-watched-builds . ("dev" "cards")))))
However this is throwing an error: split-string: Wrong type argument: stringp, ("npm run feature-flags && npx shadow-cljs")#2021-10-1815:57Drew Verleeoh i probably need that period.#2021-10-1816:18Drew Verleehmm now it seems there is some descripency between what i can run at the command line and what will execute in emacs as i get this error:
error in process sentinel: Could not start nREPL server:
>
#2021-10-1816:20borkdudeWhat version of bb is this?#2021-10-1816:21Drew Verleeoh intresting. emacs shell has a much older version, 0.0.96#2021-10-1816:21borkdudemaybe an old one on your path somewhere#2021-10-1816:33Drew Verleeyep that was the issue. Ty#2021-10-1816:34Drew VerleeWhat variable would i use to pass args after the watch option? e.g the --config-merge ... part of: npx shadow-cljs watch dev --config-merge ./config.edn#2021-10-1816:35Drew Verleecider-shadow-cljs-global-options ?#2021-10-1816:38dpsuttonyou'll need to look at the source whether there is a variable spliced in there#2021-10-1919:20nhaI’m not sure if I should ask here or in #nrepl
When upgrading my cider/cider-nrep dependency I loose the logs. The last version that works is “0.25.11”, and starting from “0.26.0" I just don’t have the logs anymore. I had a quick look at the changes and nothing jumps out - is it something known?
cider/cider-nrepl {:mvn/version
;; "0.25.4" = OK
;; "0.25.10" = OK
;; "0.25.11" = OK
"0.25.11"
;; "0.26.0" = KO
;; "0.27.2" = KO
}
In case it matters, I am using deps.edn+`clojure.tools.logging` +`log4j2`#2021-10-1919:24vemvthere was an issue related to *out* but that was fixed in 0.27.1#2021-10-1919:26vemvif possible create a repro with an analog setup (deps.edn, logback.xml etc) and create a GH issue, LMK :)
(a part of the repro is that it should be visible over iTerm - adding Emacs to the mix makes things less certain)#2021-10-1919:40nhaI am looking at logs in iTerm actually - I tried “0.27.2” so it should not be that.
I’ll wait a bit before jumping on a repro in case something knows what it is but I agree that will make it easier if that’s not the case.#2021-10-1919:43vemvI'll re-review a suspicious commit (various added type hints)#2021-10-2113:38vemvchecked out, nothing seemed off
would gladly inspect a GH issue/repro#2021-10-2116:54nhaNoted. I'll se if I can make a repro#2021-10-1920:42dpsuttonhelpful function inspired by calva's latest feature:
(defun personal/insert-comment ()
(interactive)
(end-of-defun)
(insert "\n")
(insert "(comment\n )\n")
(clojure-backward-logical-sexp)
(forward-char 1)
(clojure-forward-logical-sexp)
(insert "\n")
(indent-according-to-mode))
#2021-10-1920:42dpsuttonif you're in a form, add a new comment form after it for easy repling#2021-10-1920:42DerekPut a comma before the trailing paren 🙂#2021-10-1920:43dpsuttonfor what purpose?#2021-10-1920:43DerekIt keeps paredit from collapsing the trailing paren up a line#2021-10-1920:44Derektype ‘)’ and paredit will join the following line if present#2021-10-1920:44dpsuttonyou probably mean parinfer?#2021-10-1920:44Dereknope#2021-10-1920:44Derek_ is cursor position
clj
(comment
(execute-some-fn)_
,)
#2021-10-2011:16tvaughanI use 42 :)#2021-10-1920:45dpsuttonoh i see. i guess i never type closing parens#2021-10-1920:46Dereka useful function — didn’t mean to derail#2021-10-1920:46dpsuttonno worries. i honestly didn't know about how paredit did that but i honestly never type closing parens ha#2021-10-1920:53pezThat's another Calva feature, actually, to not fold the trailing paren in a rich comment form. #2021-10-1920:53Derekhaha#2021-10-1920:53Derekwonderful#2021-10-2107:12Christian JohansenAfter jack-in-cljs, and then opening the app in a browser I often get this exception:
1. Unhandled clojure.lang.ExceptionInfo
Expected REPL Connections Evaporated!
{:type :js-eval-exception,
:error
{:status :exception,
:value "Expected REPL Connections Evaporated!",
:stacktrace "No stacktrace available."},
:form (set! cljs.core/*print-namespace-maps* true),
:js "(cljs.core._STAR_print_namespace_maps_STAR_ = true)"}
This results in no working figwheel REPL in cider, but the rest of the figwheel process works as expected (e.g. it still compiles and reloads). Any pointers to some options I can tweak to avoid this?#2021-10-2107:13Christian Johansen(This might be better directed at #figwheel-main, I’m not exactly sure)#2021-10-2115:37Christopher MilesI'm having problems with Emacs and Cider on Windows using a deps.edn file, I was wondering if anyone else had issue with this combination. We have an alias in this project called "dev" that includes the paths to the project source but I can't seem to get Cider to set that path. I can try to edit the command, but it's a big blob of base64 encoded text.#2021-10-2116:02vemvI can't help much here however you might have better luck by launching a nrepl (+ cider-nrepl, refactor-nrepl) process from a terminal and then running cider-connect against that
It's a more transparent approach if just a little more manual#2021-10-2116:10Christopher MilesYes, you are correct: that's the only thing that's worked for me so far. The "escaping quotes" section on the clj-on-windows project page kind of hints that something nutty is happening.
https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows#escaping-quotes#2021-10-2116:27vemvI'd guess that not many maintainers hack on Windows so you might find something interesting / PR-able by inspecting the source and evaling various forms in an Elisp repl.
Else you can always report an issue over GH#2021-10-2117:53Christopher MilesI can't seem to make it work, I wonder if there's something weird happening that is preventing it from seeing the deps.edn file. I did submit an issue. 🙂
https://github.com/clojure-emacs/cider/issues/3079#2021-10-2119:12Christopher MilesThanks @U45T93RA6, setting the cider-clojure-cli-aliases variable did resolve my problem.#2021-10-2115:46richiardiandreaHi folks, I am trying to install clj-refactor from source but I have some problem finding the inflections package's source - where does the project live?#2021-10-2115:47richiardiandreaOh it might be buried in this one
https://github.com/eschulte/jump.el/tree/55caa66a7cc6e0b1a76143fd40eff38416928941#2021-10-2116:43richiardiandreaHi there, today is nrepl day.
I thought I knew how to do this but when I start nrepl this way
(nrepl-server/start-server :port port
:address bind-address
:middleware [#'cider.nrepl/cider-middleware #'refactor-nrepl.middleware/wrap-refactor])
I get the warnings that functions may not be available...
I tried symbols as well to no avail, is there anything there obviously wrong I am doing?#2021-10-2116:50richiardiandreaOh, did :middleware disappear on start-server?#2021-10-2116:50richiardiandreaOh, did :middleware disappear on start-server?#2021-10-2116:50dpsuttonits not there. i think you create a handler with middleware#2021-10-2116:52dpsuttonfor your handler i think you want cider.nrepl/cider-nrepl-handler#2021-10-2116:52dpsuttonwhich is just
(def cider-nrepl-handler
"CIDER's nREPL handler."
(apply nrepl-server/default-handler (map resolve-or-fail mw/cider-middleware)))
#2021-10-2117:04richiardiandreaThis is what eventually worked:
(def custom-nrepl-handler
"We build our own custom nrepl handler, mimicking CIDER's."
(apply nrepl-server/default-handler (conj cider.nrepl.middleware/cider-middleware 'refactor-nrepl.middleware/wrap-refactor)))
The fact is that cider-middleware is actually middleware*s* and you need to add the refactor-nrepl one to it#2021-10-2117:18vemvprobably we should have an 'official' snippet for this, or if it's around in the docs already it should be more easily discoverable.#2021-10-2117:30richiardiandreaPR is ready 😄
https://github.com/clojure-emacs/refactor-nrepl/pull/341#2021-10-2117:18vemvprobably we should have an 'official' snippet for this, or if it's around in the docs already it should be more easily discoverable.#2021-10-2117:30richiardiandreaPR is ready 😄
https://github.com/clojure-emacs/refactor-nrepl/pull/341#2021-10-2210:32Luis SantosHi everyone,
I keep getting the following error while trying to jackin a cljs session:
ArtifactResolutionException Could not find artifact refactor-nrepl:refactor-nrepl:jar:3.0.0alpha13 in central ()
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:422)
org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)
org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:338)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
Caused by:
I looked online and the version is 3.0.0-alpha13 instead of 3.0.0alpha13. Am I doing something wrong? How do I change the version used by cider to jackin? cider-shadow-default-options?
https://mvnrepository.com/artifact/refactor-nrepl/refactor-nrepl/3.0.0-alpha13
Thanks#2021-10-2210:47vemvcan you confirm that evaling cljr-injected-middleware-version returns the right version?#2021-10-2210:47vemvafter that, are you using deps.edn or Lein?#2021-10-2210:59Luis Santosneither I'm just using shadow-cljs#2021-10-2211:03vemvI don't know much about how that works, can try helping though (I maintain refactor-nrepl etc)#2021-10-2211:03vemvwhat does cljr-injected-middleware-version eval to?#2021-10-2211:05vemvanother nice one to eval is cider-jack-in-lein-plugins (shadow uses that variable despite the "lein" naming)#2021-10-2211:20vemvAlso there's a good chance that the jack in command is logged to your *messages* buffer or a similar one#2021-10-2510:34vemvStarting from this morning there's refactor-nrepl 3.0.0 (no more alpha!) which should, among other things, fix your problem#2021-10-2507:13dakraMaybe it's useful for some.
I wrote a simple cider-jack-in-babashkafunction that's handy when you want to have a repl quick:
(defun cider-jack-in-babashka ()
(interactive)
(let* ((default-directory (project-root (project-current t)))
(port (+ 1024 (random 5000)))
(params `(:host "localhost"
:port ,port
:project-dir ,default-directory)))
(start-process-shell-command "babashka-nrepl" "*babashka-nrepl*"
(concat "bb nrepl-server " (number-to-string port)))
(sleep-for 0.5)
(cider-connect-clj params)))
#2021-10-2507:55borkdudeThis seems useful to contribute to the http://book.babashka.org nREPL section#2021-10-2508:21dakraShould I make a PR or you want to just add it?
Also, if someone has a better idea to find a free port and check when the babashka process is really running please say 🙂
random port and just sleeping for 0.5 seconds doesn't sound ideal but was enough for me personally.#2021-10-2508:45borkdudeA PR is fine or just an issue#2021-10-2513:05bozhidar@UFAP0C8KU If the server writes the port you can just wait a bit a read it from the .nrepl_port file (or however it was named).#2021-10-2513:06bozhidarOr you can just extract it from the server output, as we do for the Clojure nREPL server.#2021-10-2513:07bozhidarAnyways, at some point I should add something similar to CIDER.#2021-10-2513:10dakraThanks. I think parsing it from the output is a good idea. Then I don't need the sleep kludge as the server should be ready when I'm able to read the port.#2021-10-2513:12dakra@U04V15CAJ is there a simple way to start babashka on the command line to always start on a free port (e.g. if 1667 is already in use, just use 1668 etc)? I don't really want to use a bb.ednas described in https://book.babashka.org/#_nrepl#2021-10-2513:26borkdude@UFAP0C8KU yes, use port 0#2021-10-2513:28dakraVery nice. I'll update my snippet tonight.#2021-10-2513:58solfI have one similar:
(defun my-babashka-connect--process-filter (proc string)
"Run cider-connect once babashka nrepl server is ready."
(when (string-match "Started nREPL server at .+:\\([0-9]+\\)" string)
(cider-connect-clj (list :host "localhost" :port (match-string 1 string))))
;; Default behavior: write to process buffer
(internal-default-process-filter proc string))
(defun my-babashka-connect ()
"Start babashka on a random port."
(interactive)
(let ((port (+ 1230 (cl-random 300))))
(set-process-filter
(start-process "babashka"
"*babashka*"
"bb" "--nrepl-server" (number-to-string port))
'my-babashka-connect--process-filter)))
(defun my-babashka-quit ()
"Quit cider and kill babashka process."
(interactive)
(cider-quit)
(kill-process (get-process "babashka"))
(message "babashka is kill"))#2021-10-2513:59borkdudeWe could also post this on the babashka wiki if there not a single right approach (the wiki is open for anyone to post)#2021-10-2513:59borkdudeor ... someone can make a babashka elisp package ;)#2021-10-2514:00solfMaking a PR for CIDER is probably the way to go?#2021-10-2514:00borkdudeyeah why not#2021-10-2514:26dakra@U7S5E44DB nice, that looks like something I would have ended up with anyway. Just that port number can be 0 now instead of random.
And an improvement would maybe to remap cider-quit to your babashka quit function.#2021-10-2514:27dakraFor cider itself there is already an open issue https://github.com/clojure-emacs/cider/issues/2947
But if I read it correctly the plan is to not add a special babashka jack-in function#2021-10-2516:36bozhidarMy point was that I was hoping we could detect that something is a babashka project and use the existing jack-in function which simply runs bababashka's nREPL server then.#2021-10-2516:37bozhidarSeems like a better user experience than one more function that people will have to know about, but I don't have any fundamental issues with a dedicated babashka command.#2021-10-2520:00richiardiandreayeah agree with Bozhidar, we could detect if the project contains bb.edn IIRC we do a similar thing for Shadow Cljs#2021-10-2520:05dakraJep, I agree. One jack-in command where someone can choose the repl backend(?) is probably more user-friendly.#2021-10-2520:10dakraBut lets start with putting a simple command in the babashka wiki or http://book.babashka.org
This is basically the version from @U7S5E44DB but with port 0, the default directory is set to the project root and it should work over tramp (untested):
(defun cider-jack-in-babashka ()
"Start an babashka nREPL server for the current project and connect to it."
(interactive)
(let* ((default-directory (project-root (project-current t)))
(process-filter (lambda (proc string)
"Run cider-connect once babashka nrepl server is ready."
(when (string-match "Started nREPL server at .+:\\([0-9]+\\)" string)
(cider-connect-clj (list :host "localhost"
:port (match-string 1 string)
:project-dir default-directory)))
;; Default behavior: write to process buffer
(internal-default-process-filter proc string))))
(set-process-filter
(start-file-process "babashka"
"*babashka*"
"bb" "--nrepl-server" "0")
process-filter)))#2021-10-2520:11borkdudePerhaps start with wiki so we can tweak the code easier, and we can link in the book to the wiki#2021-10-2520:11borkdudehttps://github.com/babashka/babashka/wiki/
Shall we add an emacs page there?#2021-10-2520:13dakraOk. I think that's a good idea.#2021-10-2520:13borkdudeok, go ahead#2021-10-2520:16dakra@U0C8489U6 the thing with bb.edn is that it's not always there. And the main reason I even wrote this snippet was that often I simply wanted a quick repl to experiment in my project. Now I can just create a buffer playground.clj and M-x cider-jack-in-babashka and I have a working nrepl session in my editor in milliseconds preloaded with lots of useful libs to manipulate all kinds of files etc 🙂#2021-10-2520:24richiardiandrea@UFAP0C8KU I see yeah that makes sense for random stuff. I am actually using both in project and random...however for the latter use case I have this in my conf and connect directly:
(cider-known-endpoints '(("localhost" "1667") ;; babashka
("localhost" "5555") ;; common
))#2021-10-2520:25dakraCould probably use more text but here's a start: https://github.com/babashka/babashka/wiki/GNU-Emacs#2021-10-2508:17bozhidarFYI - I plan to cut CIDER 1.2 in a week or two, so now's a good time to test the current master. It seems to be in a good shape overall, but a bit of extra testing never hurts. 🙂#2021-10-2520:40dakraI just saw https://github.com/babashka/neil/blob/main/neil#L2
and made https://github.com/clojure-emacs/clojure-mode/pull/604 so that's not necessary anymore. I would say bb is unique enough for us to always add to interpreter-mode-alist when the user has clojure-mode installed.#2021-10-2607:02bozhidarFYI - https://metaredux.com/posts/2021/10/26/clj-refactor-3-0.html#2021-10-2607:10javahippieI upgraded my packages yesterday (I’m using Doom Emacs, so doom upgrade), and now I get an error when opening clj files or trying to launch cider: Error (clojure-mode-hook): Error running hook "clj-refactor-mode" because: (file-missing Cannot open load file No such file or directory cider-jar). Googling the error message did not help that much, do you have any pointers for me?#2021-10-2607:11vemvhttps://github.com/clojure-emacs/cider/blob/master/cider-jar.el is new, I'd make sure that your cider.el is the latest snapshot#2021-10-2607:14javahippieHmmm have to dig into that, everything regarding clojure and cider was managed by doom until now and I never had to do anything manually.#2021-10-2607:21bozhidarDid you restart Emacs after the package update? From time to time this fixes problems with package.el.#2021-10-2607:21bozhidarReinstalling packages manually also helps.#2021-10-2607:22javahippie@U45T93RA6 Thanks for the help, got a starting point! cider-jar.el is in the repository, that looks fine to me.#2021-10-2607:22javahippie@U051BLM8F Yes, Emacs was restarted. Also cleaned out the repositories folder and ran doom sync again#2021-10-2607:22vemvSame error?#2021-10-2607:22javahippieYes.
The cider repo in .emacs.d/.local/straight is on 0a9d0ef429e76ee36c34e116c4633c69cea96c67#2021-10-2607:24vemvDoes (require 'cider-jar) succeed in a repl? (or other Elisp eval command)#2021-10-2607:30javahippie> Reinstalling packages manually also helps.
That did the trick for me. I’d like to know the root cause and might look into it again later, but for now I needed everything to work again. Thanks for your help!#2021-10-2607:31vemvSounds good! Might have been cached byte compilation#2021-10-2607:32vemv(for which the fix is removing all .elc files recursively within .emacs.d prior to starting Emacs - it's always a harmless step)#2021-10-2607:34bozhidarI think removing a package also removes its bytecode, but I might be mistaken. At any rate - such issues with bytecode that didn't get properly recompiled are very common.#2021-10-2607:36javahippieMight fit these messages, I am just seeing right now?#2021-10-2607:36javahippie#2021-10-2607:38vemvdefinitely :)
I'd guess that those messages would go away on subsequent Emacs sessions as the code get compiled again#2021-10-2607:38javahippieHa, learned something. Will do the cleanup of .elc files as you suggested, thanks!#2021-10-2607:50vemv:) Perhaps doom or straight.el maintainers would appreciate an issue report so that they can improve .elc handling#2021-10-2608:04javahippieAbsolutely, will try to write down the steps I did and the results 👍#2021-10-2709:25CaseyMy cider repl sessions are crashing, but I'm not sure how to debug it. I'm REPLing away when all of a sudden my send-to-repl commands are failing because there "Is No Linked CIDER Session". I don't see any error messages anywhere... is there a way to enable logging or something to troubleshoot what's going on?
(I'm using Doom, cider-nrepl 0.27.2 and cider with https://github.com/clojure-emacs/cider/commit/0a9d0ef429e76ee36c34e116c4633c69cea96c67)#2021-10-2710:47bozhidar@ramblurr Have you seen https://docs.cider.mx/cider/1.1/troubleshooting.html ?#2021-10-2710:48bozhidarSession management is covered here https://docs.cider.mx/cider/1.1/usage/managing_connections.html#2021-10-2711:03CaseyThanks this is just what I needed, I'll start troubleshooting and see what's going on.#2021-10-2720:05richiardiandreaHi there, does cider-debug-function-at-point replace the var of the function? I am trying to debug a pedestal handler but I cannot seem to get it working...#2021-10-2720:37dpsuttonyes. i think the way it works is that instruments the forms by reevaluating with custom debugger code involved#2021-10-2720:45richiardiandreaThat explains it thank you - every time I refresh I have a new var and that debug info is lost - sounds good#2021-10-2720:47dpsuttonyeah. that's how you uninstrument a function, just re-eval it#2021-10-2801:29ericdalloI'd like to improve doom-emacs modeline icon where tells if cider is connected or not, I want to add a intermediate state telling if there is something being evaluated, is there any cider hook where I can rely on this?#2021-10-2801:30ericdalloso when cider is not connected the icon would be:#2021-10-2801:30ericdallowhen connected but never evaluated nothing or there is something being evaluated it would be:#2021-10-2801:31ericdalloand when connected and nothing evaluating/something was already evaluated:#2021-10-2801:32ericdalloI managed to make almost everything work using cider-connected-hook , cider-disconnected-hook , cider-mode-hook and cider-file-loaded-hook , but the latter is not totally reliable for the intermediate state#2021-10-2801:33ericdalloit'd be nice to have a pre-hook when cider is evaluating something and a pos-hook when it finished evaluated or it's cancelled#2021-10-2801:33ericdalloBTW this already work on doom-emacs without the intermediate state, I made it some months ago
My modeline:#2021-10-2801:34ericdalloWDYT @bozhidar? if you agree, would you accept an PR adding those hooks?#2021-10-2801:35ericdalloI see the hooks beeing important not for just modeline but anyone that would want to add some kind of UX feedback of cider state :)#2021-10-2801:51dpsuttonI thought these books existed and the spinner package was used for this#2021-10-2801:56ericdalloAFAIK the spinner is used only for lsp-mode#2021-10-2801:58ericdalloit seems cider has spinner indeed, but I never see it working, maybe doom disables it?#2021-10-2802:02ericdalloI think it's related with the spinner running on the repl buffer, and the repl buffer has no modeline#2021-10-2802:02ericdalloI managed to manually call cider code on my buffer and only this way works:#2021-10-2802:43dpsuttonah we use spinner in CIDER but it's hardcoded with no hooks#2021-10-2802:43dpsuttonhttps://github.com/clojure-emacs/cider/blob/master/cider-client.el#L207#2021-10-2802:45ericdalloyeah I saw that, but even so I never saw this spinner working, does it always work for you @U11BV7MTK?
I suspect doom-emacs does something that hides it#2021-10-2802:45dpsuttonand the stop messages:
• https://github.com/clojure-emacs/cider/blob/master/cider-connection.el#L159
• https://github.com/clojure-emacs/cider/blob/master/cider-debug.el#L349
• https://github.com/clojure-emacs/cider/blob/master/cider-client.el#L94#2021-10-2802:45dpsuttonbeen a while since i've used CIDER actually but yes it always worked#2021-10-2802:46dpsuttonyou can check the value of the var cider-show-eval-spinner#2021-10-2802:46dpsuttonif doom sets this to nil it will never show#2021-10-2802:46ericdalloI see, so probably a doom-emacs thing, anyway, I still think the hooks would improve how other can extend this behavior#2021-10-2802:46dpsutton100% agree on the hooks#2021-10-2802:46ericdalloit's true, I checked it#2021-10-2802:47ericdalloI checked every variable related to the spinner, all are on the default value 🤷#2021-10-2802:47dpsuttononly thing i can think of is there are packages that dimish things in the modeline and i bet they are getting swept up in that#2021-10-2802:47dpsuttonbut i forgot what its called#2021-10-2802:47ericdallo#2021-10-2802:47dpsuttonmight actuall be called diminish#2021-10-2802:48dpsuttonmaybe diminished-mode-alist#2021-10-2802:49ericdalloI have no variable or function with dimi as prefix :thinking_face:#2021-10-2802:50dpsuttonhmm. i bet there's another package that achieves the same thing. anything that claims to clean up the modeline. but this is all speculation#2021-10-2802:50ericdalloyeah, it makes sense#2021-10-2802:51ericdalloactually, doom-modeline is built-in on doom-emacs: https://github.com/hlissner/doom-emacs/blob/develop/modules/ui/modeline/+light.el
I remember I coded there adding that cider repl icon#2021-10-2802:52ericdallobut most doom-emacs people use the main modeline: https://github.com/seagle0128/doom-modeline
I already used both and saw people using both, and never saw that spinner#2021-10-2802:53dpsuttonif you turn off modeline-mode does it show up when you eval?#2021-10-2802:55ericdallothe modeline becomes huge 😂 I can't even know if it works#2021-10-2802:55ericdallobut I suspect it's there....#2021-10-2802:57ericdallo😂 yeah.. I'm used to keep only on the notebook without any extra monitor :man-shrugging:#2021-10-2802:57ericdallo14"#2021-10-2802:58dpsuttonyou'll need to kill some minor modes and hopefully it shows up#2021-10-2802:58dpsuttonhaha. i guess proving the point of why its so useful lol#2021-10-2803:00ericdalloCleaned some minor modes, but no spinner:#2021-10-2803:01dpsuttonits still not clear to me that you can see all of them#2021-10-2803:01dpsuttoni don't see any space indicating the list has ended#2021-10-2803:01dpsuttonusing the mouse can you click on them and choose which ones to see?#2021-10-2803:02ericdalloI think the repl one was the last, I cleaned some more:#2021-10-2803:03ericdalloYeah, I actually wrote that code @U8QBZBHGD 😅#2021-10-2803:03ericdallothis whole conversation was to have some hooks from cider to improve it even more :)#2021-10-2803:04dpsuttonif you do (require 'spinner) and then (spinner-start) do you see it now?#2021-10-2803:05dpsuttoni also see this in spinner.el:
(unless (and (listp mode-line-process)
(memq 'spinner--mode-line-construct mode-line-process))
(setq mode-line-process
(list (or mode-line-process "")
'spinner--mode-line-construct)))#2021-10-2803:05dpsuttoncheck those constraints? mode-line-process. although i guess that's just adding it to the list and ensuring not to re-add it#2021-10-2803:05ericdalloyes, running that works#2021-10-2803:06ericdallothis show the cider spinner corectly:
(spinner-start cider-eval-spinner-type nil
cider-eval-spinner-delay)#2021-10-2803:06ericdallobut that's the question, why it's not activating automatically#2021-10-2803:07ericdalloanyway, thanks for the help @U11BV7MTK, I'd still like to have my repl icon instead of the spinner#2021-10-2803:07dpsuttoni'm gonna look into this: maybe spinner start isn't built into all interactive eval handlers?#2021-10-2803:07dpsuttonright. i agree. but my thinking is that the places where spinner calls are would be the place to swap in the hooks and have spinner as the default on the hook#2021-10-2803:08ericdalloyes, agree#2021-10-2803:08dpsuttonso once spinner works for you you'll know that your change works when the spinner keeps working on the hook, and then unhook it and set your own icon on the hook and it'll almost 100% work#2021-10-2803:09dpsuttonanother thing to check, is define dummy functions for spinner-start and stop that just message "i was called and started" or whatever and see if CIDER is failing to call or spinner is failing to render#2021-10-2803:09ericdallogood idea, let me try#2021-10-2803:11ericdalloyeah, cider-spinner-start is being called for sure#2021-10-2803:12ericdalloprobably the buffer it's wrong, it's the repl one, not the active buffer where I'm coding :)#2021-10-2803:12dpsuttonwell that's frustrating#2021-10-2803:12dpsuttonoh maybe! i haven't seen CIDER in a while so i'm not actually sure which buffer lol#2021-10-2803:12ericdallowith a hook, I'll be able to listen to the hook on other buffers#2021-10-2803:12dpsuttonand you'll dabble a toe into the waters of multiple connections and figuring out which repl buffer is connected#2021-10-2803:13dpsuttonthat's an area where the workspace style editors are far easier: intellij and vs code. There aren't multiple projects open at once#2021-10-2803:13ericdalloyeah haha, I used the simple one https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/clojure/config.el#L105#2021-10-2803:14ericdalloyes, but that's one of the things I like emacs, I don't need multiple emacs :p#2021-10-2803:14dpsuttonagree. i really like that about emacs. but it does make that particular problem harder#2021-10-2803:14ericdallofor sure#2021-10-2803:15dpsuttonactually one thing i don't like about lsp. I often look into lots of other projects and that spins up lsp servers just by looking at a clj file. i wish it was opt in per proejct#2021-10-2803:15dpsuttoni have to remember to lsp-workspace-shutdown if i go look at clojure source code or core.match, etc#2021-10-2803:16ericdalloyeah, unless you opened the buffer from the current workspace which will open in a cache emacs folder using the same session, it will connect another session indeed#2021-10-2803:18dpsuttonyikes#2021-10-2803:19ericdalloyeah, maybe we could improve that on lsp-mode somehow#2021-10-2803:19ericdalloanyway, I'll go to bed now, thank you for the help and chat @U11BV7MTK @U8QBZBHGD#2021-10-2812:00bozhidarThanks one long thread! @UKFSJSM38 all sorts of improvements are more than welcome. 🙂#2021-10-2812:01bozhidarI also also thinking it'd be nice to have some indication about whether a ns was evaluated or not, etc, but never got to doing those.#2021-10-2812:35ericdalloThanks!
I'll try to open a PR adding those hooks so :)#2021-10-2812:36bozhidarBtw, what are you using to see the variable values in the minibuffer? That looks cool!#2021-10-2812:36bozhidarThat's another thing we can do for CIDER as well, although I'm not sure how it will look for bigger values. 😄#2021-10-2812:40ericdalloHaha, it's from doom-emacs I guess
It uses ivy via shortcut SPC h vshowing all variables and it's values#2021-10-2812:49bozhidarHmm, I used ivy for years and I never knew it could do this. Oh, well... 😄#2021-10-2812:50ericdalloHaha :man-shrugging: maybe some doom magic as well#2021-11-0101:25ericdalloreviewplease https://github.com/clojure-emacs/cider/pull/3084#2021-10-2812:33bozhidar@borkdude I think you'll like this - https://github.com/clojure-emacs/cider/commit/4ba36bccd2fc7b5da1f0b5f156059bdf3391b2d1 🙂#2021-10-2812:34bozhidarI didn't have time to test it properly, but the code is pretty straight-forward, so I'm optimistic it will work. bb.edn made implementing jack-in support pretty simple.#2021-10-2813:08borkdudew00t! @bozhidar thank you!#2021-10-2813:09borkdude@bozhidar just checking. does this assume anything about anyone writing an .nrepl-port file?#2021-10-2813:26bozhidarNo, it just assumes that you write the port to the terminal, the same wait that Lein does it.#2021-10-2813:27borkdude@bozhidar cool.
lein:
nREPL server started on port 63373 on host 127.0.0.1
#2021-10-2813:27borkdude$ bb nrepl-server
Started nREPL server at 127.0.0.1:1667
For more info visit:
#2021-10-2813:28borkdudethere is some code here that accounts for this:
https://github.com/babashka/babashka/wiki/GNU-Emacs#2021-10-2813:28borkdudenbb does it the way lein does (this time we could fix it in time)#2021-10-2817:59FiVoJust wanted to point you at the bb-jack-in @U07FP7QJ0 showed me a while ago. https://gist.github.com/plexus/5c27d643853c791685cede8b24fb854b#file-03_user_config-el-L35#2021-10-2819:37bozhidarYeah, it's trivial to have a dedicated command, but if we assume that most babashka projects use bb.edn, I think it makes more sense to make cider-jack-in-clj aware of babashka (which is what I did), than to introduce one more set of commands. Obviously with Emacs we always have infinite possibilities. 🙂#2021-10-2818:02FiVoDid anyone run into issues with dependencies and deps.edn aliases recently? I sometimes jack-in and it just doesn't find the deps from some alias. No change in code. I jack-in again and it works. I can't reproduce it reliably. I also don't know if it is some cider issue or lower down. My dir-locals.el mostly contains something like (cider-clojure-cli-global-options . "-A:dev:test:build")#2021-10-2818:10vemvNothing comes to mind, however if the issue is flaky, perhaps tools.deps own caching .cpcache is into play#2021-10-2818:32Alex Miller (Clojure team)this can happen if you are using local deps#2021-10-2818:32Alex Miller (Clojure team)cache will not be recomputed if those change#2021-10-2818:33Alex Miller (Clojure team)(but I am working on a fix for this!)#2021-10-2820:25thomDoubt this is an issue but FYI you can specify aliases directly with cider-clojure-cli-aliases, instead of sending them as global options.#2021-10-2906:18FiVoOne project contains a local dep, but it was never a local dep I had issues with#2021-10-2912:20Alex Miller (Clojure team)Well it would be something transitive from a local dep so could be about anything#2021-10-2912:21Alex Miller (Clojure team)You should be able to fix it by using clj -Sforce from the command line (+ any aliases) #2021-11-0210:09FiVoNo seems to be a cider issue. Ran into it again a couple of times and the jack in command does not contain the aliases.#2021-11-0210:11FiVocider-clojure-cli-global-options seem to be nil in that case#2021-10-2822:44tomdAre :indents and :alias-map the only options that cider can send to cljfmt? I'd like to enable :remove-multiple-non-indenting-spaces? for cider's use of cljfmt, but adding it to the cider-format-code-options plist doesn't work. Is there another way or will this need a code change to cider?#2021-10-2910:42iarenaza@UE1N3HAJH Unfortunately only :indents and :alias-maps are currently supported. We'd need to change both cider--nrepl-format-code-request-map from cider-client.el in Cider code, and at least format-code-reply in Cider-nREPL code.#2021-10-2911:11tomdThanks @U8T05KBEW I thought as much. I may make a PR if I get around to it.#2021-11-0101:25ericdalloreviewplease https://github.com/clojure-emacs/cider/pull/3084#2021-10-2908:10pmooserI'm trying to use company mode everywhere for completions with cider ... but like in my clj repl buffer, if I do (ma and hit TAB, I get the standard emacs buffer completion. Is this likely to be a misconfiguration on my part, or is it because I'm trying to complete something starting with only 2 chars?#2021-10-2908:22FiVoHave not tried it:
(setq company-minimum-prefix-length 2)
#2021-10-2908:24FiVodefault is 3, I think#2021-10-2908:33pmooser@UL638RXE2 Thank you, that seems to have been it! I didn't stumble across that when reading docs and I was worried I had something messed up with my CIDER config.#2021-10-2917:43Imdad AhmedHow does cider work along with reader conditionals?
For ex. if i conditional require two different namespaces. Would cider correctly evaluate a function based on the loaded namespace?#2021-10-2917:47dpsuttonCIDER should be pretty transparent with this. If it works in Clojure it will work in CIDER#2021-10-2917:47dpsuttonare you observing any issues?#2021-10-2917:49Imdad AhmedYes it was my bad, i was doing something incorrectly. It worked as expected. Sorry for the false alarm 😕#2021-10-2917:50dpsuttonno worries 🙂#2021-11-0103:13anonimitorafHi guys
• We have machines dev1, dev2, devN running nREPL on the same port (7777)
• We sometimes need to connect to multiple machines and preferably not have to kill CIDER's nREPL connection before connecting to another machine
• Would it make sense to change nrepl--ssh-tunnel-connect such that it used a random unused local port (i.e. not just forward remote 7777 -> local 7777)?
I don't mind implementing this myself and making a PR, just wanted to sanity-check that the behaviour proposal makes sense#2021-11-0104:56dpsuttonThat sounds reasonable. Although writing up an issue and and posting a potential solution would be a good idea. Off the top of my head I don’t see why you don’t just connect to to the nrepl port on that machine directly#2021-11-0105:48anonimitorafRight, yea I'll do that. I can't connect directly because only way is through a bastion host#2021-11-0105:57dpsuttonah i'm surprised it works through cider. i figured you'd have to open those tunnels manually with the correct identify file#2021-11-0106:50anonimitorafI think it's because if you don't specify an identity file SSH commands default to id_rsa (which I use)#2021-11-0210:37kirill.salykinhi
I am using direnv emacs package (https://github.com/wbolster/emacs-direnv) which kinda handles local (to directory) env variables
but I cant access those vars from the cider (i can access them from the emacs tho)
please advice is there a way to access it from the cider?
thanks!#2021-11-0307:18zackteoHello! if I need to set JVM args : "-http://Djavax.net.ssl.trustStore=..." in IntelliJ where would I do that for cider in a lein project? I tried cider-clojure-cli-global-options but that doesn't seem to work#2021-11-0307:45zackteoOkay! I added a system var of JVM_OPTS which lein takes in and that worked out!#2021-11-0307:59vemvI'd recommend :jvm-opts over env vars
:jvm-opts are more composable, via Lein profiles#2021-11-0308:00zackteohmmmm, I tried :`jvm-opts` initially but it didn't quite seem to work#2021-11-0308:00zackteoHow do lein profiles work actually?#2021-11-0308:01vemvyou can learn about them here https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#2021-11-0308:02vemv:jvm-opts ["-.ssl.trustStore=..."] should work
the way you can debug it is by inspecting the resulting java process via ps aux#2021-11-0317:24plexusBlog post about nREPL/CIDER stuff. I actually wanted to blog about the work I've been doing on CIDER and related projects, but this turned into a separate exposition explaining where we are and what the problem is I'd like to see solved. (apologies for cross-posting with #news-and-articles) https://lambdaisland.com/blog/2021-11-03-making-nrepl-cider-more-dynamic-1#2021-11-0320:31richiardiandreaI was actually thinking of dropping our deps.edn stating tooling deps - thank you!#2021-11-0409:17bozhidar@plexus Great article! Looking forward to the next installment.#2021-11-0420:13Drew VerleeFollowing the instructions here https://docs.cider.mx/cider/1.1/cljs/shadow-cljs.html#starting-a-shadow-cljs-repl (like always) to start my shadow cljs app via cider-jack-in. Everything works as expected, except, when i val expressions in emacs it doesn't work. Nothing is returned, no error. How do i debug this?#2021-11-0420:43justinbarclayI've only ever used Shadow-CLJS with web apps. But to make sure, have you had a web browser connect to your shadow-cljs server/opened up your web app?#2021-11-0422:02vemvDoes the cljs repl buffer work?#2021-11-0423:04Drew Verlee@U45T93RA6 it does#2021-11-0504:41vemvwhat's the exact name of the feature that is failing again?#2021-11-0513:41Drew VerleeCider eval last expression#2021-11-0516:06vemvThis is the defun in question https://github.com/clojure-emacs/cider/blob/94aff28016c63e4567ceaa3ed1bb7ee9d8eedbbb/cider-eval.el#L914
> . How do i debug this?
I'd try to understand what it does internally, the defcustoms that affect it and learn recursively about its impl details#2021-11-0516:07vemvmaybe it's related to sesman, IDK, simply mentioning a usual suspect#2021-11-0713:22thomI've recently started getting errors with AVFS paths when following xrefs in CIDER (i.e. I have not ~/.avfs directory). I don't know what AVFS is or why CIDER thinks I'm using it, but I can't jump to symbols in library code anymore, and I'm not aware of having changed anything. Any ideas on how to debug this?#2021-11-0713:29vemvhttps://github.com/clojure-emacs/cider/commit/cf13fc0f32efe3e5339953cef2567a7da2dc36b5 might be the culprit, idk.
idk what avds is either
for these highly specific problems an issue is most welcome 🙏 cider#2021-11-0808:41David PhamI was wondering if anyone had some issue with cider-load-buffer with conditional reads and a clojure/jvm process? I get the error conditional reads are not allowed, so I resort to call cider-eval-buffer , is this expected? I am sorry if the question is trivial.#2021-11-0809:36vemvassuming the file is a .cljc one it does sound like a bug#2021-11-0810:14micoHello, does anyone happen to make https://github.com/metosin/testit work with cider ? (currently it obviously fires the error that says that there is no 'is' defined in tests)#2021-11-0810:16mico@U76D9RZRR?#2021-11-0810:18Kari MarttilaI think e.g. @U06QSF3BK is using Emacs / Cider. I'm a Cursive guy myself. 🙂
https://www.metosin.fi/blog/metosin-favorite-editors/#2021-11-0810:18viestiI now use clojure-lsp also! 🙂#2021-11-0810:19viestion metosin/testit
> https://github.com/metosin/open-source#project-lifecycle-model Deprecated: not actively maintained nor recommended for new projects#2021-11-0810:20viestibut if you have it already, might not be worth to replace#2021-11-0810:24mico@U76D9RZRR thanks for the redirect!
@U06QSF3BK ok interesting, may be I should try clojure-lsp too though currently everything seems to work fine with cider except tests currently.
Unfortunately have to support lots of testit-based codebase even it's deprecated.#2021-11-0810:25vemvperform walk/macroexpand-all on a deftest and see whether in fact is has an is somewhere
CIDER doesn't perform an heuristic, it just runs whatever you throw at it so it if contains an is (via macroexpansion), it should work#2021-11-0810:26mico@U06QSF3BK but from the clojure-lsp docs I got the impression that it tries to leverage cider's run-tests so I would end up with the same problem#2021-11-0810:26viestitoo fast reply, so clojure-lsp just static analysis#2021-11-0810:28micoThis doc says https://docs.cider.mx/cider/testing/supported_libraries.html
that cider run-test looks into metadata for filtering tests#2021-11-0810:31viestiI haven't used midje style things myself, and haven't used metosin/testit, which seems to use clojure.test, so would think that loading a namespace with vars created by deftest should still work with cider#2021-11-0810:31viestihave you loaded the namespace into repl?#2021-11-0810:34micoyes, I did and here is the macroexpand results:
(def
my-test
(fn* ([] (clojure.test/test-var #'my-test))))
may be I am doing something wrong (or not doing smth)#2021-11-0810:36micooh! suddenly it started to work, don't know what I did though :))
suuri kiitos @U06QSF3BK#2021-11-0810:36viestiEipä kestä! 🙂#2021-11-0811:02bozhidarYeah, that’s the magic link https://docs.cider.mx/cider/testing/supported_libraries.html#2021-11-0811:03bozhidarCIDER cares only that the clojure.test protocol being implement by some particular library and it should work fine.#2021-11-0811:09bozhidarI’ve avoided adding native support for different libraries as that’s a pretty slippery slope, plus in most cases you can easily run whatever tests you have in the REPL.#2021-11-0811:24micomakes lots of sense! though this midje reference forced me to look into the different direction (emidje) @U051BLM8F Thanks for the amazing package!#2021-11-0819:49bmaddyDoes anyone have tips on how to debug a shadow-cljs repl not connecting with cider-connect-clj&cljs? I end up with two clj repls. Here's what I'm seeing in *Messages*:
[nREPL] Establishing direct connection to localhost:50636 ...
[nREPL] Direct connection to localhost:50636 established
[nREPL] Establishing direct connection to localhost:50636 ...
[nREPL] Direct connection to localhost:50636 established
user-error: The shadow-cljs ClojureScript REPL is not available. Please check for details
Version info:
;; Connected to nREPL server -
;; CIDER 1.2.0snapshot (package: 20211108.621), nREPL 0.8.3
;; Clojure 1.10.3, Java 11.0.1
The project seems to be running fine. I see this in the js/console: shadow-cljs: #3 ready!
and everything at http://localhost:9630/dashboard looks fine (although I'm new to using shadow-cljs).
I'm just not sure where to look next. Does anyone know where I should look next?#2021-11-0819:51bmaddyOh, more info:
I'm choosing shadow-select on the :main build.
Some extra deps for the clojure repl:
{:extra-deps
{nrepl/nrepl {:mvn/version "0.8.3"}
refactor-nrepl/refactor-nrepl {:mvn/version "3.0.0"}
cider/cider-nrepl {:mvn/version "0.27.2"}}
:main-opts
["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}#2021-11-0820:07bmaddyWell, immediately after I post here I found this: https://shadow-cljs.github.io/docs/UsersGuide.html#_troubleshooting
Perhaps this is more of a shadow-cljs issue. I'll study this and maybe post over in #shadow-cljs if I still can't figure it out.#2021-11-0821:05pithyless@U067Q76EP perhaps try:
M-x cider-connect - select localhost and the nREPL port. Then M-x cider-connect-sibling-cljs#2021-11-0821:05pithylessNot sure if that will be any different, but perhaps will bubble up a helpful error?#2021-11-0821:41bmaddyYeah, same issue. Thanks for the suggestion though.#2021-11-0821:48pithylessDo you have the appropriate :deps {:aliases [:your-alias]} in shadow-cljs.edn?#2021-11-0821:50bmaddyYeah, it's just this code with the :sql and :xtdb aliases deleted.
https://github.com/fulcrologic/fulcro-rad-demo#2021-11-0821:51bmaddyI shouldn't say "just" there. It's a pretty complex set of dependencies. I bet there's something wrong in there but I'm just not sure how to debug it yet.#2021-11-0906:30bozhidarThe error you’re getting seems to indicate that the shadow-cljs library is not loaded, as CIDER does a trivial check to see if something is around, so it can invoke code from it safely.#2021-11-0906:33bozhidar(defun cider-check-shadow-cljs-requirements ()
"Check whether we can start a shadow-cljs REPL."
(unless (cider-library-present-p "shadow.cljs.devtools.api")
(user-error "The shadow-cljs ClojureScript REPL is not available. Please check for details")))#2021-11-0906:33bozhidarBasically it’s a namespace check.#2021-11-0906:34bozhidarIf you think this has backfired for you, there’s a defcustom to disable such checks.#2021-11-0906:34bozhidarSee cider-check-cljs-repl-requirements.#2021-11-0909:52dakraThis sounds similar to this bug https://github.com/clojure-emacs/cider/issues/2946#issuecomment-768140666#2021-11-0922:18bmaddyI figured it out. It turns out I was connecting to a clj repl insterad of a cljs one. I thought I was supposed to connect to a clj one and it would start a cljs repl, but I was wrong.#2021-11-0922:23bmaddyWell, mostly figured out. cider-connect-clj&cljs only works with one of them depending on if I give it the clj port or the cljs port. I can call cider-connect-clj then cider-connect-cljs and that works.#2021-11-0916:55Drew VerleeI take it cider enlightenment mode doesn't work for cljs?#2021-11-0917:14bozhidarIt doesn’t.#2021-11-1122:45Drew VerleeCan i help get it there 🙂 . e.g is it documented why? i'm curious. It's a joy to have at times, when a function has a lot of vars mostly.
I miss it especially now that my backend is written in node.
Regardless, thanks again for you hard work. I need to up my contribution to the project.#2021-11-1518:16blak3mill3rIIUC, the way enlighten mode works is by adding an nrepl middleware which responds to cider eval ops by modifying the eval'd code to add instrumentation... that instrumentation, when executed, sends information back via nrepl messages specific to enlighten-mode. To support it in cljs would require achieving the same essential thing, and would have some additional complexity because the instrumentation (in cljs) needs to communicate values back to the cider client.#2021-11-1518:17blak3mill3rI also love cider-enlighten and missed it when working in cljs#2021-11-1004:06diego.videcoHey all. While using cljr-rename-file I am getting an EOF exception, but it is not very informative. My question is how can I find out which is the file that is making it throw.
cljr--maybe-rethrow-error: clojure.lang.ExceptionInfo: [line 587, col 1] Unexpected EOF while reading item 85 of list, starting at line 151 and column 1. {:type :reader-exception, :ex-kind :eof, :file nil, :line 587, :col 1}
I tried running cider-load-all-project-ns to see if something stood out, but everythig loads correctly.#2021-11-1009:43vemvwhich version of refactor-nrepl are you using?#2021-11-1014:47diego.videco2.5.1#2021-11-1014:49vemvThe 3.0.0 series makes these less likely because it analyzes/refactors far fewer irrelevant files :)
Just today we released 3.1.0
If you update clj-refactor.el to latest (3.1.0 or $snapshot), you'll get an updated refactor-nrepl with it as well#2021-11-1015:06diego.videcothanks, I'll try that#2021-11-1201:32diego.videcoJust as an update, it did work. Thanks @U45T93RA6#2021-11-1010:55BenjaminWhen I have clojure running and I change deps.edn (add deps) is there some easy way to pull stuff into the running program?#2021-11-1010:57vemvI believe that add-lib + running cider-nrepl 'standalone' (as opposed to cider-jack-in) should work
https://github.com/practicalli/clojure-deps-edn/blob/157a08ac8712fd544727302f7669789addac48a8/deps.edn#L178-L185#2021-11-1010:59Benjamingonna check it out#2021-11-1014:21practicalli-johnHere is an accompanying guide to using add-libs to hot load libraries
https://practical.li/clojure/alternative-tools/clojure-tools/hotload-libraries.html#2021-11-1113:23FlavaDaveI have a shadow-cljs reagent projects that builds when i run shadow-cljs watch app but when i run , ' cider-jack-in-cljs shadow i get the following error
error in process filter: parseclj: Syntax error: "At position 249, unmatched :rbrace"
anyone know what might be the issue?#2021-11-1114:04vemvcheck whether there's in fact an unmatched } somewhere
next would be to check whether you're running parseedn + parseclj latest#2021-11-1118:25FlavaDavethat was it! thanks!#2021-11-1420:45macrobartfastWhat’s the trendiest way to generate a reagent project that will play well with Emacs/cider?#2021-11-1420:45macrobartfastshadow-cljs is out there now, too… not sure if/how that all fits in now.#2021-11-1420:46macrobartfastI like to evaluate forms in terminal Emacs.#2021-11-1420:48macrobartfastlein… clj… etc… various options. I should say, what’s a trendy way… I’m sure there are a lot.#2021-11-1421:13macrobartfasttrying lein new shadow-cljs treefinder +reagent…#2021-11-1421:14macrobartfastand, from Emacs, cider-jack-in-clj&cljs.#2021-11-1421:33macrobartfastthat ran into the weeds… trying npx create-cljs-app myapp. UPDATE: that worked. Had to run yarn start, quit that, then cider-jack-in-clj&cljs from within Emacs and everything worked.#2021-11-1604:11stuartrexkingIs it possible to have css autocomplete from CLJS react components using :className key in cider? I’m using Cursive which doesn’t support this. I’m just wondering if it’s possible with emacs / cider.#2021-11-1612:17vemvIt sounds possible but I would bet it's not implemented.
If you wish to peek/hack, cider-nrepl's stack is Compliment (for pluggable completion sources) + Suitable (for a cljs-specific source: https://github.com/clojure-emacs/clj-suitable/blob/8ec4258709d3a41f3cdd51c646674e0dba80219d/src/main/suitable/compliment/sources/cljs.clj)#2021-11-1608:47Christian JohansenIs it possible to complete java methods with complete-symbol? If my cursor is at the pipe here: (.| (java.time.LocalDate/now)) can I somehow have type-appropriate completions? It feels like I’ve had this before, but I can’t get it to work now :thinking_face:#2021-11-1612:03vemvOne certainly can get high-quality Java completions. https://github.com/alexander-yakushev/compliment/ as embedded in CIDER is the responsible for this.
Whether things like (. or (-> will be parsed depends on compliment's impl.
If you can get some completions but others not, you can always report an issue / offer a PR in Compliment#2021-11-1612:04vemvhere's an example of something you can expect to always work#2021-11-1613:56Christian JohansenIt works as expected now 😮 I wonder what was going on earlier#2021-11-1613:56Christian JohansenWell, thanks 🙂#2021-11-1614:02Christian JohansenOk, I have a few follow-ups 🙂#2021-11-1614:03Christian JohansenThe reason it didn’t work earlier was that I did:
(.| (java.time.LocalDate/now))
in a REPL where java.time.LocalDate wasn’t imported. If I import LocalDate first, suggestions are available.#2021-11-1614:04Christian JohansenMy next question is this: I get a lot of suggestions for completions that aren’t relevant to the specific type. For instance, it suggests (.isRegisteredAsParallelCapable (LocalDate/now)), which isn’t possible. This happens even with a type hint in front of the object?#2021-11-1614:05Christian JohansenIf I define a var, then suggestions are type-appropriate#2021-11-1614:07vemv> If I import LocalDate first, suggestions are available.
I can't confirm or deny that :) in general I wouldn't expect import itself to make a difference, but maybe I'm wrong or it triggers a coincidentally-useful side-effect.#2021-11-1614:10vemvCompliment has partial support for observing type hints. IIRC it observes them for . but not -> . Personally I use a fork adding things here and there, I'll eventually wrap that up and contribute it upstream
Any issues you observe, probably would be welcome as Compliment issues. For making a particularly useful report you can even try reproducing it with a test case (that's in pure Clojure, doesn't need you to be a tooling expert)#2021-11-1614:12Christian Johansenok, I’ll report it, thanks 🙂#2021-11-1620:55vemvI see there are a couple open issues for . access, they lacked feedback from the people who reported it though#2021-11-1707:12Christian JohansenInteresting, I’ll pitch in#2021-11-1618:40João Pedro de Amorim Paulahello everyone, how are you all doing? i wanted to get some help because CIDER doesn't appear to be highlighting correctly the cljs.core namespace symbols on a project i'm working on. i tried running (cider-resolve-core-ns) on a cljs buffer, with the REPL running and all, but the return is always '(dict), while in clj buffers it returns the full dict object; i believe this is why it isn't highlighting the core symbols. i'm using shadow-cljs if that helps with anything#2021-11-1620:41vemvℹ️ clj-refactor.el 3.2.2 is out!
New: a couple defcustoms, which if tweaked, will match more closely Stuart Sierra's https://stuartsierra.com/2016/08/27/how-to-ns guide.
Doc here: https://github.com/clojure-emacs/clj-refactor.el/blob/v3.2.2/clj-refactor.el#L918-L935#2021-11-1913:39eval-on-pointis there an example somewhere showing how to use the "step in" function of the debugger? I can't seem to get it to work the way I would expect. In the below example, I would expect the debugger to allow me to step through the plus1 function if I step in, but for some reason it does not behave any differently from just stepping with "next".
(defn plus1 [x]
(+ 1 x))
#dbg
(defn add-one [x]
(plus1 x))
(add-one 2)
#2021-11-1916:07practicalli-johnAdd debugging on the plus1 function as well, otherwise it will just return the result when called from add-one#2021-11-1918:11eval-on-pointah, so what is the point of step in? I supposed that it would instrument the next function-to-be-called for me#2021-12-0614:26jumarI'm not sure about this particular example but step-in typically works as expected and you don't need to instrument the function you want to "step in".
In this case, it might be that the implementation of plus1 is so trivial (perhaps combined with it using clojure.core/+ fn? ) there's no place in it to step in#2021-11-2017:58Drew VerleeIs there a way to get cider to return/show the value of a pull from a core.async channal? right now i get object[cljs.core.async.impl.channels... ] but if i bind that value and tap it then i get the value.
This might be more of a core async question actually, maybe you have to bind the value?#2021-11-2020:15lilactownYou mean like this?
(<!! chan)
#2021-11-2020:16lilactownthat should display the value on chan. it sounds like you might be doing this inside of a go block and evaluating the go block, which returns a channel#2021-11-2020:24Drew Verleeyes, thats correct. let me think about whats going on here more.#2021-11-2205:51macrobartfastI’m trying to create a single project with a clj backend and a cljs frontend… hence I have both a deps.edn and a shadow-cljs.edn (don’t know if that’s correct)… when I cider-jack-in-clj everything works on the clj side… when I cider-jack-in-cljs everything works on the cljs side… but when I cider-jack-in-clj&cljs the clj side has numerous compilation problems on the requires of the first namespace I evaluate… thoughts?#2021-11-2205:54macrobartfastupdate: I also don’t get a cljs repl apparently when using cider-jack-in-clj&cljs.#2021-11-2206:01dpsuttonjack-in-clj&cljs is when you can create a clojure and clojurescript repl in the same process. since you are using shadow you cannot do this. because shadow is a separate process from your clojure backend process#2021-11-2206:03dpsuttonfor instance, if you were using figwheel-main, you would start up two repls, and in one you would just require figwheel.main.api or whatever the namespace is that cranks up the cljs stuff. and then you have "upgraded" one of the clj repls into a cljs repl. but for your setup you start two different programs so this technique won't work for you#2021-11-2206:03dpsuttonthat function has probably caused more confusion than benefit and perhaps removed. just start your two repls independently because they are independent#2021-11-2206:08macrobartfastThis is so helpful! Thank you for helping me to understand this.#2021-11-2206:12dpsuttonat the top of the repls should be a startup command and a command that turns your cljs repl into a cljs repl. I put those in the startup text to take some of the mystery out of the tooling. I think if you see those two you'll get some more insight why this doesn't work#2021-11-2206:28macrobartfastah cool… lemme look at that now.#2021-11-2206:31macrobartfastAh, yep… that’s really helpful, actually.#2021-11-2206:34macrobartfastAnd using cider-drink-a-sip now since reading about it there. 🙂#2021-11-2211:03bozhidar@macrobartfast That's the greatest, yet most underappreciated command in all of CIDER!#2021-11-2214:20Leah Neukircheni wish M-x cider-connect had an own history ring for the port number...#2021-11-2214:41bozhidar@leah I guess this should be easy to implement. I typically connect to a locally running server instance, that's why I never thought much about storing the ports (in my case they are typically random). I guess this also makes a lot of sense for remote hosts. Feel free to file a ticket on the subject.#2021-11-2218:06Leah NeukirchenYeah, I guess I could let it autoconnect too. Thanks!#2021-11-2214:44bozhidarBtw, have you seen this:#2021-11-2214:44bozhidar(setq cider-known-endpoints
'(("host-a" "10.10.10.1" "7888")
("host-b" "7888")))#2021-11-2214:45bozhidarMight be useful in your use case (assuming you want to connect to the same port on the same host).#2021-11-2217:32Carsten BehringDo people here have an opinion on the role of Emacs in the upcoming "wave of devcontainers" paired with "in-browser software development" ?
In this, every open-source project will configure "centrally" one development setup (including tools + IDE + IDE configuration).
This does match badly IMHO with Emacs (technically and philosophically), unless we address this.#2021-11-2220:22solfIs there such a wave coming? 😱#2021-11-2220:23solfIs it about something like the gitpods from github? (not 100% sure about the name)#2021-11-2220:23solfgitpods do not force a specific IDE if I remember correctly#2021-11-2307:34bozhidarI see value in using containers for local development, but I don't see much value in forcing people to use specific development tools.#2021-11-2316:35justinbarclayI hope I never have to worry about that issue. But, there has been some work done getting emacs working on gitpods: https://github.com/emacs-lsp/lsp-gitpod#2021-11-2920:57Carsten BehringOne way to address this in Emacs would be to have a way to support "devcontainers".
There is not accepted standard yet, but VSCode specifies a "json file", which allows (VSCode for teh moment) to build automatically an Docker image from a Dockerfile and it runs on startup commands on it,
so you get a docker container running, with all tools installed inside.
Big parts of that json file are independent of VSCode or any IDE, so could be in theory used cross IDE.#2021-11-2920:59Carsten BehringDocker is not a big subject for Clojure development thanks to the JVM.#2021-11-2217:34Carsten BehringAnd companies might then follow.#2021-11-2223:00CarnunMPHmm, maybe I should have asked https://clojurians.slack.com/archives/C053AK3F9/p1637621834098200 here? 🙂#2021-11-2307:35bozhidar@carnunmp I assume that if you don't see the output in your REPL/source buffer they ended up in the server process's buffer. If you search in CIDER's issues you'll see a few tickets explaining why output from threads in tricky to deal with.#2021-11-2308:11CarnunMPI'll take a look. Thanks!#2021-11-2423:18Brandon OlivierIs there a way to combine 2 connections into one with sesman via cider? I haven’t found a straightforward way to run my shadow-cljs server with the sibling command#2021-11-2500:03Brandon OlivierI think I’ve mostly figured out how to get what I want with a combination of dir-locals and the custom cljs repl combined with the combo jack-in command#2021-11-2911:33paulspencerwilliamsSo, I’ve been successfully using cider-debug-defun-at-point to allow me to debug functions. However, I’ve been trying to set breakpoints at certain locations within a function to allow me to skip noisy sections. This works fine in a toy project.
(ns test-dbg.core)
(defn foo
"I don't do a whole lot."
[x]
#dbg (println x "Hello, World!"))
(foo 3)
But doesn’t work in my work project when debugging a http request.
(defn- return-something
[dep1 blah
#dbg
(when blah
The function evaluates successfully but the breakpoint doesn’t invoke the debugger. I’ve tried #break too? What am I doing wrong?#2021-11-2912:21SophieThe function is not called from the repl, right? I had the same problem and my guess is that cider does not get an answer from the repl for asynchronous function calls and thus does not know of the execution of the function. But that's just a guess as I didn't have the time to look into the implementation yet.#2021-11-2912:22bozhidarYeah, I recall there was some sporadic issue with async evals, but I think it was fixed a while ago.#2021-11-2912:22SophieTip: execute the function you want to debug manually or from a test.#2021-11-2912:23bozhidarSee https://github.com/clojure-emacs/cider-nrepl/pull/695#2021-11-2912:39paulspencerwilliams@U02MWDCU3U6 before the function evals from a http request or instead of?#2021-11-2912:41SophieI do it instead of#2022-09-0611:32Dmitri AkatovIt looks like this still does not work as of cider-nrepl 0.28.5 ? I mean starting to debug on an “asynchronous” call to a function marked for debugging (e.g. on an http request)?#2021-11-2912:21bozhidarDid you start the project from the same REPL you've connected CIDER to?#2021-11-2912:32paulspencerwilliamsYeah, same REPL :thumbsup:#2021-11-2912:21bozhidarThat's pretty much the only thing you need to do for this to work.#2021-11-2915:46paulspencerwilliamsSo, after further investigation, I can now use #dbg in a function that I eval using C-x C-e . However, this does not work if I eval the function using C-c C-k which is what I was doing prior.#2021-11-2915:54dpsuttonare you saving the buffer?#2021-11-2915:56paulspencerwilliamsYeah.#2021-11-2915:59dpsuttonwhich functions do these key chords invoke? I’m assuming eval last expression and load-buffer?#2021-11-2916:06paulspencerwilliamsYeah!#2021-12-0102:22quollI’ve finally decided that I can’t rely on a console repl for ClojureScript on node anymore, and I’m trying to use Cider, since that’s what I use with Clojure.
Unfortunately, I haven’t been able to make it work.
I’ve added cider/piggieback to my deps.edn, and added the recommended alias:
:aliases {:cider-cljs {:main-opts ["-m" "nrepl.cmdline" "--middleware"
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}
Then when I use M-xcider-jack-in-cljs I give my desired repl as node
This responds with a banner, and finishes with:
;; Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.26.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:cider/nrepl
;;
;; ClojureScript REPL type: node
;; ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))
;;
user>
So I type: (+ 2 3) to see if it works, and I get:
TypeError: Cannot read property 'error__GT_str' of undefined
at Socket.<anonymous> ([stdin]:89:28)
at Socket.emit (events.js:400:28)
at Socket.emit (domain.js:470:12)
at addChunk (internal/streams/readable.js:290:12)
at readableAddChunk (internal/streams/readable.js:261:11)
at Socket.Readable.push (internal/streams/readable.js:204:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
at TCP.callbackTrampoline (internal/async_hooks.js:131:17)
So now I’m stuck. Any advice is welcome please.#2021-12-0102:35Drew Verleedo you have to run the init form it suggets? (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))#2021-12-0102:36quollwell, I’ve since discovered that I don’t have to type anything and I get that stack trace after a few seconds#2021-12-0102:36quollgiven that (+2 3) doesn’t work, then I don’t think that form will do anything#2021-12-0102:37Drew Verleeright#2021-12-0102:37quollI just tried anyway, because I really don’t know what I’m doing… but no, nothing happens.#2021-12-0102:38DerekAre you activating your :cider-cljs alias?#2021-12-0102:39quollI don’t understand that question, sorry#2021-12-0102:39DerekThe startup command:
Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.26.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:cider/nrepl
doesn’t seem to have the :cider-cljs alias within it#2021-12-0102:39Drew Verleewhen you run cider-jack-in-cljs it won't run with the :cider-cljs alias you setup unless you add it to your dir locals file#2021-12-0102:39Derek^ this#2021-12-0102:40DerekYou can manually insert it by C-u M-x cider-jack-in-cljs#2021-12-0102:40Derekand inserting it#2021-12-0102:40Derekor .dir-locals#2021-12-0102:41DerekI believe I set ~cider-clojure-cli-global-options~ in the .dir-locals file#2021-12-0102:42DerekBut I think the prefix argument (C-u) would be a good first try#2021-12-0102:42Drew Verleein your project root you would add the file ".dir-locals.el"
((clojurescript-mode
(cider-clojure-cli-aliases . "-A:cider-cljs")
)))
docs: https://docs.cider.mx/cider/config/project_config.html#2021-12-0102:42Derekoh even better#2021-12-0102:42Drew VerleeI think, i manage to always F it up though 😢#2021-12-0102:43Drew VerleeFWIW, i don't know if that will fix things. I always start clojure script through shadow#2021-12-0102:47quollOK, I’ve tried this, but to no avail#2021-12-0102:47DerekDid you see the alias in the startup command?#2021-12-0102:47Derek-M:cider-cljs:cider/nrepl is what we’re hoping to see#2021-12-0102:48quoll;; Startup: /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.26.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:cider-cljs:cider/nrepl
;;
;; ClojureScript REPL type: node
;; ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))#2021-12-0102:48quolllooks like the command was updated, but not the aliases. I don’t know how they get updated?#2021-12-0102:48quollevidently not my deps.edn :)#2021-12-0102:49DerekI wouldn’t expect to see your project alias in the aliases map#2021-12-0102:49Derekthose are the injected ones from CIDER#2021-12-0102:49Derekthat command, to my eyes, looks correct#2021-12-0102:51DerekI think, unfortunately, we’ve solved a problem, not the problem#2021-12-0102:51quollMaybe I just need to learn how to use shadow#2021-12-0102:53Drew Verlee[stands up on a desk]
My name is drew verlee. i have been doing cljs development for like 3 years on and off, i have no idea how to get a cljs repl running correctly without shadow or figwheel.#2021-12-0102:54Drew Verleei await someone to be along shortly and show me a one line of code to do it.#2021-12-0102:57quollI started setting up shadow on a test project earlier, but hadn’t actually done anything with it. I just tried it now. Worked perfectly#2021-12-0102:57quollSo… apparently shadow is what I’m using from now on#2021-12-0103:01quollNope… spoke too soon. I have a working repl, that’s true, but I can’t load namespaces#2021-12-0109:41thhellermaybe to clarify how things work in shadow-cljs. shadow-cljs itself is written in Clojure so the default REPL you start out with is CLJ. From there you can control shadow-cljs itself, all via CLJ. One thing you can do is select/switch your CLJ REPL to a CLJS REPL. either that is coupled to a build or not#2021-12-0109:42thhellerfrom the command line for example you can do shadow-cljs clj-repl which connects you do the CLJ REPL. in there you can run (shadow/node-repl) which will switch that REPL to CLJS running in node#2021-12-0109:42thhelleror (shadow/browser-repl) or (shadow/repl :your-build-id)#2021-12-0109:43thhellerthat is basically what you need cider to do. Can't tell you how but I believe you got it to work in the end#2021-12-0109:44thhellerso the "can't load namepaces" likely means you are still in a CLJ REPL that needs to be switched#2021-12-0109:44thhellerall the other CLI commands also basically directly translate to REPL commands#2021-12-0109:44thhellershadow-cljs clj-repl (shadow/watch :my-build) same as shadow-cljs watch my-build only that you still have a open REPL connection to do more (eg. start another build, stop it, etc)#2021-12-0111:53quollIt was my mistake… I was running emacs in the wrong project. It contained identical files, so I hadn’t realized that I was in the wrong place. Very embarrassing 😳#2021-12-0103:02quollC-c C-k says that it’s loading the file, but then it just sits there. If I look at any symbols (it’s test file with a single defn in it) then they’re not defined#2021-12-0122:11Drew VerleeI started by repl via cljs-jack-in-cljs selected my shadow config and the app rendered without error in my browser. I have my nrepl server buffer running telling me nrepl is on a port, and i havea repl buffer where i can type in commands.
However, cider eval last sexp does nothing and if tell cider to quit it tells me "no repls in the current session"#2021-12-0122:17dpsuttonput your cursor in the cljs repl and then try again?#2021-12-0122:17dpsutton(not a joke. i suspect this will fix it)#2021-12-0122:19Drew Verleeit doesnt#2021-12-0122:19Drew Verleeit says my repl is connected. it's like it goes through all the steps but doesn't establish the connection#2021-12-0122:20dpsuttonweird. is it possible you’ve navigated to a dependency or something? It sounds like everything is working but it doesn’t recognize the source buffer as being in the project that is connected to the repl#2021-12-0122:22Drew Verleeerr, ugh. i just had a half formed thought. I know why its happening in a vague way.#2021-12-0122:23Drew VerleeIt's on my end, not emacs or cider, but how the project is setup.#2021-12-0122:24dpsuttonare the sources in another directory?#2021-12-0122:24dpsuttonthere’s something like sesman link directory or equivalents that should hopefully help you correct all that#2021-12-0122:29Drew Verlee@dpsutton i think the namespaces are excluded in the compilation step. We have feature flags. When i switched to a different ns everything worked.#2021-12-0122:30dpsuttonwomp. well sounds like its for sure your end. and hopefully there is a workaround#2021-12-0320:13diego.videcoHello I am having trouble jacking in to a polylith project (not sure if it is due to it, I am new to the project). The trouble is actually that no dependencies are being loaded so getting things like: Could not locate io/pedestal/http__init.class, io/pedestal/http.clj .
The jack-in startup string is this:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta5"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl -A:dev:test
If I try to connect by launching a command line process with this string, then everything works fine:
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.27.2"}}}' -A:dev:test -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
Can anyone help me figure out what is going on?#2021-12-0320:23dpsuttoni don’t think this can work: -M:cider/nrepl -A:dev:test. If you use a prefix arg with jack in you can edit the string. If you instead edit it to be -M:dev:test:cider/nrepl does it work?#2021-12-0321:06Alex Miller (Clojure team)Would work if you swapped the order -M and -X consume all arguments after them so -A should go prior to be used#2021-12-0321:06Alex Miller (Clojure team)But putting them all with -M is better#2021-12-0321:27dpsuttonah that’s right. I think i used to prefer the “aliases” and then “main” style but it doesn’t really matter. and it gets confusing because -A still allows for main args from an alias so it doesn’t do what i thought it was doing anyways#2021-12-0320:25dpsuttononce that is confirmed, i think you can set
(defcustom cider-clojure-cli-aliases
nil
"A list of aliases to include when using the clojure cli.
Should be of the form `foo:bar`. Any leading \"-A\" or \"-M\" will be
stripped as these are concatenated into the \"-M[your-deps]:cider/nrepl\"
form."
:type 'string
:group 'cider
:safe #'stringp
:package-version '(cider . "1.1"))
to include those and it will work it out#2021-12-0320:26diego.videcoThanks, this works indeed (pretty new to tools.deps as well)#2021-12-0320:27dpsuttonso in a dir locals you’d include (cider-clojure-cli-aliases . "dev:test")#2021-12-0320:38diego.videcoSo then I can do cider-jack-in-clj? I am trying that without luck. I have the .dir-locals.el in the same directory as my deps.edn (never used .dir-locals.el so I am not sure if I am doing something wrong)#2021-12-0320:39diego.videcoI see this error though: Error reading dir-locals: (wrong-type-argument listp "dev:test")#2021-12-0320:52dpsuttonyeah that is just a snippet of the dir local#2021-12-0320:53dpsuttoni think
((nil
(cider-clojure-cli-aliases . "dev:drivers:drivers-dev:ee:ee-dev:user")))
is a full one you can use#2021-12-0320:53dpsuttonit’s an alist of modes to overrides. use nil to say “all modes”, and the override is the cli alias is “dev:test”#2021-12-0320:53dpsutton(i used our aliases here so substitute your own)#2021-12-0320:54dpsuttonthen you just cider-jack-in-clj. That’s the point of the dir-locals, in directories, these variables will be set.#2021-12-0322:17diego.videcoThanks a lot @dpsutton#2021-12-0322:19dpsuttonmy pleasure. glad you have it working#2021-12-0706:40jumarREPL started from a deps.edn file containing this definition for :jvm-opts doesn't seem to pickup the options - is this :cider/nrepl alias the correct way to pass them?
...
:aliases
{:cider/nrepl
{:jvm-opts ["-Djdk.attach.allowAttachSelf=true"
...
#2021-12-0706:42vemvFrom what I remember from a GH issue, :cider/nrepl is internal / not an API; instead you should define your own alias and make cider use it via a related defcustom#2021-12-0706:54jumarThanks, found cider-clojure-cli-aliases here: https://docs.cider.mx/cider/basics/up_and_running.html#clojure-cli-options
Also found this which suggests another approach: https://clojureverse.org/t/how-to-setup-deps-edn-project-with-cider/6375/6#2021-12-0707:05jumarI'm struggling to set it to proper value via customizer-variable - what is the proper syntax?
I tried dev, dev:, '("dev") , etc. but nothing seems to work#2021-12-0707:08vemvI know of a codebase that uses this (cider-clojure-cli-global-options . "-A:dev:test")
(note it's a different defcustom)#2021-12-0707:12jumarHere I've found a newer information: https://practical.li/spacemacs/clojure-projects/project-configuration.html
Ended up with this in .dir-locals.el:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . ":dev"))))
I couldn't make it work via customize-variable gui#2021-12-0713:28dpsuttonYou don't need that leading semi colon. Also, you only need to specify the preferred build tool if there are multiple tooling files (shadow-cljs.edn or project.clj files at the root as well)#2021-12-0714:48practicalli-johnNot using a leading colon is confusing, as it’s not the name of the alias. I always include the colon so it’s consistent with the normal use.
It seems cider adds an extra colon after the -M flag for some reason, but it still works#2021-12-0714:50dpsuttonah right. good call#2021-12-0714:51dpsuttonit adds an extra colon?#2021-12-0715:04practicalli-johnWhen I use an alias, for example ":dev:test" , as the cider-clojure-cli-aliases value, then in the command line that Cider generates when calling cider-jack-in-clj, that command ends with
-M::dev:test:cider-nrepl
I assume it works because the missing alias, the first colon by itself : , doesnt match anything, so is just ignored by the clojure command line program#2021-12-0715:08practicalli-johnI noticed this when I was editing the command before executing, using C-u (or SPC-u in spacemacs)
On my project at work I get the same result. This is the command from the buffer window after running cider-jack-in-cljs with a .dir-locals.el set to include ":env/develop:env/test"
Starting new CIDER session ...
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta5"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M::env/develop:env/test:cider/nrepl
[nREPL] server started on 34825
[nREPL] Establishing direct connection to localhost:34825 ...
[nREPL] Direct connection to localhost:34825 established
1#2021-12-0715:28dpsuttoni see. the string functions could use a little cleanup then. It does some trimming and needs to be updated to allow for a leading : on the cli aliases#2021-12-0716:53diego.videcoI want to add cemerick.pomegranate as a dev dependency (only for me) on a tools.deps project. What is the best way to go about it?#2021-12-0717:01dpsuttonthrow that dep in an alias in your ~/.clojure/deps.edn and add that when you jack in. you can manually edit the jack-in string with a prefix arg, or use dir locals in that project
((nil
(cider-clojure-cli-aliases . "pomegranate")))
or whatever you name the alias. that requires adding the dir-local to the repo, not sure if that’s already taken. another option is just to copy the startup command from the repl buffer at the top and then start it yourself on the command line with whatever aliases you want. This is the most straightforward way i think#2021-12-0717:02dpsuttonif you copy the alias the CIDER creates in-line with -Sdeps you can throw that into your ~/.clojure/deps.edn and then any project you can easily start up with ~~easy~~ simple. And you can then just cider-connect#2021-12-0721:16diego.videcoThanks again @dpsutton#2021-12-0801:22vemvthere's dir-locals2 which can be gitignored#2021-12-0723:00winsomewhat's the setting to make the repl not open a new window after cider-jack-in?#2021-12-0723:13fedregThis?
(setq cider-repl-pop-to-buffer-on-connect nil)
#2021-12-0802:01yubrshenHow can I tell if a long-running evaluation finishes?
In my emacs/Doom configuration, the evaluation of expression in cdier is asynchronous, when I submit to evaluate, I can still continue to use the emacs, but now, I have no way to tell if the evaluation completes or not.
What would be the way to tell? Thanks!#2021-12-0802:07yubrshenIt seems that once the evaluation is done, there will be a indication in the mini-buffer. Just trust, and be patient.#2021-12-0802:24anonimitorafReturn value gets shown like this?#2021-12-0802:26anonimitorafAlso, in the latest doom version, you should see a loader in your CIDER repl's modeline
e.g.
(require '[clojure.core.async :as async])
(do (async/<!! (async/timeout 5000))
(println "done"))#2021-12-0803:58vemvsounds like a Turing-undecidable problem to me :)
in practice you can wrap a slow sexpr in println so that it goes to your repl eventually, which seems a little more durable than the UI widget.
You also can inspect thread dumps (`Ctrl+\` , yourkit etc) and see if there's a thread named nrepl-worker-foo that is currently doing something related to your sexpr.#2021-12-0811:21bozhidar@yubrshen See also https://docs.cider.mx/cider/usage/code_evaluation.html#display-spinner-during-evaluation#2021-12-0914:18Benjamindeferred-update does cider somewhere keep a record of this being a macro? Not that bad but it's a function in my namespace#2021-12-0914:36bozhidarUnless it's hardcoded in clojure-mode, CIDER extracts the type of things from their var metadata. See track-state in cide-nrepl.#2021-12-1116:21diego.videcoIs there a way with clj-refactor to prevent the clean-ns function from running when moving a form to another namespace? Or more concretely is there way to prevent it from deleting unused exports in a namespace? I am using potemkin/import-vars in one ns, so the unused requires aren't really unused.#2021-12-1116:27dpsuttonwe have a trick for this at work. in the require you have [some-ns :as alias] and in the code do (comment alias/keep-me)#2021-12-1116:37vemv@diego.vid.eco I recommend removing it from the ns form and using (require ...) right below it.
ns is only sugar over require/`load` so there's no difference. There's a good chance other tools will also understand this pattern (clj-kondo does!)#2021-12-1116:38diego.videcothanks @vemv!#2021-12-1116:38borkdudeclj-kondo (and clojure-lsp) won't warn/touch unused requires when they have 1) no alias and 2) no refers#2021-12-1116:38borkdudeif they don't have 1 and 2 then it is assumed the namespace was required for side effects#2021-12-1116:40vemvyeah that's a difference relative to refactor-nrepl, which doesn't infer things from ns libspecs
In a way I like require , it seems very explicit/unmistakable#2021-12-1116:41borkdudeworks for JVM, not for CLJS#2021-12-1116:41vemvdon't quote me on this but doesn't cljs support require now?#2021-12-1116:42borkdudenot really. in the REPL yes, but in a file, perhaps only the first top level require, but not all over the place. don't also quote me on that#2021-12-1116:43vemvyeah I had the same in mind, first top-level#2021-12-1116:41borkdudebut then again, so doesn't potemkin#2021-12-1116:46dpsuttonThe top level requires might make some reloading code not function correctly. Both tools namespace and possibly require :reload-all#2021-12-1116:47vemvt.n for sure, that's a good call#2021-12-1116:47vemvhonestly I consider it a flaw that it doesn't try analyzing the whole source other than the ns form#2021-12-1116:48vemvcode in the wild not only can have top-level requires, but also conditional ones, which warrant a more advanced parsing#2021-12-1116:51borkdudeclj-kondo at least finds all top level namespace usages#2021-12-1116:52vemvBtw, an idiomatic solution for clj-refactor is setting https://github.com/clojure-emacs/clj-refactor.el/blob/363b95c5d2855abc93ac011e9adc778cf7a773e5/clj-refactor.el#L265-L273 in your dir-locals#2021-12-1317:51eggsyntaxHas anyone else run into a problem where adding a `.dir-locals.el` with tools.deps aliases results in cider-jack-in failing to create a REPL window, and instead dropping the prompt into the `*nrepl-server <project>*` namespace that typically just holds the repl startup logging? Here's the `.dir-locals.el` that's causing the problem (created with `M-x add-dir-local-variable`, so presumably syntactically valid):
((clojure-mode . ((cider-clojure-cli-global-options . "-M:logging:repl"))))
#2021-12-1317:53dpsuttoncan you see what the full startup command looks like? My guess is that no nrepl server is getting started so its just a regular repl and CIDER has no idea what to do with it#2021-12-1317:55eggsyntaxFor sure! It's
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} refactor-nrepl {:mvn/version "2.5.1"} cider/cider-nrepl {:mvn/version "0.25.5"}}}' -M:logging:repl -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor","cider.nrepl/cider-middleware"]'#2021-12-1317:57eggsyntaxThe odd thing is that if I just move the deps in those aliases to the main dependencies and remove .dir-locals.el, cider-jack-in starts up as expected.
The project has recently been switched from mount to integrant, and my guess is something about that is what's throwing it off.#2021-12-1317:57dpsuttonthat looks really weird. you’re on an older CIDER?#2021-12-1317:58dpsuttondo either of the deps logging or repl have main args in your deps.edn?#2021-12-1317:58eggsyntax1.0.0, so not too old.#2021-12-1317:58eggsyntaxIt does, repl is
:repl
{:extra-paths ["dev"]
:extra-deps {com.bhauman/rebel-readline {:mvn/version "0.1.4"}
integrant/repl {:mvn/version "0.3.2"}}
:main-opts ["-m" "user"]}#2021-12-1317:59dpsuttonmy guess is one of those has main args and the -m nrepl.cmdline ---middleware ... is actually being passed as main args to another main args#2021-12-1317:59dpsuttonyup. :repl gives main args. So you are starting up as -m user -m nrepl.cmdline ...#2021-12-1317:59dpsuttonnewer cider works around this#2021-12-1317:59eggsyntaxOhhhh, that would make sense.#2021-12-1318:00eggsyntaxCool, thanks lots, I'll update cider. 🙏#2021-12-1318:00dpsuttonif you want to not upgrade, you can put your main args for CIDER into an alias and ensure that alias comes last#2021-12-1318:00dpsuttonwhich is what the change in CIDER that you need does#2021-12-1318:00eggsyntaxNo, no reason not to update -- I'm just a slow updater for everything emacs related since I'm on spacemacs and updates result in breakage a bit more often than I'd like 😜#2021-12-1318:03eggsyntax> if you want to not upgrade, you can put your main args for CIDER into an alias and ensure that alias comes last
Just in case, though -- that would be about creating an alias containing :main-opts ["-m" "nrepl.cmdline"]?#2021-12-1318:07eggsyntaxNever mind, just confirmed that for myself 🙂#2021-12-1318:07eggsyntaxThanks again!#2021-12-1414:48richiardiandreaHi all, I have recently updated company-mode and I started having some strange behavior on completion: if the completion is not present in the candidates it does not allow me to type.
That's a bit annoying cause sometimes you don't need completion as you remember things.
I dug into it and now company has got company-auto-commit and company-require-match for controlling the behavior. I set both to nil but it still happens.
Has anybody else faced the same problem?#2021-12-1418:51motformI don't know if you've seen, but Tonsky just released a stable version of his nrepl-client for Sublime Text, and it is really great! https://tonsky.me/blog/sublime-clojure/ I was wondering if there was a way to emulate some of the design choices in Cider? I've managed to make evaluations more permanent with (setq cider-eval-result-duration nil), but I was wondering if it is possible to disable auto-opening of the repl buffer (that I never use) and if one could emulate the multiple, non-blocking evaluations. Any ideas?#2021-12-1419:14pavlosmelissinosI think this covers the first part of your question: https://docs.cider.mx/cider/repl/configuration.html#behavior-on-connect
not sure about the second part#2021-12-1420:17Leah Neukircheni'd like showing the execution times if something was slow#2021-12-1422:14anonimitorafHow does Sublime Clojure show large results?#2021-12-1507:23motformIt displays as much as fits from the right edge of to buffer to the left, then it truncates the rest with a "view more" arrow.#2021-12-1518:22diego.videcoI am trying to cider-jack-in-cljs into a shadow-clj project, but I am getting this error:
"Execution error (NoSuchMethodError) at com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths (ModuleLoader.java:257).\n'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'\n"
Does anyone have any idea what this may mean? (I can jack-in with calva)#2021-12-1518:23vemvcan you see a fuller stacktrace?#2021-12-1518:26diego.videcoyes#2021-12-1518:27diego.videco{:clojure.main/message
x"Execution error (NoSuchMethodError) at com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths (ModuleLoader.java:257).\n'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'\n",
:clojure.main/triage
{:clojure.error/class java.lang.NoSuchMethodError,
:clojure.error/line 257,
:clojure.error/cause
"'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'",
:clojure.error/symbol
com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths,
:clojure.error/source "ModuleLoader.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.NoSuchMethodError,
:message
"'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'",
:at
[com.google.javascript.jscomp.deps.ModuleLoader
createRootPaths
"ModuleLoader.java"
257]}],
:trace
[[com.google.javascript.jscomp.deps.ModuleLoader
createRootPaths
"ModuleLoader.java"
257]
[com.google.javascript.jscomp.deps.ModuleLoader
<init>
"ModuleLoader.java"
147]
[com.google.javascript.jscomp.deps.ModuleLoader
<init>
"ModuleLoader.java"
48]
[com.google.javascript.jscomp.deps.ModuleLoader$Builder
build
"ModuleLoader.java"
139]
[com.google.javascript.jscomp.deps.ModuleLoader
<clinit>
"ModuleLoader.java"
408]
[com.google.javascript.jscomp.DiagnosticGroups
<clinit>
"DiagnosticGroups.java"
189]
[shadow.build.closure__init load nil 77]
[shadow.build.closure__init <clinit> nil -1]
[java.lang.Class forName0 "Class.java" -2]
[java.lang.Class forName "Class.java" 398]#2021-12-1518:29diego.videcoJust found out that this is the culprit.
(setq cider-jack-in-dependencies
(delete-dups
(append
lispy-cider-jack-in-dependencies
cider-jack-in-dependencies)))
#2021-12-1518:30diego.videcoI had added that because lispy tries to add pomegranate and dynapath dynamically but sometimes it fails. But seems like this is incompatible with cljs projects#2021-12-1518:32vemvfunny thing, just this week we completed removing dynapath from cider-nrepl.
what does lispy do to require such dynamism anyways? I don't know much about the project but good old paredit.el certainly never needs to inject JVM deps or such :)#2021-12-1518:57diego.videcohttps://github.com/abo-abo/lispy/blob/master/lispy-clojure.clj#2021-12-1518:58diego.videcoHonestly all I care is the editing commands, so I think most of this somewhat unnecessary and better provided by cider and other modules#2021-12-1518:58diego.videcobut I don't quite know how to disable it yet#2021-12-1521:56vemvHere you can track the logic it follows for conditionally injecting its stuff https://github.com/abo-abo/lispy/blob/e9731aa95581951ab2cbfaed28f0ac7d71124ac0/le-clojure.el#L145-L189
It observes (eq major-mode 'clojurescript-mode) . Maybe when you cider-jack-in-cljs the major mode is clojure-mode instead?
You can also just setq lispy-cider-jack-in-dependencies nil , maybe that won't cause an immediate issue if you only use the editing commands#2021-12-1523:32diego.videcothanks for the suggestios, I'll try them out#2021-12-1608:40magnarsAny clues as to why the CIDER repl doesn't include everything that is printed to out? I understand this might be a hairy issue, but it's becoming a problem for us when we no longer see cljs compilation errors. Any help would be appreciated. (more details in thread)#2021-12-1608:40magnarsIn the terminal:#2021-12-1608:41magnarsIn emacs:#2021-12-1608:41magnars#2021-12-1608:41magnarsNote how all the [Figwheel] logging is omitted. When the compile is successful, it's merely an inconvenience. But when it hides compilation errors, cue headaches.#2021-12-1608:42vemvHave you checked in the Fig source the difference between strings prefixed with [Figwheel] , and strings without?#2021-12-1608:43vemvI reckon they are printed/logged differently, should give a clue#2021-12-1608:45magnarsI'll look into that. I'd still like for CIDER to capture everything going to standard out, tho. Maybe that is naive.#2021-12-1608:47vemvthat diagnostic might be mistaken though, there's a good chance cider doesn't randomly decide to not relay certain lines from out#2021-12-1608:47magnarsI think you're right about that, for sure. I'm just confused by this whole thing.#2021-12-1608:48magnarsIn particular, I am confused as to how a process writes to my terminal without printing to out , I guess.#2021-12-1608:49vemvmaybe it has "logging levels" of sorts. or maybe it's going to err idk#2021-12-1609:00magnarsI would certainly hope that err is also shown in the repl.#2021-12-1609:03magnarsThese same log messages do show up in older versions of figwheel-main. So there's something there. Thanks for pointing me in the right direction.#2021-12-1609:26magnars👀 indeed. Now it's inconsistent instead. What a mess.#2021-12-1609:33magnarsAnd with inconsistency came the new theory: It's a timing issue. The log statements appear if I do it manually (ie. slower).#2021-12-1609:35vemvThat might well make sense, perhaps the initial cljs compilation errors happen before a connection is established? (Don't quote me on that)#2021-12-1609:41magnarsIt seems like something along those lines. Maybe the CLJS REPL-starting commands should wait for a connection to be established.#2021-12-1609:42vemvBtw, if in a rush you can always use the cider-connect* family of functions, i.e. start the repl from the terminal#2021-12-1610:58magnarsTo summarise: (require 'figwheel.main) sets up its own logger. If this is done too early, it is set up to print somewhere CIDER doesn't look. Postponing the require to after CIDER is ready fixes all these issues. I would say this is a figwheel issue, not a CIDER-issue. Thanks for sparring with me, @vemv.#2021-12-1611:11vemvCheers! Is there anything that we could improve cider side? Or should an issue be created in Fig?#2021-12-1611:18magnarsA workaround would be postponing the (do (require 'figwheel.main) ...) during jack-in-clojurescript , but it does not really solve the issue. If I place (:require [figwheel.main]) somewhere in my project code, that too would require it too soon - with no recourse for CIDER that I can think of. I've asked in the #figwheel-main channel here.#2021-12-1609:12vemvℹ️ since this week cider.el master (snapshot) includes our latest tech (cider-nrepl, orchard, enrich-classpath) that makes Java jump-to-definition and other similarly core Java features finally possible.
This works for the JDK core classes (`Thread` , File etc), third-party dependencies, and your own sources alike.
Experience reports are very much welcome, before we cut a stable release.#2021-12-1609:13vemvIt's a Lein-only feature for the time being, more context here https://clojurians.slack.com/archives/C6QH853H8/p1639467484052200#2021-12-1610:58magnarsTo summarise: (require 'figwheel.main) sets up its own logger. If this is done too early, it is set up to print somewhere CIDER doesn't look. Postponing the require to after CIDER is ready fixes all these issues. I would say this is a figwheel issue, not a CIDER-issue. Thanks for sparring with me, @vemv.#2021-12-1612:17magnarsIf I wanted CIDER to capture out and err earlier during startup, where would I start looking at the code? nrepl? cider-nrepl? Right now it takes a few seconds after startup before (java.util.logging.ConsoleHandler.) creates a handler that will output to the repl.#2021-12-1818:11lassemaattaI was experimenting with nubank/matcher-combinators earlier today and noticed that the cider test results show raw escape characters instead of applying a color to the text. Am I doing something wrong or is this related to https://github.com/clojure-emacs/cider/issues/2901?#2021-12-1820:19mister_mHi - are the ClojureDocs lookups using C-c C-d C-c (`cider-clojuredocs`)something that requires an internet connection?#2021-12-1820:47dpsuttonI think it requires an internet connection once to get the entire corpus and then individual lookups use the local versions#2021-12-2007:39bozhidarYou only need an internet connection to update the local data. We ship some export (basically an EDN file) with Orchard and we update it there from time to time. Older versions of CIDER downloaded the data locally the first time you needed it.#2021-12-1821:15mister_mIs there a way to change the order of arguments in a function definitionusing CIDER or the clj-refactor extension that will update usage sites?#2021-12-1821:18mister_mIf that isn't directly supported, I am wondering what the best way to do something like that might be.#2021-12-1908:21vemvno it's not offered. clj-refactor and clojure-lsp offer "find usages" functionality. So you can jump to each callsite and edit it by hand (I'd use some paredit to move the symbols around)#2021-12-1908:21vemvIf you are interested in a generalized/automated feature, I reckon that would take some rewrite-clj skills#2021-12-1908:44pavlosmelissinosIn my experience you shouldn't have to do that a lot.
Don't get me wrong, having great tooling is awesome but in this case what you're asking for is a tool to contain complexity created by bad design.
Some pointers:
1. In general prefer maps over positional arguments
2. Try not to break your APIs, even if they're internal. Instead of having a messy git diff and risk breaking something during the refactoring, keep the old code as is for compatibility reasons (mark it as deprecated), and create a function that wraps it, using a map. Then gradually convert your usages to the new API. No need to make all the changes in your code in one go.
3. If for some reason you don't want to do either of the above or if few changes are involved, consider refactoring the code by hand (search for usages and change them yourself) - not always possible but sometimes I like to do it as an exercise of why good design is important
It helps to ask yourself why. What's wrong with the existing code? Why do I need to refactor it?
I've found that most of the time it isn't worth the trouble.#2021-12-2018:31Robert A. RandolphReading https://docs.cider.mx/cider/1.1/usage/pretty_printing.html it is unclear to me if I should expect (setq cider-print-fn "") to work with the latest cider. I attempted to use this setting and it appears to not work, as pr is still being used.#2021-12-2018:33dpsuttonthat documentation lists possible values for cider-print-fn. The empty string is not one of them so I’m not sure what you are trying to do#2021-12-2018:34Robert A. RandolphMy apologies, my speech-to-text failed there. Setting it to any value listed on that page does not appear to work.#2021-12-2018:35Robert A. RandolphSetting it to an invalid value does not throw an error either.#2021-12-2018:36dpsuttonah ok. i’d file a bug report then. And probably the easiest way to confirm and demonstration the it does not work would be with the custom version. Because there is a custom var version, i’m not sure how we could really define an invalid value#2021-12-2018:38dpsuttonbut a minimal repro in a ticket with a custom printer
(defn custom-printer [value writer options] (.println writer ^String "custom value"))
and set that. Would be pretty conclusive if it worked or not#2021-12-2018:39dpsutton(as it can be hard to distinguish between if fipp or pprint are actually working#2021-12-2018:40Robert A. RandolphHmm, interesting. (setq cider-print-fn 'true) does throw an error when attempting to pprint.#2021-12-2018:40Robert A. RandolphOk, I'll mess with this more. I just wanted a quick sanity check to set my expectations.#2021-12-2018:40dpsuttonwhat about (setq cider-print-fn "true"). that might just be a type error on string vs symbol#2021-12-2018:40dpsuttonand then the string is just ignored when it actually matters#2021-12-2018:41Robert A. Randolph"true" succeeds in printing#2021-12-2018:43Robert A. RandolphI would expect that to fail#2021-12-2018:45Robert A. Randolphhmm, default value is "pprint", and it's not using pprint by default. Docs say it should be using what's bound to nrepl.middleware.print/*print-fn*, which is pr by default.#2021-12-2107:34bozhidarAs mentioned on the ticket - looking at the code you should get some error in the nREPL log, but it will just pick fallback to the default if you supply a function that won't resolve. The printing behavior does change when using the built-in cider-nrepl functions, so it seems to be working.#2021-12-2018:45dpsuttonfor sure a bug report then#2021-12-2103:31mister_mis there a quick way to remove anything that no longer has a definition from the active namespace? I was using the namespace browser and noticed some fn I deleted was still present in the namespace. In the namespace browser, hitting s takes me to the definition of the absent function which is a blank line now.#2021-12-2110:29practicalli-johncider-undef function will remove a function definition from the running REPL.
Either call this with the cursor on the function name or if function is already deleted then it prompts for a function name.
If there are lots of deleted functions in the REPL, I usually stop/start the REPL process.#2021-12-2103:33mister_mI am wondering if I am missing a workflow step here as well. Typically I write some stuff, and either evaluate the def or defn that I just made ad hoc with C-x C-e or I periodically do something like C-c C-k. Am I doing things wrongly?#2021-12-2103:37mister_mI don't really need to remove this function that has no definition in the source file of course, but I feel like I should in case it is called accidentally or something#2021-12-2103:48dpsuttonYou're doing it correctly#2021-12-2103:48dpsuttonHitting where clojure is mutable: namespaces#2021-12-2103:49dpsuttonThis is the most annoying when you remove a test. But look up remove-ns to clobber a whole namespace and there are some other helpful ones #2021-12-2104:07mister_mThanks I think removing the ns and then just loading the file again should work fine for me at the moment.#2021-12-2105:24coetryHi there! I have paredit enabled in my cider buffer, so when I try to enter a form and open a set of parenthesis, the closing paren gets added automatically, which makes it hard for me to write out a more elaborate set of forms since pressing enter evals the form#2021-12-2105:25coetrywhat i want is to not eval the form until i'm ready, does that make sense?#2021-12-2106:09dpsuttonyeah that's understandable. What i've done is swap the send form and enter newline keybindings
("RET" . cider-repl-newline-and-indent)
("C-j" . cider-repl-return)
Getting used to this is awesome. return always enters a newline and c-j sends the form#2021-12-2106:10dpsuttonanother thing that you could do is get used to using comment forms in your regular text buffers. There are two interactions that make this nice:
• eval current form will eval whatever you are editing and show the result in-line
• send form to repl will plop that form into the repl buffer just as if you had typed it there. This is my preferred way to work#2021-12-2106:11dpsuttonIf that sounds good to you the following customizations are useful
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
(setq clojure-toplevel-inside-comment-form t)
Ensure that sending forms to the repl automatically evaluates them, doesn't put the cursor in the repl buffer, and treats top level forms in comment forms as top level forms#2021-12-2109:01magnarsThis is the way @U1KFUC2NA - (comment ...) in your namespace. 👍#2021-12-2111:20coetryThank you guys!#2021-12-2115:51DerekAnyone on latest CIDER seeing an issue regarding clojure.instant/thread-local-utc-date-format? Still in the formative stages of looking at this, so no easy repro yet#2021-12-2115:51DerekCaused by: java.lang.RuntimeException: Unable to resolve var: clojure.instant/thread-local-utc-date-format in this context
#2021-12-2115:52DerekMy REPL fails to start#2021-12-2116:19DerekSeems to be related to the cider.enrich-classpath/middleware and lein-doo plugin#2021-12-2116:34DerekVery small repro case can be found here:
https://github.com/dpassen/cider-doo-repro#2021-12-2116:36Frank HenardAlso getting this#2021-12-2118:52vemvTaking a look#2021-12-2118:53DerekThanks. Let me know if I can provide more information#2021-12-2119:02vemvCan repro#2021-12-2119:06vemvThis fixes it for me, can you verify?
[mx.cider/enrich-classpath
#_"Please add this below the lein-doo vector. Please make sure the version is the same that cider would inject"
"1.5.0"]
(this works, but it's better to not patch things by hand; simply upgrade cider as mentioned below)#2021-12-2119:16DerekAs soon as I get back to my desk#2021-12-2119:37vemvI strongly believe it's that as I was somewhat familiar with the issue and could repro the issue + verify its fix.
It's now on cider master https://github.com/clojure-emacs/cider/pull/3105
There will be a MELPA snapshot auto-generated within a few hours.
cc @U06BQ07JS @U011T61C1V4#2021-12-2119:51DerekFWIW, adding the dep below lein-doo worked for now#2021-12-2119:51DerekI look forward to the next MELPA snapshot#2021-12-2119:51DerekThank you tons#2021-12-2119:59vemvLikewise thanks for the accurate repro, happy to have fixed this fast
FYI, what the enrich-classpath plugin does is adding Java sources (for the JDK itself + 3rd party deps) so that cider's ide-like functionality can work for Java too.
Would much appreciate if you can give it a spin, try jump-to-definition for a Java class for example#2021-12-2119:59DerekWait for the next snapshot? Or try with the manual plugin#2021-12-2120:00vemvwith the manual plugin it will work too, there's no difference#2021-12-2120:03DerekUsed (M-.) xref to jump to a Java constructor#2021-12-2120:03Derekthat worked#2021-12-2120:04Derekoh that was neat on a member function#2021-12-2120:09vemvawesome! feel free to keep an eye on it, feedback appreciated
I reckon that by keeping a codebase free of reflection warnings you can help these features work#2021-12-2122:35Dereknewest snapshot is working#2021-12-2122:44Derekwait#2021-12-2122:46DerekI think I called that prematurely#2021-12-2122:49Dereklein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.27.4\"\] -- update-in :plugins conj \[mx.cider/enrich-classpath\ \"1.5.1\"\] -- update-in :middleware conj cider.enrich-classpath/middleware -- repl :headless :host localhost
still results in that error in my repro repo#2021-12-2122:58vemvThanks, can repro
Looks like one of those wicked lein problems. At least we know a workaround: https://clojurians.slack.com/archives/C0617A8PQ/p1640113595395100?thread_ts=1640101913.375900&cid=C0617A8PQ
I'll see the best way to fix this, could be https://github.com/bensu/doo/pull/205 , or maybe there's something to be improved in the Fipp library#2021-12-2123:01Dereklein plugins are .. yes#2021-12-2123:32vemvFix on its way https://github.com/clojure-emacs/cider/issues/3106, as mentioned the 'manual' fix is ok for now#2021-12-2116:27FiVoIs there currently anything in Cider or an emacs package that autogenerates namespace files? I am not talking about the repl, i.e. in-ns , but rather if I want to create the ns that it generates the path src/foo/bar/biz.clj with a file already containing (ns ).#2021-12-2116:42lilactownI noticed that when I installed the LSP layer for spacemacs, when I create a new file like src/foo/bar/biz.clj it would sometimes add the ns form for me#2021-12-2116:42lilactownI'm not sure whether that's the lsp-mode package or something else that is enabled between the interaction of the lip-layer and clojure-layer#2021-12-2116:45FiVoI guess it's time to try out lsp-mode#2021-12-2119:18practicalli-johnLSP does add a namespace by default when creating a new Clojure file.
I believe clj-refactor also does this too if it's enabled.#2021-12-2119:45vemvyes clj-refactor.el does it as well https://github.com/clojure-emacs/clj-refactor.el/blob/363b95c5d2855abc93ac011e9adc778cf7a773e5/clj-refactor.el#L55-L59#2021-12-2122:37ericdalloI mention this conflict https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/#refactorings and how to solve it#2021-12-2117:46winsomeI'm running into a weird thing - I just restarted my repl and I got a FileNotFound exception while trying to build my classpath. Here's what I've tried in order:
1. deleted .cpcache and restarted the repl
2. verified that the dependency in question was present in .m2 cache
3. started a clj repl in the project directory and successfully required the dep
4. deleted the target directory out of paranoia
5. completely killed emacs and restarted it
On each step after a cider-jack-in I get the same classpath exception
#error {
:cause "Could not locate aero/core__init.class, aero/core.clj or aero/core.cljc on classpath."
:via
[{:type clojure.lang.Compiler$CompilerException
:message "Syntax error compiling at (prj/ws_proxy/config.clj:1:1)."
:data #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "flureehub/ws_proxy/config.clj"}
:at [clojure.lang.Compiler load "Compiler.java" 7652]}
{:type java.io.FileNotFoundException
:message "Could not locate aero/core__init.class, aero/core.clj or aero/core.cljc on classpath."
:at [clojure.lang.RT load "RT.java" 462]}]
:trace
[[clojure.lang.RT load "RT.java" 462],,,]]#2021-12-2117:48winsomeOh, and the dep is definitely present under the :deps key in my deps.edn file:
{:deps {aero/aero {:mvn/version "1.1.6"}},,,} ,,,}#2021-12-2118:07lilactownwhat command is cider-jack-in running?#2021-12-2118:08lilactownyou should be able to view and edit it by running C-u cider-jack-in#2021-12-2118:10winsome/run/current-system/sw/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta4"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:build:cider/nrepl#2021-12-2118:11winsomeI've also just restarted the computer but the problem persists :p#2021-12-2118:27winsomeAh! New data: when I comment out the usage of the particular dependency, it blows up on the next one. So I don't think it's pulling in any of my deps.#2021-12-2118:36Alex Miller (Clojure team)/run/current-system/sw/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta4"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -Spath -P -M:dev:build:cider/nrepl
what does that tell you?#2021-12-2118:36Alex Miller (Clojure team)that should be the classpath being used#2021-12-2118:55winsomeWhen I run that from the cli it just runs for 2 seconds and then exits with no output#2021-12-2119:08Alex Miller (Clojure team)then, get rid of the -P, that might prevent -Spath from working#2021-12-2119:12winsomeAlright, that has produced something:
dev:test:src:resources:/home/user/.m2/repository/cider/cider-nrepl/0.27.2/cider-nrepl-0.27.2.jar:/home/user/.gitlibs/libs/io.github.clojure/tools.build/0361ddef468691af4a369fbc5338abf98b2b59ba/src/main/clojure:/home/user/.gitlibs/libs/io.github.clojure/tools.build/0361ddef468691af4a369fbc5338abf98b2b59ba/src/main/resources:/home/user/.gitlibs/libs/io.github.seancorfield/build-clj/9b8e09bf819a0e30b7e972abaafa8ce1a64b9a36/src:/home/user/.m2/repository/nrepl/nrepl/0.9.0-beta4/nrepl-0.9.0-beta4.jar:/home/user/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar:/home/user/.m2/repository/org/clojure/tools.namespace/1.2.0/tools.namespace-1.2.0.jar:/home/user/.m2/repository/refactor-nrepl/refactor-nrepl/3.1.0/refactor-nrepl-3.1.0.jar:/home/user/.m2/repository/org/clojure/tools.deps.alpha/0.12.1090/tools.deps.alpha-0.12.1090.jar:/home/user/.gitlibs/libs/io.github.seancorfield/build-uber-log4j2-handler/8d493a82b91dd32bd35735ad33d76f7c77b1f393/src:/home/user/.m2/repository/slipset/deps-deploy/0.2.0/deps-deploy-0.2.0.jar:/home/user/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar:/home/user/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar:/home/user/.m2/repository/org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.jar:/home/user/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar:/home/user/.m2/repository/com/cognitect/aws/api/0.8.536/api-0.8.536.jar:/home/user/.m2/repository/com/cognitect/aws/endpoints/1.1.12.93/endpoints-1.1.12.93.jar:/home/user/.m2/repository/com/cognitect/aws/s3/814.2.991.0/s3-814.2.991.0.jar:/home/user/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/home/user/.m2/repository/org/apache/maven/maven-core/3.8.3/maven-core-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-resolver-provider/3.8.3/maven-resolver-provider-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-api/1.6.3/maven-resolver-api-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-connector-basic/1.6.3/maven-resolver-connector-basic-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-impl/1.6.3/maven-resolver-impl-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-spi/1.6.3/maven-resolver-spi-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-file/1.6.3/maven-resolver-transport-file-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-http/1.6.3/maven-resolver-transport-http-1.6.3.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.6.3/maven-resolver-util-1.6.3.jar:/home/user/.m2/repository/org/clojure/data.xml/0.2.0-alpha6/data.xml-0.2.0-alpha6.jar:/home/user/.m2/repository/org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar:/home/user/.m2/repository/org/clojure/tools.gitlibs/2.4.172/tools.gitlibs-2.4.172.jar:/home/user/.m2/repository/org/apache/logging/log4j/log4j-core/2.16.0/log4j-core-2.16.0.jar:/home/user/.m2/repository/clj-commons/pomegranate/1.2.1/pomegranate-1.2.1.jar:/home/user/.m2/repository/org/slf4j/slf4j-nop/2.0.0-alpha5/slf4j-nop-2.0.0-alpha5.jar:/home/user/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar:/home/user/.m2/repository/s3-wagon-private/s3-wagon-private/1.3.4/s3-wagon-private-1.3.4.jar:/home/user/.m2/repository/com/cognitect/http-client/1.0.110/http-client-1.0.110.jar:/home/user/.m2/repository/org/clojure/core.async/1.5.644/core.async-1.5.644.jar:/home/user/.m2/repository/org/clojure/data.json/1.0.0/data.json-1.0.0.jar:/home/user/.m2/repository/org/clojure/tools.logging/1.1.0/tools.logging-1.1.0.jar:/home/user/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar:/home/user/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar:/home/user/.m2/repository/org/apache/maven/maven-artifact/3.8.3/maven-artifact-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-builder-support/3.8.3/maven-builder-support-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-model/3.8.3/maven-model-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-model-builder/3.8.3/maven-model-builder-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-plugin-api/3.8.3/maven-plugin-api-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-repository-metadata/3.8.3/maven-repository-metadata-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-settings/3.8.3/maven-settings-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/maven-settings-builder/3.8.3/maven-settings-builder-3.8.3.jar:/home/user/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.3.4/maven-shared-utils-3.3.4.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar:/home/user/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5.jar:/home/user/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.5/org.eclipse.sisu.plexus-0.3.5.jar:/home/user/.m2/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar:/home/user/.m2/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar:/home/user/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar:/home/user/.m2/repository/org/clojure/data.codec/0.1.0/data.codec-0.1.0.jar:/home/user/.m2/repository/org/apache/logging/log4j/log4j-api/2.16.0/log4j-api-2.16.0.jar:/home/user/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-wagon/1.3.3/maven-resolver-transport-wagon-1.3.3.jar:/home/user/.m2/repository/org/apache/maven/wagon/wagon-http/3.3.4/wagon-http-3.3.4.jar:/home/user/.m2/repository/org/apache/maven/wagon/wagon-provider-api/3.3.4/wagon-provider-api-3.3.4.jar:/home/user/.m2/repository/org/tcrawley/dynapath/1.0.0/dynapath-1.0.0.jar:/home/user/.m2/repository/org/slf4j/slf4j-api/2.0.0-alpha5/slf4j-api-2.0.0-alpha5.jar:/home/user/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar:/home/user/.m2/repository/com/amazonaws/aws-java-sdk-s3/1.11.713/aws-java-sdk-s3-1.11.713.jar:/home/user/.m2/repository/com/amazonaws/aws-java-sdk-sts/1.11.713/aws-java-sdk-sts-1.11.713.jar:/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.10.1/jackson-databind-2.9.10.1.jar:/home/user/.m2/repository/org/springframework/build/aws-maven/4.8.0.RELEASE/aws-maven-4.8.0.RELEASE.jar:/home/user/.m2/repository/org/eclipse/jetty/jetty-client/9.4.44.v20210927/jetty-client-9.4.44.v20210927.jar:/home/user/.m2/repository/org/eclipse/jetty/jetty-http/9.4.44.v20210927/jetty-http-9.4.44.v20210927.jar:/home/user/.m2/repository/org/eclipse/jetty/jetty-util/9.4.44.v20210927/jetty-util-9.4.44.v20210927.jar:/home/user/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.1/tools.analyzer.jvm-1.2.1.jar:/home/user/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/home/user/.m2/repository/com/google/guava/guava/25.1-android/guava-25.1-android.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar:/home/user/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/home/user/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar:/home/user/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/home/user/.m2/repository/org/apache/maven/wagon/wagon-http-shared/3.3.4/wagon-http-shared-3.3.4.jar:/home/user/.m2/repository/com/amazonaws/aws-java-sdk-core/1.11.713/aws-java-sdk-core-1.11.713.jar:/home/user/.m2/repository/com/amazonaws/aws-java-sdk-kms/1.11.713/aws-java-sdk-kms-1.11.713.jar:/home/user/.m2/repository/com/amazonaws/jmespath-java/1.11.713/jmespath-java-1.11.713.jar:/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.10/jackson-annotations-2.9.10.jar:/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.10/jackson-core-2.9.10.jar:/home/user/.m2/repository/ch/qos/logback/logback-classic/1.0.12/logback-classic-1.0.12.jar:/home/user/.m2/repository/org/eclipse/jetty/jetty-io/9.4.44.v20210927/jetty-io-9.4.44.v20210927.jar:/home/user/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar:/home/user/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar:/home/user/.m2/repository/org/ow2/asm/asm/5.2/asm-5.2.jar:/home/user/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/home/user/.m2/repository/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar:/home/user/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/home/user/.m2/repository/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar:/home/user/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0.jar:/home/user/.m2/repository/org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar:/home/user/.m2/repository/org/jsoup/jsoup/1.12.1/jsoup-1.12.1.jar:/home/user/.m2/repository/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar:/home/user/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/user/.m2/repository/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar:/home/user/.m2/repository/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar:/home/user/.m2/repository/ch/qos/logback/logback-core/1.0.12/logback-core-1.0.12.jar:/home/user/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar:/home/user/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar
#2021-12-2119:13winsomeSorry for the giant paste!#2021-12-2119:13winsomeThis isn't including any of my deps#2021-12-2119:14winsome{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
juxt/clip {:mvn/version "0.27.0"}
aero/aero {:mvn/version "1.1.6"}
metosin/malli {:mvn/version "0.7.5"}
hato/hato {:mvn/version "0.8.2"}
;; AWS S3 API
com.cognitect.aws/api {:mvn/version "0.8.539"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.129"}
;; web server
http-kit/http-kit {:mvn/version "2.5.3"}
metosin/reitit {:mvn/version "0.5.15"}
compojure/compojure {:mvn/version "1.6.2"}
metosin/muuntaja {:mvn/version "0.6.8"}
metosin/jsonista {:mvn/version "0.3.5"}
metosin/ring-http-response {:mvn/version "0.9.3"}
;; logging
ch.qos.logback/logback-classic {:mvn/version "1.2.8"}}
:paths ["src" "resources"]
:aliases
{:dev
{:extra-paths ["dev", "test"]
:extra-deps {org.clojure/tools.namespace {:mvn/version "1.2.0"}}}
:test
{:extra-paths ["test" "test-resources"]
:extra-deps {com.cognitect/test-runner
{:git/url ""
:sha "dd6da11611eeb87f08780a30ac8ea6012d4c05ce"}}
:exec-fn cognitect.test-runner.api/test}
:build
{:deps {io.github.clojure/tools.build {:git/tag "v0.7.2" :git/sha "0361dde"}
io.github.seancorfield/build-clj {:git/tag "v0.6.3" :git/sha "9b8e09b"}}
:ns-default build}
:ancient
{:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core" "--skip=github-action"]}
:clj-kondo
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "2021.12.19"}}
:main-opts ["-m" "clj-kondo.main" "--lint" "src" "--config" ".clj-kondo/config.edn"]}}}#2021-12-2118:56dpsuttonI'd also look into which directory cider is running the command from. Is this a weird mono repo or have sub projects?#2021-12-2118:57winsomeNope, just a barebones deps.edn prj:
.
├── build.clj
├── deps.edn
├── dev
│ ├── dev.clj
│ └── user.clj
├── README.md
├── resources
│ ├── logback.xml
│ └── system-config.edn
└── src
└── prj
└── ws_proxy
├── api.clj
├── config.clj
├── main.clj
├── proxy.clj
└── server.clj#2021-12-2118:59winsomeThe weird thing is that clj just does everything fine - I can still build the project, load the project in a cli repl, tinker with it. It just fails to load all the deps when I cider-jack-in. And that worked this morning!#2021-12-2119:10dpsuttonWhat buffer are you in when you run the Jack in command?#2021-12-2119:13winsomeUsually deps.edn, but I've been working in config.clj so that too#2021-12-2119:14dpsuttonOh you probably want to drop the “build” alias#2021-12-2119:14winsome{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
juxt/clip {:mvn/version "0.27.0"}
aero/aero {:mvn/version "1.1.6"}
metosin/malli {:mvn/version "0.7.5"}
hato/hato {:mvn/version "0.8.2"}
;; AWS S3 API
com.cognitect.aws/api {:mvn/version "0.8.539"}
com.cognitect.aws/endpoints {:mvn/version "1.1.12.129"}
;; web server
http-kit/http-kit {:mvn/version "2.5.3"}
metosin/reitit {:mvn/version "0.5.15"}
compojure/compojure {:mvn/version "1.6.2"}
metosin/muuntaja {:mvn/version "0.6.8"}
metosin/jsonista {:mvn/version "0.3.5"}
metosin/ring-http-response {:mvn/version "0.9.3"}
;; logging
ch.qos.logback/logback-classic {:mvn/version "1.2.8"}}
:paths ["src" "resources"]
:aliases
{:dev
{:extra-paths ["dev", "test"]
:extra-deps {org.clojure/tools.namespace {:mvn/version "1.2.0"}}}
:test
{:extra-paths ["test" "test-resources"]
:extra-deps {com.cognitect/test-runner
{:git/url ""
:sha "dd6da11611eeb87f08780a30ac8ea6012d4c05ce"}}
:exec-fn cognitect.test-runner.api/test}
:build
{:deps {io.github.clojure/tools.build {:git/tag "v0.7.2" :git/sha "0361dde"}
io.github.seancorfield/build-clj {:git/tag "v0.6.3" :git/sha "9b8e09b"}}
:ns-default build}
:ancient
{:extra-deps {com.github.liquidz/antq {:mvn/version "RELEASE"}}
:main-opts ["-m" "antq.core" "--skip=github-action"]}
:clj-kondo
{:extra-deps {clj-kondo/clj-kondo {:mvn/version "2021.12.19"}}
:main-opts ["-m" "clj-kondo.main" "--lint" "src" "--config" ".clj-kondo/config.edn"]}}}#2021-12-2119:16winsome@dpsutton got it 🎉 - it was the :build alias that I included in my .dir-locals.el#2021-12-2119:17winsomeAh, I see - in the :build alias I use the :deps key, which presumably overwrites the top-level deps facepalm#2021-12-2119:37Alex Miller (Clojure team)Yep#2021-12-2119:17dpsuttonYou can test that hypo by changing that to extra-deps#2021-12-2119:19winsomeIt's funny how computers do exactly what you tell them too and yet I'm the one getting upset :p#2021-12-2119:19dpsuttonBut in general the build alias removes deps and changes your class path roots. But I thought that was only when run as -T. But I'm not sure. And I'm surprised if using “:deps” will nuke all other deps#2021-12-2119:21winsomeI also thought it would only do the whole new classpath if you run it with -T, that's why I thought it was safe. I'm sure the :deps behavior is documented somewhere, I just pulled it off the example from the tools.build repo, I think#2021-12-2119:38Alex Miller (Clojure team):deps is an alias for :replace-deps in aliases in case that helps clarify#2021-12-2120:45mister_mI'm interested in hacking on cider, and wondering if anyone has some recommendations on getting a development environment stood up. I've got a copy of the repo locally, but I'm not sure on how to load this local copy into emacs for development#2021-12-2120:46mister_mAh I've found https://docs.cider.mx/cider/1.1/contributing/hacking.html which I somehow missed earlier#2021-12-2211:18shemcider-jack-in stopped working here today as well after updating it. this is leiningen project. it runs a couple of minutes and dies with:#2021-12-2211:18shemRetrieving mx/cider/enrich-classpath/1.5.1/enrich-classpath-1.5.1.jar from clojars
java.lang.Exception: Couldn't create directories:
at leiningen.core.utils$mkdirs.invokeStatic (utils.clj:71)
leiningen.core.utils$mkdirs.invoke (utils.clj:67)
leiningen.core.eval$prep.invokeStatic (eval.clj:83)#2021-12-2211:21shemmy uid should be well capable of creating directories#2021-12-2211:40bozhidar@shem See https://github.com/clojure-emacs/cider/issues/3108#2021-12-2211:40bozhidarI'm puzzled by those permission issues, but at least the workaround is simple.#2021-12-2211:54Brett KromkampHi! What is the workaround (I cannot seem to find it)?#2021-12-2212:10vemvhttps://github.com/clojure-emacs/cider/issues/3108#issuecomment-999393497#2021-12-2212:21vemvThis appears to be an issue in Lein itself. I've tried this plugin over a year, in many projects, personally and in an extensive CI matrix alike.#2021-12-2212:22vemvAnyway here are some questions that would help us debugging it cc/ @shem https://github.com/clojure-emacs/cider/issues/3108#issuecomment-999536065#2021-12-2212:25shemThe workaround works, thanks. FWIW, I saw it download lots of dependencies (apparently storing them somewhere) before it bailed not being able to make directories.#2021-12-2212:32shemIf I create a new minimal leiningen project without any dependencies except clojure, I get the same error about not being able to create directories.#2021-12-2212:33Brett Kromkamp@shem Hi. I'm new to Clojure/Cider... how do you apply the work-around?#2021-12-2212:34vemvIt's odd because enrich-classpath does not use leiningen.core.utils$mkdirs which is what your stacktrace reflects.
So it looks like enrich-classpath did its job correctly and completed, and then Lein failed for some reason, which might be related, but indirectly#2021-12-2212:37vemv@U0125NB5XLG M-x customize, set cider-enrich-classpath to nil there, restart Emacs
it will persist across Emacs sessions#2021-12-2212:38Brett Kromkamp@U45T93RA6 Ok, thanks! I will give it a try and report back#2021-12-2212:38shemor if you just want to try it once, Esc :
<then write>
(setq cider-enrich-classpath nil)
<enter>#2021-12-2212:39Brett KromkampYep! That worked! 🙂#2021-12-2212:39Brett KromkampThank you!#2021-12-2212:40vemv> If I create a new minimal leiningen project without any dependencies except clojure, I get the same error about not being able to create directories.
oh wow @shem :/ could you post that in the GH issue along with your JDK + lein version + OS?#2021-12-2212:41shemwill do#2021-12-2212:51shemI only have {:antq {} } in my ~/.lein/profiles.clj so that shouldn't bring surprises#2021-12-2212:52vemvI've created https://github.com/technomancy/leiningen/pull/2778, which hopefully will either solve the issue or make it more debuggable#2021-12-2214:30bozhidarCIDER 1.2 ("Nice") is out https://metaredux.com/posts/2021/12/22/cider-1-2-nice.html#2021-12-2214:31bozhidar(`cider-enrich-classpath` was disabled for the time being until we figure out the issue with Leiningen)#2021-12-2217:35mister_mquestion RE using eldev for hacking; after starting eldev emacs in the top level of my fork, I seem to be unable to "jack in" to a fresh lein project. I am 1. creating a fresh project with lein new sample , 2. opening the project.clj, then 3. M-x c-j-i to jack in. https://gist.github.com/matt-y/c0302b961901a78cc305fe5888750ef6. I am very unfamiliar with eldev, are there additional steps I am missing in these steps in order to load up a lein project?#2021-12-2217:39dpsuttonif you scroll up a bit you can see that people hit this issue and there’s a workaround and a disabling of some feature. I don’t think it is related to eldev emacs (which i don’t actually know what that is. I thought eldev was a new test runner?)#2021-12-2217:40mister_mI should pay attention more, thanks! That works for the time being.#2021-12-2217:42dpsuttonno worries 🙂#2021-12-2321:11SchmohoI'm getting this stack trace trying to cider-connect to a running shadow-cljs nREPL, Cider version 1.2.0, (system) Clojure version 1.10.1, cider-nrepl version 0.27.4 (openjdk 11, since it seems to have a Classloader issue ...).
Anybody got a clue what's going on here? I assume it's some kind of version mismatch issue ...
[2021-12-23 22:07:36.019 - WARNING] :shadow.cljs.devtools.server.nrepl/middleware-fail - {:sym cider.nrepl/cider-middleware}
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Syntax error compiling at (cider/nrepl.clj:1:1). #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "cider/nrepl.clj"}
clojure.lang.Compiler.load (Compiler.java:7648)
clojure.lang.RT.loadResourceScript (RT.java:381)
clojure.lang.RT.loadResourceScript (RT.java:372)
clojure.lang.RT.load (RT.java:459)
clojure.lang.RT.load (RT.java:424)
clojure.core/load/fn--6839 (core.clj:6126)
clojure.core/load (core.clj:6125)
clojure.core/load (core.clj:6109)
clojure.core/load-one (core.clj:5908)
clojure.core/load-one (core.clj:5903)
clojure.core/load-lib/fn--6780 (core.clj:5948)
clojure.core/load-lib (core.clj:5947)
Caused by:
IllegalAccessError with-session-classloader does not exist
clojure.core/refer (core.clj:4249)
clojure.core/refer (core.clj:4217)
clojure.core/apply (core.clj:667)
clojure.core/load-lib (core.clj:5966)
clojure.core/load-lib (core.clj:5928)
clojure.core/apply (core.clj:667)
clojure.core/load-libs (core.clj:5985)
clojure.core/load-libs (core.clj:5969)
clojure.core/apply (core.clj:667)
clojure.core/require (core.clj:6007)
clojure.core/require (core.clj:6007)
cider.nrepl/eval8075/loading--6721--auto----8076 (nrepl.clj:1)#2021-12-2321:22SchmohoI've also tried with cider-nrepl 0.7.0, which gives these warnings and shadow-cljs complaining it needs cider-nrepl:
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.apropos/wrap-apropos, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.classpath/wrap-classpath, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.complete/wrap-complete, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #', see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.inspect/wrap-inspect, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.macroexpand/wrap-macroexpand, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.resource/wrap-resource, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.stacktrace/wrap-stacktrace, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.test/wrap-test, see nrepl.middleware/set-descriptor!
[WARNING] No nREPL middleware descriptor in metadata of #'cider.nrepl.middleware.trace/wrap-trace, see nrepl.middleware/set-descriptor!
#2021-12-2321:25vemv> trying to cider-connect to a running shadow-cljs nREPL,
how do you initiate said repl?#2021-12-2321:31Schmohoshadow-cljs watch app#2021-12-2321:32vemvcould it be that said command launches an nrepl server using an older nrepl version?#2021-12-2321:32SchmohoI managed to resolve all my version issues though, turns out they were all outdated and out of whack. Now my only remaining problem is that the connect shadow repl stays in pending state forever.#2021-12-2321:33SchmohoI only had nREPL 0.7.0 on my classpath, have now put 0.9.0 explicitly into the deps#2021-12-2321:33Schmoho:dependencies [[cider/cider-nrepl "0.27.4"]
[nrepl "0.9.0"]
[refactor-nrepl "3.1.0"]]#2021-12-2321:33vemv(I meant cider-nrepl most of all, my bad)#2021-12-2321:34Schmoho(from the shadow-cljs.edn) - last server restart fetched all those deps so I would assume these are used in starting the nrepl server too#2021-12-2321:35vemv> Now my only remaining problem is that the connect shadow repl stays in pending state forever.
Yeah that item pops up in this channel from time to time. Thankfully all the archive is searchable nowadays :)
Check anything posted in the last couple months.#2021-12-2321:38SchmohoOkay, so the immediate issue (buffer evaluation) is resolved by M-x cider-set-repl-type, but I'm not really wiser as to the underlying issue. Its good enough for now though. Thanks a lot!#2021-12-2321:39vemvSounds like an instance of https://github.com/clojure-emacs/cider/issues/3097#2021-12-2321:46SchmohoHard for me to tell. I know the issue described there well too, but I don't immediately see the connection. Then again, I do, until this day, remain pretty blissfully ignorant of the interior workings of both CIDER and sesman#2021-12-2321:50vemvlet's hope it gets fixed soon regardless! it's been a weak spot for far too long now.
It's in the plans apparently.#2021-12-2321:56SchmohoI'm just happy they still develop this stuff at all :D#2022-12-2815:44DerekLatest CIDER (<tel:202112281132|20211228.1132>) exhibits this issue when jacking in:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.27.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
[nREPL] server started on 51690
[nREPL] Establishing direct connection to localhost:51690 ...
[nREPL] Direct connection to localhost:51690 established
error in process filter: cider--version: Wrong type argument: stringp, nil
error in process filter: Wrong type argument: stringp, nil#2022-12-2816:16vemvTry to get a stacktrace (`M-x toggle-debug-on-error`) and please post it as a GH issue 🙏
thanks!#2022-12-2816:40Derekhttps://github.com/clojure-emacs/cider/issues/3113#2022-12-2817:10practicalli-johnIs this also an issue if the REPL process is started on the command line and cider-connect-clj is used to connect?
Maybe worth trying to help narrow down the issue (or not)#2022-12-2817:12DerekSame error#2022-12-2817:13DerekAdded to the issue#2022-12-2820:59Brett KromkampJust done a fresh install on a new machine... get the same error 😞#2022-12-2821:15vemvhttps://github.com/clojure-emacs/cider/issues/3113#issuecomment-1002204474#2022-12-2907:26bozhidarI've patched up the problem. Will go back to the drawing board for a real solution. I hate it how complex it is to do something as trivial as extracting package metadata.#2022-12-2907:26bozhidarThe old approach worked fine for years, but the submission of CIDER to NonGNU ELPA forced me trim the non-essential deps like pkg-info (which in turn depends on a much bigger package).#2022-12-2909:18Brett KromkampCan confirm that it works now. Thanks! 🙏#2022-12-2912:20bozhidarYou're welcome - all of this was an educational experience for me as well. 😄 Now I know not to use load-file-name with byte-compiled code.#2022-12-3002:19ACAnyone have some workflow suggestions using tap> (or something else) with cider to log verbose debugging output?
When doing Advent of Code, for example, I often run into situations where I want to just spew tons of “printf” debug statements without worrying about bogging down emacs. (as opposed to a “real” project where I’d have something more formal to handle logging)#2022-12-3003:44anonimitorafCheck out https://github.com/athos/Postmortem if you haven't yet, specifically the dump function. You can use this lib in conjunction with tap> or just a vanilla REPL I guess#2022-12-3010:30practicalli-johnHave you considered using the cider-inspect tool to see larger results and navigate through them
https://practical.li/spacemacs/evaluating-clojure/inspect.html#inspecting-simple-values
Or the cider-debug tool to step through code, seeing the values at each stage.
Otherwise, I would set up a tap> source, such as Portal in a dev/user.clj file and then use tap> (instead of println expressions)
Printing lots of lines or very long lines to a REPL buffer is a guaranteed way to slow Emacs down. If this must be done, limit the size of the repl buffer (setq cider-repl-buffer-size-limit 100) ;; limits the number of lines shown in REPL buffer
consider using fundamental mode (to remove syntax highlighting any any other process consuming tasks)#2022-12-3110:29bozhidarSee also https://github.com/clojure-emacs/cider/issues/3094#2022-12-3110:29bozhidarand https://github.com/clojure-emacs/cider/issues/3055#2022-12-3111:52anonimitorafHi guys, anyone know what package/how these (eval outputs) are shown?
Asking because I'm writing something like CIDER but for JS
I've tried to wrap my head around cider's code (mainly cider-eval.el) but a bit too much to grasp quickly#2022-12-3112:16vemvI think that's cider-emit-into-popup-buffer doing it
btw, in case it helps, I used elisp jump to definition recursively to track it down#2022-12-3112:42anonimitorafAh cool thanks, I'll have a look. And yea I did, just hard to know where to start (when looking through an unfamiliar codebase)#2022-12-3115:19bozhidar@UR37CBF8D It's not a separate package - see cider-overlays.el.#2022-12-3115:19bozhidarAt some point I toyed with the idea to make this more generic and reusable, but I never got to doing so.#2022-12-3115:20bozhidarA while ago someone adapted the code from CIDER for Emacs Lisp https://github.com/xiongtx/eros#2022-01-0104:41anonimitorafAh sweet. Thanks, I might try to make it generic/reusable, if I can!#2022-01-0117:19ericdalloHello, getting this error on doom emacs after https://github.com/clojure-emacs/cider/commit/b07208f2979483b95606e1fd10f650a8104004ee#diff-cd4560794fb599bec6ef532b196acbf5a5a873c985a547dd0bb70289ce70250cL119-R114:
(error "ad-deactivate: 'enable-theme' is not advised")
any clues?#2022-01-0118:40Drew Verleei have no idea... i'll google around a minute or two.#2022-01-0118:41Drew VerleeIs there some problem your seeing? It could just be system just being overly chaty.#2022-01-0118:41ericdallono, it's a error indeed, not a warning#2022-01-0118:42ericdalloit makes doom-emacs doesn't start, my guess is that it's a elisp issue indeed on cider#2022-01-0118:42Drew VerleeThat's an issue for sure.#2022-01-0118:42ericdallomaybe this line should not be removed?
https://github.com/clojure-emacs/cider/commit/b07208f2979483b95606e1fd10f650a8104004ee#diff-cd4560794fb599bec6ef532b196acbf5a5a873c985a547dd0bb70289ce70250cL119#2022-01-0118:43ericdallonot sure, maybe @U051BLM8F will know better#2022-01-0118:51Drew Verleeyep, i'm guessing the line you linked is the top stack. maybe the cider-scale-background color shouldn't be set to nil there?
Hard for me to say.#2022-01-0118:51Drew Verlee(setq cider-docview-code-background nil)#2022-01-0310:22bozhidar> it makes doom-emacs doesn't start, my guess is that it's a elisp issue indeed on cider
Perhaps there's something in Doom's code related this advice? The change made to CIDER's code should be more or less equivalent to what was done before. (the code was just updated to follow the modern Emacs advice conventions)#2022-01-0310:23bozhidarAt any rate - please file a ticket about this, so we won't forget to explore it more more details.#2022-01-0310:23bozhidarOut of the box CIDER still works fine, so I'm inclined to believe that the problem is some combination of the code in Doom + CIDER.#2022-01-0310:28bozhidarYeah, the problem is here https://github.com/hlissner/doom-emacs/blob/f18a8ad10984162ae178a3dbd83604cfbeac1b07/modules/lang/clojure/config.el#L239#2022-01-0310:29bozhidarGenerally I don't even remember why we had advised this in the first place, but I'm 100% this code is causing your breakage.#2022-01-0310:55bozhidarBtw, I've noticed that the Doom configuration for CIDER is huge and they are doing some questionable things here and there (e.g. redirecting everything from the nrepl-server buffer to the REPL, given there's a middleware that redirects everything that you'd really want redirected)#2022-01-0310:59bozhidarAnyways, I guess Emacs distros are called opinionated for a reason. 😄#2022-01-0314:07ericdallo@U051BLM8F thanks for the help, I'm almost sure that code is outdated and people maybe don't know about this middleware or is not the default or easy to setup for some reason(?)#2022-01-0314:46bozhidarNot a big deal. I guess the main concern they had were any potential errors during server startup, as those go to the server buffer (although something should be displayed in the minibuffer as well). Not a big deal, I was just a bit concerned they might end up patching something just because they don't quite understand it.#2022-01-0123:59Drew Verleei get this error File mode specification error: (file-missing Cannot open load file No such file or directory cider-compat) when i run cider-jack-in-cljs in a .cljc file.
I tried looking for this cider-compat and it appears here https://github.com/clojure-emacs/helm-cider/blob/master/helm-cider-spec.el#2022-01-0200:10Drew Verleei probalby need to remove a cache or something#2022-01-0200:15Drew Verleehow do i get a stack trace of a line number for these errors?#2022-01-0204:29Drew VerleeI seem to get this error when ever i load a clojure file.#2022-01-0204:30Drew VerleeDebugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "cider-compat")
#<subr require>(cider-compat)
apply(#<subr require> cider-compat)
require(cider-compat)
eval-buffer(#<buffer *load*-421903> nil "/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." nil t) ; Reading at buffer position 960
load-with-code-conversion("/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." "/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." nil t)
#<subr require>(helm-cider-spec)
apply(#<subr require> helm-cider-spec)
require(helm-cider-spec)
eval-buffer(#<buffer *load*> nil "/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." nil t) ; Reading at buffer position 1340
load-with-code-conversion("/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." "/home/drewverlee/.emacs.d/elpa/27.2/develop/helm-c..." nil t)
helm-cider-mode()
run-hooks(change-major-mode-after-body-hook prog-mode-hook clojure-mode-hook)
apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook clojure-mode-hook))
run-mode-hooks(clojure-mode-hook)
clojure-mode()
set-auto-mode-0(clojure-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer binary_boarding_5.clj> "~/Personal/aoc2020/src/binary_boarding_5.clj" nil nil "~/Personal/aoc2020/src/binary_boarding_5.clj" (17039696 2067))
#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files. When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x1ff7bda0be01>)("/home/drewverlee/Personal/aoc2020/src/binary_board...")
apply(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files. When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x1ff7bda0be01>) "/home/drewverlee/Personal/aoc2020/src/binary_board..." nil)
editorconfig--advice-find-file-noselect(#f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files. When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x1ff7bda0be01>) "/home/drewverlee/Personal/aoc2020/src/binary_board...")
apply(editorconfig--advice-find-file-noselect #f(compiled-function (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer.\nIf a buffer exists visiting FILENAME, return that one, but\nverify that the file has not changed since visited or saved.\nThe buffer is not selected, just returned to the caller.\nOptional second arg NOWARN non-nil means suppress any warning messages.\nOptional third arg RAWFILE non-nil means the file is read literally.\nOptional fourth arg WILDCARDS non-nil means do wildcard processing\nand visit all the matching files. When wildcards are actually\nused and expanded, return a list of buffers that are visiting\nthe various files." #<bytecode 0x1ff7bda0be01>) "/home/drewverlee/Personal/aoc2020/src/binary_board...")
find-file-noselect("/home/drewverlee/Personal/aoc2020/src/binary_board...")
mapcar(find-file-noselect ("/home/drewverlee/Personal/aoc2020/src/binary_board..."))
(let* ((files (helm-marked-candidates)) (buffers (mapcar 'find-file-noselect files))) (spacemacs//helm-open-buffers-in-windows buffers))
(lambda (candidate) (let* ((files (helm-marked-candidates)) (buffers (mapcar 'find-file-noselect files))) (spacemacs//helm-open-buffers-in-windows buffers)))("/home/drewverlee/Personal/aoc2020/src/binary_board...")
helm-execute-selection-action-1()
helm-execute-selection-action()
helm-internal(helm-source-find-files "/home/drewverlee/Personal/aoc2020/src/" "Find files or url: " nil nil "*helm find files*" nil nil nil)
apply(helm-internal (helm-source-find-files "/home/drewverlee/Personal/aoc2020/src/" "Find files or url: " nil nil "*helm find files*" nil nil nil))
helm(helm-source-find-files "/home/drewverlee/Personal/aoc2020/src/" "Find files or url: " nil nil "*helm find files*" nil nil nil)
apply(helm (helm-source-find-files "/home/drewverlee/Personal/aoc2020/src/" "Find files or url: " nil nil "*helm find files*" nil nil nil))
helm(:sources helm-source-find-files :input "/home/drewverlee/Personal/aoc2020/src/" :case-fold-search smart :preselect nil :ff-transformer-show-only-basename t :default nil :prompt "Find files or url: " :buffer "*helm find files*")
helm-find-files-1("/home/drewverlee/Personal/aoc2020/src/")
(let* ((hist (and arg helm-ff-history (helm-find-files-history nil))) (default-input hist) (input (cond ((and (eq major-mode 'dired-mode) default-input) (file-name-directory default-input)) ((and (not (string= default-input "")) default-input)) (t (expand-file-name (helm-current-directory)))))) (set-text-properties 0 (length input) nil input) (helm-find-files-1 input))
spacemacs/helm-find-files(nil)
funcall-interactively(spacemacs/helm-find-files nil)
call-interactively(spacemacs/helm-find-files)
lazy-helm/spacemacs/helm-find-files()
funcall-interactively(lazy-helm/spacemacs/helm-find-files)
call-interactively(lazy-helm/spacemacs/helm-find-files nil nil)
command-execute(lazy-helm/spacemacs/helm-find-files)#2022-01-0204:35Drew Verleecommenting out the require for cider-compat seems to remove the error. no idea if thats the right idea. i can't tell what thats doing https://github.com/clojure-emacs/helm-cider/blob/master/helm-cider-spec.el#2022-01-0204:38Drew Verleeseems to be this package.... https://github.com/pjstadig/dotfiles/blob/master/.emacs.d/elpa/cider-20201210.1748/cider-compat.el#2022-01-0210:23practicalli-johnSeems the cider-compat.el library was to support earlier versions of Emacs (before 26), so assuming your using Emacs 26 or newer, then comment/ removing that line from helm-cider code seems fine (I am not expert though)
https://github.com/clojure-emacs/cider/issues/1882#2022-01-0210:47practicalli-johnIt seems cider-compat contains two macros, if-let* and when-let* which are defined if they do not already exist.
helm-cider-spec.el doesnt call either of these as functions, so it seems the cider-compat namespace require is not needed anyway.
The cider-compat does require subr-x, and helm-cider-spec.el does use functions from that namespace, however, helm-cider-spec.el also requires subr-x namespae.#2022-01-0212:16practicalli-johnI've https://github.com/clojure-emacs/helm-cider/issues/12 to request removing the require of cider-compat as its simply not needed#2022-01-0213:03practicalli-johnI've also raised a PR#2022-01-0213:03practicalli-johnhttps://github.com/clojure-emacs/helm-cider/pull/13#2022-01-0215:48Drew Verlee👀#2022-01-0217:56practicalli-johnUpdated helm-cider package now available via Melpa now (and therefore available in Spacemacs package updates too)#2022-01-0214:54practicalli-johnFYI helm-cider errors when opening Clojure files when using latest snapshot of CIDER. Some options for work-arounds here: https://practical.li/blog/posts/emacs-cider-removing-old-cider-compat/
I've raised a PR with helm-cider#2022-01-0310:27bozhidarFYI - the helm-cider issue has been fixed and a new version (0.5) is out. I had completely forgotten about this package to be honest. In general it's a bad idea to rely on private compatibility workarounds. At any rate - I'm glad we finally removed the last of them. Life is easier on Emacs 26+.#2022-01-0310:31h0bbitOff-topic, but can you please share why life is easier on Emacs 26+ :D . Context: I maintain pdf-tools, which currently supports Emacs all the way back to 24.3. This is causing problems for me and I plan to drop support for Emacs 24. org-mode policy is to support 3 major versions of Emacs (which would be 25, 26, 27 since 28 is not yet released). If there are good reasons to drop support for Emacs 25, I might as well do that in one-go as well :D#2022-01-0311:04bozhidarLife is easier because we can use more newer APIs without resorting to hacks like the cider-compat.el that got deleted. 🙂 This simplifies the CI setup/speed as well.
Our policy is to support whatever Emacs ships with RHEL and Debian Stable and for a while that has been Emacs 26.#2022-01-0311:05bozhidarAlso - Emacs 28 is going to be released pretty soon, so the 3 last releases will be 26, 27 & 28 anyways. 🙂#2022-01-0311:08bozhidarJust check https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS.26 and look for * Lisp Changes in Emacs 26.1#2022-01-0311:08bozhidarNothing really major, but if almost no one uses Emacs 25 at this point, why not make our lives easier and the codebase better?#2022-01-0311:09bozhidarAdmittedly, my hand was also forced by some upstream deps of CIDER that dropped support for Emacs 25 (e.g. seq.el).#2022-01-0404:47h0bbitThanks, I'd love nothing more than to drop support for it, if only to simplify my life and CI setups :P . I'll review the NEWS as well as cider-compat files. I'm hoping Emacs 28 releases soon! 🤞#2022-01-0318:56practicalli-johnProposed two minor changes to the way cider-clojure-cli-aliases is used.
Happy to raise a PR if this seems okay
https://github.com/clojure-emacs/cider/issues/3125#2022-01-0409:58practicalli-johnPR was raised with the changes and additional unit tests. Some of the checks are failing, but this seems to be due to things outside the scope of this change.
Please let me know if there are further changes I should make to the PR. Thank you.#2022-01-0410:04bozhidarLooks good. Thanks!#2022-01-0522:14winsomeIs there a way to get my logs to show up in the repl? I'm using clojure.tools.logging with logback-classic, with a logback.xml that has <appender-ref ref="STDOUT" />#2022-01-0522:15winsomeLogging definitely works to stdout after I've built it, but I'd love to see the output while I'm developing#2022-01-0523:39vemvIf you fire up a vanilla repl with no cider in it, does the logging go to stdout / is visible through that vanilla repl?#2022-01-0612:19coetry👋 I have a shadow repl connnected to my build in the browser in the bottom buffer, however in the top buffer where my source is, the minibar is reporting that nothing is connected. As a result, I'm not able to eval any forms from that buffer. Any ideas?#2022-01-0615:02SophieHave you opened your app in the browser?#2022-01-0620:03coetryyeah, and the bottom repl evaluates expressions fine (i can do (js/alert "yo") and it works without issue)#2022-01-0620:04coetryI can even load up the namespace in the repl, but i can't eval forms from the top buffer#2022-01-0618:05richiardiandreaHi there, I am testing cider-upgrade-nrepl-connection but I just see Starting nREPL's sideloader in the message buffer...what is a nice smoke test to try?#2022-01-0618:06richiardiandrea(require 'cider.nrepl.middleware) works and I did not include it in my deps.edn nice!#2022-01-0618:09richiardiandreaDoes the sideloader also loads refactor-nrepl?#2022-01-0618:10vemvI don't know much about the sideloader (or should I say ciderloader? cider)
I believe @U07FP7QJ0 is the man#2022-01-0618:24richiardiandreait seems to all work very well#2022-01-0618:25richiardiandrea(apart from the warning, that I am leaving on just to understand that I need to upgrade :D)#2022-01-0811:49bozhidarIt doesn't currently load refactor-nrepl, but this can be added in clj-refactor.el.#2022-01-0811:50bozhidarI've yet to document this properly on http://docs.cider.mx, but there's plenty of info about the sideloader on http://nrepl.org.#2022-01-0811:51bozhidarAnd we also have the blog posts by Arne#2022-01-0811:51bozhidarhttps://lambdaisland.com/blog/2021-11-24-making-nrepl-cider-more-dynamic-2#2022-01-0819:17plexuswhich I still need to update based on some input from Bozhidar 🙈 thanks for the reminder#2022-01-0819:18plexusNote that (as I write) I'm not convinced the sideloader is that interesting/useful, but dynamically adding middleware is a game changer.#2022-01-1116:22richiardiandreaFWIW we have also another use case, we would like to load portal when we side load cider-nrepl...it is very nice to have both in dev mode 😄#2022-01-1214:16plexusRight, but same thing applies. Multiple ways to get that onto the classpath, of which the sideloader is IMO the most inferior.#2022-01-1217:14richiardiandreaYeah I remember you mentioned that in the blog post, thanks for working on this stuff by the way!#2022-01-0618:09richiardiandreaDoes the sideloader also loads refactor-nrepl?#2022-01-0906:45normannrepl.cmdline doesn't seem to be able connect to a new unix socket repl. It can start one, and cider will connect over the socket just fine, but I'm not seeing any way to connect to that repl from the command line. Am I missing something or is it just not implemented yet?#2022-01-0906:47normanin fact, even "-i -s mynrepl.sock" fails for lack of a port#2022-01-0920:39bozhidarProbably we forgot to implement this. Please, file a ticket about it.#2022-01-0920:50normanWill do#2022-01-1103:15mister_mDo I need to stop my REPL and re-run M-x cider-jack-in after adding a new lein dependency (and running lein deps) ?#2022-01-1103:18dpsuttonyou do not need to run lein deps to download deps. but you will need to restart the repl. just cider-jack-in will be sufficient#2022-01-1103:18mister_mThanks :thumbsup:#2022-01-1116:27Benjaminisn't there some function that prints a clojure quote or do I misremember that#2022-01-1116:28dpsuttonwhat is a clojure quote?#2022-01-1116:29dpsuttonthere’s m-x cider-drink-a-sip which will print some CIDER tips. Is that what you mean?#2022-01-1116:32BenjaminSome inspirational quote. Ye not drink-a-sip#2022-01-1210:41bozhidarI think it was cider-words-of-inspiration or something like this. It's basically used to display an inspirational message on connect.#2022-01-1211:08Benjaminyea I did remember something with inspiration 😛 Guess it's out of scope. But cool instead of lorem ipsum#2022-01-1215:25jumarAfter upgrading cider today to the latest version I've got a weird error when trying to start a clojure repl in one of my leiningen projects.
At first, thought it's a leiningen issue because I also upgrade lein, but it doesn't seem so now (`lein repl` works fine).
Here's the error: https://clojurians.slack.com/archives/C0AB48493/p1642000230007800
Here's the stacktrace: https://clojurians.slack.com/archives/C0AB48493/p1642000794009900
Does anyone know what might be causing this?
I'm using macOS 12.1.
$ lein -v
Leiningen 2.9.8 on Java 1.8.0_302 OpenJDK 64-Bit Server VM
It seems that after upgrading cider today I face some weird errors -#2022-01-1215:32vemvwhat's twarc.core? Do you have anything funny in your user.clj?
I think #1 thing you should determine is what is invoking tools.analyzer. Generally that's not something Lein or cider-nrepl do.
refactor-nrepl does, however it's not present in the stacktrace
If you're using refactor-nrepl make sure to use version > 3, older versions have less graceful err handling#2022-01-1215:36vemvchecking out again the stacktrace, my bet would be that this has nothing to do with tooling, but with dep resolution (which might have changed with the Lein update?)#2022-01-1215:37vemvbasically core.async depends on tools.analyzer, so if you had two deps depending on different tools.analyzer versions, maybe the wrong one is winning#2022-01-1215:37vemvyou can just bump core.async and t.ana both to $latest and see what happens#2022-01-1215:40jumartwarc is a quartz wrapper: https://github.com/prepor/twarc
It's funny that lein repl just works but cider-jack-in fails with the exception#2022-01-1215:41jumarFrom the deps, this is relevant to core.async and tools analyzer
[org.clojure/core.async "1.3.618"]
[org.clojure/tools.analyzer.jvm "1.1.0"]
[org.clojure/tools.analyzer "1.0.0"]
[org.ow2.asm/asm "5.2"]#2022-01-1215:43vemvI'd try to use latest, for example core.a is now in 1.5.x
I don't think cider requires core.a, but the more stuff you give to a dep resolution algo, the funnier it can get :)#2022-01-1215:45jumarJust bumping up tools.analyzer.jvm to 1.2.2 helped.
@U45T93RA6 thanks a ton!#2022-01-1215:46vemvcider !#2022-01-1217:39jumarI found another thing which I believe worked fine before - cider-pprint-eval-last-sexp and cider-pprint-eval-defunt-at-point now fail with this:
apply: Cannot open load file: No such file or directory, cider-compat
Before, a new buffer would be open with pretty-printed result.#2022-01-1217:39jumarI use spacemacs so it might be related to do - wanted to ask here first to be sure.#2022-01-1217:41vemvknown one, I believe the latest cider shapshot fixed cider-compat whoopsies?#2022-01-1217:48jumar👍#2022-01-1221:11practicalli-johncider-compat was remove (its now redundant) at the end of 2021. A package update in Spacemacs should get the latest snapsots of cider and related packages (i.e. helm-cider if using helm)#2022-01-1305:52jumarUpdating all my emacs packages and spacemacs to latest develop helped.
Thanks @U05254DQM !#2022-01-1221:57zalkyHi all, wondering about the cider nrepl port auto detection functionality. I work with both a both a clj repl, and a cljs repl via shadow, but if a clj repl is already started, it will fail to autodetect the shadow nrepl server port. My best guess from a quick glance at the cider code is that nrepl-extract-port in nrepl-client.el will always choose the clj port over the shadow port, even if both may be valid. Should nrepl-extract-port return multiple ports if they exist? Wondering from someone with more cider expertise if this is issue worthy, or if there is some other configuration approach I'm missing. Thanks!#2022-01-1223:52mister_mI'm having some trouble debugging a defrecord in cider (1.2.0snapshot) . When instrumenting the top level form with C-u C-M-x I get the following error: Unable to resolve symbol: STATE__ in this context https://github.com/clojure-emacs/cider/issues/2453 -- has anyone run into something similar? My error trace is https://gist.github.com/matt-y/f3a83c025a6ceefcdb7d20d2c8bb7c11 . The form compiles fine, I only run into this failure when trying to debug the top level form. Happy to make a bug report if that is appropriate.#2022-01-1307:00Ben SlessI don't think you can debug defrecords. I tried but got the same exception. What people usually do is pull out the implementation if the method they want to debug to a defn#2022-01-1307:00Ben SlessThen directly dispatch to it in the record#2022-01-1314:47mister_mI see. I can do that then, thanks.#2022-01-1305:13didibusIs there a way in Cider to have output display in line? For example right now you get inline evaluation, where the return of evaluation shows up next to the line I evaled in the buffer, but if it also printed something I need to open the REPL window. I'd like to have the output show up inline as well somehow. Is that an existing feature?#2022-01-1308:16magnarsC-u C-x C-e
If cider-eval-last-sexp is bound to C-x C-e , you'll insert the output into the buffer with the prefix command C-u .#2022-01-1308:26didibusBy output, I mean like what goes to out like say when I do (println "hello") I'd like to see "hello" in the buffer#2022-01-1407:04bozhidarAh, got it. No, that's currently not possible.#2022-01-1407:04bozhidar(but it's quite doable)#2022-01-1406:09Nom Nom MousseJust found out about the debugger. What a marvel CIDER is ❤️#2022-01-1406:31Nom Nom MousseI have a web app running, started from within the CIDER REPL. I have added breakpoints to a part of the backend code, evaluated the buffer, and then invoked the function again indirectly (click front-end button which sends a request to the backend). But CIDER does not break at the breakpoint.
Should what I am trying to do be possible? I.e. adding breakpoints to a live app?#2022-01-1407:06bozhidar@endrebak It should work. There was a bug in older versions that messed up the debugger over http, but we addressed it last year https://github.com/clojure-emacs/cider-nrepl/issues/689#2022-01-1414:26Dimitar UzunovHi is there a way to display the history of the return values of evaluated forms (like you do with C-c C-c)?#2022-01-1414:26Dimitar UzunovI see there is M-x cider-repl-history but it is empty, mostly likely because I don’t type in the repl window#2022-01-1414:27dpsuttoni think this is what the repl is good for. I always send forms to the repl so i have a history of it#2022-01-1414:30Dimitar UzunovI usually use C-c C-p to print to another window when I know I want to read the output, but sometimes when eval-ing forms I want to take a second look#2022-01-1421:46practicalli-john@dimitar.ouzounoff to navigate through the history of evaluated form results, I suggest using Portal - https://github.com/djblue/portal which can be used as a tap> source and keeps a history of the results sent to portal.
A very simplistic approach is to evaluate results to a comment, cider-eval-defun-to-comment in the source code buffer and keep all the comments. Each new evaluation adds a comment
The Cider repl history only keeps a the history of forms and not their results.#2022-01-1604:14stardiviner[BUG] I found I can’t complete library namespace after require or import with latest version CIDER CIDER 1.3.0-snapshot (package: 20220113.610) . I tried to use old git source code commit version cider, still not working.#2022-01-1604:17vemvcould you report it on github as detailedly as possible?
thanks!#2022-01-1604:18stardivinerSure. I originally message here to confirm whether it’s a bug. I will report bug on github.#2022-01-1708:45bozhidarI can't think of any recent changes in this area, but it's always possible there's some regression.#2022-01-1613:25Nom Nom MousseI have a program that relies on futures a lot. If I set a #break in a future will it still work?#2022-01-1722:14vemvsee also https://github.com/clojure-emacs/cider-nrepl/issues/630#issuecomment-524857244#2022-01-1623:31Charles ComstockI've recently started to have problems with Cider and CLJS after updating to the latest Cider. After the application loads and it kicks off the nested Figwheel repl, the page loads, and is functioning (ie CLJS compiled), but just after it completes a "Exception updating the ns-cache" shows up in the repl output. Specifically it's triggering an NPE by way of cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.cljs.analysis$all_ns. The repl is still running but it throws the NPE about updating the ns-cache even if I try to execute (+ 1 2). I'm happy to submit a detailed bug report, but am not sure if it should be against Cider, cider.nrepl, or orchard? I've been using this setup daily for the past year without any issue like this, so it's certainly possible I changed a config somewhere, but seems highly suspect it's related to some change in the Cider update. Anyone else encountering something like this?#2022-01-1700:03Charles ComstockHere is a more detailed example of the output in the repl buffer: https://gist.github.com/dgtized/aa046d06c921d4cb9f7dc51ea2729459.#2022-01-1700:40vemvWe changed that code very recently. Looks like something was nilable whereas we didn't expect so.
We'll be fixing it within ~1 day
Thanks much for the report 🙏#2022-01-1700:41Charles ComstockYou are welcome, thanks for taking a look so quickly!#2022-01-1700:52vemvI realise this might be somewhat hard but do you have it possible to jump to cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.cljs.analysis and add a println in line 12? https://github.com/clojure-emacs/orchard/blob/febf8169675af1b11a8c00cfe1155ed40db8be42/src/orchard/cljs/analysis.cljc#L12
In [ns-sym ns] , ns-sym is clearly nil, however I'm curious about ns#2022-01-1700:54Charles ComstockJump to mechanism is broken because of the error, but I guess could try to set that up as a local repo dependency temporarily? Though not quite sure what I would exclude as it's supposed to be an inline from the injected nrepl right? Sorry happy to try, but a little unsure how to start?#2022-01-1701:01vemvnote that the ns is jvm clojure, is jvm interaction broken as well?#2022-01-1701:02Charles ComstockSo I tried adding cider/orchard {:local/root "../../upstream/orchard/"} to my deps.edn after placing it there and making println the change, however, I'm getting the following error: error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Error building classpath. Manifest type not detected when finding deps for cider/orchard in coordinate #:local{:root "/home/clgc/code/upstream/orchard"}. Is it expecting a pom.xml file or something? I will double check on jvm alone, AFAIK that was working.#2022-01-1701:06Charles ComstockConfirmed that CIDER is working fine on a tiny project that is only using Clojure, no CLJS. So it looks like it's CLJS specific?#2022-01-1701:10vemvyes it's definitely cljs specific#2022-01-1701:12vemvhaving a local checkout is pretty difficult, because we use "mranderson" to add prefixes to namespaces
... make install installs Orchard to your ~/.m2 with the mranderson stuff if you're willing to give it a shot#2022-01-1701:12vemvbut honestly it's no big deal, mostly I seek to gain understanding of what's going on, which is not crucial, I can just use some-> :)#2022-01-1701:12Charles ComstockOk and then I would roll back the local/root change?#2022-01-1701:13vemvmmm make install will not work, sorry for the noise.
let's leave it at that, I'll add that some->#2022-01-1701:14Charles ComstockGotcha, yea I was trying adding a manual deps.edn to orchard root but it didn't seem to override it correctly#2022-01-1701:16Charles ComstockAppreciate it might have it's own problems getting setup, but https://github.com/dgtized/shimmers is CLJS project I was having trouble with. Don't know if that helps for diagnosis at all, but if it helps.#2022-01-1701:17vemv👀 if I run bin/repl can I expect to repro this?#2022-01-1701:17Charles Comstockno if you cider-jack-in-cljs#2022-01-1701:17Charles Comstockbin/repl I believe is working, will double check#2022-01-1701:20Charles Comstockbin/repl is working but it's just setting up the figwheel repl and not doing any of the cider/piggieback handshake which is where this is failing I think. I don't know if I explained that well before but the CLJS builds, it launches the page but then a second or so later the exception triggers, so I don't think it's happening until piggieback starts trying to talk to the page in the browser?#2022-01-1701:27vemvI'll see if I can repro using the repo else no issue :)#2022-01-1701:28Charles ComstockI can also trigger it by running /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/piggieback {:mvn/version "0.5.2"} refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} cider/cider-nrepl {:mvn/version "0.28.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -Mdev:cider/nrepl from the commandline, and then connecting with cider-connect-cljs. However it fails the same way after it compiles and kicks off figwheel to host the page. It brings up the prompt and then gives the NPE. So again I think that means it's only happening once it starts trying to talk with the browser repl.
Thank you so much, happy to provide any other information that might help.#2022-01-1701:30Charles Comstock(to clarify, "it starts trying to talk with the browser repl", the it is not figwheel/clojurescript, but Cider/orchard and associated tools)#2022-01-1701:42vemvalright! so unfortunately my cider.el setup is really old so cider-connect-cljs won't work for me with a modern stack
Anyway here's the fix, should be released within a day https://github.com/clojure-emacs/orchard/pull/148#2022-01-1701:43Charles ComstockCool, thank you so much!#2022-01-1701:44Charles ComstockIn the meantime, should I just try rolling back orchard to the previous release or something? Or is it more in something that uses that?#2022-01-1701:44Charles Comstock(also can wait, just curious if there is a workaround)#2022-01-1701:47vemvyes, but it's not orchard that you have to rollback but cider-nrepl#2022-01-1701:47vemvbecause c-nrepl bundles orchard via "mranderson"#2022-01-1702:00Charles Comstockgotcha, thanks. I tried overriding
(setq cider-required-middleware-version "0.27.4"
cider-injected-middleware-version "0.27.4")
But that doesn't seem to update the version requested at connection as it's still requesting 0.28.0. So I must not be modifying the right values to force the older cider-nrepl. Anyway thanks for all your help, I guess I will just wait for the fix.#2022-01-1702:13vemvcider-injected-middleware-version should work. It doesn't, of course, if you will use cider-connect over a process you spawned yourself#2022-01-1702:13Charles Comstockoh right that makes sense, I will try that, thank you#2022-01-1718:47Charles ComstockOh! I figured it out:
(setq cider-required-middleware-version "0.27.4"
cider-injected-middleware-version "0.27.4")
(cider-add-to-alist 'cider-jack-in-lein-plugins
"cider/cider-nrepl" cider-injected-middleware-version)
Just updating cider-injected-middleware-version is insufficient, because the add-to-alist update to 'cider-jack-in-lein-plugins is top level and only execute on initial require. I think it might make sense to force the add-to-alist calls to recompute just prior to running jack-in if they depend on a defcustom variable. Anyway I will submit an issue or see if I can dust off a PR to address it#2022-01-1718:49vemvGot it! I think we introduced one of those defcustoms just a few months ago so yeah it's not impossible that it doesn't really work.
PR welcome#2022-01-1719:29Charles ComstockOoph, that's kinda gnarly in there, I documented it in https://github.com/clojure-emacs/cider/issues/3133, and will think on if there is a clean PR to address.#2022-01-1719:30Charles ComstockThanks so much for your help again though!#2022-01-1718:48gdanovIs cider supposed to evaluate depending namespaces? E.g. I have foo.core which contains protocols and foo.impl with implementations of the protocols.
When I c-c c-k (eval buffer) in the foo.core buffer and re-run code in the REPL that uses foo.impl I get the type of exceptions that show foo.impl is stale and I need to re-evaluate it#2022-01-1718:50vemvwith cider-ns-refresh, which is a wrapper for tools.namespace
or reload dependent namespaces by hand, some people swear by it#2022-01-1718:53dpsuttoncan you explain a bit more of what you are doing? It sounds like you edited foo.impl, then reload foo.core and want to see the updated behavior of foo.impl? Is that correct?#2022-01-1718:54gdanov@U45T93RA6 I don’t see how it’s supposed to solve my problem? plus, I’ve found it to mess up the repl if used too often#2022-01-1718:57gdanov@U11BV7MTK let me fix my explanation:
1. with existing and evaluated foo.impl edit foo.core
2. eval foo.core
3. re-run code in repl
4. get error
No implementation of method: :apply-reaction of protocol:
#'ffr.core/Reaction found for class: ffr.reactions.Targets
#2022-01-1718:57vemvso core contains a defprotocol, and impl defrecords?
if you change core, save, then cider-ns-refresh, it will reload core and impl, preventing errors related to staleness#2022-01-1718:57gdanovI need to save?#2022-01-1718:58vemvnot super sure with cider-ns-refresh, personally I use tools.namespace directly, which does#2022-01-1718:59vemvmy unknown is whether cider-ns-refresh saves, should be easy to check
but it's certainly needed, because it uses this external lib called tools.namespace#2022-01-1719:01gdanovns-refresh does not do the job unfortunately, I get the same error#2022-01-1719:03vemvgenerally it works but it can not work like 1% of the time, unless you take some explicit measures
see also https://clojurians.slack.com/archives/C03S1KBA2/p1642439762134300?thread_ts=1642430221.125500&cid=C03S1KBA2#2022-01-1719:05gdanovI think metadata is looked up last, so this is the slowest performing option. I’d rather switch and re-eval, but thanks#2022-01-1719:06vemvit's not looked up last, it's in the middle of the check chain#2022-01-1719:06vemvalso protocols generally represent IO work, so dispatch overhead will be negligible compared to said IO costs#2022-01-1719:47peterdeeUpdating to cider-20220113.610 I found I was getting a version mismatch "WARNING: CIDER 1.3.0-snapshot requires cider-nrepl 0.28.0, but you're currently using cider-nrepl 0.27.4.". I got around it by (setq cider-jack-in-lein-plugins '(("cider/cider-nrepl" "0.28.0"))) which seems odd because the project where I started has a deps.edn and no project.clj.#2022-01-1719:49vemvmaybe you have cider-nrepl in your deps.edn which would need updating as well?
but yeah IIRC there's some internal conflation between lein and deps.edn#2022-01-1805:30lassemaattawhen running cider-jack-in-clj (or -cljs), cider asks me which command should be used. In our project, with clj the answer is lein and with cljs its shadow-cljs. Is it possible to configure this automatically with e.g. .dir-locals.el? I tried browsing through the cider variables, but didn't find anything suitable.#2022-01-1805:53dpsuttonthis both exists and doesn’t exist. What exists is a var called cider-preferred-build-tool. Using .dir-locals, you can make this var have lein when in clojure-mode and shadow when in clojurescript mode. But this leaves ambiguity when in an edn buffer like shadow-cljs.edn annoyingly. And even more annoyingly, it (currently) isn’t configured by cider-jack-in-clj and cider-jack-in-cljs which it should. So the answer is “kinda” and open to improvements. You could also make little functions like work-clj-repl and work-cljs-repl that call cider-jack-in with the correct vars passed in#2022-01-1806:10lassemaattaBased on my very minimal emacs experience I assume the first trick you mentioned requires that I must be in a cljs buffer to start the cljs repl and vice versa with clj? I guess creating custom functions is a better choice, that way I can call them regardless of the buffer type I assume#2022-01-1806:13dpsuttoncorrect about the buffer types. you can set dir-locals that work in all modes, and you can set values for each type of mode you are in. But yeah it would require being in a cljs buffer when you start up your repl. and forgetting that makes a long and annoying mistake. I’d for sure go with functions#2022-01-1909:29Nom Nom MousseI'd love to use the debugger, but I can't get it to break in a live luminus app, only when evaluating forms in the buffer. What would you recommend I start to look at to investigate why this happens?#2022-01-1910:06Nom Nom MousseIf I try to add #break before starting my app I get the following error when attempting to start it:
Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'cider.nrepl.middleware.debug/breakpoint-reader
#2022-01-1914:26jumar@endrebak how recent cider you have installed?
It's usually working very well in our web app based on ring.#2022-01-1916:40Nom Nom MousseGood point! I'll try upgrading tomorrow#2022-01-2108:56Benjaminwith the latest master cider there is an error (in some cases) when it handles an exception Cannot open <nil> as a Reader#2022-01-2108:57BenjaminERROR: Unhandled REPL handler exception processing message {:op stacktrace, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :session 544c1c6d-8c96-4538-9149-3eb86f66bc09, :id 96}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot open <nil> as a Reader.
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at clojure.core$deref_future.invokeStatic(core.clj:2304)
at clojure.core$future_call$reify__8477.deref(core.clj:6976)
at clojure.core$deref.invokeStatic(core.clj:2324)
at clojure.core$deref.invoke(core.clj:2310)
at clojure.core$map$fn__5884.invoke(core.clj:2759)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5419.invokeStatic(core.clj:139)
at clojure.core$filter$fn__5911.invoke(core.clj:2813)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.length(RT.java:1785)
at clojure.lang.RT.seqToArray(RT.java:1726)
at clojure.lang.LazySeq.toArray(LazySeq.java:132)
at clojure.lang.RT.toArray(RT.java:1699)
at clojure.core$to_array.invokeStatic(core.clj:346)
at clojure.core$sort.invokeStatic(core.clj:3101)
at clojure.core$sort.invokeStatic(core.clj:3090)
at clojure.core$sort.invoke(core.clj:3090)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$classpath_namespaces.invokeStatic(namespace.clj:119)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$classpath_namespaces.invoke(namespace.clj:106)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$project_namespaces.invokeStatic(namespace.clj:131)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$project_namespaces.invoke(namespace.clj:123)
at cider.nrepl.middleware.stacktrace$directory_namespaces.invokeStatic(stacktrace.clj:132)
at cider.nrepl.middleware.stacktrace$directory_namespaces.invoke(stacktrace.clj:122)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invokeStatic(stacktrace.clj:216)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invoke(stacktrace.clj:213)
at cider.nrepl.middleware.stacktrace$analyze_cause.invokeStatic(stacktrace.clj:323)
at cider.nrepl.middleware.stacktrace$analyze_cause.invoke(stacktrace.clj:314)
at cider.nrepl.middleware.stacktrace$analyze_causes$fn__4422.invoke(stacktrace.clj:348)
at clojure.core$map$fn__5880$fn__5881.invoke(core.clj:2746)
at clojure.core$take_while$fn__5931$fn__5932.invoke(core.clj:2905)
at clojure.lang.Iterate.reduce(Iterate.java:81)
at clojure.core$transduce.invokeStatic(core.clj:6885)
at clojure.core$into.invokeStatic(core.clj:6901)
at clojure.core$into.invoke(core.clj:6889)
at cider.nrepl.middleware.stacktrace$analyze_causes.invokeStatic(stacktrace.clj:347)
at cider.nrepl.middleware.stacktrace$analyze_causes.invoke(stacktrace.clj:339)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invokeStatic(stacktrace.clj:356)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invoke(stacktrace.clj:353)
at clojure.lang.Var.invoke(Var.java:388)
at cider.nrepl$wrap_stacktrace$fn__2459.invoke(nrepl.clj:432)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_format$fn__2377.invoke(nrepl.clj:194)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.interruptible_eval$interruptible_eval$fn__1278.invoke(interruptible_eval.clj:154)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_inspect$fn__2395.invoke(nrepl.clj:227)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.session$add_stdin$fn__1396.invoke(session.clj:379)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.sideloader$wrap_sideloader$fn__1901.invoke(sideloader.clj:108)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_xref$fn__2509.invoke(nrepl.clj:514)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_out$fn__2419.invoke(nrepl.clj:334)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_ns$fn__2411.invoke(nrepl.clj:300)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_debug$fn__2361.invoke(nrepl.clj:163)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_enlighten$fn__2369.invoke(nrepl.clj:190)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_profile$fn__2427.invoke(nrepl.clj:343)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_apropos$fn__2335.invoke(nrepl.clj:129)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.dynamic_loader$wrap_dynamic_loader$fn__1464.invoke(dynamic_loader.clj:98)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.load_file$wrap_load_file$fn__1820.invoke(load_file.clj:81)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_tracker$fn__2483.invoke(nrepl.clj:482)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__1211.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_content_type$fn__2319.invoke(nrepl.clj:107)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__1381.invoke(session.clj:325)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__1178.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.server$default_handler$fn__1949.invoke(server.clj:141)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:24)
at nrepl.server$handle_STAR_.invoke(server.clj:21)
at nrepl.server$handle$fn__1917.invoke(server.clj:41)
at clojure.core$binding_conveyor_fn$fn__5772.invoke(core.clj:2034)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalArgumentException: Cannot open <nil> as a Reader.
at $fn__11544.invokeStatic(io.clj:288)
at $fn__11544.invoke(io.clj:288)
at $fn__11446$G__11422__11453.invoke(io.clj:69)
at $reader.invokeStatic(io.clj:102)
at $reader.doInvoke(io.clj:86)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$read_namespace.invokeStatic(namespace.clj:22)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$read_namespace.invoke(namespace.clj:19)
at clojure.
#2022-01-2108:57Benjamincider 8bb67174ffa0cd7ae01f544926b4ed5a17965d76#2022-01-2108:57vemvWill be gone with https://github.com/clojure-emacs/cider-nrepl/pull/744#2022-01-2108:58vemvI think @U051BLM8F was afk a few days, can deploy if needed#2022-01-2108:59Benjaminah can I patch my orchard version then to get the fix already?#2022-01-2109:01vemvtransiently yes, persistently it's harder than it might seem
the transient fix:
jump to
cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace
replicate https://github.com/clojure-emacs/orchard/commit/2728d6fbbbb74388ca3bf5bd383943cb8cb36e41 and eval the changes with cider#2022-01-2109:18vemvAnyway said PR is merged now, if you use cider master via git I guess that you can just pull it, if it's via melpa, you'd have to wait until the melpa badge here https://github.com/clojure-emacs/cider indicates today's day (should happen within a few hours - it's outside our control)#2022-01-2109:18Benjaminsick thanks#2022-01-2109:19bozhidarWe still need a bugfix cider-nrepl release that the MELPA release would use, otherwise people would have to build a new cider-nrepl themselves and point CIDER to it.#2022-01-2109:21bozhidarI've been traveling the past couple of weeks, and now I have a ton of things to catch up with, or so it seems. 🙂#2022-01-2110:26vemvOh yes sorry about that misinfo, having a slow morning I guess#2022-01-2111:01vemvNow it's been actually released, https://clojurians.slack.com/archives/C0617A8PQ/p1642756706060500?thread_ts=1642755404.058900&cid=C0617A8PQ still applies#2022-01-2110:23djanusHello! CIDER used to bind cider-find-var to M-. in buffers connected to a REPL – it appears to have stopped doing that. Is that on purpose?#2022-01-2110:34bozhidarIt's now replaced by default with xref keybindings, and there's a setting to revert to the old behaviour.#2022-01-2110:35bozhidarIn practice xref should behave the same, unless you're using other xref provides for Clojure (e.g. clojure-lsp).#2022-01-2110:35djanushmm, looks like I need to go learn about xref 🙂#2022-01-2110:35djanusthanks!#2022-01-2110:36bozhidarSee https://docs.cider.mx/cider/usage/misc_features.html#xref-integration#2022-01-2113:50mac@U051BLM8F I am having issues with go to definition too. If I just load a Clojure file it works(presumably because of come fallback), but if I jack in, I get 'Nothing under point'. I have tried with CIDER 1.2.0 and CIDER 1.1.1, but the result is the same.#2022-01-2113:52bozhidarIt's not supposed to work in files that haven't been evaluated. #2022-01-2113:53macThe result is the same even if I load the buffer.#2022-01-2113:56mac@U051BLM8F Sorry, forgot to mention you.#2022-01-2114:30bozhidarPlease, share here (or on GitHub) the nREPL message log, which should give us a bitter idea about what's going on.#2022-01-2114:43mac@U051BLM8F This is what i see in the nrepl mesage buffer after enabling logging:#2022-01-2114:43mac(-->
id "23"
op "info"
session "0c26c6f1-51a5-439c-bbdf-f4b76647877d"
time-stamp "2022-01-21 15:41:31.297180000"
ns "http://hypercontracts.domains.contracts.se.adda.trygghetslarm-2019...."
sym "period-form"
)
(<--
id "23"
session "0c26c6f1-51a5-439c-bbdf-f4b76647877d"
time-stamp "2022-01-21 15:41:31.302015400"
arglists-meta (nil nil)
arglists-str "[]"
column 1
end-column 18
end-line 18
file "file:/home/mac/projects/hypercontracts/src/cljs/hypercontrac..."
fn-var "true"
line 18
max-fixed-arity 0
meta (dict ...)
method-params (nil)
name "period-form"
ns "http://hypercontracts.domains.contracts.se.adda.trygghetslarm-2019...."
resource "hypercontracts/domains/contracts/se/adda/trygghetslarm_2019/..."
ret-tag "function"
status ("done")
variadic? "false"
)#2022-01-2114:58bozhidarSeems like data about the symbol was returned properly from the backend. Does this happen only in ClojureScript?#2022-01-2115:07mac@U051BLM8F No, it is the same with Clojure files.#2022-01-2115:09macHere is the corresonding nrepl log for clj.#2022-01-2115:29bozhidarHmm, everything looks just fine in the response. I see all the sym metadata. I'm puzzled as to why this isn't working for you.#2022-01-2115:48mac@U051BLM8F Yeah, it is weird. Is there anything else I can provide? I am using Doom emacs, if that makes a diff?#2022-01-2116:13mac@U051BLM8F And it only starts failing after jack-in. So strange. First I thought it had to do with lsp, but I have diabled that completely.#2022-01-2117:06bozhidarIs this with or without xref integration?#2022-01-2117:13mac@U051BLM8F I have not switched xref on or off. Just using defaults. Is there a way I could check?#2022-01-2121:00mac@U051BLM8F I am attaching the output from describe-kye M-. before and after jacking in. Looks like xref is used after jacking in.#2022-01-2123:43macI finally tracked this down. Apparently it is an emacs bug in the version I am using. See https://github.com/hlissner/doom-emacs/issues/5537#2022-01-2206:50bozhidarGot it. Those are always the hardest bugs to track.#2022-01-2318:18mac@U051BLM8F Sorry to waste your time, thanks for your help.#2022-01-2322:59dgrI’m running the latest snapshot from ELPA (cider-20220121.1047), and running all tests (`cider-test-run-project-tests`) doesn’t seem to work. I have ensured that the test namespace is loaded and can run tests with 🙂 This is also running on Emacs 28.0.91 pretest build from https://emacsformacosx.com/builds, if that might matter. Just fiddling around some more and cider-test-run-loaded-tests also fails with the same error.#2022-01-2400:00vemvThanks for the report!
Could you open it as a github issue?#2022-01-2400:28vemvas some quick debugging you can do:
• type (all-ns) in a JVM repl
• search for a ns named approximately orchard.query (the real name will be munged)
• Invoke its namespaces function like this: (namespaces {:project? true :has-tests? true}).
If it returns nothing, that's the problem :)#2022-01-2401:05dgr(cider.nrepl.inlined-deps.orchard.v0v9v1.orchard.query/namespaces {:project? true :has-tests? true}) => ()#2022-01-2401:06dgr@U45T93RA6 Looks like that’s the issue. I’m happy to open a github issue. How do you want me to describe it for best capture of the root cause (which I don’t quite understand)?#2022-01-2401:21vemvYes an issue against https://github.com/clojure-emacs/orchard would be very appreciated
If you can play a bit with that defn (and also cider.nrepl.inlined-deps.orchard.v0v9v1.orchard.namespace functions) and see which things do work, that would accelerate things.
This is the namespace https://github.com/clojure-emacs/orchard/blob/master/src/orchard/query.clj try passing it different arguments per its docstring.
These two functions also seem relevant https://github.com/clojure-emacs/orchard/blob/dfab99eb9ad4b7373044f8ed1b983992b25fbb1b/src/orchard/namespace.clj#L65-L72#2022-01-2401:22vemv(probably without you diving a bit as suggested I won't be able to do much - this is the sort of stuff that is practically impossible to debug without a repl 😇)#2022-01-2401:35vemvAnother relevant one https://github.com/clojure-emacs/orchard/blob/dfab99eb9ad4b7373044f8ed1b983992b25fbb1b/src/orchard/namespace.clj#L127-L135
If it also returns empty, try removing in-project? and see if it makes a difference#2022-01-2515:51dgr@U45T93RA6 Apologies, got caught up with other things yesterday. I’ll try this later today and open an issue against Orchard with the results.#2022-01-2517:43fjolnehello! have been trying to make cider-pprint-eval-defun-at-point work in CLJS repl with shadow, which seems to be implemented on the shadow side for https://github.com/thheller/shadow-cljs/commit/285829fcc9113ad34d5b0d5e99f4e6c78874e2a4, maybe someone got it working? connecting to shadow's nrepl server, running shadow with latest nrepl, cider-nrepl, piggieback deps injected#2022-01-2520:34zalky@UDQ2UEPMY, just tried this in my shadow build and it seems to work. I'm on cider 1.1.0, nrepl 0.8.3, and cider-nrepl 0.26.0. I don't think piggieback is relevant for a shadow-cljs connection since it has its own middleware to make a cljs repl.#2022-01-2600:15fjolnethank you! turned out pretty printing just broke on all my inputs because of #js tags and some other stuff, I wasn't smart enough to test it on pure data first 🥲#2022-01-2520:27zalkyHi all, wondering what would be the best way to ensure that I have (set! *print-namespace-maps* nil) automatically set when I connect an nrepl via cider. Would it be a cider or nrepl configuration point? Thanks!#2022-01-2520:52dawdlerDoes anybody have any helpful info as to why emacs process hangs, eating 100% CPU and me not being able to interact with the terminal, when running cider and nrepl via cider-jack-in? Appears to happen everytime I encounter a ClassCastException?
clojure-cli command:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} cider/cider-nrepl {:mvn/version "0.28.1"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl#2022-01-2520:53dpsuttoncan you post the full stacktrace?#2022-01-2520:57dawdlerThis? Or debug info from emacs, I appear not to get the latter, since everything just freezes.
Execution error (ClassCastException) at migratus.database/connect* (database.clj:132).
class com.zaxxer.hikari.HikariDataSource cannot be cast to class java.sql.Connection (com.zaxxer.hikari.HikariDataSource is in unnamed module of loader 'app'; java.sql.Connection is in module java.sql of loader 'platform')
#2022-01-2520:58dpsuttonthat’s just normal application code it appears. You are trying to run migrations and its not happy#2022-01-2520:59dpsuttonif you run clj -M:dev in a terminal what happens?#2022-01-2521:00dawdleryeah, just a stupid code error, but that's all the info that pops up. will try your suggestion#2022-01-2521:13dawdlerhere's the stacktrace causing emacs to become unresponsive, running clj -M:dev
{:clojure.main/message
"Execution error (NullPointerException) at migratus.database/connect* (database.clj:133).\nCannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null\n",
:clojure.main/triage
{:clojure.error/class java.lang.NullPointerException,
:clojure.error/line 133,
:clojure.error/cause
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null",
:clojure.error/symbol migratus.database/connect*,
:clojure.error/source "database.clj",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type clojure.lang.ExceptionInfo,
:message "Error on key :db/datasource when building system",
:data
{:reason :integrant.core/build-threw-exception,
:system {},
:function
#object[clojure.lang.MultiFn 0x54d16074 "clojure.lang.MultiFn@54d16074"],
:key :db/datasource,
:value
{:db-spec
{:dbtype "postgresql",
:password
"pazzword",
:connectionInitSql "COMMIT;",
:username "db_user",
:port 5432,
:dbname "my_database",
:host "192.168.0.1",
:maximumPoolSize 3}}},
:at [integrant.core$build_exception invokeStatic "core.cljc" 285]}
{:type java.lang.NullPointerException,
:message
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null",
:at
[migratus.database$connect_STAR_
invokeStatic
"database.clj"
133]}],
:trace
[[migratus.database$connect_STAR_ invokeStatic "database.clj" 133]
[migratus.database$connect_STAR_ invoke "database.clj" 117]
[migratus.database.Database init "database.clj" 255]
[migratus.core$init invokeStatic "core.clj" 170]
[migratus.core$init doInvoke "core.clj" 167]
[clojure.lang.RestFn invoke "RestFn.java" 410]
[backend.db.datasource$eval26692$fn__26694
invoke
"datasource.clj"
22]
[clojure.lang.MultiFn invoke "MultiFn.java" 234]
[integrant.core$try_build_action invokeStatic "core.cljc" 294]
[integrant.core$try_build_action invoke "core.cljc" 293]
[integrant.core$build_key invokeStatic "core.cljc" 302]
[integrant.core$build_key invoke "core.cljc" 298]
[clojure.core$partial$fn__5861 invoke "core.clj" 2643]
[clojure.core.protocols$fn__8181 invokeStatic "protocols.clj" 168]
[clojure.core.protocols$fn__8181 invoke "protocols.clj" 124]
[clojure.core.protocols$fn__8136$G__8131__8145
invoke
"protocols.clj"
19]
[clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 31]
[clojure.core.protocols$fn__8168 invokeStatic "protocols.clj" 75]
[clojure.core.protocols$fn__8168 invoke "protocols.clj" 75]
[clojure.core.protocols$fn__8110$G__8105__8123
invoke
"protocols.clj"
13]
[clojure.core$reduce invokeStatic "core.clj" 6830]
[clojure.core$reduce invoke "core.clj" 6812]
[integrant.core$build invokeStatic "core.cljc" 325]
[integrant.core$build invoke "core.cljc" 305]
[integrant.core$init invokeStatic "core.cljc" 431]
[integrant.core$init invoke "core.cljc" 423]
[integrant.core$init invokeStatic "core.cljc" 428]
[integrant.core$init invoke "core.cljc" 423]
[backend.system$run invokeStatic "system.clj" 31]
[backend.system$run invoke "system.clj" 30]
[backend.core$_main invokeStatic "core.clj" 9]
[backend.core$_main doInvoke "core.clj" 7]
[clojure.lang.RestFn invoke "RestFn.java" 397]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.RestFn applyTo "RestFn.java" 132]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause
"Cannot invoke \"java.sql.Connection.setAutoCommit(boolean)\" because \"conn\" is null"}}#2022-01-2521:31dpsuttoni’m wondering why its trying to do stuff. Do you have any top level stuff in user.clj?#2022-01-2520:53dpsuttonand might be helpful to copy that and run it in a terminal#2022-01-2520:58dawdlerNo difference when running repl in terminal and using cider-connect#2022-01-2520:58dpsuttonThings i do to diagnose: start removing the refactor stuff as sometimes that can get out of date. If still an error, try in a blank project to ensure that its not related to the particular project#2022-01-2521:00dawdlerThanks, will try and remove refactor stuff, thing is, this has happened for a while now, even before I added refactor yesterday.#2022-01-2521:02dpsuttonyeah. my general idea is to remove all tooling, ensure that it fundamentally works. Then slowly reintroduce a single tool at a time.#2022-01-2521:17dawdlerbah, removing all the extra stuff did not bring emacs to silence. thanks, @dpsutton. Said differently: Problem solved.#2022-01-2521:50Nick McAvoyBut what was the problem?#2022-01-2521:57dawdlerI am too embarrassed to tell, but here it is: never ever blindly copy some random person's cider config and expect it to work. I should have known, but I was desperately trying to tidy up my emacs config, and forgot to clean up the cider specific one. Shit happens.#2022-01-2521:58dpsuttonwhat was the offending bit? Knowing the issue can help others in the future. I doubt you’ll be the last person to have this and it could help diagnosing in the future#2022-01-2521:58dpsuttonThere’s no embarrassment about using a config and there being a foot-gun. It’d be nice to know the footgun for the future though#2022-01-2522:06dawdlerGood point.
(use-package cider
:ensure t
:defer t
:init (add-hook 'cider-mode-hook #'clj-refactor-mode)
:diminish subword-mode ;; <-- THIS WAS THE CULPRIT
:config
(setq nrepl-log-messages t
cider-repl-display-in-current-window t
cider-repl-use-clojure-font-lock t
cider-prompt-save-file-on-load 'always-save
cider-font-lock-dynamically '(macro core function var)
nrepl-hide-special-buffers t
cider-overlays-use-font-lock t)
(cider-repl-toggle-pretty-printing) )
Ijust simply didn't have the package installed#2022-01-2522:06dpsuttonoh wild#2022-01-2522:07dpsuttoni would never have thought to look there. So thanks for sharing. And that’s super subtle. Not stupid at all#2022-01-2522:08dawdlerNo worries.#2022-01-2522:09dawdlerAnd thanks for pushing me in the right direction.#2022-01-2522:15Nick McAvoyI've written less than 1% of the shell or emacs config that I use, so I can definitely relate! Very understandable.
Kudos for sticking with it and finding the issue!#2022-01-2616:59andrea.crottiis there a way to inspect javascript objects with cider-inspect by any chance?#2022-01-2616:59andrea.crottiwould be great to have the same kind of output I see in the console (with dev tools enabled etc) but in Emacs directly#2022-01-2711:47fjolnenot sure if inspector supports datafy/nav, but if it would you could use https://github.com/lambdaisland/dom-types
otherwise dom-types provide printers, which is better than nothing#2022-01-2802:09Drew Verlee@U0524T275 if you find something let me know.#2022-01-2802:10Drew VerleeI think the answer is fundamentally "no" though. It works in clojure because the reader knows what its looking at in order to create that view. And you know that view means.#2022-01-2802:10Drew VerleeIn js, code isn't data.#2022-01-2802:11Drew Verleeat best it can hand you a dump of a big string#2022-01-2802:11Drew Verleewhat you can easily search in JS is the parts of code that are more data like, or at least thats how it feels, i have never really thought about it.#2022-01-2809:26andrea.crottiwell it is certainly possible, because the output I see in the console (with devtools etc) is pretty much perfect#2022-01-2809:26andrea.crottiI just want to see data if it's data and a mention to what it is otherwise maybe#2022-01-2809:27andrea.crottiso I can just do a js/console.log and I see a nice output, but would just be amazing if I could see that directly with cider inspect or similar#2022-01-3004:55Christopher GenoveseI'm running a Clojurescript repl in CIDER (using shadow-cljs) and every session over the past few months eventually hangs. It starts with small delays on response that quickly grow longer and longer until it fully hangs. Sometimes it takes days before this occurs and sometimes it takes minutes. I went a week without a problem recently and then had to re-jack in six times in the past hour. This does not seem to happen when I run the shadow-cljs repl in a terminal, though to be honest I haven't done that nearly as much as I miss cider when I do. Still, this is an increasingly frustrating problem. I've monitored the nrepl messages but see nothing obvious, and there are no errors or otherwise showing up. When it starts to hang, even just entering 1 at the repl takes increasingly long, a few seconds at first and quickly ramping up. The only association I've seen is that it is more likely to occur when I call pprint. (The pretty printing by default is not working for me at all, so I sometimes call pprint to look at complicated data.) But this connection does not fully explain what's happening as it frequently does occur even when I don't print anything.
I'd very much appreciate any advice or ideas. I'm not sure how to track down the problem. I'm running CIDER 1.2.0snapshot, Emacs 28.0.60, on Mac OS X 10.14.5. I've been using CIDER for a long time without this problem, and I don't see what has changed recently. Thanks!#2022-01-3005:50vemvmight be a memory leak?#2022-01-3005:53vemvnot sure if you are used to something like Yourkit. It tends to be a good idea to always attach it beforehand to your JVM process, so that you can see the full history of memory usage (as a graph)
controlling the "agent" (yourkit or some other) is easier if you launch the repl yourself from the terminal, i.e. favor cider-connect* over cider-jack-in*#2022-01-3005:54vemvother than that this doesn't ring a bell, I've heard of various shadow-cljs issues but nothing like this one.
By any chance your own application code could be responsible for the leak? Look for anything that accumulates state (`def` , memoize ...)
Will take a quick look across our codebase but most likely without you going through Yourkit/etc it will be nearly impossible to debug#2022-01-3016:17Christopher GenoveseThanks, that's very helpful. I haven't used yourkit but it sounds like a good idea. I'll also look out for possible leaks in the code. For a while I thought it was tap>'s which I've been using frequently, but I reset that state frequently. Thanks again.#2022-07-0818:14fentonyou still get cider if you cider-connect-cljs to your shadow terminal?#2022-01-3120:36winsomeI'm trying to cider-jack-in-cljs with a node repl and it's failing at init. It's trying to run (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env))), but it fails when trying to call cider.piggieback/cljs-repl:
TypeError: Cannot read properties of undefined (reading 'error__GT_str')
at Socket.<anonymous> ([stdin]:89:38)
at Socket.emit (node:events:390:28)
at Socket.emit (node:domain:475:12)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:285:11)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)#2022-01-3120:37winsomeThis is what my cljs.repl.node/repl-env looks like:
{:host "localhost",
:port 51620,
:path nil,
:socket #<Atom@6be16c7e: nil>,
:proc #<Atom@145601a4: nil>,
:state #<Atom@27b9c48f: {:listeners 0}>,
:debug-port nil}#2022-01-3120:38winsomeI see there that the :socket and :proc atoms have a val of nil, and I wonder if that's a problem. But I'm not sure how to go about troubleshooting.#2022-02-0107:22magnarsIs there some way to start the REPL in a specific namespace with deps.edn? I'm asking here because I haven't been able to find anything for deps, so maybe CIDER can help here?#2022-02-0108:47practicalli-johnThe REPL always starts in the user namespace. Leiningen would switch to a specified namespaces once the REPL was running.
For a Clojure CLI (deps.edn) project, I would add a user namespace to the project and use an alias that added that namespace to the classpath.
I assume it is then a mater of using (in-ns 'desired.namespace) in the user namespace
Some examples here
https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html#2022-02-0206:52bozhidar@U07FCNURX I looked at this in the past and there was no alternative of :initial-ns for tools.deps.#2022-02-0113:12FiVoIs there an equivalent of cider-pprint-eval-defun-at-point for cider-eval-last-sexp ? So I want the result of cider-eval-last-sexp but pprinted to a buffer?#2022-02-0114:10magnarscider-pprint-eval-last-sexp
#2022-02-0122:22FiVothanks#2022-02-0208:04magnarsI just broke the clojure-emacs/clojure-mode build. The compiler complains about "Unused lexical variable delete-pair-blink-delay'". However, delete-pair-blink-delay` is a special variable (having been defined with defcustom), and is not subject to lexical binding. It is supposed to be used in the way I'm using it (shadowing the value with a let-binding). Any ideas on a fix?#2022-02-0208:04magnarsHere's the commit in question: https://github.com/clojure-emacs/clojure-mode/commit/328fb6cdd3ea861de210aab1d62e5bdd935105b9#2022-02-0209:25magnars@U45T93RA6 Any ideas here?#2022-02-0209:27vemvnope 😑#2022-02-0210:21dakradelete-pair-blink-delay was only added in Emacs version 28.1 according to the :version tag. So you probably need a defvar first for compatibility?#2022-02-0210:23magnarsThat would also explain why this change was suddenly needed. Thanks!#2022-02-0210:55magnarsThat did indeed do the trick. Thanks, @UFAP0C8KU ❤️#2022-02-0308:39Jo Øivind GjernesIs there any way of knowing what is currently executing in cider? (i.e. when the progress bar is “busy”?)#2022-02-0308:43vemvplugging in YourKit or similar
(I always do so beforehand so that when I connect Yourkit, it has already a history of metrics)#2022-02-0407:59bozhidarIf we're not looking for much details - it's always the last expression that go evaluated, as evaluation is serialized on the nREPL end. You can't evaluate multiple expression simultaneously in the same nREPL session.#2022-02-0407:59bozhidar(but you can spin a separate session for each eval op if you want to achieve something like this)#2022-02-0522:53geoffHi I’m getting the following error when connecting to a running repl with (cider-connect-clj '(:host "localhost" :port 5555 :project-dir "~/devel/")):
Error:
(error "Sync nREPL request timed out (op clone id 5)")
The repl was started with -Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}
Debugger error:
Debugger entered--Lisp error: (error "Sync nREPL request timed out (op eval code (seq (.split (System/getProperty \"java.class.path\") \":\"))...")
signal(error ("Sync nREPL request timed out (op eval code (seq (...."))
error("Sync nREPL request timed out %s" ("op" "eval" "code" "(seq (.split (System/getProperty \"java.class.path\"..." "id" "2"))
nrepl-send-sync-request(("op" "eval" "code" "(seq (.split (System/getProperty \"java.class.path\"..." "id" "2") #<buffer *cider-uninitialized-repl*> nil tooling)
nrepl-sync-request:eval("(seq (.split (System/getProperty \"java.class.path\"..." #<buffer *cider-uninitialized-repl*> nil tooling)
cider-sync-tooling-eval("(seq (.split (System/getProperty \"java.class.path\"...")
cider-fallback-eval:classpath()
cider-classpath-entries()
#f(compiled-function (system session) "Check if SESSION is a friendly session." #<bytecode 0x460f1c0f>)(CIDER ("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>))
apply(#f(compiled-function (system session) "Check if SESSION is a friendly session." #<bytecode 0x460f1c0f>) CIDER ("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>))
sesman-friendly-session-p(CIDER ("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>))
#f(compiled-function (ses) #<bytecode 0x461a2e83>)(("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>))
#f(compiled-function (elt) #<bytecode 0x461a2eb5>)(("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>))
mapcar(#f(compiled-function (elt) #<bytecode 0x461a2eb5>) (("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>)))
#f(compiled-function #'sequence #<bytecode 0x4ac2b6a3>)(#f(compiled-function (elt) #<bytecode 0x461a2eb5>) (("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>)))
apply(#f(compiled-function #'sequence #<bytecode 0x4ac2b6a3>) #f(compiled-function (elt) #<bytecode 0x461a2eb5>) (("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>)) nil)
seq-map(#f(compiled-function (elt) #<bytecode 0x461a2eb5>) (("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>)))
seq-filter(#f(compiled-function (ses) #<bytecode 0x461a2e83>) (("devel/canto:localhost:5555" #<buffer *cider-uninitialized-repl*>)))
sesman--friendly-sessions(CIDER sort)
sesman-current-sessions(CIDER (project))
cider--check-existing-session((:host "localhost" :port 5555 :project-dir "~/devel/canto/" :repl-init-function nil :session-name nil :repl-type clj))
cider-connect-clj((:host "localhost" :port 5555 :project-dir "~/devel/canto/" :repl-init-function nil :session-name nil :repl-type clj))
canto-connect-to-nrepl()
eval((canto-connect-to-nrepl) nil)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp) #2022-02-0523:00dpsuttonYou are connecting an nrepl client to a regular socket repl. That will not work#2022-02-0523:00geoffah, right#2022-02-0523:01dpsuttoninf-clojure will happily do this but there’s a big difference in what inf-clojure and CIDER provide#2022-02-0523:01dpsutton(this is how i’ve developed for the last 14 months though)#2022-02-0523:01geoffis there a way to start the nrepl server with a command line arg as I’ve done with the normal socket server above?#2022-02-0523:02geoffor what’s the recommended way?#2022-02-0523:02dpsuttonyes and no. The benefit of clojure’s socket repl is that clojure main will start that on initialization. Nrepl obviously cannot share this benefit since it is third party. You need use the main entry to start the nrepl server or have code that will start an nrepl server for you#2022-02-0523:03dpsuttonThe easiest way to do this is just to cider-jack-in and then see the startup command listed at the top of the repl and duplicate this#2022-02-0523:03dpsuttonAn alternative is to just use whatever main your program is using and add some code that will optionally start up an nrepl server with cider-nrepl middleware involved#2022-02-0523:04geoff> add some code that will optionally start up an nrepl server with cider-nrepl middleware involved
I think this might be the go for me, thanks!#2022-02-0523:19geoffworked like a charm, cheers#2022-02-0607:31eplokoHm... when I connect to a REPL with cider-connect-clj I get the following warning:
> WARNING: clj-refactor and refactor-nrepl are out of sync.
> Their versions are 3.2.2 and 3.2.2, respectively.
The versions seem to be the same, yet it still complains. Does anyone have an idea on how to resolve this?
> CIDER 1.2.0 (Nice), nREPL 0.9.0
> Clojure 1.10.3, Java 16.0.1#2022-02-0610:16vemvclj-refactor 3.2.2 expects refactor-nrepl 3.2.0. You were using a more recent refactor-nrepl version it seems
Anyway I've released now clj-refactor 3.2.3 which uses refactor-nrepl 3.2.2; MELPA should pick it up within a couple hours#2022-02-0610:16vemvthese warnings are pretty safe to ignore anyway. there's a defcustom to always do so#2022-02-0621:08eplokoThanks heaps for the fix 🙂#2022-02-0621:08eplokoI was confused by it listing two identical versions and claiming they were out of sync. Could the message potentially be improved to something along "clj-refactor 3.2.2 expects refactor-nrepl 3.2.0 (you are running 3.2.2)"?#2022-02-0701:35Zach Mitchell, PhDI'm having an issue loading my dependencies. When I user CIDER to connect to a REPL without my :dev alias everything seems to work fine with the exception of a warning when evaluating server.clj (source below):
Warning: environ value /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home for key :java-home has been overwritten with /Library/Java/JavaVirtualMachines/jdk1.8.0_291.jdk/Contents/Home/jre
This appears to be coming from environ, but I don't know why.
When I activate my :dev alias my dependencies are no longer found on the classpath:
Syntax error (FileNotFoundException) compiling at (src/zmitchell/cheffy/server.clj:1:1).
Could not locate reitit/ring__init.class, reitit/ring.clj or reitit/ring.cljc on classpath.
This is the command that CIDER is using to jack-in:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta3"} refactor-nrepl/refactor-nrepl {:mvn/version "3.0.0-alpha13"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl
This is what my deps.edn file looks like:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}
ring/ring {:mvn/version "1.8.1"}
integrant/integrant {:mvn/version "0.8.0"}
environ/environ {:mvn/version "1.2.0"}
metosin/reitit {:mvn/version "0.5.2"}
seancorfield/next.jdbc {:mvn/version "1.0.462"}
org.postgresql/postgresql {:mvn/version "42.2.14"}
clj-http/clj-http {:mvn/version "3.10.0"}
ovotech/ring-jwt {:mvn/version "1.2.5"}}
:aliases
{:run-m {:main-opts ["-m" "zmitchell.cheffy.server"]}
:web {:main-opts ["-m" "zmitchell.cheffy.server"]}
:run-x {:ns-default zmitchell.cheffy
:exec-fn greet
:exec-args {:name "Clojure"}}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.4.0" :git/sha "54e39ae"}}
:ns-default build}
:dev {:extra-paths ["dev"]
:deps {integrant/repl {:mvn/version "0.3.1"}
ring/ring-mock {:mvn/version "0.4.0"}}}
:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "48c3c67"}}}}}
This is what server.clj looks like:
(ns zmitchell.cheffy.server
(:require [reitit.ring :as ring]
[ring.adapter.jetty :as jetty]
[integrant.core :as ig]
[environ.core :refer [env]]))
(def app
(ring/ring-handler
(ring/router
["/"
{:get {:handler (fn [req] {:status 200 :body "Hello, World!"})}}])))
(defmethod ig/init-key :server/jetty
[_ {:keys [handler port]}]
(jetty/run-jetty handler {:port port :join? false}))
(defmethod ig/prep-key :server/jetty
[_ config]
(merge config {:port (Integer/parseInt (env :port))}))
(defmethod ig/halt-key! :server/jetty
[_ server]
(.stop server))
(defmethod ig/init-key :cheffy/app
[_ config]
(app config))
(defmethod ig/init-key :db/postgres
[_ config]
(:jdbc-url config))
(defn -main
[config-file]
(let [config (-> config-file
slurp
ig/read-string)]
(-> config
ig/prep
ig/init)))
#2022-02-0702:20dpsuttonYou have :dev {:deps {}} but :test {:extra-deps {}}. Maybe try switching to use extra-deps?#2022-02-0702:20dpsuttonI think :deps is the same as :replace-deps#2022-02-0703:32Alex Miller (Clojure team)correct#2022-02-0703:38dpsuttonalso, when i run into issues I would just remove CIDER and see if the issue persisted. You should have seen this behavior from just clj -A:dev i think. The repl also always prints up how it starts the clj and repl and how it starts the cljs repl (when appropriate) so it should remove any semblance of magic. You can try out its commands in a terminal to ensure you get all error messages and then slowly start pulling out tooling.#2022-02-0704:06Zach Mitchell, PhDThis fixed it, thank you!#2022-02-0720:37Zach Mitchell, PhDI'm having trouble getting my user.clj picked up when I load a file in my editor. When I start a REPL with clj -A:dev:test the functions in user.clj are available. However, when I start a REPL from Emacs using the jack-in command below, the functions are no longer available:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta3"} refactor-nrepl/refactor-nrepl {:mvn/version "3.0.0-alpha13"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:test:cider/nrepl
When I say that the functions are no longer available, I mean that when I'm inside a file, say src/zmitchell/cheffy/server.clj and try to evaluate the (go) inside (comment (go)) I get an error saying that the symbol go could not be resolved.
My user.clj is at dev/user.clj and I include dev in the :extra-paths of the :dev alias. I've attached some relevant files for troubleshooting.#2022-02-0722:42vemvuser.clj does not define globally-referred functions. The user ns is (almost) like any other one, so once you are in the cider REPL, you should make sure that your current ns is user, not server#2022-02-0722:42vemvOr if you want the repl to stay in namespaces other than user , use fully-qualified function names (via key bindings, or maybe yasnippets)#2022-02-0722:44vemvLastly, I think cider/nrepl is not an alias that CIDER (publicly) defines? I'd recommend using a different name that does not possibly clash with actual cider internals.#2022-02-0723:11Zach Mitchell, PhDActually the current namespace is user (according to the REPL prompt). The cider/nrepl alias is part of the jack-in command that CIDER generates, that's not something I've set on my own.#2022-02-0723:12Zach Mitchell, PhDIf I'm editing server.clj I can call the functions via user/go, so the functions are loaded. I just can't access without a namespace like I thought I could.#2022-02-0723:20vemvIndeed, user.clj does not define globally-referred functions#2022-02-0723:20vemvbtw, an idiomatic approach for a "Reloaded" workflow would be tweaking cider-ns-refresh-after-fn and cider-ns-refresh-before-fn , you can find some recent results on this Slack#2022-02-0723:24Zach Mitchell, PhDI'll take a look, thanks!#2022-02-0810:34practicalli-john@U02CDRYNHDM an example of configuring Cider with lifecycle services https://practical.li/spacemacs/clojure-repl/component-lifecycle.html#configure-cider-refresh-to-use-component-lifecycle#2022-02-0810:37practicalli-johnWhen calling (go) or (reset) I tend to do that from the user buffer, or have the REPL buffer open and in the user namespace - especially if logs are sent to the REPL#2022-02-0721:06dominguesHow can i use cider REPL, on emacs ,to evaluate clojure functions on a .clj file that isn't associated to a lein project .#2022-02-0722:45vemvcider-load-buffer? https://docs.cider.mx/cider/usage/cider_mode.html#2022-02-0818:07dominguesCool ! Thanks !#2022-02-0811:07vemvℹ️ clj-refactor.el 3.3.1, released today, honors .clj-kondo :unused-namespace config. That way, you can declare in a single place the namespaces that should never be cleaned (e.g. side-effectful ones) and have a variety of tools respect that setting.#2022-02-0817:09Jim Newtoncan someone remind me how to run the test my cursor is sitting inside of using cider?
I’m looking at https://docs.cider.mx/cider/testing/running_tests.html and I don’t quite see it.#2022-02-0817:10dpsuttoncider-test-run-test
Command: Run the test at point.
?#2022-02-0817:11Jim Newtonahh, thanks. it does not seem to be mentioned on that doc page 8-)#2022-02-0817:11dpsuttonfair. I just did m-x apropos [ret] cider-test and saw it in there#2022-02-0817:11dpsuttonin practice, i do m-x cider-test and see what is in the list and their docstrings#2022-02-0817:13Jim NewtonI was thinking that when I’m writing tests, If I’ve just finished a (deftest …) form and I prec C-c C-c to compile it, it would also be nice to run it. I.e., run the one test I just defined.#2022-02-0817:14dpsuttonyeah i think its just C-c C-t but i don’t remember offhand#2022-02-0817:14Jim NewtonGuess it is C-c C-t C-t#2022-02-0817:15dpsuttonah yeah. that’s right#2022-02-0817:15dpsuttonneed room in the chord to choose namespace, region, etc#2022-02-0817:15Jim Newtonmy cat decided she either wants to type or block the screen#2022-02-0817:16dpsuttonthey help as they are able#2022-02-0820:47winsomeDoes anybody know how to find the process id for the running clojure repl? I'm using jcmd to try to find the process I want to profile in VisualVM, but all of my repls have the same starting incantation, so I can't tell them apart#2022-02-0820:47winsome└─> jcmd
795369 clojure.main -m nrepl.cmdline --middleware [refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]
786987 clojure.main -m nrepl.cmdline --middleware [refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]
921526 clojure.main -m nrepl.cmdline --middleware [refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]
930343 jdk.jcmd/sun.tools.jcmd.JCmd
#2022-02-0820:51magnars(.pid (java.lang.ProcessHandle/current))
#2022-02-0820:51winsomePerfect, thanks!#2022-02-0820:49Alex Miller (Clojure team)jps is the tool - I usually pass it some random set of args -m or -v or something, can never remember which is which#2022-02-0820:49agHey folks, can someone please help me out with the right combination of vars?
I have a leiningen project (all Clojure); I have shadow-cljs.edn in the same repo. All dependencies gotta be separated.
That means I cannot initiate shadow-cljs watch/complile from Clojure REPL via shadow.cljs.devtools.api & shadow.cljs.devtools.server.
So I did this in .dir-locals.el:
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "app")
Now, when I do cider-jack-in-clj&cljs it still prompts me with: "Which command should be used... bla-bla". I don't want that prompt, right? So I set this up (cider-preferred-build-tool . "lein"). But then, it doesn't make CLJs REPL right. Instead of doing it separately, it starts lein REPL (which doesn't have the dependencies I need)#2022-02-0820:54agWhen I don't set cider-preferred-build-tool, I can create two separate REPLs, but I have to do it manually for each. When it prompts and I selected lein - it won't compile cljs. If I select shadow - it creates Cljs REPL and compiles cljs, but Clj REPL is now all messed up.#2022-02-0820:54magnarsCould you have two .dir-locals.el in different folders, and then start the repl you want by going to the correct folder?#2022-02-0820:57agI'm trying to reduce the "manual labor" here. Ideally, I want to run cider-jack-in-clj&cljs and get two REPLs. But I can't seem to find a way for them to spin out using different build tools#2022-02-0901:20agDaaang. Ended up overriding cider-jack-in-clj&cljs via :around advice, and had to add a directory-local var
This is my .dir-locals.el:
((nil . ((cider--custom-clj&cljs-jack-in-p . t)
(cider-shadow-default-options . "app")
(cider-offer-to-open-cljs-app-in-browser . nil)
(eval . (progn
(defun cider-jack-in-clj&cljs* (&rest params)
(interactive)
(if (and (boundp 'cider--custom-clj&cljs-jack-in-p)
cider--custom-clj&cljs-jack-in-p)
(progn
(let ((cider-preferred-build-tool 'lein)
(cider-jack-in-default 'lein))
(funcall 'cider-jack-in-clj nil))
(let ((cider-preferred-build-tool 'shadow-cljs)
(cider-jack-in-default 'shadow-cljs)
(cider-cljs-repl-type "shadow"))
(cider-jack-in-cljs '(:cljs-repl-type shadow))))
(cl-destructuring-bind (orig-fn args) params
(funcall orig-fn args))))
(advice-add 'cider-jack-in-clj&cljs :around #'cider-jack-in-clj&cljs*))))))#2022-02-1006:55viestiHmm, wonder if there's a way to copy&paste a stack trace from say logs of a server into Emacs buffer and make the lines navigable#2022-02-1018:46jumarPerhaps cider--render-stacktrace-causes could be used? https://github.com/clojure-emacs/cider/blob/65a23e54227e3575f5a909dcfbdbbaef70d1438b/cider-eval.el#L456
But I have no idea how O:-).#2022-02-1110:08viestiyeah kinda realised that cider gets stacktrace data from nrepl, but if I only have a text presentation, need probably to actually parse it#2022-02-1110:08viestibut after that, could then use the machinery to make the printout navigable#2022-02-1110:09viestiit's ok to also just read the stacktrace, somehow had this idea that what about making it navigable when pasting into emacs :)#2022-02-1119:16jumarIntellij has such a thing and I used it a lot back in the day#2022-02-1119:31viestiI think Eclipse also had such a thing back in the day#2022-02-1007:44lassemaattaWhen cider spits out an error in the repl (e.g. a "unable to resolve a symbol" error when I try to call a non-existing function) it seems to often also show another error regarding "Cannot open <nil> as a reader".#2022-02-1007:45lassemaatta#2022-02-1007:45lassemaattahave I messed up something in my cider setup or nrepl middlewares or something?#2022-02-1009:16vemvwhat's your cider version?#2022-02-1009:20vemvah the stacktrace says it, you're not running a recent-enough cider-nrepl
the error comes from Orchard, check out https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#091-2022-01-17
it has the precise fix!#2022-02-1009:20lassemaattaCIDER 1.3.0-snapshot (package: 20220204.917)#2022-02-1009:21lassemaatta#2022-02-1009:22vemvcider-nrepl must be 0.28.2#2022-02-1009:22lassemaattagreat, thanks 👍#2022-02-1009:23vemvCheers cider also lein-nvd as a plugin is deprecated, fyi#2022-02-1009:23lassemaattais there a source for finding out "I'm running the latest cider, what should my lein profiles look like wrt. nrepl/piggieback etc?"?#2022-02-1009:26vemvNot that I know. Maybe you can run https://github.com/liquidz/antq#leiningen-as-a-plugin which will take into account ~/.lein/profiles.clj
Running latest is generally always safe, unless it has a suffix like alpha#2022-02-1020:00bmaddyIs there an easy way to specify the nrepl port in my .dir-locals.el for when I'm connecting with cider-connect-cljs? Even better would be if I could tell it to look in .shadow-cljs/nrepl.port for the number. I've been looking through the docs and elisp code and haven't found anything.#2022-02-1020:10vemvOne of these perhaps? https://github.com/clojure-emacs/cider/blob/e8b582e1f28b27cdb0574e0f9361cbb9eb62afd0/cider.el#L168-L188
There's also https://github.com/clojure-emacs/cider/issues/3140 which seems quite closely related#2022-02-1116:20bmaddyThose look like what I need. Thank you!#2022-02-1200:00cflemingHas anyone done any work converting between the format specs of :style/indent and cljfmt? I’m trying to figure out if the specs are roughly equivalent, or if there are things that one format supports that the other doesn’t.#2022-02-1200:01cflemingAlso, is there any way I can easily format some text using CIDER’s formatter, in a way that I can call from e.g. a Clojure program? Can I invoke Emacs on the command line to do this?#2022-02-1200:03cflemingFailing that, are there any tests anywhere showing how the spec works in practice?#2022-02-1202:55vemvThis has worked for me / a team setting over the years
(defn to-cljfmt-indent [{cider-indent :style/indent}]
(or (and (number? cider-indent) [[:block
cider-indent]])
(and (#{:defn} cider-indent) [[:inner 0]])
nil))
It doesn't cover everything, at the time I wasn't even sure that was possible because both have different conceptions, so perhaps a 1:1 mapping cannot be established
Worst-case one can simply write the specs twice, once in cljfmt config and another as :style/indent metadata. In practice that very rarely happens - often it indicates an unidiomatic macro or such
Hope it helps!#2022-02-1204:49cflemingGreat, thanks! I’m going to re-work the Cursive formatting and was keen to be able to test edge cases. I’ll probably choose one of the formats to allow users to specify, whichever maps best onto the final Cursive model.#2022-02-1204:57cflemingI must admit that the cljfmt doc wasn’t especially clear on what the format means, so that helps - thanks.#2022-02-1205:12vemv> I’ll probably choose one of the formats to allow users to specify, whichever maps best onto the final Cursive model.
My humble suggestion would be to favor :style/indent because it maps 1:1 to what clojure-mode can achieve, without even a CIDER connection. So one can get fast formatting in Emacs without a cider or lsp connection. And of course after getting such a connection it will work even better.
It also means that one invites users to create simple specs, and accordingly, simple macros
(source: I've contributed to cider and cljfmt alike, and also as mentioned I've bridged both in a particular tool. I'd love to see ecosystem complexity reduced with new tool developments!)#2022-02-1205:16vemv(These might be handy https://github.com/clojure-emacs/clojure-mode/blob/913e2450a77a6ddda051f55ac651c99337147db1/clojure-mode.el#L1647-L1722 )#2022-02-1207:54cflemingI definitely prefer the :style/indent spec, I think it’s much easier to understand. However it seems to me that cljfmt is what the community is settling on for a formatting solution for cross-editor teams, and it’s being used in things like commit hooks and the like. I’m worried about committing to a spec which expresses things that cljfmt can’t achieve.#2022-02-1212:58vemvI have the impression that :style/indent is a subset of what cljfmt can achieve, while cljfmt's spec is not a subset of :style/indent. So in terms of viability it would be no problem - you'd just make cljfmt use less of its potential.
Don't quote me on that though :) it simply has been my experience briding both for 2+ years. But I might have a hole in my mental model, always good to understand the semantics of both approaches of course.#2022-02-1204:44Drew VerleeI think it would be cool if there was a cider option to pick a key from a given map from the file via a UI generated list. like with your cursor as the * `(-> {:hello :cat :goodby :dog} *)` when you use this hypothetical command it would move your cursor to a list with `:hello :cat` as options you could scroll through and when you picked one it inserted it.
I would like input on the idea. If it seems like a good idea, ill make a github issue and then try my hand at building it. I have been learning a bit of elisp and i'm ready to fail trying to build something in another language :slightly_smiling_face:. My stand in for doing this is copying from either the printed keys or cider inspect, both work great, this would just be another option.
Or hopefully, like most times when i ask a question about a new feature someone tells me it already exists.#2022-02-1300:25anonimitorafCan you do this via paredit/lispy/etc?#2022-02-1300:25anonimitorafi.e you slurp or barf *#2022-02-1301:18Drew Verleeno you can't. those can slurp text that is around it. The tool i'm suggesting calls clojure.core/keys on the hash-map and then lists the outputs as options you can select from. I run into this situation quite frequently especially with a troublesomely long keyword, i don't even want to use autocomplete because usually there are a dozen like it.
My currently solution is that i print the keys and copy them as needed.#2022-02-1317:27Drew Verleei guess what makes this idea to situational is the range of things you might want to do with the selected keywords is too large to warrant learning another keystroke in many cases. It would have to produce a lst of the keys and then you choose what you want to do with it. And thats very close to what we already have.#2022-02-1219:01frozenlockIs there an easy way to get the var name after cider-interactive-eval ? The returned value appears to be this:
(#[0 "\301\300!\207"
[[cl-struct-spinner
["[ ]" "[= ]" "[== ]" "[=== ]" "[====]" "[ ===]" "[ ==]" "[ =]"]
-10 10
[nil 25095 65080 200000 0.1 spinner--timer-function
(#3)
nil 91298]
nil #<buffer *cider-repl MYFILE:localhost:7002(clj)
*> 1]
spinner-stop]
2])#2022-02-1219:04vemvprobably you're looking at an unrelated value
you should get a "nrepl dict" (essentially a hashmap) and call nrepl-dict-get over it, which hopefully would have a key for the var name
https://github.com/clojure-emacs/cider/blob/f556d30f687cbf20703ccda6f510254bdfa0cb9e/nrepl-dict.el#L63#2022-02-1219:09frozenlockHmmm
I checked again and it's really the cl-struct-spinner thingy that is returned.
(setq bbb (cider-interactive-eval (cider-defun-at-point)
nil
(cider-defun-at-point 'bounds)
(cider--nrepl-pr-request-map)))
#2022-02-1219:12vemvprobably it accepts a callback as an argument which should handle the actual value
most evaluation apis are async, sync ones are have a -sync suffix or such#2022-02-1219:14frozenlockAhh yes I see#2022-02-1219:14frozenlockThank you very much#2022-02-1219:02frozenlockI quickly browsed the code, but it looks like everything is expecting a handler or a buffer. 😕#2022-02-1219:30frozenlockLooks like cider-test-run-test doesn't work on inline tests (those defined inside the :test metadata).
A simple fix could be to remove (member deftype cider-test-defining-forms).#2022-02-1219:32vemvNote that cider-test-defining-forms is a defcustom, so you can try expanding it to also include defn
If you can confirm it works for you, surely a PR is welcome to expand this default value.#2022-02-1219:39frozenlockIndeed it works. :thumbsup:
However it means mean one would have to update it for every different defnX macro.
Is this check really worth it?#2022-02-1219:40frozenlockTho at this point it's probably an edge case... not many people use inline tests.#2022-02-1219:42vemvI have no idea, I didn't author that code :) I sympathize with removing the check, cider's philosophy is to avoid heuristics - normally the Clojure runtime gives us all we need.
A conservative PR would simply expand cider-test-defining-forms , you can also discuss the alternative concurrently as a GH issue#2022-02-1415:09Alex Miller (Clojure team)https://ask.clojure.org/index.php/11578/help-writing-simple-cider-emacs-defun-modify-cider-eval-last#2022-02-1415:09Alex Miller (Clojure team)^^ in case anyone wants to address there#2022-02-1415:53dpsuttonanswered. Thanks for highlighting it here @alexmiller#2022-02-1520:19FiVoHey, I upgraded cider recently. I am on 1.3-snapshot now. I was on 1.2 before. Did something change in the way you inject dependencies. I had to downgrade to 1.2 again as I was getting a NoClassDefFoundError`` error in one leiningen based project. I couldn't reproduce it in a small project.#2022-02-1520:27vemvWithout a stacktrace and/or a reasonably detailed context we can't possibly provide support 😇
This one seems important enough to warrant a GH issue, would appreciate very much if you created it#2022-02-1521:05FiVoWell it's a private repo. I will try to reproduce, but it might be a bit difficult.#2022-02-1521:36vemvRepro isn't as important as a stacktrace, which is fine to redact if it includes private namespaces#2022-02-1621:23FiVoERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :op stacktrace, :session a30c16e0-b9ac-49b7-aa52-882236506ea0, :id 37}#2022-02-1621:34vemvThat doesn't look like the meaty part of the stacktrace#2022-02-1621:34FiVoI could reproduce it, will post the repo in a minute#2022-02-1621:38FiVoHere is the repo https://github.com/FiV0/cider-1-3-lein-issue#2022-02-1621:38FiVohttps://github.com/FiV0/cider-1-3-lein-issue/blob/main/src/cider_1_3_lein_issue/core.clj#2022-02-1621:42vemvThanks! If possible create a reproducible CLI command, else it's more of mixed bag since personal emacs config changes from user to user#2022-02-1621:44FiVoNot quite following, what do you mean by CLI command for cider?#2022-02-1621:46vemvA repro that doesn't involve launching Emacs at all. So you'd follow https://docs.cider.mx/cider/basics/middleware_setup.html#using-leiningen, run lein repl and hopefully repro the same#2022-02-1621:46vemvas a last resource you can simply post a full stacktrace, might be available at *cider-error* ?#2022-02-1621:46FiVoWell that is the issue, if I run`lein repl` and run the commands everything works as expected.#2022-02-1621:47vemvcider-nrepl isn't in your project.clj so your lein repl isn't an apples-to-apples comparison#2022-02-1621:49FiVook, got you now#2022-02-1620:27Sampo ToivaHi, I have a weird problem.
I've been testing clojure-cli and I'm trying various different tooling. Currently, I'm testing portal and I've set up a simple test project for that.
My personal deps.edn contains an alias:
:portal {:extra-deps {djblue/portal {:mvn/version "0.21.0"}}}
I've added to the projects .dir-locals.edn the following config:
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . "portal"))))
When I run cider-jack-in-clj the command that is executed is the following;
/opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:portal:cider/nrepl
That will open a REPL buffer, but the classpath won't contain the portal dependencies and things like (require 'portal.api) will fail with FileNotFoundException.
However, if I start the nREPL server from command line with the exact same command as above and just connect to it with cider-connect, everything works just fine.
Can someone shed some light on what is happening and how to debug this further?#2022-02-1620:35vemvWhat exact CIDER version are you using?
Could it have to do with https://github.com/clojure-emacs/cider/pull/3127/files ?
cc @U05254DQM#2022-02-1620:44Sampo ToivaMight be. Cider version is 1.2.0 . The default that comes from doom-emacs.#2022-02-1620:44Sampo ToivaMaybe, I should look into upgrading...#2022-02-1620:51Sampo Toiva@U45T93RA6 unpinning and upgrading cider to newest version fixed things.#2022-02-1620:55vemvCheers! your refactor-nrepl is also somewhat outdated#2022-02-1620:55vemvWondering if I should start creating PRs against doom or spacemacs whenever we cut releases, not sure of how those distros work#2022-02-1621:04Sampo ToivaHumm, actually, now cider stopped injecting refactor-nrepl altogether.#2022-02-1621:08Sampo ToivaLet's see what else I need to upgrade 😄#2022-02-1621:18Sampo ToivaYeah, now everything works. Upgrading helped there also.
@U45T93RA6 yeah, doom-emacs pins to specific versions of packages to achieve some stableness in the package ecosystem and reproducibility to the configs. I think that's a good thing in general, but in some cases a bit more speed in the upgrades might be needed. Luckily, one can just opt out of the pinning case-by-case and speed things up.
But in general, I guess doom welcomes PR's for upgrading packages - especially for critical upgrades and bugfixes. The clojure relevant package management is here: https://github.com/hlissner/doom-emacs/blob/master/modules/lang/clojure/packages.el#2022-02-1621:32vemvthanks!
Is refactor-nrepl being injected now? Without upgrading clj-refactor.el I don't expect it to work, see https://github.com/clojure-emacs/clj-refactor.el/blob/master/CHANGELOG.md#333#2022-02-1621:34Sampo ToivaYeah, thanks for help! Everything is working now. I decided to unpin everything in the clojure module to keep everything in sync since basically most of the stuff there is a dependency to cider.#2022-02-1705:50practicalli-johnFYI @U45T93RA6 - Spacemacs uses packages from https://melpa.org/ by default, so no need for a PR on the Spacemacs repository to update Cider.
It only requires the user to run a package update, which checks for new versions. So the user can upgrade when required#2022-02-1705:57practicalli-john@UFG0HRDC7 all aliases are keywords, so :portal should be used in the .dir-locals.el file, rather than portal.
I believe Cider will still work if only using the name and not the keywords, but technically (and for clarity) the keyword should be used.#2022-02-1706:12Sampo Toiva@U05254DQM thanks, I actually changed it to that after upgrading and checking the newest documentation. With older cider it didn't work.#2022-02-1707:55Drew VerleeHow do you pass a clojure deps alias in a dir-locals file to a shadow-cljs project. Here is what i'm trying and its not working
((nil . (
(cider-preferred-build-tool . shadow-cljs)
(cider-clojure-cli-aliass . "-A:dev") <-------
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "dev")
(cider-shadow-watched-builds . ("dev" "cards"))
)))#2022-02-1710:04Sampo Toiva@U0DJ4T5U1 cider-clojure-cli-aliass should be cider-clojure-cli-aliases and you should also omit the -A.
So, something like
(cider-clojure-cli-aliases . ":dev")
should do the trick.#2022-02-1710:11Sampo ToivaAnd actually, in your case, you probably want to use something like (cider-clojure-cli-global-options . "-A:dev") since the cider-clojure-cli-aliases apply to my knowledge to starting the repl with clojure-cli
Check this for more info: https://docs.cider.mx/cider/cljs/shadow-cljs.html#using-shadow-cljs-with-deps-edn-and-custom-repl-initialization#2022-02-1711:08practicalli-johnFro reference, there are several variables for Cider shadow-cljs
https://practical.li/spacemacs/reference/cider/configuration-variables.html#ciderel#2022-02-1804:28Drew Verleethanks @UFG0HRDC7 and @U05254DQM those suggestions worked, i'm embarrassed i didn't notice the typo in my original attempt.#2022-02-1805:26Sampo ToivaNo worries, not the first nor the last time someone (me included) typos something and wonders why it doesn’t work :)#2022-02-1805:33Drew VerleeI need a faster way to understand the code i'm putting in those dir-local files. i spend way to much time messing with them. I need to learn elisp and probably just stop using them in the way I am, or something.#2022-02-1809:56practicalli-johnhttps://exercism.org/ has an Emacs Lisp learning track#2022-02-1716:50winsomeI'm trying to start a cljs node repl and it opens up a cljs repl but fails when it tries to run (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)), with this stacktrace:
TypeError: Cannot read properties of undefined (reading 'error__GT_str')
at Socket.<anonymous> ([stdin]:89:38)
at Socket.emit (node:events:390:28)
at Socket.emit (node:domain:475:12)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:285:11)
at Socket.Readable.push (node:internal/streams/readable:228:10)
at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17)#2022-02-1716:50winsomeI can get browser repl going, but I'm not sure where to start debugging this one.#2022-02-1722:29Akshay C. Gollapallidoes cider attempt to launch repls under a different user or in a different environment than the one emacs is running under? (on linux)#2022-02-1722:30dpsuttonno#2022-02-1722:33dpsuttonemacs does have a different exec-path from the env of the launching shell, especially when started as a GUI frame not as a child of a terminal#2022-02-1722:34dpsuttonwhat error are you seeing?#2022-02-1722:34Akshay C. GollapalliI'm having issues with cider running figwheel-main with npm dependencies coming from webpack. It's not able to find node, installed via nvm. When I run the figwheel-main via clojure -m figwheel.main -b dev -r it works fine. But running from the major mode in emacs returns
[Figwheel:SEVERE] Bundling command failed /usr/bin/env: 'node': No such file or directory
#2022-02-1722:35dpsuttonyeah. i’ve had issues with this in the past. in my init i had to add the nvm location to the exec-path.#2022-02-1722:35dpsuttonyou can test out by opening an eshell buffer and typing which node. If that doesn’t work no emacs child process will. You’ll need to add to the exec-path so it can find node#2022-02-1722:36dpsuttonexec-path is a variable defined in 'C source code'.
Its value is
("/Users/dan/.sdkman/candidates/java/current/bin/" "/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/" "/usr/local/bin/" "/usr/bin/" "/bin/" "/usr/sbin/" "/sbin/" "/opt/homebrew/Cellar/emacs-mac/emacs-27.2-mac-8.3/libexec/emacs/27.2/aarch64-apple-darwin21.2.0/")
[truncated]
Documentation:
List of directories to search programs to run in subprocesses.
Each element is a string (directory name) or nil (try default directory).
By default the last element of this list is 'exec-directory'. The
last element is not always used, for example in shell completion
('shell-dynamic-complete-command').#2022-02-1722:37dpsuttonnot sure if nvm does something similar to sdkman there where java/current/bin is on my exec-path#2022-02-1722:37dpsuttonand of course this helpful lib if you aren’t already using it #2022-02-1722:40Akshay C. GollapalliThanks.#2022-02-1722:41Akshay C. GollapalliI remembered that doom actually lets you alter your env. So I ran doom env, but I didnt' realize that it was by frame. Restarting emacs after adding an environment file did the trick!#2022-02-2107:10anonimitorafHi guys, how do I go about showing the active CIDER session on my modeline? Use case: I usually connect to several (3+) nREPL instances so it'd be nice if I could easily see which one is currently active#2022-02-2107:33dpsuttoncider-mode-line-show-connection defaults to t and should show the connection#2022-02-2107:34dpsuttonshould be showing
(concat
(symbol-name cider-repl-type)
(when cider-mode-line-show-connection
(format ":%s@%s:%s"
(or (cider--project-name nrepl-project-dir) "<no project>")
(pcase (plist-get nrepl-endpoint :host)
("localhost" "")
(x x))
(plist-get nrepl-endpoint :port))))
perhaps you have something inhibiting it?#2022-02-2108:54anonimitorafOh wait, is that only for CIDER REPL buffers?#2022-02-2109:45markgdawsonDoes cider have any way to capture a scope from the debugger? I'd like to just def all current locals in the current top level environment.
I seem to be either be able to hit e (for eval) then (def some-var some-var) or go to locals (`l`) and hit d to def into the user namespace.
I'd like to just def all the locals in this namespace easily. Any suggestions how to achieve this (either with something built-in or thoughts on implementing it in elisp).#2022-02-2110:13Carsten BehringI was looking for a feature like this already for a while.
I find my self writing (too often) by hand:
(def x x)
(def y y)
....
Not sure, if this is required to be part of the cider debugger, or if static code analysis magic and some elisp could do it.
I would prefer without debugger, even if it is not "perfectly working".#2022-02-2113:20anonimitorafMight be relevant: https://github.com/vvvvalvalval/scope-capture#2022-02-2115:58dpsuttoni made this a while ago: https://clojurians.slack.com/archives/C0617A8PQ/p1554777847089000#2022-02-2122:22jvtriguerosWhen I run cider-load-buffer on a buffer, this also loads other namespaces that that file depends on, is there a way to have those print to *Messages* or really any other buffer? I see in the REPL that there’s stuff running but I’m having a hard time tracing where that’s coming from.#2022-02-2200:23practicalli-johnThe require function has a :verbose option that shows what namespaces are loaded when reloading a namespace.
So this expression should show all the namespaces that are loaded when loading the specified namespace
(require '[fully.qualified.namespace] :reload :verbose)
#2022-02-2200:26practicalli-johnI haven't tried this in Cider, so not sure if this shows in the source code buffer or repl buffer#2022-02-2200:39jvtriguerosThank you! I’ll give this a shot!#2022-02-2200:41jvtriguerosHmm my configuration might be swallowing the output let me try with a vanilla REPL.#2022-02-2200:53practicalli-johnsorry, there was a typo, fixed it now. moved the closing square bracket to the right place#2022-02-2201:22jvtriguerosOh I see, yeah I wasn’t getting any traction with the bracket at the end, this is now spitting all the namespaces that the code traverses through, thank you so much!#2022-02-2201:40jvtriguerosFor completion’s sake, it’s part of the documentation https://clojuredocs.org/clojure.core/require#2022-02-2122:34winsomeI'm trying to run a test (cider-test-run-test) from a node repl, but I get this error: No clj REPLs in current session: "project:localhost:39703". Which is true, it's just a cljs repl.
Is running tests in a non-jvm repl supported?#2022-02-2202:28practicalli-johnI believe CIDER test runner only supports https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj, which is a jvm only.
Perhaps https://github.com/lambdaisland/kaocha-cljs might be a relevant approach for testing ClojureScript#2022-02-2123:51jmckitrickHas anyone seen this error running cider in emacs 29?#2022-02-2123:51jmckitrick.emacs.d/elpa/cider-20220216.732/cider-mode.el: Warning: Error: %S#2022-02-2123:52jmckitrickI’m getting this error in 2 emacs packages, and the other one is working incorrectly. I haven’t discovered a breakage yet in cider, but it’s subtle, so I’m asking around here.#2022-02-2123:53jmckitrickThis issue does not appear in emacs 29#2022-02-2211:47jumarI upgraded my Emacs (spacemacs) today and all the packages and noticed cider got some nice improvements like downloading java sources automatically
It also shows a nice red error dialog (not sure if this is something spacemacs specific).
But the problem is that it now frequently freezes upon evaluation, possibly when there are some errors in the source buffer.
So it can consume lot of CPU (let's say 800%) for minutes without doing anything.
An example OOM I got after which it crashed:
E.g. I#2022-02-2211:49jumarI tried to profile it with async while it was doing a lot of work and apart from GC
there's a lot of work done inside orchard#2022-02-2211:50jumar#2022-02-2211:51vemvyou are using JDK8, correct?
One line of research if checking if the error simply goes away by using a more recent JDK#2022-02-2211:53vemvAnd another is using JVM flags to avoid OOMs, here are mine (for a 64GB MBP) https://github.com/reducecombine/.lein/blob/f01aec663ff4ac8f8e83f8eca93a13b2cf99aa4b/profiles.clj#L10-L43
People would be surprised by how many issues go away with these flags - Clojure can be hungry in general and it can show in arbitrarily many libs#2022-02-2211:54vemvwill try to make sense of the flamegraph anyway 🙏 maybe something is problematically lazy#2022-02-2211:58jumarThanks for the prompt response.
I'm using JDK 8 and I'm a bit stuck with this for a while (a legacy app).
I haven't tuned it much but it's got 1GB heap (to mimic production settings).
I'll keep an eye on it and will see if this becomes a frequent issue.#2022-02-2211:59jumarFrom your settings, I would say only setting large Xmx and Xss could have a positive effect.#2022-02-2212:05vemvXX:CompressedClassSpaceSize also (although not so much for this specific problem)
In general I don't recommend mimicking production settings. A dev repl can have much more in it e.g. cider-nrepl, refactor-nrepl, kondo (when used as a jvm lib) etc so that already makes the memory requirements different
Perhaps in CI it's more apt#2022-02-2212:27vemvAnother line of research is that gc overhead limit exceed is an unusual wording, perhaps it's specific to a given GC? Not sure if you are explicitly choosing one. Swapping impls might do the trick.
Also in the second screenshot I'd need to be able to read what is said in the rightmost panes#2022-02-2212:53vemvHopefully this will fix it, at the same time everything I said stands :) https://github.com/clojure-emacs/orchard/pull/154 working on a 1GB jvm is not guaranteed#2022-02-2215:06jumarThanks for the prompt action!
Note that gc overhead limit exceed is a very common thing nothing special:
The rule tends to be something like :
> too much time (e.g. 98%) of a time interval (e.g. no less than 1 minute) during which multiple (e.g. at least N) full GC cycles have run was spent in stop-the world GC.
(https://groups.google.com/u/1/g/mechanical-sympathy/c/TpyjsaPhM5U)#2022-02-2215:09jumarAlso, the app has been working with 1gb just fine for a couple of years.
I'm adding a couple more pictures, the second one is at the very far right but it also consumed only a tiny piece of CPU time#2022-02-2215:10jumarThat said, I'm really impressed by the prompt fix you did 🙂#2022-02-2305:46jumar(If you saw it already, forget what I said above - it was a stupid mistake on my side and I deleted the messages)#2022-02-2307:45vemvI guess I was lucky because I didn't see them :)#2022-02-2307:45vemv> too much time (e.g. 98%) of a time interval (e.g. no less than 1 minute)
what I find peculiars about this is that memory hasn't literally run out, but rather an heuristic is being hit#2022-02-2307:46vemv> Also, the app has been working with 1gb just fine for a couple of years.
But tooling changes, so it's a bet that can fail at any time (as it has for me with various other tooling or libs)#2022-02-2307:47vemv> That said, I'm really impressed by the prompt fix you did
cheers cider The changes made it to the latest CIDER snapshot, would be curious as to whether they make a difference#2022-02-2308:38jumarSnapshots are published to MELPA? That is I can just upgrade the emacs cider package?#2022-02-2308:40vemvdepends on what melpa are you using#2022-02-2308:41vemva stable release will be cut within a week#2022-02-2216:00ennis there an easy way to change the REPL a given buffer is associated with? I know that if I kill all but one REPL, then all remaining Clojure buffers will compile to the last REPL standing, regardless of their previous association. But I’d like to be able to change the REPL for a buffer without killing its old REPL.#2022-02-2307:31magnarsC-c C-s b is sesman-link-with-buffer which does this.#2022-02-2315:35ennthank you!#2022-02-2219:09eggsyntax@bozhidar or anyone else, have you ever looked into (or are you aware of anyone experimenting with) having https://mikelevins.github.io/posts/2020-12-18-repl-driven/ in CIDER? Or possibly at the nREPL level? I’ve been doing a bit of reading about the benefits of the breakloop & starting to think about what it would take to have one in Clojure.#2022-02-2219:16mkvlr@U5NCUG8NR has been building https://github.com/IGJoshua/farolero and I believe nrepl integration is on the roadmap#2022-02-2219:24Joshua SuskaloIt is definitely on the roadmap. Unfortunately it will never come all the way to what common lisp can do because I can't inject usage of farolero into clojure core, and I'm not currently aware of a way to hijack a thread when an exception is thrown before it unwinds, so it'll be limited to where you place wrap-exceptions calls and similar.#2022-02-2219:30Joshua SuskaloAny library or application using farolero for its stuff will get a breakloop-style debugging experience for stuff that they've written to support that workflow, though.#2022-02-2219:32eggsyntaxVery cool! As awesome as it would be to have full a CL condition system in Clojure, I was imagining something lighter-weight built on CIDER’s existing debugger — IIUC the CIDER debugger https://docs.cider.mx/cider/debugging/debugger.html#using-the-debugger before running it, and I was imagining this could similarly wrap everything in a try/catch, and drop to the debugger whenever it caught an exception.
> I’m not currently aware of a way to hijack a thread when an exception is thrown before it unwinds
I wonder whether you could temporarily capture the stack before evaluating each expression, and then if the expression resulted in an exception, restore the saved stack and drop to the breakloop. That might result in user-visible side effects happening twice, but seems like it’d still be very useful.
I may be being painfully naive here; like I said I’ve just started to think about this problem.#2022-02-2219:34eggsyntaxI’m basically wondering what if anything I could accomplish in this vein as an experienced Clojure programmer with a couple of weeks between jobs to devote to it.#2022-02-2219:38Joshua SuskaloThat "capture a stack" is continuations, and the JVM does not currently expose a way to do that.#2022-02-2219:40Joshua Suskaloand try/catch misses the bit where you have to catch things before they unwind, although just wrapping all functions in this type of try/catch and then retrying the function may be possible if the cider debugger already does this, but I want to note that the cider debugger doesn't wrap most functions, just the ones you explicitly wrap.#2022-02-2219:43eggsyntax> That “capture a stack” is continuations, and the JVM does not currently expose a way to do that.
Gotcha, makes sense, not something I’ve ever looked into with the JVM.
> although just wrapping all functions in this type of try/catch and then retrying the function may be possible
That’s definitely what I was imagining.
> the cider debugger doesn’t wrap most functions, just the ones you explicitly wrap.
cider-debug-defun-at-point is what I’m thinking of; per the CIDER docs that “will insert as many breakpoints as possible into the form”.#2022-02-2219:45eggsyntaxIt does certainly sound like there’s no easy intervention that would enable the true CL breakloop with restarts, but it seems like “break to debugger on exception” would have some value on its own, and I’m hoping that the “wrap every single expression and subexpression with try/catch” could prevent the unwinding to keep the state of the stack as local as possible.
Might still be being too naive though 😆#2022-02-2219:48Joshua Suskaloright, my main thought is that often when an exception appears out of nowhere and it would be the most useful to have this kind of breakloop is when it's already 10 layers deep in the callstack and now you have to go find the function that threw the exception, mark it as a debugged function, and then retry your whole thing up to that point to get it to fire.#2022-02-2219:49Joshua SuskaloThat said, I don't want to discourage you from trying, if you're able to get something that works for that usecase I think it'd help me out quite a bit in my personal workflow.#2022-02-2219:52eggsyntax> right, my main thought is that often when an exception appears out of nowhere and it would be the most useful to have this kind of breakloop is when it’s already 10 layers deep in the callstack and now you have to go find the function that threw the exception, mark it as a debugged function, and then retry your whole thing up to that point to get it to fire.
My ideal would be to call something like toggle-debug-on-exception and then every expression would be transparently wrapped.
> That said, I don’t want to discourage you from trying, if you’re able to get something that works for that usecase I think it’d help me out quite a bit in my personal workflow.
Not discouraging at all! This is super-helpful info that’ll save me at least one big blind alley, and I really appreciate you taking time to talk about it. It definitely doesn’t have nearly as much potential as Farolero! But I’m hoping that it could be done in a relatively lightweight way and wouldn’t require writing/rewriting the code to specifically take advantage of it.
Worst case it’ll be a fun way to spend a couple of weeks even if nothing comes of it 😆#2022-02-2219:54mkvlrcurious if project loom will lift these limitations#2022-02-2220:10Joshua Suskaloloom has continuations at a low level, but I don't know how much that would actually help if there isn't a reasonable way to do a "break on exception" style facility.
I know that some debuggers can do this, so maybe it's feasible?#2022-02-2220:11Joshua SuskaloHonestly my main thought would be that I suspect that normal threads would dodge this by not actually having continuations, since they're only needed on the virtual threads.#2022-02-2220:17mkvlrcan the uncaught exception handler be such a facility?#2022-02-2220:26eggsyntax> can the uncaught exception handler be such a facility?
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Thread.UncaughtExceptionHandler.html the stack would be fully unwound by the time it hit the uncaught exception handler, so it would be of limited use for something like a debugger.#2022-02-2220:52Joshua Suskaloyes#2022-02-2222:50eggsyntaxOh, hmm. I see @U0GN0S72R has already created https://github.com/gfredericks/debug-repl, implemented as nREPL middleware. I think that means that automatically dropping to a debug repl on exception would “just” require automatically wrapping each call (or maybe even just the top-level call?) in the https://github.com/gfredericks/debug-repl/blob/master/src/com/gfredericks/debug_repl.clj#L256 macro.
Although I’m a bit confused as to how/why debug-repl is middleware, since at least in its https://github.com/gfredericks/debug-repl/blob/master/README.md the breakpoints are being set manually.
So playing with that will be my next step 🙂#2022-02-2223:00eggsyntaxOh, I think I see, maybe it’s middleware https://nrepl.org/nrepl/design/middleware.html#sessions its own set of dynamic vars (eg *1, *e).#2022-02-2223:14gfredericksMy vague recollection is it's more fundamental than that#2022-02-2223:18gfredericksIt's gnarly code though. Can't figure out at a glance what problems it was trying to solve#2022-02-2300:13eggsyntaxAh, gotcha. It might make it extra-useful for what I’m trying to do anyhow, not sure yet. I’ll play with it. Thanks for making it!#2022-02-2402:07eggsyntax@U0GN0S72R wow, that really is some genuinely gnarly code 😅#2022-02-2402:08gfredericksOops#2022-02-2402:09eggsyntaxSuper cool though. I’m having fun trying to reverse engineer it a bit 😁#2022-02-2219:58gasrulleIs there a way to evaluate all forms within a rich comment? As it is now I have to eval each one by one when i start the REPL. I can evaluate the whole buffer, but as far as I can see, this does not apply to things defined in rich comments (and that’s maybe how it supposed to be)?#2022-02-2220:03eggsyntaxI usually wrap them in a do if I think I’m going to frequently want to eval them all.#2022-02-2220:03practicalli-johnThis is exactly how I use rich comment forms. I can safely evaluate the namespace without worrying about code I do not want to load in the comment form#2022-02-2220:04eggsyntax> I usually wrap them in a `do`
ie
(comment
(do
(foo)
(bar)
(baz)
))
so that I can then evaluate them separately or all at once as desired.#2022-02-2220:06gasrulle@U077BEWNQ thanks for the quick reply! I’ll try that.#2022-02-2220:12gasrulle@U05254DQM yeah, it makes sense (just trying to get my head around all the things about Clojure :)#2022-02-2221:36Joshua SuskaloIs there any way with cider's debugger to go up in the callstack and inspect the state of locals or similar, without unwinding?#2022-02-2222:34eggsyntaxYou can definitely inspect locals without unwinding, and you can pop out a level (although from that latter I don’t think you can get back inward). Locals being shown on left:#2022-02-2222:35eggsyntaxThis bit shows the debugger commands, which are documented https://docs.cider.mx/cider/debugging/debugger.html:#2022-02-2305:49jumarNot sure what you mean by unwinding but every now and then, I wish it was possible to step out of the instrumented function and continue debugging higher up the stack.
I don't think this is doable today.
Like here, If I instrument only baz I would like to be able to jump out and continue stepping through the code in bar and possibly foo
https://github.com/jumarko/clojure-experiments/blob/master/src/clojure_experiments/debugging.clj#L6
(defn baz [z]
(let [zz (+ 10 z)
zzs (repeat zz z)]
(mapv inc zzs)))
(defn bar [y]
(let [yy (+ 5 y)]
(baz yy)))
(defn foo [x]
(bar (inc x)))
(comment
(foo 3)
,)
#2022-02-2305:49jumarThe other thing that doesn't really work for me is *s*tacktrace.
When I press s nothing happens, at least I don't see anything - I though it would print the stacktrace to stdout.#2022-02-2305:52jumarI'm not sure how in works but it apparently is able to step through a function which wasn't explicitly instrumented.
I would love to see a variant of out that would have the same capability.#2022-02-2306:01jumarOk, I thought that perhaps s isn't working because I use spacemacs in evil mode.
But it still doesn't seem to do anything after I switch to emacs mode.
I'm wondering where the "s" shortcut is defined - it seems most of them are here, but not "s": https://github.com/clojure-emacs/cider/blob/master/cider-debug.el#L400-L424#2022-02-2314:33eggsyntax@U06BE1L6T working fine for me in spacemacs/evil (CIDER 1.1.1), so I don’t think that’s your problem.
The binding to s might actually be https://github.com/clojure-emacs/cider/blob/master/cider-debug.el#L191 in cider-debug-prompt-commands.#2022-02-2314:36jumar@U077BEWNQ so it actually prints the stacktrace in the REPL buffer or what exactly it does?#2022-02-2314:37eggsyntaxFor me it pops up the *cider-error* buffer and shows it there.#2022-02-2314:42jumarI see, thanks - have no idea why it doesn't work for me 😞
Ah, maybe...
Oh yes!
It's a sideffect of me disabling the error buffer via cider-show-error-buffer set to never. (I found it quite slow and annoying)
Definitely unintuitive!#2022-02-2315:03Joshua Suskaloin works by recompiling the function with instrumentation before you call it#2022-02-2315:03Joshua Suskaloat least I'm fairly sure#2022-02-2315:03Joshua SuskaloOut can't do that because you can't recompile code that's already been partially run#2022-02-2315:03jumarYes, makes sense.#2022-02-2616:20bozhidar⚠️ ⚠️ ⚠️
Hey, everyone! CIDER's author here. As you might have noticed I've been kind of absent on the CIDER front (and open-source in general) recently. I guess by now all of you are aware of the horrible war that Russia is waging on Ukraine. What you probably don't know is that my wife is from Ukraine and I have a ton of family members, friends and colleagues living there. My second home is being invaded and me and my wife are devastated. The brave people of Ukraine can use all the help that they can get these days and I'll encourage all of you to consider donating to some of the support and relief efforts:
• the Ukrainian army - https://bank.gov.ua/en/news/all/natsionalniy-bank-vidkriv-spetsrahunok-dlya-zboru-koshtiv-na-potrebi-armiyi
• Charitable Foundation "Come Back Alive" - https://savelife.in.ua/en/donate/
Please, share those important donation channels with as many people in your social circles as possible! #StandWithUkraine
P.S. I'm considering to add those donation links to CIDER's welcome message. I hope you won't hate me if I do this. Likes and prayers mean little to the people of Ukraine. Real actions are the difference between life and death for them. :flag-ua: cider#2022-02-2616:35solf300 usd sent to the swift information in the charity link#2022-02-2616:36solfI don’t have words for what’s happening#2022-02-2616:44bozhidarThanks for your support! It's a nightmare, I can't describe it in any other way. I pray for 3 things all the time:
• the safety of all people of Ukraine
• victory (and freedom from Russia) for Ukraine
• Putin to burn in hell for all the atrocities he has committed#2022-02-2617:35apiologyFor those of us unfamiliar with SWIFT transfers (e.g., my bank doesn’t list Ukraine as a valid destination country) and a little twitchy about Bitcoin, are there other means to get money over? Not saying that’s going to be a permanent barrier on my side, but every bit of ease makes it easier for the next person this gets amplified to.#2022-02-2617:36apiology(I’ll dig in here and report back what I find as well - I don’t mean to put more burden on you here)#2022-02-2617:37solfI used http://wise.com (as I already had an account there), you can use your credit card to send to swift there#2022-02-2617:39bozhidarYeah, I was going to suggest http://wise.com as the easiest and cheapest way to wire money in Ukraine.#2022-02-2617:39bozhidarI think they waived all transfer fees yesterday to support the country.#2022-02-2617:43fedregyou can also send BTC through the come back alive site#2022-02-2713:20bozhidarThere's this fund that doesn't support the army, but rather the refugees https://www.globalgiving.org/projects/ukraine-crisis-relief-fund/ I hope that this doesn't classify as a form of political expression.#2022-02-2713:21bozhidarThere are a few other options for you to choose from here.#2022-02-2713:21bozhidarhttps://www.globalgiving.org/search/?size=25&nextPage=1&sortField=sortorder&selectedLocations=00ukrain&loadAllResults=true#2022-02-2701:46dpsuttonI've deleted a message about a petition for a no-fly zone in Ukraine. I see the post is also (appropriately) posted in #off-topic so if you are interested check it out there#2022-02-2808:14lassemaattadoes cider offer anything equivalent to stub generation in cursive?#2022-02-2808:41magnarsI'm not sure what stub generation in cursive is, but based on the name, is this what you are looking for? https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-add-stubs#2022-02-2808:42lassemaatta> There are still some cases that are impossible for Cursive to analyse the source, for example when vars are dynamically created at runtime, or in cases such as Datomic which are distributed without source at all. For these cases, Cursive supports stub generation. This will run a process and load the problematic namespaces into it, introspect the var metadata and then generate source files containing empty function stubs which it can index for use in the editor.#2022-02-2808:44magnarsCIDER doesn't do static analysis, so I don't see what an equivalent would be.#2022-02-2808:45lassemaattaI guess enrich-classpath is vaguely similar, except here we don't have any premade foo-sources.jar to download and display#2022-02-2809:25lassemaattaah, it seems clojure-lsp provides this, https://clojure-lsp.io/settings/#stub-generation#2022-03-0104:33dpsuttonI'm still confused by this. Clojure queries namespace vars at runtime and does not require static analysis. Thus there is no need for a stub to provide the vars from a namespace, since (ns-vars the-ns) will provide the actual vars#2022-03-0104:56lassemaattathe actual reason for asking about this feature is simple: I want to see the function/var docstrings in emacs.#2022-03-0104:57dpsuttonCIDER should 100% be able to do this with no extra tooling or stub generation#2022-03-0104:57dpsuttonCIDER just queries the runtime for the information. As long as those namespaces are loaded it should work#2022-03-0105:01lassemaattaah, interesting. I'll admit, I'm not always certain what functionality in emacs is provided by cider and what comes from other packages (e.g. clojure-lsp).#2022-03-0105:03dpsuttonthey both will provide this functionality, but with two different philosophies. CIDER requires a running repl and queries the runtime for information. In Clojure this is surprisingly sufficient. Clojure-lsp (and Cursive) use static analysis and do not require a running repl. This has benefits, but has the downside that if the source is obfuscated (eg, Datomic) it has nothing to reason about and cannot offer any information#2022-03-0106:58vemv(-> #'+ meta :doc) should be enlightening :) that's basically what CIDER does#2022-03-0313:45jumarI'm trying figwheel-main and want to integrate it with emacs.
I followed https://docs.cider.mx/cider/cljs/figwheel.html and https://figwheel.org/docs/emacs.html
and my project (lein based) works with lein fig:build
However, when I try to run cider-jack-in-clj&cljs I get this error
1. Unhandled java.lang.NullPointerException
Null closurePrimitiveNames
AutoValue_Config.java: 196 com.google.javascript.jscomp.parsing.AutoValue_Config$Builder/setClosurePrimitiveNames
ParserRunner.java: 91 com.google.javascript.jscomp.parsing.ParserRunner/createConfig
Compiler.java: 2686 com.google.javascript.jscomp.Compiler/createConfig
Compiler.java: 2667 com.google.javascript.jscomp.Compiler/getParserConfig
JsAst.java: 155 com.google.javascript.jscomp.JsAst/parse
JsAst.java: 55 com.google.javascript.jscomp.JsAst/getAstRoot
externs.clj: 169 cljs.externs/parse-externs
externs.clj: 156 cljs.externs/parse-externs
externs.clj: 204 cljs.externs/externs-map*/fn
protocols.clj: 49 clojure.core.protocols/iter-reduce
protocols.clj: 75 clojure.core.protocols/fn
protocols.clj: 75 clojure.core.protocols/fn
protocols.clj: 13 clojure.core.protocols/fn/G
core.clj: 6830 clojure.core/reduce
core.clj: 6812 clojure.core/reduce
externs.clj: 201 cljs.externs/externs-map*
externs.clj: 185 cljs.externs/externs-map*
externs.clj: 189 cljs.externs/externs-map*
externs.clj: 185 cljs.externs/externs-map*
AFn.java: 154 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 667 clojure.core/apply
core.clj: 6342 clojure.core/memoize/fn
RestFn.java: 408 clojure.lang.RestFn/invoke
env.cljc: 51 cljs.env$default_compiler_env_STAR_/invokeStatic
env.cljc: 46 cljs.env$default_compiler_env_STAR_/invoke
env.cljc: 62 cljs.env$default_compiler_env/invokeStatic
env.cljc: 59 cljs.env$default_compiler_env/invoke
main.cljc: 2172 figwheel.main$default_compile/invokeStatic
main.cljc: 2167 figwheel.main$default_compile/invoke
main.cljc: 2291 figwheel.main$start_STAR_/invokeStatic
main.cljc: 2267 figwheel.main$start_STAR_/doInvoke
...
What can I do to make this work?#2022-03-0315:20hkjelsHaven’t seen this, but it looks like you don’t have a main function in your Clojure-code. Does it work to just jack into clj?#2022-03-0316:02practicalli-johnI use https://github.com/bhauman/figwheel-main-template to create projects that work with Cider jack-in#2022-03-0404:48jumarYeah, I tried that too.
It works with the sample project - I'm not sure what's different in my setup.
Maybe some dependency conflicts?
Compared to the sample project my project has a significant server-side portion and I only include clojurescript relatd dependencies in the dev lein profile.#2022-03-0416:12jumarRandomly clicking through the stacktrace of the error I realized there might be a version conflict.
Cider opened a very old version of closure-compiler library (v20130603) but I have no idea where it is coming from.
lein deps :tree only shows v2020315 (I also tried to specify it explicitly in project.clj with the same result).
lein plugins :tree show an old v2016 version brought in by lein-doo plugin but it's still not this old v2013 thing.#2022-03-0416:37jumarThis is the default command used for cider-jack-in-clj&cljs
/usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.28.1\"\] -- update-in :plugins conj \[mx.cider/enrich-classpath\ \"1.9.0\"\] -- update-in :middleware conj cider.enrich-classpath/middleware -- repl :headless :host localhost
I tried using the same thing for deps :tree but got rather confusing results
lein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.28.1\"\] -- update-in :plugins conj \[mx.cider/enrich-classpath\ \"1.9.0\"\] -- update-in :middleware conj cider.enrich-classpath/middleware -- deps :tree >& deps-cider.out
When I look into deps-cider.out I see this
less deps-cider.out
...
[com.google.javascript/closure-compiler-unshaded "v20200315" :classifier "javadoc" :exclusions [[*]]]
[com.google.javascript/closure-compiler-unshaded "v20200315" :classifier "sources" :exclusions [[*]]]
[com.google.javascript/closure-compiler-unshaded "v20200315"]
[args4j "2.0.26"]
...
[com.google.javascript/closure-compiler "v20130603" :classifier "javadoc" :exclusions [[*]]]
[com.google.javascript/closure-compiler "v20130603" :classifier "sources" :exclusions [[*]]]
so v20130603 is a top-level dependency but I don't know how that can be - it's definitely not in my project.clj and also not in the dependencies added by the command.
Moreover, it seems there are only javadoc and sources but not the standard artifact like there is for closure-compiler-unshaded#2022-03-0416:46jumarIf I remove enrich.classpath there are way less dependencies and the mysterious v20130603 version is gone too!
lein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.28.1\"\] -- deps :tree > deps-cider.out
If I run
/usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.9.0\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.3.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.28.1\"\] -- repl :headless :host localhost
@U45T93RA6 do you have an idea why is this happening?#2022-03-0422:11vemvI've been meaning to cut a new enrich-classpath release, sounds like now it's the time
Please clearly save your project as a branch/etc so we can see if the fix worked
Thanks!#2022-03-0506:23jumarGreat, thank you!#2022-03-0507:11vemvKinda bad news unfortunately! https://github.com/clojure-emacs/cider/pull/3164#2022-03-0508:55jumarI don't really know how enrich-classpath works but when I was looking at the list of dependencies and the problem I hit
it seemed to me that it's not respecting exclusions and dependency version resolutions and instead it's trying to include every version of every library which could possibly end up on classpath because it's defined as a transitive dependency of some artifact.
Even if the actuall classpath (as computed by leiningen) would never contain such artifact.
That's why I think I ended up with an ancient version of closure-compiler being loaded by an ancient version of clojurescript#2022-03-0715:09vemv> it seemed to me that it's not respecting exclusions and dependency version resolutions and instead it's trying to include every version of every library which could possibly end up on classpath because it's defined as a transitive dependency of some artifact.
Could you describe this in specific terms? A GH issue would be welcome
I can actually debug it at some point (for which I'll count on that you've saved this reproducible case as a named branch), but for now a description suffices#2022-03-0715:32jumarYeah, I can try to write down something more comprehensive 🙂#2022-03-0804:13jumar@U45T93RA6 here's the issue: https://github.com/clojure-emacs/cider/issues/3167
I managed to create a kind of minimal reproducer: https://github.com/jumarko/figwheel-main-cider-issue#2022-03-0322:19hoppyrecently started happening for node repls using development tree of spacemacs, and most current shadow-cljs. Attempting to jack-in and/or connect - nrepl dies. There are no significant spacemacs changes aside from enabling clojure layer with LSP. If you need a play project: /cdn-cgi/l/email-protection:/Gnurdle/aoc2019.git is intended to be used this way. I'll also add that calva handles this atm, and spacemacs seems like it was working until very recently.#2022-03-0322:22hoppyhappy to help with debugging, but not sure what next step would be#2022-03-0416:12jumar#2022-03-0603:53stuartrexkingWhen printing inline in the buffer, say cider-eval-last-sexp, should the pretty printing config be respected? I’m getting pretty printing (zprint) directly in the repl, but not inline.#2022-03-0603:55stuartrexkingIt’s hard to tell exactly, but it looks like I’m getting zprint inline, but not respecting my zprint config, which I seem to get in the repl.#2022-03-0715:59practicalli-john@stuartrexking try the eval-pprint commands when evaluating in the source code buffer - e.g. cider-pprint-eval-last-sexp or cider-pprint-eval-last-sexp-to-comment . This approach works with cider configured to use puget, so assume it should also work with zprint.#2022-03-0717:02bozhidarCIDER 1.3 ("Ukraine") is out! More details - https://github.com/clojure-emacs/cider/releases/tag/v1.3.0#2022-03-0717:58vemvℹ️ It is good time to upgrade clj-refactor/refactor-nrepl as well!
If you're a fan of cljr-slash and Stuart Sierra's https://stuartsierra.com/2015/05/10/clojure-namespace-aliases, you are in luck: now it will offer completions for newly created namespaces, even if those haven't been aliased elsewhere in the codebase.
e.g. if I create a new namespace called my.prefix.foo, then in another ns I'll be able to type foo<slash> (or prefix.foo<slash>) and cljr-slash will insert a my.prefix.foo :as foo libspec in the ns form.
I'm finding this crazy useful.#2022-03-0720:07afleckis there a way to have indentation pick up specs from the :cljfmt key in lein project.clj ?#2022-03-0721:11vemvSee https://docs.cider.mx/cider/1.3/usage/misc_features.html#formatting-code-with-cljfmt
You could create a piece of Lein middleware that translates+dumps the cljfmt config to a .dir-locals file, setting cider-format-code-options
The pattern would look like this:
:middleware [~(do
(intern 'user
'my-middleware
(fn [project]
(println "Do your work here with " (:cljfmt project))
project))
'user/my-middleware)]
#2022-03-0721:12vemvIf you create something interesting or could use some help, feel free to ping me, I'd be happy for someone to contribute this for everyone to use :)
(but other than that I don't happen to need it on a personal level)#2022-03-0721:20vemvmmm, I'm talking about cider-format, which is a different feature from cider indentation
But the principle is similar: you create Lein middleware that dumps an .el file
Instead of targeting cider it should target clojure-mode. You would generate a bunch of put-clojure-indent calls. An example: https://github.com/metabase/metabase/blob/fb9e912d0bc47471024a66e3c8f59afd888e4129/.dir-locals.el#L36-L46
As for how to convert a "cljfmt indent" to a "clojure-mode indent spec", here's some inspiration: https://github.com/nedap/formatting-stack/blob/b77370f9ed972b21203b4f15197ad297688e4b29/src/formatting_stack/formatters/cljfmt/impl.clj#L38-L46#2022-03-0721:38afleckok, thanks for the pointers!#2022-03-0821:56fedregHi all 👋
At some point in the past several days I noticed that I stopped seeing errors in my code & repl buffers when I eval a fn that has an exception…
For example, say I have (/ 1 0) in a file and eval it with C-c C-e, I won’t see that code snippet turn red, get underlined, etc and no error will print out in my cider repl buffer.
But if I compile the entire file with C-c C-k, then that snippet turns red, error msg prints out to buffer, etc etc, like it always has.
Cider 1.3 & cider-nrepl 0.28.3 but can recreate on older versions of these as well.
Before I dig through every potential conflict, has anyone else experienced this and maybe know what might be causing exceptions to not print??
Thx!!
• Emacs 28.0.91 (native comp)
• Mac OS#2022-03-0822:03Alex Miller (Clojure team)what Clojure version?#2022-03-0822:05fedreg1.10.3 (can’t recall if the same happens on other projects on 1.11.. but I can double check)#2022-03-0822:12fedregwell on 1.11.0-rc1, the code snippet won’t turn red in the code buffer regardless of how I eval it, but at least the exception will now always print out to the repl buffer ..which is all I really need, so thx!!
Didn’t occur to me that it would be a clj version issue…
But I know it used to work fine with 1.10.3 in the past, so something else is still conflicting#2022-03-0822:36vemvDoesn't ring a bell, feel free to create an issue#2022-03-0822:41fedregthx, think it’s more likely something on my end. Will create an issue if I can’t find anything after exhausting some possibilities#2022-03-0822:50Alex Miller (Clojure team)I was in particular wondering if this change affected it https://clojure.atlassian.net/browse/CLJ-2529#2022-03-0822:57Alex Miller (Clojure team)that change will affect the type of the exception flowing out of load. I don't know exactly what cider does with it after that#2022-03-0914:30fedregThat certainly seems related, and explains why cider correctly prints the error when I try it on 1.11.0. Cider may just have to update how it handles the error to mark the code correctly in the code buffer.
Will create an issue with them just in case.
Thanks for sharing!#2022-03-0901:43vemvℹ️
clojure-mode 5.14.0 is out (first release in over a year)
clj-refactor.el 3.4.2 is out (bugfix release on top of yesterday's release)#2022-03-0922:56hoppyBeen discussing this problem in the shadow-cljs channel, but it may apply here as well.#2022-03-0923:39dpsuttonare you choosing "shadow" and then "node-repl"? or just node-repl first?#2022-03-0923:53vemv@hoppy you should request that that assertion is expressed more informatively, from shadow's side. The faulty value could be nil or maybe some other type.#2022-03-1001:16hoppy@dpsutton that appears to be the debacle. I guess I have forgotten what I once knew. I do bounce between spacemacs and calva at low frequency to keep myself on my toes. IRdumb#2022-03-1001:23hoppyI let them know what is going on, but the ergonomics of this is kinda a bitey-dog. I'm doing 'node' so I was easily snared. seems like 'node' and 'shadow' shouldn't be at the same level in that search path, but I understand how we got here.#2022-03-1001:23hoppyperhaps a prompt a bit more telling than 'node' is appropriate#2022-03-1015:54CaseyThe jump to test feature only seems to work if a test exists. Is there a quick way to create a new test ns and open it ?#2022-03-1106:04bozhidar@ramblurr No, there's no. It's kind of hard to decide where exactly a new test should go within a test ns, but if you have concrete ideas feel free to open a feature request ticket.#2022-03-1108:09magnars@ramblurr If your assumptions match mine, you can use the code here: https://github.com/magnars/.emacs.d/blob/master/defuns/clj-defuns.el#L50#2022-03-1108:09magnarsIt will create the missing file given the universal prefix (C-u).#2022-03-1123:40diego.videcoHello everyone, I recently started getting this error when ever I get a runtime error. Does anyone know what may be going on?
PS: the error buffer appears rarely now, and I get most errors directly on the repl buffer.
PS2: seems like it may be a problem with a single specific repository, but it’s the one I have been mainly working on, so it’s hard tell with 100% certainty. But if it was the case, we are using mulog and that seems to interact with logging in some ways.
Execution error (IndexOutOfBoundsException) at my.namespace/eval66596 (REPL:204).
null
ERROR: Unhandled REPL handler exception processing message {:nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 80, :length 80, :level 20}, :op stacktrace, :session f81c5e6b-a4be-47fc-9573-7e3c532e4e06, :id 394}
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Cannot open <nil> as a Reader.
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$future_call$reify__8454.deref(core.clj:6974)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$pmap$step__8467$fn__8471.invoke(core.clj:7025)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5402.invokeStatic(core.clj:137)
at clojure.core$filter$fn__5893.invoke(core.clj:2809)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.length(RT.java:1784)
at clojure.lang.RT.seqToArray(RT.java:1725)
at clojure.lang.LazySeq.toArray(LazySeq.java:132)
at clojure.lang.RT.toArray(RT.java:1698)
at clojure.core$to_array.invokeStatic(core.clj:344)
at clojure.core$sort.invokeStatic(core.clj:3113)
at clojure.core$sort.invokeStatic(core.clj:3102)
at clojure.core$sort.invoke(core.clj:3102)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$classpath_namespaces.invokeStatic(namespace.clj:119)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$classpath_namespaces.invoke(namespace.clj:106)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$project_namespaces.invokeStatic(namespace.clj:131)
at cider.nrepl.inlined_deps.orchard.v0v9v0.orchard.namespace$project_namespaces.invoke(namespace.clj:123)
...#2022-03-1204:46vemvknown one - you're using Orchard 0.9.0 and latest is 0.9.2#2022-03-1204:48vemvso use that latest cider and/or cider-nrepl stable stack and it will be gone :)#2022-03-1210:12bruno.bonacciHi @U7AMPCPU2 I'm the author of μ/log and I use cider as well for my development and I never seen this error. I agree with @U45T93RA6, by the message it looks like a version mismatch between cider and cider-nrepl.
however should the error persist, I'll be happy to help you to debug and check whether mulog is the cause of to rule it out.#2022-03-1217:32diego.videcoThanks a lot @U45T93RA6 and @U0LCHMJTA. Appreciate your help. I’ll update ASAP and will let you know if the issue persists.#2022-03-1418:34diego.videcoAll working good now with the orchard update#2022-03-1205:53David PhamI recently have cider freezing my emacs when I write a namespace and a slash sign (which I have to hit C-g to unfreeze), after cancellation I see an error message in the repl stating it was from nrepl. For example clojure.string/ would freeze emacs. Does anyone saw a similar behavior?#2022-03-1206:00vemvby any chance you have cider and clojure-lsp running at the same time?#2022-03-1206:05vemvAnyway, the functionality you are exercising is called cljr-slash, from clj-refactor.el.
Try these two from your emacs' JVM repl:
(refactor-nrepl.ns.libspecs/namespace-aliases-response {:suggest true})
(refactor-nrepl.ns.libspecs/namespace-aliases-response {:suggest false})
Do they fail? Do they time out?#2022-03-1206:07vemvThe next thing you can try is https://github.com/clojure-emacs/clj-refactor.el/blob/d7384a4edddc6c875f8562e2acd4e7346a68553f/clj-refactor.el#L1951-L1958
Same questions - does it fail, does it timeout? What if you remove parseedn-read-str (note the surrounding thread-first which is identical to clojure's ->)#2022-03-1207:39David PhamThanks a lot! I will try this. But yes I use both at the same time, is there any problem?#2022-03-1207:42vemvsometimes 😑
but let's try first with these#2022-03-1223:37Charles ComstockI'm getting a similar error from namespace-aliases because I have a data_readers.cljc with "No ns form".
ERROR: Unhandled REPL handler exception processing message {:op namespace-aliases, :prefix-rewriting false, :insert-newline-after-require true, :debug false, :suggest true, :session 3dafca56-daeb-4b3b-aa19-a64d5d42faff, :id 257}
java.lang.IllegalStateException: No ns form at /src/data_readers.cljc
at refactor_nrepl.core$read_ns_form_with_meta.invokeStatic(core.clj:383)
at refactor_nrepl.core$read_ns_form_with_meta.invoke(core.clj:372)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
I can kinda fix this by adding (ns data-readers) to the file and then ns alias suggestion works, but then I get compile warnings for the data-readers file.
I'm happy to adjust my project to include the appropriate ns for data-readers, but I'm not sure what that is supposed to be, but also, maybe namespace-aliases should have error recovery to skip any files it can't parse?#2022-03-1302:09Charles ComstockFollowup - on advanced compilation including the ns form in data_reader.cljc results in the following error:
clojure.lang.ExceptionInfo: Not a valid data-reader map {:url #object[java.net.URL 0x6caf0677 "file:/home/clgc/code/clojure/shimmers/src/data_readers.cljc"]}
at clojure.core$load_data_reader_file.invokeStatic(core.clj:7815)
So my guess is that there exists a set of clj/cljc/cljs files that should not have a namespace header but still live inside of the main src tree of a project, so I think that supports the argument that the namesapce-alias suggestions should be resilient to parsing files without a ns header. Does analysis make sense or am I missing something about how this works?#2022-03-1302:21vemvSounds like something that can be easily fixed. refactor-nrepl upgrade to come very soon.
Does your experienced issue freeze your Emacs, as David shared?
Also, @UEQGQ6XH7, your feedback for the greatly valued. No rush as it's weekend it would be priceless to have it 🙏#2022-03-1302:23Charles ComstockYea, it similarly hangs whenever I use a unknown ns and hit slash. If I temporarily "fix" the data_readers.cljc so it has a ns form then the method completes as it has in the past.#2022-03-1302:23Charles Comstock(I didn't try any of the workarounds suggested above, though is there any there that I should try?)#2022-03-1302:24vemv@UMGAMGWF8 I think it's a good idea (regardless of refactor-nrepl!) to move data_readers.cljc from src to resources. It's semantically more accurate and I'm pretty sure it will fix it (while the content themselves can remain unchanged)#2022-03-1302:26Charles ComstockCool thanks I will try that, wasn't aware that was a viable place to put it#2022-03-1302:27vemvCheers 🍻
> Yea, it similarly hangs whenever I use a unknown ns and hit slash.
This one seems pretty concerning, wasn't aware of it. Could you report it in clj-refactor.el? I assume you're using a reasonably recent stack#2022-03-1302:30Charles ComstockSorry to clarify, it hung because of the error above, and on Ctrl-g would report the error about the unhandled repl handler exception. Fixing the ns header issue in data_readers by moving it to resources results fixes it so there is no hang. It does pause for a second on first invoke but it doesn't hang. Is that still new behavior that would be good to report an issue on or no?#2022-03-1302:33Charles ComstockI think the "hanging" behavior is actually just anything that triggers an exception inside of that stack?#2022-03-1302:39Charles ComstockAnyway I have to take off this evening, but happy to submit a bug report when I return if that seems necessary.#2022-03-1305:11vemv> Is that still new behavior that would be good to report an issue on or no?
No, cljr-slash can take a little (proportionally to your project's size) on first invocation, later on it's cached except for new/changed files.#2022-03-1305:14vemv> I think the "hanging" behavior is actually just anything that triggers an exception inside of that stack?
Could be. This is worth reporting about if it can be clearly articulated and/or reproduced.
The problem wouldn't entirely surprise me since the middleware is called synchronously. Error detection depends on this defun, which maybe can be refined https://github.com/clojure-emacs/clj-refactor.el/blob/d7384a4edddc6c875f8562e2acd4e7346a68553f/clj-refactor.el#L2953-L2970#2022-03-1305:18vemvbtw, using a recent-enough version of refactor-nrepl is crucial for avoiding the issues both of you have described. the 3.x series has improved error handling (and performance), if you're still on 2.x all hope is lost :)#2022-03-1306:46Charles ComstockI'm using refactor-nrepl 3.4.1 with cider-nrepl 0.28.3 so I believe that's all cutting edge. I'll see if I can summarize it more succintly than a project that includes a cljs/cljc/clj file in src that doesn't have a namespace header?#2022-03-1307:05David PhamSo I used eMacs for a smal clj project yesterday and the behavior disappeared. I retried quickly on one of my cljs project and it was smooth again without changing anything. I might retry next week, but I will change computer for a month so I hope the bug persist in that other environment.#2022-03-1307:12Charles ComstockI documented a minimal way to trigger the hanging problem from an exception: https://github.com/clojure-emacs/refactor-nrepl/issues/373#issuecomment-1066041519#2022-03-1307:26vemvThank you both cider
all info is always useful. Will fix what I can very soon :)#2022-03-1417:12Charles ComstockThanks again for all your hard work @U45T93RA6, really appreciate it.#2022-03-1422:51vemvI could repro the freezing issue.
refactor-nrepl 3.4.2 and clj-refactor 3.4.3 (these are different numbers) fix it for all of us three.
clj-refactor 3.4.3 will be on MELPA within a couple hours cider#2022-03-1504:12vemvI've worked on Clojure 1.11's :as-alias which is now supported.
So while you're there, you can bump clj-refactor.el/refactor-nrepl to 3.5.1 and it will work with various features.#2022-03-1209:42lassemaattaWhat sort of performance should I expect from cider-format-region or cider-format-buffer? I've been testing both and formatting a simple region of maybe 5 lines or a full buffer of <100 lines both seem to take 3-4 seconds. Is this as expected?#2022-03-1209:47vemvI don't think it's expected
Note, per https://docs.cider.mx/cider/usage/misc_features.html#formatting-code-with-cljfmt those use cljfmt (over nrepl, so fortunately no JVM spawning is involved)
You could try profiling what the bottleneck is.
If you don't particularly want to use the cljfmt backend, a pure clojure-mode formatting should be pretty quick#2022-03-1209:48lassemaattayeah, indent-region which I believe uses clojure-mode is lightning fast#2022-03-1209:51lassemaattaI'm in the process of considering whether to ditch parinfer-rust-mode (for various reasons) and move over to parinfer/lispy/smartparens/etc and trying to understand what tools I need to a) keep my code nice and pretty and b) don't slow down too much when editing huge buffers/projects#2022-03-1209:59vemvyeah many options out there :)
I think cider-format is kind of a fringe feature, although supported. If you could give it a go to profiling that would be much welcome and can easily mean that a fix will be provided.
One of the simplest things you can do is jumping to the JVM code in cider-nrepl, add a time somewhere, re-eval that defn and see how much the formatting itself is taking#2022-03-1209:59vemvhttps://github.com/clojure-emacs/cider-nrepl/blob/0310f1cdb1151e980147d75baa04520ec5e358e8/src/cider/nrepl/middleware/format.clj#L28#2022-03-1210:02lassemaattaI added some keybindings to manage the profiler and run cider-format commands and naturally the delay no longer occurs 🙂#2022-03-1210:06vemvNote that individual cider-nrepl middleware is lazily-loaded. So the first time you'll use it it will load that ns and cljfmt#2022-03-1210:27lassemaattaThis is funny. Running M-x cider-format-buffer takes a few seconds, regardless of how many times I call it. But when I define (global-set-key (kbd "<f8>") 'cider-format-buffer) then both <f8> and M-x cider-format-buffer are really fast.#2022-03-1210:30lassemaattasimilarly if I add that keybinding to my (use-package cider ... it's fast. Well, I guess this is one way to solve this issue 🙂#2022-03-1210:32vemv> Running M-x cider-format-buffer takes a few seconds, regardless of how many times I call it.
unless you profile it, I assume?#2022-03-1210:38lassemaatta#2022-03-1210:40lassemaattaI really don't understand how to interpret that. From htop I can see that emacs is eating up cpu while running cider-format-region, but the profiler says most of the time is spent on that completion stuff.#2022-03-1210:45vemvIt could be useful to determine which lib is scheduling that timer-event-handler . Disabling it would demonstrate if it has to do#2022-03-1210:51lassemaattaoh my, the delay seems to be caused by suggest-key-bindings 😄#2022-03-1210:58vemvThat would explain https://clojurians.slack.com/archives/C0617A8PQ/p1647080836897889?thread_ts=1647078150.963899&cid=C0617A8PQ perhaps?#2022-03-1210:59lassemaattayep#2022-03-1505:13vemvLet us know if something could be improved somewhere :)#2022-03-1505:14vemvℹ️ clj-refactor 3.5.2 / refactor-nrepl 3.5.2 are out, with Clojure 1.11 :as-alias compatibility.#2022-03-1523:05vemv3.5.1 series has been followed up with a 3.5.2 series, with .cljc support#2022-03-1603:48Charles ComstockSo I am curious, when using invoking cljr-slash for ns suggestions in a cljc file, it prompts to inquire if the recommended ns should be from the cljs or cljc set. I wonder if that can provided as annotation on the source for a completion framework like counsel. Same as variable / fn completions are annotated, but instead show if whether or not the ns recommendation is from the cljs or clj set or both. Has anyone else explored that approach, or is there some technical limitation I'm not considering?#2022-03-1605:42vemvAll cljr prompts are done https://github.com/clojure-emacs/clj-refactor.el/blob/f368c56c83843396b160440f472a661a3b639862/clj-refactor.el#L2291-L2300.
Note that it has a completing-read call. One can instead place there his favorite completion helper e.g. ido-completing-read or ivy-completing-read .
I accomplish by using a local fork. Not sure if Emacs is supposed to have a generic way of customizing completing-read without altering sources.
If this sounds like what you want, PR certainly welcome, it's just extracting a function to a defcustom :)#2022-03-1617:11Charles ComstockI think the issue here is that before it even reaches that completing-read call for the candidates it goes through: https://github.com/clojure-emacs/clj-refactor.el/blob/f368c56c83843396b160440f472a661a3b639862/clj-refactor.el#L1928-L1940. I think my question is if instead the completing read call could include both clj and cljs suggested namespaces in one shot, but annotate the source?#2022-03-1617:33Charles Comstock(by annotation I mean something like: https://garethrees.org/2015/02/09/emacs/)#2022-03-1617:36Charles ComstockAnyway thanks, I think I might know how to address this, I'll see if I can't scratch the itch myself soon.#2022-03-1620:13vemvYeah I'd implement this as two separate features/defcustoms that can be composed together (or not):
• merge clj + cljs options
◦ I think this makes a lot of sense on its own. Often the two sets are similar enough, that a distinction just means more user friction
• annotate options
Both are things that are better done "client side" (clj-refactor, not refactor-nrepl) so hacking seems at hand.
Let me know how it goes :)#2022-03-1620:15Charles ComstockThanks! Will do!#2022-03-1620:17vemvAs a quick thought, merging has some danger in case of cljs "string requires" which could mean that we're inserting such a require for the JVM clj code path, which is syntactically invalid#2022-03-1620:22Charles ComstockAh gotcha, yea that's the sort of domain gotcha I wasn't quite aware of but assumed lurked in the depths. Is that annotated at all in the info coming back from the middleware? Ie is there anything in the system that is already aware of that edge case?#2022-03-1620:28Charles ComstockAlso I see from cljr--get-aliases-from-middleware that the hash returns either clj and cljs aliases, does it or should it also return aliases used in cljc files? Would that help address this? Anyway I'll play with it without changing what the middleware returns for now, but I wonder if that would help.#2022-03-1620:45vemvin all cases refactor-nrepl returns a map with :clj and :cljs keys
for a .clj file, :clj will be filled and :cljs will be empty
vice versa for a .cljs file#2022-03-1620:47vemvfor a .cljc file,
:clj will have only the libspecs for the :clj code path (i.e. those that don't go through :cljs reader conditionals)
:cljs will have only the libspecs for the :cljs code path (i.e. those that don't go through :clj reader conditionals)#2022-03-1620:48vemvso, in a way it's already handled for you: if a libspec is only present in the :cljs set, then you can annotate it with "cljs only"
So the user will know that, and the danger of inserting invalid code will be minimal (i.e. the user won't do something stupid :) )#2022-03-1620:54Charles ComstockGotcha, alright I will explore that. As an aside on development, is there a nice way to trick an elisp buffer to use a particular cider connection and bypass the cljr--assert-middleware guard for cider-connected-p?#2022-03-1621:01vemv> is there a nice way to trick an elisp buffer to use a particular cider connection
That seems sesman stuff which I know very little about
> bypass the cljr--assert-middleware guard for cider-connected-p
You can (defun cljr--assert-middleware ()) in your init.el, it will override the original#2022-03-1621:03Charles ComstockI guess, but the buffer won't know which connection to use, which is I guess more what I was looking for. Anyway, thanks for the help, was just hoping there was a quick trick to allow eval in the elisp buffer instead of defining a helper interactive function to run from the cider connected buffer, but I think the latter will help explore better anyway.#2022-03-1603:57ahungryI've been away from cljs for some time (last time I tinkered with shadow-cljs was ~3 years ago). I'm trying to follow set up guides for both fulcro and re-frame, and I'm hitting a dead-end in both scenarios when it comes to "Having no JS environment" (even if I ensure I visit something like localhost:8200 before trying repl buffer evaluation). If I change from build-id :main or :app to browser, I can get a successful repl call to something like (js/alert 1) to work, but can't load any files from my project template (cljs) in repl. Also, trying a simple thing like cider-eval-defun-at-point appears to do nothing at all (no error, warning, info or side effect) - it appears it isn't trying to send to the cljs repl at all. Lastly, if I try to connect a clj repl while the cljs one is open (or vice-versa) it complains and ask if I want a sibling connection instead. Are there any modern step-by-step guides for emacs+cider+cljs = SPA? I may try figwheel-main next, to avoid the shadow-cljs stuff...#2022-03-1617:19lilactownsounds like you're using emacs & cider#2022-03-1617:19lilactownhow are you connecting to the running app?#2022-03-1701:03ahungryI was able to get it working with re-frame, I just had to wait awhile for the js to be present in browser (it was 404ing prior to compiling)#2022-03-1701:03ahungryI guess initial load was taking longer and I was being impatient 😄#2022-03-1701:04ahungryWhat cider function would swap REPL to the current buffer's ns?#2022-03-1701:05eggsyntaxcider-send-ns-form-to-repl#2022-03-1701:05eggsyntaxBound to <LEADER>-s-n for me.#2022-03-1701:06ahungryty!#2022-03-1701:07ahungryOh, odd - I have "cider-version" - 1.3.0 (Ukraine) - however this function doesn't seem to exist for me - I wonder if there's a cider thing I need that isn't loaded or if it comes from another package?#2022-03-1701:09eggsyntaxHmm, I’m back on 1.2.#2022-03-1701:09ahungryI see here it's present in a spacemacs specific thing - I grepped cider github on master and don't see the fn#2022-03-1701:09ahungryhttps://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/clojure/funcs.el#2022-03-1701:09ahungryi'll peek at cider repo history, maybe it was there and removed, or its a spacemacs extra#2022-03-1701:10eggsyntaxAh, ok. Yeah, for me it’s defined in the clojure spacemacs layer. My bad, thought it was a CIDER built-in.#2022-03-1701:10ahungryis the spacemacs clojure layer available as a standalone package? (is it clojure-mode? Mine may be outdated...)#2022-03-1701:11eggsyntaxIt may be clojure-mode packaged with a few other things.#2022-03-1701:12eggsyntaxLooks like you’d probably just use cider-load-buffer to evaluate the full namespace?
https://docs.cider.mx/cider/usage/code_evaluation.html#2022-03-1701:13ahungryinterestingly enough, that doesn't swap active ns in the repl#2022-03-1701:13eggsyntaxOr one of these two?#2022-03-1701:14eggsyntax🤷 I’m so used to the spacemacs overlay that I’m less familiar with the core CIDER commands, I guess.#2022-03-1701:14ahungryit refreshes the stuff in said ns, but to actually call those things, I still need to prefix with the ns or do the (in-ns) manually - although it shouldn't be hard to extract this from the spacemacs stuff or just write a small custom function I guess 😄 - ty for the link, I'll give those two a peek#2022-03-1701:15eggsyntaxSurely there’s already a way to switch ns in the REPL.#2022-03-1701:17ahungrywell, yes, I can type (in-ns 'whatever) 😄#2022-03-1701:17ahungryok, this is in cider and all the spacemacs layer does:
(cider-insert-ns-form-in-repl t)
#2022-03-1701:17eggsyntaxI mean a standard CIDER command.#2022-03-1701:17ahungryits just not interactive so not in the M-x completions#2022-03-1701:18eggsyntaxBased on the screenshot above, it certainly seems like adding a prefix argument to cider-load-buffer-and-switch-to-repl-buffer should do it (“Use a prefix argument to change the namespace of the REPL buffer to match the currently visited source file.“)#2022-03-1701:22ahungryOh yup, that's right - I was missing it as it didn't have a default keybind - without prefix arg, it inserts the form but doesn't hit enter, with it, it does, thank you all for the assist#2022-03-1703:36ahungryHi all - how does jack-in choose dependencies? It's pulling in com.cemeric//cdn-cgi/l/email-protection which errors out on a NoSuchMethodError for some of the goog stuff in shadow-cljs when I'm using openjdk v11 (works fine on v17) - grepping, I can't find any reference to 'pomegranate' in cider repo or in my shadow-cljs (lein new re-frame reframe-stuff +cider) project. I've "fixed" it by manually setting cider-jack-in-dependencies to it's current value, but 0.4.0 swapped to 0.3.0#2022-03-1703:49vemvwhat exact cider version are you using?#2022-03-1704:01ahungryCIDER 1.3.0 (Ukraine)#2022-03-1705:00vemvThanks!
Nothing comes to mind.
cider.el generates a command such as lein update-in ... repl keeping into account your cider-jack-in-dependencies etc.
What if you take that command and replace repl with deps :tree and run it in the terminal? The answer might be found there#2022-03-1703:37ahungrybut I'm curious where the dependency originates from - maybe some old file I have like a leinrc or something out of dir#2022-03-1709:51zendevil.ethMy cider eval is broken. It was working fine just now but now when I do cider-connect and enter the host and port, and then try to eval an expression or a buffer, it just hangs on showing loading in the minibuffer. How to fix this?#2022-03-1710:20vemvI don't think much has changed in this area, I'd recommend going through https://docs.cider.mx/cider/troubleshooting.html and ultimately creating a GH issue#2022-03-1710:24practicalli-johnAssuming Cider hasn't been updated since it was last working, the most likely cause is some long running Clojure code.
Suggest stop/start the REPL process and evaluate a very simple expression, e.g. (+ 1 2)
Also try evaluate in the terminal UI for the repl, helps to identify if it's a Cider or Clojure project specific issue#2022-03-1710:28vemvYes excellent hints, you might as well want to verify whether this also happens in a minimal, fresh project#2022-03-1919:14Chicãohello, i'm trying to import some java lib at clojure code and i'm using emacs, someone knows how could I see javadoc or parameters from those function at java code that I'm importing into my clojure code. I already tried with clojure-lsp but they don't have support yet to this. Does anyone know if cider do this?#2022-03-1921:00magnarsYes, CIDER will give you autocompletion and parameter signatures for java code.#2022-03-1923:21Chicãocould I go to definition inside java lib import it on clojure code?#2022-03-1923:21ChicãoI'm working with jgit java and would like to go to some definition inside java lib, like intellij do. Is this possible with emacs doom?#2022-03-1923:49vemvyes, 100%, javadocs and sources. You'd have to enable this option https://github.com/clojure-emacs/cider/blob/1e27eba570d265bc27317dc2a8f8c98d8b5414e0/cider.el#L428-L436
It only works for Lein projects. It's disabled by default because in big projects, occasionally it can create issues.
Both things will be fixed in the next major CIDER release#2022-03-1923:49vemvbtw related to doom https://github.com/hlissner/doom-emacs/pull/6183#2022-03-2009:27practicalli-johnFor Java open source projects, I download the source code for the project and add the Java source code to the classpath.
(I think this is what the enrich paths function does in the background)
I use Clojure CLI and add the Java source code via an alias, adding an :extra-paths that points to the Java source directory or zip archive#2022-03-2015:02Chicãonice, i will try it.#2022-03-2015:36Chicão@U05254DQM this is my deps.edn, i'm trying go to jgit definitions, but jump to definition did not work. Even doc about the function/classes. I put extra-paths with the jgit source code.
{:paths ["src"]
:mvn/repos {"jgit-repository" {:url ""}}
:deps {org.clojure/clojure {:mvn/version "1.10.2"}
org.clojure/data.json {:mvn/version "1.1.0"}
org.clojure/tools.logging {:mvn/version "1.2.4"}
clj-jgit/clj-jgit {:mvn/version "1.0.2"
:exclusions [org.eclipse.jgit/org.eclipse.jgit.gpg.bc]}
clucie/clucie {:mvn/version "0.4.2"}
environ/environ {:mvn/version "1.2.0"}
middlesphere/clj-compress {:mvn/version "0.1.0"}
talltale/talltale {:mvn/version "0.4.3"}
org.eclipse.jgit/org.eclipse.jgit {:mvn/version "6.0.0.202111291000-r"}}
:aliases {:run {:ns-default chrondb.core
:exec-fn chrondb.core/-main}
:extra-paths ["/Users/matheusfrancisco/m/dev/jgit"]
:test {:extra-paths ["test"]
:extra-deps {clj-kondo/clj-kondo {:mvn/version "2022.02.09"}
com.cognitect/test-runner
{:git/url ""
:sha "76568540e7f40268ad2b646110f237a60295fa3c"}}
:main-opts ["-m" "cognitect.test-runner" "-d" "test"]}
:depstar {:extra-deps {seancorfield/depstar {:mvn/version "2.0.171"}}}
:uberjar {:replace-deps {seancorfield/depstar {:mvn/version "2.0.171"}}
:name "chrondb-standalone.jar"
:exec-fn hf.depstar/uberjar
:exec-args {:aot true
:jar "chrondb.jar"
:main-class "chrondb.core"
:sync-pom true}}}} #2022-03-2015:44Chicãowith project.clj adding the jgit to dependencies it work, but needs to type (.org.eclipse.jgit.lib.Repository) the whole path to goto definition work.#2022-03-2015:45Chicãowith deps.edn I couldn't be able yet to config this on emacs#2022-03-2018:10practicalli-john@UL618PRQ9
To include the Java standard library sources, I create an alias as follows (with the zip of the sources manually downloaded to the path specified)
:src/java17
{:extra-deps
{openjdk/java-sources {:local/root "/usr/lib/jvm/openjdk-17/lib/src.zip"}}}#2022-03-2018:12practicalli-johnI believe you should just need to move the jgit :extrapaths into the :run alias scope in the deps.edn file above
:aliases
{
:run {:extra-paths ["/Users/matheusfrancisco/m/dev/jgit"]
:ns-default chrondb.core
:exec-fn chrondb.core/-main}
,,,
} #2022-03-2018:16practicalli-johnOr probably they need to be a :local/root to work (I havent tried just using the path), so that would then be
:aliases
{
:run {:extra-deps {jgit/src {:local/root "/Users/matheusfrancisco/m/dev/jgit"}}
:ns-default chrondb.core
:exec-fn chrondb.core/-main}
,,,
} #2022-03-2018:27practicalli-johnThe jgit sources can be cloned from the Eclipse foundation Git service https://git.eclipse.org/c/jgit/jgit.git/
I assume the sources are not distributed in the jar files obtained from the Eclipse Maven repository, so should be downloaded separately.
git clone /Users/matheusfrancisco/m/dev/jgit
#2022-03-2018:57practicalli-johnI made an example project here: https://github.com/practicalli-john/jgit-hack
There are several sub projects under the cloned repository above (I dont know if they are all needed). If other sub-projects are needed, then add an :extra-deps for each sub-project.
In the jgit-hack project it only includes org.eclipse.jgit, so that is probably the only functions that will auto-complete and for which cider-find-var command will work. cider-find-var need a running repl process and at least one namespace from the clojure project to be evaluated (standard Cider function behaviour)#2022-03-2019:17Chicãoi tried with your repo, thanks a lot , it worked very well with deps.edn#2022-03-2015:12Dustin PaluchWhy might I be getting
Debugger entered--Lisp error: (wrong-type-argument wholenump -9)
make-list(-9 nil)
lisp-indent-initial-state()
indent-sexp()
paredit-open-curly(nil)
funcall-interactively(paredit-open-curly nil)
call-interactively(paredit-open-curly nil nil)
command-execute(paredit-open-curly)
when typing { in my cider repl?#2022-03-2110:43dergutemoritzWhat's the recommended way to set up an initial namespace for a clojure-cli repl? https://docs.cider.mx/cider/repl/configuration.html#customizing-the-initial-repl-namespace only mentions Leiningen's builtin setting. The only option that probably could be made to work that I could find so far is customizing cider-repl-init-code via an eval form in .dir-locals.el since one needs to add to the default rather than replace it. Is there a cleaner alternative?#2022-03-2114:07practicalli-johnI recommend using the user namespace to set the namespace, or require/start other development tools
I create a dev/user.clj file and add the dev path via an alias, e.g. :env/dev
In the user.clj file, require the namespace and then use (in-ns 'namespace.name) to switch to the namespace
This works fine for a terminal UI to the REPL, but I don't remember testing it with the Cider repl buffer (I use the source code buffers to evaluate, so setting the namespace is redundant, as Cider manages that for me)
Here are some examples of how I use the dev/user.clj file
https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html#2022-03-2114:47dergutemoritzThanks! I should mention that this is in the context of a monorepo with a common user.clj for all subprojects but each subproject has its own dev helpers namespace (e.g. with some convenience functions for a "reloaded" workflow) which is probably a bit of a special situation. I solved this now by passing in a jvm property via an alias which determines the dev namespace to load when said common user namespace is loaded. However, invoking in-ns this way doesn't affect CIDER's current REPL namespace. But that's alright. Just wanted to be sure that I'm not missing anything obvious!#2022-03-2120:12practicalli-johnYes, I could change the namespace but couldnt get the REPL to stick with changed namespace, its always reverting back to user at some point before the REPL prompt displays.#2022-03-2215:10ahungryThanks for this conversation, helped me get a deps.edn setup going#2022-03-2216:34practicalli-johnYes, it was interesting to revisit this issue. I do have a way to set it the namespace for a terminal repl (Rebel Readline), but its a bit of a hack.
I made some notes in this issue in case I have time for more investigation https://github.com/practicalli/clojure/issues/409#2022-03-2113:47dpsuttonThat's really not a cider property there. I think it's common to make a user.clj file with a function that requires and then in-ns whichever namespace you need#2022-03-2114:07practicalli-johnI recommend using the user namespace to set the namespace, or require/start other development tools
I create a dev/user.clj file and add the dev path via an alias, e.g. :env/dev
In the user.clj file, require the namespace and then use (in-ns 'namespace.name) to switch to the namespace
This works fine for a terminal UI to the REPL, but I don't remember testing it with the Cider repl buffer (I use the source code buffers to evaluate, so setting the namespace is redundant, as Cider manages that for me)
Here are some examples of how I use the dev/user.clj file
https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html#2022-03-2305:32AkizHi, i am trying to find some resource about running clj and cljs repl in case of monorepo.
My workflow:
1) jack-in-clj
2) running shadow-cljs watch
3) connect-in-cljs
Cljs repl opens but is is not used by cider when i want to eval something in any cljs file. I would like to have same repl functionality for CLJ and CLJS.
Thanks for help#2022-03-2308:11vemv@zikajk I think you're hitting https://github.com/clojure-emacs/cider/issues/3097#issuecomment-988750187 which really should be fixed, the issue has been lingering for too long#2022-03-2308:14AkizAhh, is there some workaround? I relly on hot reload right now but it is limited if you need to eval just some cljs sexp etc. #2022-03-2308:15vemvPerhaps there's a buffer for the cljs repl and you can enter things there (semi-) by hand?#2022-03-2308:18Akiz@U45T93RA6 yeah, this is fine sometimes. But it gets complicated in large codebase. Thanks for the tip.#2022-03-2308:29vemvIf you get to hack on sesman / CIDER for obtaining the following behavior:
> if the file is .cljs and there's exactly one cljs connection, use that one no matter what
I think that PR would be extremely welcome#2022-03-2308:36AkizIt would 😔 #2022-03-2316:23neuralHey @zikajk don't know if it is this that you mean, but i have my workflow like this:
I have a monorepo with backend and frontend ns, then
1. jack-in-cljs: it starts a shadow-cljs watch
2. cider-connect-sibling-clj
It's gonna open two repl buffers, one for cljs and one for clj. Then if you have like a cljc file that both ns use it will work on both repl.#2022-03-2316:34Akiz@UCE6QCEQP nice tip. I will try that soon. I am running shadow-cljs/watch from clj namespace now.#2022-03-2409:49Akiz@UCE6QCEQP Hey, that works great both ways. I can do cider-connect-sibling-cljs, no problems so far 👍#2022-03-2415:09neural@zikajk Great!! I jack-in-cljs first to let cider handle the shadow stuff... i rarely handle with shadow ns (:target :browser most)#2022-03-2411:00edipofederleHi, There is a way to keep the REPL buffer always opened? something similar on how Cursive works . Thanks for help.#2022-03-2411:42magnarsYou can make Emacs do many cool things, but I'm not entirely sure how you can sticky a buffer. Instead, how about some useful features that might alleviate your problem? If you want to quickly show the REPL-buffer, you can type C-c C-z . To evaluate code in the current buffer, type C-x C-e . To show the result in a separate window, type C-c C-p .#2022-03-2411:47edipofederleYep, the C-c C-z is useful here.#2022-03-2411:58magnarsGood to hear. In that case, another tip is to use C-c C-z while in the repl-buffer to go back to where you were in the other buffer.#2022-03-2414:19César OleaYou can also open a new Emacs window (called frames in Emacs) with C-x 5 2 and have it display the REPL at all times. If the REPL has focus when C-x 5 2 the new frame will have the REPL buffer on top by default.#2022-03-2415:12edipofederleGood option too, thx César!#2022-03-2610:36tvaughanhttps://github.com/carrete/.emacs.d/blob/master/setup-packages/setup-10editor.el#L54#2022-04-1716:52camdezIf you just want to keep Emacs from taking over that window for a different purpose you can just run M-: (set-dedicated-window-p nil t) RET#2022-04-1716:53camdezIn case your bindings are non-standard:
M-: runs the command eval-expression (found in global-map), which is
an interactive compiled Lisp function in 'simple.el'.
It is bound to M-:, M-ESC :.
#2022-03-2510:18rafalwHi, not sure if cider or emacs related
when I'm pressing C-c C-z current buffer if toggling between clj file and repl buffer (in the same window) even when have repl in another window visible, this wasn't the case few versions before, then cursor moved between current source file and repl window, how to make it work like before?#2022-03-2807:39bozhidarPretty sure we haven't changed this behavior in years.#2022-03-2807:41bozhidarAs for the relevant configuration - it's https://docs.cider.mx/cider/repl/configuration.html#behavior-on-switch#2022-03-2717:03Benjamindo you know slime-words-of-encouragement ? I think this is a nice feature#2022-03-2807:38bozhidar@benjamin.schwerdtner It's been in CIDER since the earliest versions. 🙂#2022-03-2808:37Benjamincider-connection-message-fn is not used on 1.3 I think. Maybe it should be the default value for cider-connected-hook#2022-03-2808:42Benjaminhttps://github.com/clojure-emacs/cider/issues/3172#2022-03-2807:38bozhidarYou get one of those on connect, just like you do with SLIME.#2022-03-2816:56bendlasIs anybody up for getting the CIDER debugger ported to CLJS? https://github.com/clojure-emacs/cider/issues/1416#issuecomment-1080893680#2022-03-2816:59vemvSeems unlikely that someone will spontaneously volunteer - even more basic things like getting a cljs repl flawlessly for various use cases still need some love
But any PR in this direction will certainly be reviewed and we'll help with whatever is at hand for getting it in :)#2022-03-3112:27Ben SlessWould it be a good idea to add a variable like cider-clojure-cli-aliases which has a different scope?
My use case: I wish to define global development convenience aliases I'll start with by default, and dir-local aliases for specific projects
So that would translate to something like cider-clojure-cli-aliases and cider-clojure-global-cli-aliases#2022-04-0413:04winsomeI just got bit by this last night - started a new project, hacked away for a while, added a dependency, restarted the repl and boom! - the dependency wasn't on the classpath! I spent a good 20 minutes scratching my head before realizing I didn't have a dir-locals file that added the :dev alias to my repl command : /
This happens to me about every 3 months or so.#2022-03-3120:43Joshua SuskaloHey, so is it a known issue that the cider debugger compiles symbols in function call position as from clojure.core even when that symbol is shadowed by a local binding?#2022-04-0117:55nonrecursiveI’m running into an OOM error and it appears to be cider / nrepl related - has anyone else run into something like this?
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$future_call$reify__8439.deref(core.clj:6974)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$pmap$step__8452$fn__8456.invoke(core.clj:7025)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:688)
at clojure.core$first__5369.invokeStatic(core.clj:55)
at clojure.core$first__5369.invoke(core.clj:55)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invokeStatic(stacktrace.clj:198)
at cider.nrepl.middleware.stacktrace$flag_duplicates.invoke(stacktrace.clj:194)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invokeStatic(stacktrace.clj:219)
at cider.nrepl.middleware.stacktrace$analyze_stacktrace.invoke(stacktrace.clj:213)
at cider.nrepl.middleware.stacktrace$analyze_cause.invokeStatic(stacktrace.clj:323)
at cider.nrepl.middleware.stacktrace$analyze_cause.invoke(stacktrace.clj:314)
at cider.nrepl.middleware.stacktrace$analyze_causes$fn__27639.invoke(stacktrace.clj:348)
at clojure.core$map$fn__5847$fn__5848.invoke(core.clj:2742)
at clojure.core$take_while$fn__5898$fn__5899.invoke(core.clj:2901)
at clojure.lang.Iterate.reduce(Iterate.java:81)
at clojure.core$transduce.invokeStatic(core.clj:6883)
at clojure.core$into.invokeStatic(core.clj:6899)
at clojure.core$into.invoke(core.clj:6887)
at cider.nrepl.middleware.stacktrace$analyze_causes.invokeStatic(stacktrace.clj:347)
at cider.nrepl.middleware.stacktrace$analyze_causes.invoke(stacktrace.clj:339)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invokeStatic(stacktrace.clj:356)
at cider.nrepl.middleware.stacktrace$handle_stacktrace.invoke(stacktrace.clj:353)
at clojure.lang.Var.invoke(Var.java:388)
at cider.nrepl$wrap_stacktrace$fn__25802.invoke(nrepl.clj:432)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at nrepl.middleware.load_file$wrap_load_file$fn__25068.invoke(load_file.clj:81)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at cider.nrepl$wrap_content_type$fn__25662.invoke(nrepl.clj:107)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__24461.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at cider.nrepl$wrap_tracker$fn__25826.invoke(nrepl.clj:482)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at cider.nrepl$wrap_test$fn__25810.invoke(nrepl.clj:442)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__24428.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at cider.nrepl$wrap_slurp$fn__25670.invoke(nrepl.clj:121)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__24630.invoke(session.clj:325)
at nrepl.middleware$wrap_conj_descriptor$fn__24193.invoke(middleware.clj:16)
at nrepl.server$default_handler$fn__25197.invoke(server.clj:141)
at clojure.lang.Var.invoke(Var.java:384)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:24)
at nrepl.server$handle_STAR_.invoke(server.clj:21)
at nrepl.server$handle$fn__25165.invoke(server.clj:41)
at clojure.core$binding_conveyor_fn$fn__5739.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576,
#2022-04-0117:57nonrecursivefor context i’m working in a process with "-Xmx256m Xms256m"#2022-04-0117:57dpsuttoninteresting. its in stack trace annotation to flag duplicate frames cider.nrepl.middleware.stacktrace$flag_duplicates.invoke(stacktrace.clj:194)#2022-04-0118:00nonrecursiveyeah I’m having a hard time seeing how that would result in this error#2022-04-0118:00nonrecursiveI’m using cider-nrepl 0.28.3#2022-04-0118:07dpsuttonone thing stands out to me is the
(defn flag-duplicates
"Where a parent and child frame represent substantially the same source
location, flag the parent as a duplicate."
[frames]
(into [(first frames)]
(map (fn [[frame child]]
(if (or (= (:name frame) (:name child))
(and (= (:file frame) (:file child))
(= (:line frame) (:line child))))
(flag-frame frame :dup)
frame)))
(mapv vector (rest frames) frames)))
mapv could use a lazy sequence to reduce some pressure. I don’t really understand why the stacktrace ends up in pmap though#2022-04-0118:09dpsuttonyou could redefine flag-duplicates in your repl and try that out. You could also redef it to just be identity on the frames.#2022-04-0118:09dpsuttonOptimizing that function would be a nice contribution#2022-04-0118:11nonrecursivehmm maybe I could look into that. also, it looks like I’m not running into this issue with cider-nrepl 0.25.4#2022-04-0118:12nonrecursivegonna try redefing flag-duplicates now#2022-04-0118:14dpsuttonthere’s a change that switched the whole thing from a lazy computation into the eager version here for aid in stacktraces (which we are the beneficiary of here)#2022-04-0118:15dpsuttoni’d be interested if it was kept eager with into but the source collection was left lazy so there’s hopefully only one copy in memory at a time#2022-04-0118:15dpsuttonprevious version:
(defn flag-duplicates
"Where a parent and child frame represent substantially the same source
location, flag the parent as a duplicate."
[frames]
(cons (first frames)
(map (fn [frame child]
(if (or (= (:name frame) (:name child))
(and (= (:file frame) (:file child))
(= (:line frame) (:line child))))
(flag-frame frame :dup)
frame))
(rest frames)
frames)))#2022-04-0118:18vemv@nonrecursive do you have any JVM property set relative to GC settings?
I do recommend setting them - the defaults are unrealistically austere - even more so for Clojure apps, and even more so for dev tooling
here are mine https://github.com/reducecombine/.lein/blob/f01aec663ff4ac8f8e83f8eca93a13b2cf99aa4b/profiles.clj#L10-L43
I haven't faced a tooling OOM in a few years - before without these they were commonplace in arbitrary tooling and libraries for me#2022-04-0118:19dpsutton"-Xmx24G" "-Xms6G" are certainly generous#2022-04-0118:20vemvSet it and forget it®#2022-04-0407:03jumarThe problem is that Xmx24G is really unreasonable for most people.
I tend to run several clojure REPLs at the same time and I think it should perfectly valid to be able to run a decent app with Xmx1G (if not less)#2022-04-0409:20vemvXmx does not eagerly allocate the given amount of memory, it's just a maximum that isn't easily surpassed
also a modern gc like G2 relinquishes mem back to the OS as soon as one is done using it#2022-04-0409:24vemv> I think it should perfectly valid to be able to run a decent app with Xmx1G
that's just not the case unfortunately, absence of observed issues does not mean it's a sound idea
the list of tools and libs that can need greater mem is quite large. Maybe I'll avoid specifics, as it can be interpreted the wrong way
Basically anything that has an in-memory cache, or uses walk or other forms of recursion is subject to OOMs and avoidable stack overflows#2022-04-0409:26vemvMy take has long that been that the Clojure runtime and the habits of Clojure programmers are simply memory-hungry, that's ok, let's just not couple it with the 1G default which is there for historical reasons for a completely different lang/ecosystem :)#2022-04-0412:44jumarWell, yeah - we talked about this in the past and I'm with you 🙂
For production apps, I typically use between 2g and 4g without any issues.
G1 does indeed have this feature since JDK 12 but it doesn't mean that it will do it as promptly and of course the apps might consume whatever you will give them
Also overly generous memory reservation might hide an actual memory leak.
But anyway, I agree that 256m is definitely too low.
For a small project that doesn't require much memory on its own I would expect the whole IDE works with 1g well.
I would never expect more than 4g to be necessary (again, if the app itself doesn't require it).
The problem is if the issue magnifies - let's say you need 8g per app.
You run 4 apps and need 32 gigs?#2022-04-0414:07vemv> For production apps, I typically use between 2g and 4g without any issues.
(I'm specifically talking about dev tooling here)
> Also overly generous memory reservation might hide an actual memory leak.
Dev machines aren't meant for detecting memory leaks, if you do notice one that's good, but also good luck. A proper CI suite or sufficiently monitored production deployment would tell you the same
> I would never expect more than 4g to be necessary (again, if the app itself doesn't require it).
That's just an arbitrary number based on your preferences / the biases we all build up by using consumer-oriented computers. JVMs in the wild can run on terabytes of RAM.
The reality is - the bigger your codebase, the more stuff you'll be feeding to tooling, which means larger objects graphs representing a bunch of immutable data. It scales linearly, so for example a sufficiently old monorepo can require a few gigs just to work with <tool>
> You run 4 apps and need 32 gigs?
a MBP has 64, I don't see the big deal :)#2022-04-0414:08vemvmaybe I should collect these thoughts in a blog post, as you hint it's not the first time I bring them up#2022-04-0414:38jumarYeah, I think people will gonna disagree with your numbers 🙂
I also disagree with almost all the points to some extent.
But let's stop the discussion here and thank you for all the work - I really want to highlight all the great effort that went into Cider and other tools over the years.
I think it's easy to turn this into a series of complaints and that's not my point.#2022-04-0118:20nonrecursive"-Xmx256m Xms256m" is what I’m using and I’m hesitant to change these as I’m a kind of guest in this repo#2022-04-0118:21vemvyeah that's even worse than the JVM defaults
Good to decouple production from dev requirements, can be cleanly accomplished with good profile/alias management#2022-04-0118:23nonrecursiveI get that 🙂 for the time being I’m trying to reduce the scope of changes that might have unseen repercussions#2022-04-0118:24nonrecursiveafter restarting the process and using cider-nrepl 0.28.3 again I’m not running into this issue at the moment, so I don’t know if changing the version to 0.25.4 was actually meaningful or was just working by coincidence#2022-04-0118:25vemvFor completeness, Lein and tools.deps alike allow you to override a project with your own settings, i.e. no source changes needed
Other than that anything working under 256M or even 1G would be coincidence/unsupported#2022-04-0118:26dpsuttonperhaps. I’d be interested if my suggested changes could ease memory pressure with no adverse effects. Seems like a win/win#2022-04-0118:30vemvblame hints otherwise https://github.com/clojure-emacs/cider-nrepl/commit/1efce297a6e65443b5ec32522efd25b03355ff79#2022-04-0118:31dpsuttonyes that’s why i suggested retaining the into but making the source collection of stackframes lazy#2022-04-0118:31dpsutton(into [(first stackframes)] f (map vector (rest frames) frames))#2022-04-0118:32dpsutton> there’s a change that switched the whole thing from a lazy computation into the eager version here for aid in stacktraces (which we are the beneficiary of here)
> i’d be interested if it was kept eager with into but the source collection was left lazy so there’s hopefully only one copy in memory at a time#2022-04-0118:35nonrecursivethat’s a really good catch#2022-04-0118:36dpsuttonyeah just drop the v on mapv and see if it helps#2022-04-0121:00ericdalloIt's been a while this happens to me and other coworkers and I never debuged, posting here if anyone knows if this is a bug or a feature 😅
It's pretty common I run cider-test-run-ns-tests in a buffer and some tests fail, then I fix the tests running cider-test-run-test regularly, but even after tests fixed, when I cider-test-run-ns-tests again, it tells me the same tests are still failing, but it's not, it's like cider has some cache for that ns, anyone knows if this should be fixed on cider and if not, is there a setting to disable that ns test cache?#2022-04-0121:04ericdalloRecorded a gif showing that behavior#2022-04-0511:45jumarIt seems to me that you are running a different test with "ns-tests" than you are running with "run-test".
It seems that retrieve-jdk-source-and-analyze!-test is a name of the old test you changed: https://github.com/clojure-lsp/clojure-lsp/commit/80a71590bff23ce07220ce1521e490b703ab0684#diff-6ee62c9595df8191f8e61cb0cc0b2b9364115ad72b5ddfc6a6de61d815001cb2L21
I guess you haven't removed the test ns since then or you haven't restarted the REPL.#2022-04-0511:46jumarIt's a classic mistake 🙂#2022-04-0512:30ericdalloGot it, thanks, that makes sense but I'm not sure all the cases are like that, will keep an eye on it.
About this one specifically, I know cider has not control over what is on the mutable REPL state, but shouldn't check if the test is still on buffer/file? and not consider that old test? I'm trying to help "fix" this classic mistake as it seems pretty common#2022-04-0221:09CarloI read that setting (setq cider-use-overlays t) could prevent cider for showing the result in the minibuffer, but that doesn't seem the case for me. Any tip for not getting the result in the minibuffer/echo area at the bottom of the screen?#2022-04-0511:45BenjaminI think the elisp package 'macrostep' really gives legendary inline macroexpansion. cider-macroexpand-1-inplace on it's own is spartan, which is good but macrostep with it's overlays is totally smooth.
-> ok I found somebody made this work https://github.com/clojure-emacs/cider/issues/1850 this is basically what I wanted. Only thing missing at first glance is the colored gemsyms#2022-04-0516:31ennI just tried the macrostep-geiser package linked there, this is great! Thanks for sharing.#2022-04-0521:27mister_mis there a way to get cider to report to me that I have a source file using a function that is defined in the same namespace, but not actually in the code any longer?#2022-04-0521:28dpsuttonclj-kondo should handle that#2022-04-0614:58mister_mThanks, it appears I had this enabled via doom just not actually installed#2022-04-0617:51Carlowhat kind of object is:
(cider-nrepl-sync-request:eval "123")
in elisp?
If I do
(defun simple ()
(interactive)
(message (pp (type (cider-nrepl-sync-request:eval "123")))))
I get:
(dict "status"
("done")
"id" "3009" "ns" "couperin.core" "session" "541d57ee-8fe0-4bd5-8b98-8e4dc145edc9" "value" "123")
that seems a dictionary, is it only a list instead? How would I retrieve the "value"?#2022-04-0617:51dpsuttonits a an nrepl-dictionary#2022-04-0617:51Carlonrepl-dict-get is probably what I want then#2022-04-0617:51dpsuttoncheck out the file nrepl-dict.el#2022-04-0617:52Carlowhat would have been the way of knowing that that was an nrepl-dictionary ? Is there a type function of some sort?#2022-04-0617:52dpsuttonlook for uses of defmacro nrepl-dbind-response which is the normal way to “destructure” from it#2022-04-0617:52dpsuttonnot really#2022-04-0617:52dpsutton(defun nrepl-dict (&rest key-vals)
"Create nREPL dict from KEY-VALS."
(cons 'dict key-vals))
#2022-04-0617:53dpsuttonyou can see its just a cons of the symbol 'dict with the keys and vals#2022-04-0617:55paulspencerwilliamsMy minimal cider install hands Emacs displaying 'Can't find instrumented sexp, did you edit the source?' if I ever use here / h when debugging. I've replicated this on several work projects and just in a toy application. What am I doing wrong? Other debugging works fine. My entire Cider config is
(use-package cider
:ensure t
:config
(setq clojure-toplevel-inside-comment-form t)
(setq cider-save-file-on-load t)
(setq cider-repl-pop-to-buffer-on-connect nil))
I'm on Cider <tel:202204051216|20220405.1216>, Clojure CLI version 1.11.0.1100, and Java openjdk version "17.0.2" 2022-01-18.
However, as this happens on two machines, it doesn't seem config nor version dependent...#2022-04-0619:45jmckitrickWhere do I tweak JVM settings for CIDER?#2022-04-0619:47jmckitrickI’m suddenly getting OOM errors#2022-04-0619:47dpsuttonkinda depends. CIDER is gonna just launch your program with lein or the clojure cli. So you could put the settings there or behind an alias and just make sure to use that alias#2022-04-0619:47jmckitrickSorry, I should have clarified. I’m connecting to a process running via clj on the command line. But I believe CIDER spins up a separate JVM, correct?#2022-04-0619:48dpsuttonnope. all in process#2022-04-0619:48dpsuttonit uses your process#2022-04-0619:48jmckitrickHmm, ok. No one else is having this issue but me, so as the sole user of CIDER, I’m assuming that’s my problem.#2022-04-0619:48dpsuttoncider-jack-in will make sure to start the process with an nrepl server running with cider’s middleware#2022-04-0619:48dpsuttongive yourself more memory#2022-04-0619:49dpsuttonif the stacktraces have something actionable, raise an issue if that part of CIDER can use less memory#2022-04-0619:49jmckitrickok… I’ll throw memory at it as a last resort if I can’t narrow it down. But yes, I’ll try that first.#2022-04-0619:51dpsuttonwe had an OOM stacktrace recently that showed it was using too much memory in the stacktrace annotation bit. If you can recognize something like that it would be helpful#2022-04-0619:52dpsuttonsee the stacktrace here. And if it’s easy to scroll up to it you can see our proposed solutions.#2022-04-0619:55jmckitrickOh, I see. Someone else had the same issue recently. Ok, I’ll just bump up those numbers. I just hate to do it for the entire project and team when I’m the only one that needs it.#2022-04-0619:55dpsuttonput it an alias you control in your local deps#2022-04-0619:55jmckitrickIt’s only the dev alias, so…#2022-04-0619:55dpsuttonalso, try to redefine the function that OOM’d with my proposed fix and see if it solves it#2022-04-0619:55jmckitrickHmm, I could do that as well.#2022-04-0619:56jmckitrickSorry, I’m just being lazy, lol. I hate getting sidetracked while trying to solve a big issue#2022-04-0619:56dpsutton(clojure.repl/apropos "flag_duplicates") and find which namespace its in#2022-04-0619:56jmckitrickok, time to read about tools/deps aliases.#2022-04-0619:58jmckitrickLooks like I just need that simple file in my home directory.#2022-04-0619:59dpsuttonyeah. add :memory {:jvm-options ["-Xmx8g"]} to .clojure/deps.edn and then use the :memory alias when starting your process#2022-04-0619:59dpsutton(add that to the aliases map#2022-04-0620:03jmckitrickOh, this is sweet… clojure -M:dev:memory#2022-04-0620:04jmckitrickLet’s see if it does the trick…. anyway, I’m on the right track. Thanks for your help, @dpsutton!#2022-04-0620:05dpsuttonof course. happy hacking#2022-04-0700:18fadrianI'm getting a cider exception in Calva when I try to bring up a REPL in VSCode running under Windows. Needless to say, I'm trying to figure out what's going wrong and why. I'll add details (as they're a bit long) in the thread.#2022-04-0700:28fadrianMy project is held on my system in the folder c:\Users\fadrian\Projects\motive-cql-builder\mercator-server. It is a deps.edn project. This is the deps.edn file:
{:paths
["src" "resources\\jars\\apelon\\dtscore-4.6.1-838.jar"]
:deps
{org.clojure/clojure {:mvn/version "1.10.3"}
compojure/compojure {:mvn/version "1.6.2"}
http-kit/http-kit {:mvn/version "2.5.3"}
ring/ring-json {:mvn/version "0.5.1"}
ring-cors/ring-cors {:mvn/version "0.1.13"}
org.clojure/data.json {:mvn/version "2.4.0"}
mercator/mapper {:local/root "../mercator"}
mercator/expander {:local/root "../mercator"}
mercator/primitives {:local/root "../mercator"}
mercator/templates {:local/root "../mercator"}
cheshire/cheshire {:mvn/version "5.0.2"}}
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"]
:aliases {;; build an uberjar (application) with AOT compilation by default:
:dev {}
:uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}}
:exec-fn hf.depstar/uberjar
:exec-args {:aot true}}
;; build a jar (library):
:jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.303"}}
:exec-fn hf.depstar/jar
:exec-args {}}}}
Note the use of the .jar file in the :paths directive. This should add this file to the classpath. However, instead, it throws an error in cider:
java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""0.9.0""},cider/cider-nrepl {:mvn/version,""0.27.4""},cider/piggieback {:mvn/version,""0.5.3""}}}" -M:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware cider.piggieback/wrap-cljs-repl]"
nREPL server started on port 64632 on host 127.0.0.1 -
ERROR: Unhandled REPL handler exception processing message {:op eval, :code *ns*, :id 1}
Syntax error macroexpanding at (track_state.clj:156:8).
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3711)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3705)
at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457)
at clojure.lang.Compiler.eval(Compiler.java:7186)
at clojure.lang.Compiler.load(Compiler.java:7640)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6856.invoke(core.clj:6115)
at clojure.core$load.invokeStatic(core.clj:6114)
at clojure.core$load.doInvoke(core.clj:6098)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5897)
at clojure.core$load_one.invoke(core.clj:5892)
at clojure.core$load_lib$fn__6796.invoke(core.clj:5937)
at clojure.core$load_lib.invokeStatic(core.clj:5936)
at clojure.core$load_lib.doInvoke(core.clj:5917)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$load_libs.invokeStatic(core.clj:5974)
at clojure.core$load_libs.doInvoke(core.clj:5958)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$require.invokeStatic(core.clj:5996)
at clojure.core$require.doInvoke(core.clj:5996)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cider.nrepl$handler_future$fn__2307$fn__2308.invoke(nrepl.clj:53)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1977)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1977)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at cider.nrepl$handler_future$fn__2307.invoke(nrepl.clj:52)
at clojure.lang.Delay.deref(Delay.java:42)
at clojure.core$deref.invokeStatic(core.clj:2324)
at clojure.core$deref.invoke(core.clj:2310)
at cider.nrepl$wrap_tracker$fn__2512.invoke(nrepl.clj:480)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_out$fn__2448.invoke(nrepl.clj:332)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl.middleware.inspect$eval_reply.invokeStatic(inspect.clj:71)
at cider.nrepl.middleware.inspect$eval_reply.invoke(inspect.clj:69)
at cider.nrepl.middleware.inspect$handle_inspect.invokeStatic(inspect.clj:110)
at cider.nrepl.middleware.inspect$handle_inspect.invoke(inspect.clj:108)
at clojure.lang.Var.invoke(Var.java:388)
at cider.nrepl$wrap_inspect$fn__2424.invoke(nrepl.clj:225)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.caught$wrap_caught$fn__1211.invoke(caught.clj:97)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_test$fn__2496.invoke(nrepl.clj:440)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.print$wrap_print$fn__1178.invoke(print.clj:234)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at cider.nrepl$wrap_resource$fn__2472.invoke(nrepl.clj:404)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.middleware.session$session$fn__1381.invoke(session.clj:325)
at nrepl.middleware$wrap_conj_descriptor$fn__942.invoke(middleware.clj:16)
at nrepl.server$default_handler$fn__1949.invoke(server.clj:141)
at nrepl.server$handle_STAR_.invokeStatic(server.clj:24)
at nrepl.server$handle_STAR_.invoke(server.clj:21)
at nrepl.server$handle$fn__1917.invoke(server.clj:41)
at clojure.core$binding_conveyor_fn$fn__5772.invoke(core.clj:2034)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.nio.file.NoSuchFileException: c:\Users\fadrian\Projects\motive-cql-builder\mercator-server\resources\jars\apelon\dtscore-4.6.1-838.jar
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53)
at java.base/sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38)
at java.base/sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:199)
at java.base/java.nio.file.Files.readAttributes(Files.java:1851)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1264)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:347)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:318)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:284)
at cider.nrepl.middleware.track_state$fn__3870.invokeStatic(track_state.clj:155)
at cider.nrepl.middleware.track_state$fn__3870.invoke(track_state.clj:155)
at clojure.core$map$fn__5884.invoke(core.clj:2759)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5419.invokeStatic(core.clj:139)
at clojure.core$map$fn__5884.invoke(core.clj:2750)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5419.invokeStatic(core.clj:139)
at clojure.core$apply.invokeStatic(core.clj:662)
at clojure.core$mapcat.invokeStatic(core.clj:2787)
at clojure.core$mapcat.doInvoke(core.clj:2787)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3706)
... 68 more
It seems to be saying that it can't find the referenced .jar file. But the jarfile is there. Any ideas why Cider is throwing this error and how I can work around it?#2022-04-0700:30dpsuttoni've followed along in that other thread. I'd urge you to get this working without any tooling and then try to get tooling to work#2022-04-0701:26fadrianAfter adding a few more quotes around the version numbers, I was able to get theREPL to come up:
PS C:\Users\fadrian\Projects\motive-cql-builder\mercator-server> java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""""0.9.0""""},cider/cider-nrepl {:mvn/version,""""0.27.4""""},cider/piggieback {:mvn/version,""""0.5.3""""}}}" -M:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware cider.piggieback/wrap-cljs-repl]"
nREPL server started on port 65139 on host 127.0.0.1 -
So it looks like the nrepl starts, but dies when it tries to process the ns declaration in the mercator-server\core.cljs file:
(ns mercator-server.core
(:gen-class)
(:require [compojure.core :refer [defroutes GET POST]]
[mercator.expander :refer [ednize-json-keywords]]
[mercator.mapper :refer [translate json-template-sets]]
[org.httpkit.server :refer [run-server]]
[ring.middleware.cors :refer [wrap-cors]]
[ring.middleware.json :refer [wrap-json-body wrap-json-response]])
(:import [com.apelon.dts.client ServerConnectionEJB]
[java.util Base64]))
When I feed this declaration into the clj REPL, it gives the error:
Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445).
com.apelon.dts.client.ServerConnectionEJB.
The only change I've made to this declaration is the addition of the [com.apelon.dts.client ServerConnectionEJB] import. I've checked the .jar file referenced in the path attribute in the deps.edn file and there is a ServerConnectionEJB.class file in the folder /com/apelon/dts/client in the .jar file. That's the confusing part - everything seems to be in the right place, but the class still isn't being found.#2022-04-0709:53pezTo remove the quoting as a source of error, try use just the clj command. It should give you a prompt. Then load that file from that prompt and see what you get. #2022-04-0712:01fadrianI did that. The latest message says what I get when I do that.#2022-04-0712:02fadrianBasically, it says the class is not found, even though it's in the .jar file in the correct place.#2022-04-0712:22fadrianI've got the jarfile appearing in the classpath with a full direct path to the file (i.e., the classpath contains C:\Users\fadrian\Projects\motive-cql-builder\mercator-server\resources\jars\apelon\dtscore-4.6.1-838.jar). The .class file I'm importing is in the .jar file in the right place in the folder hierarchy. So I'm still wondering why the class is not found.#2022-04-0809:21fadrianI finally found the problem. I thought I had placed the resources folder under the mercator-server folder, but it was really under the mercator-server/src/mercator-server folder. I fixed that and the planets re-aligned. In any case, I learned a lot more about (a) figuring out clojure error messages and (b) deps.edn.#2022-04-0810:12pezAwesome. Thanks for the update!#2022-04-0712:01fadrianI did that. The latest message says what I get when I do that.#2022-04-0715:56Benjaminhow to prevent accidentally freezing emacs when printing out some huge (string) when calling cider-eval? I have a coworker that says it happened to him and I don't really have a good answer#2022-04-0716:02vemvThese should help https://github.com/clojure-emacs/cider/blob/db972bbdfbe777272529ec848c9f1991ae94dbda/cider-client.el#L309-L328#2022-04-0716:26César OleaI use (setq cider-repl-buffer-size-limit 100000) to limit the size of the repl buffer and avoid slowing Emacs to a crawl.#2022-04-0719:58macrobartfastI just posted a short novel in #clojure asking if anyone would be willing to actually look at my (non) workflow via screenshare… mentioning here as I’m an uncured Emacs/Cider addict.#2022-04-0719:58macrobartfastOpen to other suggestions for moving things along, too, of course.#2022-04-0721:01Ian FernandezHow cider via tramp, works?#2022-04-0721:01Ian Fernandezneed to tune more configs for it?#2022-04-0800:27macrobartfast@d.ian.b was that a response to my post? If so, yes… that’d be something I should learn about.#2022-04-1214:00Martynas MaciulevičiusHey. I found that there is a shortcut to evaluate an expression in cider.
SPC m e e evaluates an expresssion that is before the cursor. Is there a way to evaluate an expression that is one symbol further?
i.e. an expression that ends one symbol after the cursor? Otherwise it could work the same.
Example:
'(1 2 3 [4] 5)
The [] signifies where block cursor is located. It highlights whole character 4.
In this example SPC m e e would evaluate 3 but I want to evaluate 4.
And this is a more complicated example where I want to evaluate a longer function name:
(map [i]nc '(1 2 3)) => map
So the cursor is located on i letter but it would evaluate function map instead of inc. I would like to make it so that it would evaluate inc.
But if I go one symbol further SPC m e e evaluates inc:
(map i[n]c '(1 2 3)) => inc
I use block cursor all the time and evaluation of last expression doesn't make sense. Because then I end up with this behavior:
1 2 3 4 [5]$
Dollar sign means that it's end of the line and I can't move my cursor to this symbol. But evaluation via SPC m e e gives me 4.
While this cursor placement gives me the first item: 1 [2] 3 4 5$ => 1#2022-04-1214:05Martynas MaciulevičiusFound it. It was SPC m e v.#2022-04-1214:26Martynas MaciulevičiusHey. I found that CIDER has a handy binding to evaluate a full paren form.
But sometimes I want to also evaluate a vector or a map. Would it be possible to add these to the bindings?
For instance SPC m e [ and SPC m e { .
Also the VIM mode has a binding vaB that selects curly braces as in va{ and it also has vab that acts as if you'd press va(. It's more convenient because then you don't need to reach for the two-button shift+9 . And instead you can click one button b to select it. It's probably not a good idea because , e b already evaluates the whole buffer. But it's an idea to think about because , s b does something very similar.
Also I'm used to use C-p C-p a lot after I select whole form in VIM's visual mode. And it puts the result in a result buffer.
But as I found the functions , e ( and others they only show the result inline. This is completely fine but sometimes it's nice to view larger results. And this is where the result buffer comes in. But keystroke , e p ( doesn't exist.#2022-04-1214:34Martynas Maciulevičiusit could also work seamlessly with vim mode such that it would accept a region and then vim mode would take care about the selection and so on.#2022-04-1214:58Martynas MaciulevičiusYes, it's probably because I'm used to be using vim's keybinds to delete a paragraph and so on:
dap -> deletes whole paragraph (`d` is for deletion, a p => all paragraph; dip would keep the surrounding newlines).
I wanted something like this that could send a text selection directly into evaluation. Not sure if it's possible.#2022-04-1215:53Martynas MaciulevičiusFigured it out. I now have two keystrokes that allow to execute a text object from the EVIL mode.
,eda( or ,eDa( . The part a( is evil motion and selects a region of text. And it also works with already preselected text.#2022-04-1413:37Jim NewtonCan I keep cider from hijacking my C-u and C-p keys? as I’m typing I want C-f, C-u, C-p, and C-n to always move the cursor forward, up, back and down. However, sometimes it annoyingly popups completion menus which hijack normal cursor operation. If I’m not looking at the screen, or if I’m typing very fast the navigation keys start moving around in the popup rather than in the text. This is bad.#2022-04-1414:33BenjaminYou can check out the configuration for company . You could for instance get rid of it auto popping and bind company-manual-begin to a key#2022-04-1506:55Jim Newtonhow can I configure company?#2022-04-1506:56Jim NewtonI see the following in company.el
(defvar company-active-map
(let ((keymap (make-sparse-keymap)))
(define-key keymap "\e\e\e" 'company-abort)
(define-key keymap "\C-g" 'company-abort)
(define-key keymap (kbd "M-n") 'company--select-next-and-warn)
(define-key keymap (kbd "M-p") 'company--select-previous-and-warn)
(define-key keymap (kbd "C-n") 'company-select-next-or-abort)
(define-key keymap (kbd "C-p") 'company-select-previous-or-abort)
(define-key keymap (kbd "<down>") 'company-select-next-or-abort)
(define-key keymap (kbd "<up>") 'company-select-previous-or-abort)
(define-key keymap [remap scroll-up-command] 'company-next-page)
(define-key keymap [remap scroll-down-command] 'company-previous-page)
(define-key keymap [down-mouse-1] 'ignore)
(define-key keymap [down-mouse-3] 'ignore)
(define-key keymap [mouse-1] 'company-complete-mouse)
(define-key keymap [mouse-3] 'company-select-mouse)
(define-key keymap [up-mouse-1] 'ignore)
(define-key keymap [up-mouse-3] 'ignore)
(define-key keymap [return] 'company-complete-selection)
(define-key keymap (kbd "RET") 'company-complete-selection)
(define-key keymap [tab] 'company-complete-common)
(define-key keymap (kbd "TAB") 'company-complete-common)
(define-key keymap (kbd "<f1>") 'company-show-doc-buffer)
(define-key keymap (kbd "C-h") 'company-show-doc-buffer)
(define-key keymap "\C-w" 'company-show-location)
(define-key keymap "\C-s" 'company-search-candidates)
(define-key keymap "\C-\M-s" 'company-filter-candidates)
(company-keymap--bind-quick-access keymap)
keymap)
"Keymap that is enabled during an active completion.")
#2022-04-1506:56Jim Newtonit looks like C-n and C-p are explicitly hijacked.#2022-04-1506:58Jim NewtonI’m not really up on emacs scoping rules. Is there a way for me to remove something from this keymap after it has been loaded?#2022-04-1707:55Benjamin(define-key the-map (kbd "C-n") nil) yea like this#2022-04-1707:58Benjamincheck the other custom variables in company. There is a few like 'auto-delay' etc.#2022-04-1413:40Jim NewtonBTW what is cider trying to tell me with this popup anyway? it does not look like useful information. is it a cider bug?#2022-04-1413:42Jim NewtonI have to press ESC 3 times to make it go away.#2022-04-1413:44genmeblogQuestion about sayid.
> If you use CIDER's jack-in commands, then Sayid automatically adds the Maven dependency when starting a REPL. This means you don't need to manually add the dependency to your project.clj or deps.edn file.
Above is true for project.clj but not for deps.edn#2022-04-1413:45genmeblog[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.3"} com.clojure-goes-fast/clj-java-decompiler {:mvn/version "0.3.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,com.billpiel.sayid.nrepl-middleware/wrap-sayid,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:201).
Could not locate com/billpiel/sayid/nrepl_middleware__init.class, com/billpiel/sayid/nrepl_middleware.clj or com/billpiel/sayid/nrepl_middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.#2022-04-1413:46dpsuttongood catch. seems like its not injecting the actual dep, just the middleware it expects to be present#2022-04-1413:46genmeblogLooks like there is an issue for that: https://github.com/clojure-emacs/sayid/issues/68#2022-04-1905:09bozhidarYeah, that's the problem. Adding the dependency manually in your CIDER settings should fix this.#2022-04-1905:10bozhidarI'll fix this at some point, but I won't mind if someone beats me to it.#2022-04-1901:08nonrecursivethis is cider-adjacent, but i’m trying to get projectile-toggle-between-implementation-and-test to work with a deps.edn project. I get the message No matching test file found for project type 'clojure-cli' when trying to toggle to a test file that hasn’t been created. I have (setq projectile-create-missing-test-files t) in my config. Does anyone know how to fix this?#2022-04-1901:13nonrecursiveif I create the file then it toggles fine#2022-04-1901:53nonrecursivelooks like this is a known issue: https://github.com/bbatsov/projectile/issues/1765#2022-04-1905:15bozhidar@nonrecursive Yeah it was a recent regression that I had forgotten about. Clearly the past two months weren't very productive for me. The fix is merged now. Thanks for reminding me about it!#2022-04-1914:59David Pham@bozhidar Thanks a lot for everything you do, and also on Twitter, you are a great inspiration, especially with what is happening in the last two months at your borders 🙂#2022-04-1919:11wilkerluciohello, I'm just starting with Cider, most of things going great! one thing that I'm missing from Cursive is that in Cursive, when I ask to eval to top level form from inside a (comment ...) it understands I don't want the comment, but the form below it, is there a way to have to eval in Cider using this kind of constraint?#2022-04-1919:12wilkerlucioon Google I found something about cider-eval-toplevel-inside-comment-form (at https://github.com/clojure-emacs/cider/issues/2375), but I can't find this command#2022-04-1919:14dpsutton(setq clojure-toplevel-inside-comment-form t)#2022-04-1919:15dpsuttonshould do the trick for you#2022-04-1919:15dpsuttonalso, here’s a lovely function to make a comment block for you
(defun personal/insert-comment ()
(interactive)
(end-of-defun)
(insert "\n")
(insert "(comment\n )\n")
(clojure-backward-logical-sexp)
(forward-char 1)
(clojure-forward-logical-sexp)
(insert "\n")
(indent-according-to-mode))
#2022-04-1919:16wilkerlucioawesome! the setq did the trick 😄#2022-04-1919:17wilkerluciowhat that function does? I'm new on emacs but I think I used to use a snippet for something similar of what this function is doing#2022-04-1919:21dpsuttonso imagine you are working inside the body of a function. I hit C-M-i and that makes a new comment form under the function i was working in so i can start typing a comment block#2022-04-1919:36wilkerluciogonna try, thanks!#2022-04-2001:52didibusIs there a way to prevent Emacs from freezing because I accidentally ran something that is going to print a ton of stuff in the REPL?#2022-04-2002:26Drew VerleeYou can interrupt the execution.#2022-04-2002:27Drew VerleeBut i also run into that issue from time to time. I'm not sure if the other editors fair any better.#2022-04-2002:37didibusWell, that's the problem, it's too frozen to interupt, I wonder if cider could like count how many things it printed in some time-window, and if it's too many stop printing.
I'm guessing an editor with threads would fair better if the printing was concurrent, the UI thread wouldn't get blocked maybe.#2022-04-2002:39didibusI had started using cider-connect instead of jack-in, because at least I can quickly kill the repl that way at the command line, and sometimes that allows emacs to revover.#2022-04-2005:12Ben SlessYou can always kill the pid of the repl#2022-04-2006:00bozhidarYep, there's nothing magical about the process that cider-jack-in starts.#2022-04-2006:01bozhidarThat being said most print operations shouldn't block the REPL these days - ever since nREPL 0.6 printing has been done in chunks and normally you should be able to interrupt the process. But I guess there are still some edge-cases.#2022-04-2006:43bozhidarThere's a bit more on the topic here https://metaredux.com/posts/2019/03/29/nrepl-0-6.html#2022-04-2305:48didibusFor me I think it Emacs that's frozen, so even my commands to Emacs are backed up and I'd have to wait a long time until it even got to doing a C-c C-b#2022-04-2005:13Ben SlessHow does cider figure out the namespace to give new files? Sometimes it seems to get it right, while at others it isn't dine relative to the class path (like src/main/clojure)#2022-04-2005:22bozhidarThat's coming from clj-refactor.el, not from CIDER. I don't recall what the algorithm it uses to infer the namespace, though.#2022-04-2005:23bozhidarSee:
(defcustom cljr-add-ns-to-blank-clj-files t
"If t, automatically add a ns form to new .clj files."
:type 'boolean
:safe #'booleanp)
#2022-04-2005:24bozhidarSeems it's related to CIDER as it depends on cider-expected-ns:#2022-04-2005:24bozhidar(defun cljr--add-ns-if-blank-clj-file ()
(ignore-errors
(when (and cljr-add-ns-to-blank-clj-files
(cljr--clojure-ish-filename-p (buffer-file-name))
(= (point-min) (point-max)))
(insert (format "(ns %s)\n\n" (cider-expected-ns)))
(when (cljr--in-tests-p)
(cljr--add-test-declarations)))))#2022-04-2010:04CarloI'm trying to write some emacs configuration that spawns the right shadow-cljs repl (opening :app) without prompting me for questions; here's where I got:
(defun med/proper-repl ()
(interactive)
(let ((cider-preferred-build-tool 'shadow-cljs)
(cider-shadow-default-options ":app"))
(cider-jack-in-cljs '(:cljs-repl-type shadow))))
unfortunately, it seems that I can't set cider-shadow-default-options from the let block: it will always be seen as nil from the cider-shadow-cljs-init-form function (I enabled debugging to see that). However, if I set that option globally, then the function works as intended. What's happening?#2022-04-2013:15oxalorg (Mitesh)Is there a way to "repeat" an old evaluation in cider (maybe using cider's history?)? So for example I evaluated a form (some-test 1 2) at line 400 of a file. Then I'm editing some things at the top of the file and I evaluate somethings, now I want to evaluate (some-test 1 2) again but I don't want to go down to line 400 everytime. (Right now I use ciders history in the repl)
Can I keep evaluation or add a "watch" to this evaluation somehow? :thinking_face:#2022-04-2015:40CarloI would suggest to bind to a key an invocation of (cider-interactive-eval your_command)#2022-04-2015:41oxalorg (Mitesh)Thanks I think I can add something to the register and then eval directly from the register. Corgi does provide some functions to help with this#2022-04-2015:41oxalorg (Mitesh)Just wanted to check if there was an inbuilt better way 🙂#2022-04-2015:42CarloHere's an example:
(defun malli-check-all ()
(interactive)
(cider-interactive-eval "(-> (mi/check) portal.malli.visualizer/check->portal)"))
(map! :leader
(:prefix-map ("z" . "Generative testing")
"z" #'malli-check-this
"a" #'malli-check-all))#2022-04-2015:42Carlonot that I know of, but I'm curious to see if you find something else!#2022-04-2017:46CarloWhat hook could I use for the moment in which a shadow cljs repl is ready, in cider?#2022-04-2017:52CarloFor now, I'm using cider-repl-preoutput-hook to see where I am in the compilation process, but arriving here was a process full of impasses.#2022-04-2214:13Carlo@U051BLM8F maybe? ^#2022-04-2122:31genmeblogI want to inject custom middleware when using cider-jack-in, with clj is there a way to make it other than manually modify startup command?#2022-04-2122:34genmeblogWhen I do cider-jack-in, emacs produces:
/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.3"} com.clojure-goes-fast/clj-java-decompiler {:mvn/version "0.3.0"} com.billpiel/sayid {:mvn/version "0.1.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,com.billpiel.sayid.nrepl-middleware/wrap-sayid,cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl
How to add another middleware which is somewhere in deps (in :dev alias in deps.edn).#2022-04-2122:35genmeblogI tried via .nrepl.edn containing {:middleware [my.middleware/middleware]} seems not working#2022-04-2203:19vemvSee the cider-jack-in-nrepl-middlewares defcustom#2022-04-2207:29genmeblogthanks, I'll try to set it in .dir-locals.el (I need it in one project only)#2022-04-2207:29genmeblogIs there a way to list all registered middlewares?#2022-04-2207:57genmeblog~{:tag :span, :attrs {:class "username"}, :content ({:tag :a, :attrs {:href "/_/_/users/U45T93RA6"}, :content ("@U45T93RA6")})}~ 😕#2022-04-2208:09genmeblogsorry, had to call add-to-list and it works#2022-04-2208:09genmeblogthanks!#2022-04-2210:34bozhidarFun story - seems we broke CIDER's trademark inspirational connection messages 4 years ago (https://github.com/clojure-emacs/cider/commit/5cb98a74bad81a2cd15f8db86c469020ed030156) and no one noticed this until recently, including me. 😄#2022-04-2210:34bozhidarNow it's fixed on master, and I even added a super hand interactive command named cider-inspire-me. 😉#2022-04-2215:41Brandon OlivierIs there a way to get cider to indent Rum components in the same way that hiccup components are formatted? Or does everybody using Rum just accept the differences? Or not use auto formatting?#2022-04-2215:45magnarsYou are looking for define-clojure-indent#2022-04-2215:46Brandon OlivierIs that possible to generate dynamically?
I'd need to enumerate every Rum component, no?#2022-04-2215:48magnarsDynamically from what source?#2022-04-2215:52Brandon OlivierIt just feels weird to me reading Rum code and seeing the base-hiccup and higher level rum components indented differently.
Maybe I just need to get over it, but I'm used to reading just hiccup with Reagent and everything there is indented identically#2022-04-2215:54magnarsNo, I agree with you. I certainly prefer the hiccup indentation (and syntax, but that's a different matter).#2022-04-2215:54Brandon OlivierSeeing code formatted like this
(rum-component {:class ["foo"]}
[:div.flex.bg-base-100.gap-2.m-4.items-center
[:input.w-12.input.input-xs.input-primary]])
instead of
(rum-component {:class ["foo"]}
[:div.flex.bg-base-100.gap-2.m-4.items-center
[:input.w-12.input.input-xs.input-primary]])
seems weird.#2022-04-2215:55magnarsBut in lieu of enumerating the components, where would clojure-mode find the symbols to indent differently?#2022-04-2215:55magnarsYou could have emacs read the rum source code and populate it that way, perhaps?#2022-04-2215:55Brandon OlivierI'm not sure, I wanted to ask before digging in too deep with my limited expertise.#2022-04-2215:56Brandon OlivierWould it be possible to have Rum attach metadata to the functions to indent them differently?#2022-04-2215:56magnarsclojure-mode indentation is not dependent on a repl#2022-04-2216:03Brandon OlivierHmm. I guess I can just always put props on a newline. Then the indentation seems right to me.#2022-04-2217:01magnarsThat is certainly a pragmatic solution.#2022-04-2217:15lilactownthat's what we do with #helix components#2022-04-2217:16lilactownwe have a style preference for props going on a newline when a child is passed in#2022-04-2219:30lepistaneHello,
I am using emacs and i am using deps.end for a project.
This is my dev alias
{:extra-paths ["dev"]}
when i cider-jack-in i need to re-eval user namespace in order to run mount/start and to get project going.
When i do clj -A:dev in that terminal repl i can (mount/start) right away.
Why is this?
How can i make cider-jack-in behave how i expect it to behave?
This is the command cider-jack-in is using at the moment
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.1"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
i don't want to have to edit it every time i run the project#2022-04-2219:32DerekCIDER has a variable cider-clojure-cli-aliases. I often see this set in a .dir-locals.el file#2022-04-2219:32Derekhttps://docs.cider.mx/cider/basics/up_and_running.html#clojure-cli-options#2022-04-2219:45lepistaneWhere do you put .dir-locals.el?
In project folder?#2022-04-2219:46DerekYeah. Project root makes a lot of sense#2022-04-2222:17practicalli-johnSome example of using .dir-locals.el
https://practical.li/spacemacs/clojure-projects/project-configuration.html
Emacs will need to be forced to load .dir-locals.el if that file is added after a Clojure/Edn file is opened, using revert-buffer command (or reopen the Clojure/Edn file) before running the REPL command from that buffer
Alternatively, usie the universal argument, C-u before calling cider-jack-in to get an editable command in the mini buffer#2022-04-2305:51didibusI think Cider now also defaults the dev alias, so if you setup a :dev alias in your deps.edn, you can specify dev specific extras and jack-in should have them#2022-04-2310:46practicalli-johnI hope there is a Cider variable to disable the automatic loading of the dev alias
I prefer to be explicit in the aliases I want loaded when running the REPL and may not want :dev always loaded, especially if I have broken something in dev/user.clj as that could stop the repl process starting.#2022-04-2321:26didibusOh, nevermind, I was wrong haha, forgot that I had added this to my config: (setq cider-clojure-cli-aliases ":dev")#2022-04-2409:16practicalli-johnThanks for letting me know#2022-04-2220:34Ian Fernandezwhy cider is sending :cider.enrich-classpath/found ,,,,, and :cider.enrich-classpath/omitting-empty-source and :cider.enrich-classpath/timed-out to nrepl buffer lots of these and taking too long to start? 😞#2022-04-2313:53vemvenrich-classpath is disabled by default these days, make sure you're using CIDER latest stable#2022-04-2322:28mister_mis there a quick way to evaluate each form within a rich comment block in-order?#2022-04-2400:04dorabYou could mark the region you want and then cider-eval-region.#2022-04-2404:48jumarOr wrap them with do#2022-04-2404:50mister_moh yeah of course#2022-04-2404:50mister_mthanks#2022-04-2405:47mjmeintjesCurrently the inspect multimethod is behind cider.nrepl.inlined-deps.orchard.v0v9v2.orchard.inspect, and I am concerned that extending the inspect multimethod in that namespace would break if the orchard dependency version gets bumped. Is there another way to add custom types to the cider inspector?#2022-04-2407:22vemvYou can grep for the ns out of (all-ns)#2022-04-2419:16Carlo@bozhidar I would like to write the small PR that adds the possibility of not sending the result of the evaluation to the echo area, as maybe you have more practical means of seeing the results, like portal or a *cider-result* buffer always open.
I see that the code is here https://github.com/clojure-emacs/cider/blob/86dd3fee9d9836dcd56f6abb91ba59b7aeedecb9/cider-overlays.el#L286 and it would be easy to just change the condition for that invisible tag, but I'd like to ask about flag organization first:
It seems that the flag cider-use-overlay is in charge of also deciding if something goes or not in the echo area. Would it be easier to use two cider-use-overlay and cider-use-echo-area options, so that each of one does a simple t/nil customization of where the result should go?#2022-04-2505:47bozhidar@meditans I guess it depends on how many possible options can we have in the end. If there are 5-6 destinations I think those boolean flags are not going to scale well and some defcustom like cider-intereactive-eval-result-destination that's a list might be better (provided we want to combine those) or just has many possible options. In hindsight I think that showing the same results in multiple ways probably is not very useful to most people (as it happens today by default), so I'm open to reconsidering this.#2022-04-2610:32CarloRight! The list approach sounds like the most useful one to me. The remaining question I have on this functionality is: could we use this to also consider other outputs than emacs itself? Like, I have in my configuration:
(after! cider-mode
(defun cider-tap (&rest r)
(cons (concat "(let [__value " (caar r) "]"
" (tap> __value)
__value)")
(cdar r)))
(advice-add 'cider-nrepl-request:eval
:filter-args #'cider-tap))
What this does is tap> the result so that I can get it from portal, for example.#2022-04-2610:33CarloCould we put something like 'tap in the list of outputs to include this kind of functionality, or is it better left to another codepath?#2022-04-2610:34CarloAs far as destinations, I think we would have 'minibuffer, 'overlay, _BUFFER_ with the name of the buffer. Are there other possibilities?#2022-04-2610:35bozhidarI think it's fine for this to be part of the same codepath.#2022-04-2505:48bozhidarBack in the day my main concern with going in the direction of only inline results by default was that none other Emacs mode was doing something like this by default and there was a long history of following the minibuffer-first approach for displaying results.#2022-04-2505:49bozhidarBtw, in the past I did something similar for the output https://docs.cider.mx/cider/usage/code_evaluation.html#change-the-output-destination#2022-04-2523:40agCan anyone tell me if I have to tweak some elisp vars for testing in deps.edn project?
I don't remember having any troubles in lein projects, but in this one, cider-test-run-ns-tests, and similar commands don't show anything, it says "Running tests", but no results, no failures, nothing. I have cider-test-show-report-on-success t.#2022-04-2600:12vemvProbably your cider-clojure-cli-aliases has to activate a test alias#2022-04-2600:19agI have that, still nothing thinking-face#2022-04-2600:51agit looks like something to do with setting up cider-clojure-cli-global-options,
what's the difference between that and cider-clojure-cli-aliases?#2022-04-2600:56aghmm. looks like you're right Victor.
I had to fix discrepancy in deps.edn and set the var like this cider-clojure-cli-aliases ":dev:test"#2022-04-2602:42vemvcider let us know if the docs could be clearer somewhere#2022-04-2612:55practicalli-johnFYI cider-clojure-cli-aliases replaced the other variable when the format of the clojure cli command line changed to using the -M execution option and put the aliases at the end of the command. I dont think the older alias is still used.#2022-04-2613:48agare you saying cider-clojure-cli-global-options needs to be marked 'obsolete'?
it looks like messing with it (instead of setting cider-clojure-cli-aliases) can lead to bad combination of args where it won't jack-in#2022-04-2614:04practicalli-johnIn short, probably.
I do not know of a valid use case for using cider-clojure-cli-global-options unless you are using a pre 1.10.3-697 version of the Clojure CLI tool (and I think even then the newer Cider versions may complain)
I recommend only using cider-clojure-cli-aliases and maybe setting the preferred build tool (if there is both leningen and deps.edn configs in the project)
((clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . ":env/dev:env/test"))))
There are some other lesser used options here
https://practical.li/spacemacs/clojure-projects/project-configuration.html#2022-04-2614:09practicalli-johnI think cider-clojure-cli-global-options put the aliases at the start of the clojure command using the often confusing -A execution option, which is kind of irrelevant as Cider now uses the -M flag anyway.
The -A execution flag may try and run your :main-opts settings if they are in the aliases specified, which will block cider running.
With the -M flag version of the clojure command, you can add any Clojure CLI aliases you want and they are all chained together before the :cider/nrepl alias, so any main opts in your own aliases will be ingnored in preference for cider/nrepl (which should have the :main-opts middleware to wire up everything to make cider jack in work (although I should check the code to be sure)#2022-04-2614:10practicalli-johnIf in doubt, use cider connect 🙂#2022-04-2615:10pataprogrammingI'm having an annoying behavior with CIDER where, after evaluating a command, the prompt is vertically centered in the screen as if recenter-top-bottom had been executed. I'd very much like to have the prompt line remain at the bottom of the buffer, so I don't have to perpetually scroll up to see the complete last output. I've checked for obvious configuration variables, but didn't see anything that seemed germane. Any insights will be appreciated.#2022-04-2714:02soulflyerNot sure, but I think this is what fixed it for me:
(add-hook 'cider-repl-mode-hook #'(lambda () (setq scroll-conservatively 101)))
#2022-04-2719:59pataprogrammingNow that's something I wouldn't have figured out to try, for sure! Thanks for the suggestion, @U0E3H1J5Q, I'll give it a shot#2022-04-2703:24Drew Verlee[edit] solved
Any idea why i would get the error:
error in process filter: Figwheel-main is not available. Please check for details
When running cider-jack-in-cljs with this dir-locals.el file?
((nil . ((cider-clojure-cli-aliases . "-A:dev")
(cider-default-cljs-repl . figwheel-main)
(cider-preferred-build-tool . clojure-cli)
(cider-figwheel-main-default-options . "dev")
(cider-repl-display-help-banner . nil))))
My deps file:
{:paths ["src" "resources" "target"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.764"}
net.sekao/odoyle-rum {:mvn/version "0.11.0"}
haslett/haslett {:mvn/version "0.1.6"}}
:aliases {:build-dev {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:dev {com.bhauman/figwheel-main {:mvn/version "0.2.16"}
com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}}}}#2022-04-2703:30Drew Verleeit's because i didn't say :extra-deps#2022-04-2703:33Drew Verleei just magically wanted them to do something 😢#2022-04-2706:32practicalli-johnFYI: When specifying cider-clojure-cli-alias the -A execution flag is not required, only the name(s) of the alias(es). In this case ":dev"
Cider will strip any of the execution flags (-A -M -T -X) from that variable value.
Cider also used the -M flag now, so -A is not technically correct use either.#2022-04-2705:48didibusIs there a middleware for Portal? Like if I want results to go to Portal (and not have to tap>)#2022-04-2808:32genmeblogtake a look at https://scicloj.github.io/clay/ it works with Portal (Clerk and Scittle) this way. Evaluation a form in editor (I've tested it on Emacs) results in rendering a value.#2022-04-2817:04didibusCool, I'll give it a shot#2022-04-2922:26Patrick BrownIs there a function in cider I can use to programatically grab the namespace of the buffer I'm currently in. USAGE: I'd like to bind a hotkey to put the namespace in a register so I can easily insert the register into a require statement either immediately or when I get around to visiting another different namespae. Cheers.#2022-05-0906:52plexusThere's an implementation here https://github.com/corgi-emacs/walkclj/blob/master/walkclj.el#L144 which powers clj-ns-name https://github.com/corgi-emacs/clj-ns-name#2022-04-2922:37dpsutton(clojure-find-ns)#2022-05-0104:26peterdeeI just updated to emacs 27.1 on linux (PPA kellyk) and I'm getting an error Error in process filter: cyclic keymap inheritance when I try run tests through cider with cider-test-run-ns-tests. Does that sound familiar to anyone? I'm guessing some other package I've loaded is interfering. The cider version I'm running is cider-20220429.1351.#2022-05-0117:19peterdeeSome testing suggests that my hypothesis about other packages interfering is unlikely. More importantly, I only get the error when cider-test-run-ns-tests would return no errors. Add (is false) to any deftest and cider runs the tests and reports as one would expect.#2022-05-0205:32lassemaattaI just encountered the same problem. emacs 29.0.50 & cider 20220501.151 . Everything was working normally (including the test reporting) and then suddenly it failed to run the tests for a ns.#2022-05-0205:32lassemaattaerror in process filter: cider-test-render-report: Cyclic keymap inheritance
error in process filter: Cyclic keymap inheritance
#2022-05-0221:50peterdeeYes, I didn't mention that it worked for me a few times before it stopped working. It seems it always works if what you are testing reports an error.#2022-05-0618:24peterdeeIt is a problem with the recent melpa-stable 1.4 "Kiev" version too.#2022-05-0117:32pbailleHello ! I'm wondering if it is possible to modify the face of local bindings in clojure code. Any idea ?#2022-05-0206:59promesantehi guys, I'm trying to start a little project with shadow-clj / re-frame / emacs / cider with the re-frame template, https://github.com/day8/re-frame-template with lein. Opening the repl from within Emacs (C-c M-j) works ok, but when invoking any function, in different namespaces, I keep getting the same error reported:
Syntax error compiling at (*cider-repl flexiana/scrambler-fe:localhost:8777(clj)*:50:20).
Unable to resolve symbol: init in this context
and no Clojure / REPL related Emacs shortcut works, i.e. C-c C-k to compile and load current buffer, or C-c C-z to jump straight into REPL.#2022-05-0207:00promesante#2022-05-0207:01promesanteI tried the same with the front-end / SPA module of the following little Clojure fullstack project I've taking as reference: https://github.com/lagenorhynque/clj-rest-api-and-cljs-spa-example, SPA: https://github.com/lagenorhynque/clj-rest-api-and-cljs-spa-example/tree/master/todo-app, but in that other context, I keep getting exactly the same issues described above.#2022-05-0207:03promesanteFuthermore, as I start up the SPA from CLI as explained in its README:
$ npm install
$ npx shadow-cljs watch app
the SPA works well, but when started up by starting up the REPL from Emacs (C-c M-j), the SPA runs, but reporting the following warning:
shadow-cljs - Stale Output! Your loaded JS was not produced by the running shadow-clj instance. Is the watch for this build running?
#2022-05-0207:03promesantedoes anybody guess what might be the reason of these issues, or what I'm doing wrong? thanks !#2022-05-0208:21Volodymyr AnokhinIf my local lein is at /usr/bin/lein and remote server has it at /opt/asdf/shims/lein and I try to jack-in into remote project (opened via tramp) I get an error
You can run the command 'cider-jack-in-clj' with SPC m '
error in process sentinel: Could not start nREPL server: /bin/sh: 1: lein: not found
I guess I can omit this if I set up asdf version of lein on my local machine, but perhaps the channel has better ideas?#2022-05-0215:59Benjaminthe error says lein not found I'd check which lein. I would maybe ln -s /opt/asdf/shims/lein /usr/bin#2022-05-0216:43Volodymyr Anokhinthis worked a step further but now java is not found o_O
error in process sentinel: Could not start nREPL server: /opt/asdf/installs/leiningen/2.9.8/bin/lein: line 257: type: java: not found
Leiningen couldn't find 'java' executable, which is required.
Please either set JAVA_CMD or put java (>=1.6) in your $PATH (/opt/asdf/installs/leiningen/2.9.8/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin).
Will try similar approach with java#2022-05-0216:55Volodymyr AnokhinSetting $JAVA_CMD to asdf path worked -- so if someone (or future me) has problems with cider session remote jack-in using asdf-based setup, try to experiment a bit with lein and java binaries availability.#2022-05-0215:29borkdudeI want to connect to two different CIDER nREPLs within the same project. Is that supported?#2022-05-0215:29borkdudeUsually I want to connect to the other nREPL only for one or two specific files#2022-05-0215:31Hans ConradI know in spacemacs clojure layer it is supported ..but not sure if it's a cider thing or something else. Oddly enough I have a similar use case like you (running babashka repl..along side my project repl)#2022-05-0215:32borkdude@hans.conrad Yes, this is similar, but now it's a JVM REPL + a custom CLJS REPL#2022-05-0215:33Hans Conradneat... btw sorry looks like it is using this https://github.com/vspinu/sesman for multiple connections#2022-05-0215:33borkdudehmm, yes, I was trying that as well...#2022-05-0215:34Hans Conradwith sesman I can link a connection to a specific buffer#2022-05-0215:44Benjamin(sesman-link-with-buffer
(current-buffer)
(assoc "babashka"
(sesman-sessions 'CIDER)))
if you have a session called "babashka"#2022-05-0220:59bozhidarFYI - CIDER 1.4 ("Kyiv") is out! See https://github.com/clojure-emacs/cider/releases/tag/v1.4.0 for details.#2022-05-0308:35jumarI've just updated and trying cider-undef-all
It gives me this error:
#namespace[clojure-experiments.security.encryption]Syntax error compiling at (src/clojure_experiments/security/encryption.clj:48:4).
No such namespace: System
Here's the code: https://github.com/jumarko/clojure-experiments/blob/master/src/clojure_experiments/security/encryption.clj#L48
If I remove the ns and eval the buffer as usual (with the prefix) then it works again.
I'm using spacemacs if that matters.#2022-05-0308:40bozhidarProbably you've encountered some edge-case we didn't notice. Please, file an issue about this.#2022-05-0308:44codeasoneRelated: https://github.com/clojure-emacs/cider/issues/3194#2022-05-0314:21jumar@U191H9E5C @U051BLM8F that issue is I think what is happening to me.#2022-05-0308:35Volodymyr Anokhin~In doom I can set the debug instrumentation with ~ OK, it should be cider-eval-defun-at-point , not another cider-debug-defun-at-point, I really have to read the docs.#2022-05-0308:41bozhidarYeah, to remove the instrumentation you simply have to eval the definition in question normally with cider-eval-defun-at-point.#2022-05-0308:41bozhidarI'm not familiar with the Spacemacs keybindings.#2022-05-0314:26Volodymyr AnokhinThis is SPC m e d in Doom#2022-05-0309:44LycheeseIs there a way to use cider-jack-in-clj&cljs when using separate deps.edn and shadow-cljs.edn for managing dependencies? When running the jack-in command it seems to only use the dependencies in the specified command and not the other. I am currently working around this by jacking in in two separate sesman sessions but I would like to stop having to manually switch between the REPLs (e.g. when last having focused the clj repl and then switching to cljs file, I need to first focus the cljs repl before C-x C-e works).#2022-05-0414:22Scott MayI am learning using the Closure for the Brave book and I am on Chapter 2 trying to get jacked in. But I keep getting a wrong arguments error. Any help on this as I am brand new to Emacs?#2022-05-0414:51Nick McAvoyI have no specific idea, but am guessing there may a version mismatch between some combination of emacs, cider, nrepl, and clojure#2022-05-0416:08Scott MayIt seemed to not install from the init file included with the book, had to install from the Package installer list#2022-05-0512:28jmayaalvHi, with the latest version sometimes i am getting the following error when running tests:
edge.test.integration.multicurrency.surrender-test: Ran 2 assertions, in 1 test functions. 0 failures, 0 errors.
error in process filter: cider-test-report-mode: Cyclic keymap inheritance
error in process filter: Cyclic keymap inheritance
i haven’t been able to pinpoint the problem. Sometimes i kill the repl and jackin again and it works sometimes it doesn’t. has anybody seen this or any pointers to debug the problem ?#2022-05-0514:47kommenit is being discussed here https://github.com/clojure-emacs/cider/issues/3195#2022-05-0709:57bozhidarReinstalling or byte-compiling again should solve this issue from what I got. Let me know if that's not the case for someone.#2022-05-0907:20jmayaalvremoving the .elc didnt’ fixit, now after the merged pr it works fine. thanks a lot!#2022-05-0612:38MikeEhello - i just opened up a project that I haven't touched in a few months on my new iMac M1 which I just setup as a dev machine. I just realized all my logging statements no longer show logs in the cider repl anymore and I can't figure out what would be causing this issue. Has there been any changes to how logging works due to the log4j fiasco maybe? I have upgraded my dependencies to the latest versions of everything but I can't find any issues on any of the projects related to this. Here's my dependencies and logback XML
[org.clojure/clojure "1.11.1"]
[org.clojure/data.json "2.4.0"]
[com.github.seancorfield/next.jdbc "1.2.780"]
[org.postgresql/postgresql "42.3.4"]
[hikari-cp "2.14.0"]
[com.layerware/hugsql-core "0.5.3"]
[com.layerware/hugsql-adapter-next-jdbc "0.5.3"]
[migratus "1.3.6"]
[integrant "0.8.0"]
[environ "1.2.0"]
[clj-http "3.12.3"]
[ring/ring-core "1.9.5"]
[ring/ring-jetty-adapter "1.9.5"]
[ovotech/ring-jwt "2.3.0"]
[metosin/reitit "0.5.18"]
[metosin/muuntaja "0.6.8"]
[metosin/ring-http-response "0.9.3"]
[software.amazon.awssdk/s3 "2.17.183"]
[com.cognitect.aws/api "0.8.539"]
[com.cognitect.aws/endpoints "1.1.12.206"]
[com.cognitect.aws/sqs "822.2.1109.0"]
[com.cognitect.aws/s3 "822.2.1109.0"]
[org.clojure/tools.logging "1.2.4"]
[org.slf4j/slf4j-log4j12 "1.7.36"]
[integrant/repl "0.3.2"]
[ch.qos.logback/logback-classic "1.2.11"]]
#2022-05-0612:38MikeE<configuration debug="false">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %-10contextName %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.zaxxer.hikari">
<level value="error"/>
</logger>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>#2022-05-0618:47QuestAnyone have ideas on how to run the full Emacs cider-connect-clj&cljs sequence off a single keystroke?
My normal keypresses to connect to my initialized server is below.
C-c C-x C-c Enter (cider-connect-clj&cljs) ->
Enter (Host: localhost) ->
Enter (Port: 51834) ->
Enter (Select ClojureScript REPL Type: shadow) ->
Y (Reuse previous cider nrepl buffer, optional) ->
Enter (select shadow-cljs build :app)
You can kinda cheat this by using a KBD macro, but it can't handle the optional Reuse previous cider nrepl buffer & can occasionally trip up#2022-05-0620:01practicalli-johnI assume you can set defaults for all (or most of these) using a .dir-locals.el file. For example
https://practical.li/spacemacs/clojure-projects/project-configuration.html
It would be a matter of finding the right variables to set. There are some cljs and shadow-cljs specific variables here
https://practical.li/spacemacs/reference/cider/configuration-variables.html
For example:
cider-shadow-cljs-command The command used to execute shadow-cljs. By default we favour the project-specific shadow-cljs over the system-wide.
cider-shadow-cljs-global-options Command line options used to execute shadow-cljs (e.g. -v for verbose mode).
cider-shadow-cljs-parameters Params passed to shadow-cljs to start an nREPL server via cider-jack-in.
cider-default-cljs-repl ClojureScript REPL to start for cljs jack-in commands (.dir-locals.el approach recommended)
#2022-05-0620:03practicalli-johnMore examples of adding variables to the Shadow-cljs starup here
https://docs.cider.mx/cider/cljs/shadow-cljs.html#starting-a-shadow-cljs-repl#2022-05-0700:18QuestOoo, I'm going to take a look into this at start of next workweek, thanks!
(It probably seems like a small thing, but I had to execute this keysequence 100 times in the last week while chasing a bug that required a server restart, and I just really wished I could automate it)#2022-05-2517:10QuestThanks for guidance -- I set below snippet in repo/.dir-locals.el
((nil . ((cider-preferred-build-tool . clojure-cli)
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "app"))))
It cuts two of the steps so this becomes my flow
C-c C-x C-c Enter (cider-connect-clj&cljs) ->
Enter (Host: localhost) ->
Enter (Port: 51834) ->
Y (Reuse previous cider nrepl buffer, optional) ->
I searched but couldn't figure out settings to skip over host (should default to localhost) or port (should default to .nrepl-port),
or an option to "always reuse previous REPL buffers",
but it's still nice to have 4 keypresses instead of 6! thanks#2022-05-2604:04onetomif u look into the source of cider-connect-*, you can see what underlying functions does it call, so u can just make your own variant, which doesn't do the prompting.#2022-05-2604:08onetomnot that i tried to hack on this specifically, but that's the general approach u should follow, when using emacs.
here is some inspirational demonstration of an emacs old-timer demonstrating how is he whipping up small elisp programs for more complicated, but ad-hoc use-cases:
https://www.youtube.com/watch?v=cVy-kMSnaHc#2022-05-3101:23QuestJust coming back from the long weekend, but I'll give this a shot this week. I've never gone hacking into library internals (besides theming) but what you're saying makes sense#2022-05-0619:23Ian FernandezHow can I decide between 2 instances of a repl when I'm sending eval?#2022-05-0619:23Ian Fernandezlike, my C-x C-e goes to which of those repl's ?#2022-05-0700:01anonimitorafTo the one whose buffer you last focused#2022-05-0700:24QuestAnonimitoraf's answer has been my experience --
if you hit C-u C-c C-z (cider-repl-set-ns),
Then it should pop your focus over to the corresponding buffer that would've been used for eval, which is the last one with focus. (This is also how it picks between clj vs cljs when you're in a cljc file)#2022-05-0704:54Ian FernandezBut I'm having 2 repls with the same ns #2022-05-0704:54Ian FernandezBut I'm having 2 repls with the same ns #2022-05-2517:10QuestThanks for guidance -- I set below snippet in repo/.dir-locals.el
((nil . ((cider-preferred-build-tool . clojure-cli)
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . "app"))))
It cuts two of the steps so this becomes my flow
C-c C-x C-c Enter (cider-connect-clj&cljs) ->
Enter (Host: localhost) ->
Enter (Port: 51834) ->
Y (Reuse previous cider nrepl buffer, optional) ->
I searched but couldn't figure out settings to skip over host (should default to localhost) or port (should default to .nrepl-port),
or an option to "always reuse previous REPL buffers",
but it's still nice to have 4 keypresses instead of 6! thanks#2022-05-1107:06jumarWhen I try projectile-find-implementation-or-testI get an error:
Can I somehow set "test-prefix" for https://github.com/jumarko/lisp-in-small-pieces?#2022-05-1107:09bozhidarYou use .dir-locals.el for this. You can also specify some explicit project type there.#2022-05-1107:10bozhidarhttps://docs.projectile.mx/projectile/projects.html#adding-custom-project-types#2022-05-1107:13jumarExcellent, thanks!#2022-05-1511:42Lyn HeadleyI'm having some trouble getting my configuration for cider/cljfmt set up. It doesn't look like the options I am setting are taking effect.
I have set:
(setq cider-format-code-options
'(("remove-consecutive-blank-lines?" t)
("remove-multiple-non-indenting-spaces?" t)))
And inside this file I have run cider-format-buffer:
(ns temporale.network.test-format)
(def my-map {:a :b :c :d})
I would expect this file to be reformatted like this
(ns temporale.network.test-format)
(def my-map {:a :b :c :d})
But instead nothing has changed.#2022-05-1517:31yuhanThis appears to be a bug, the cider--nrepl-format-code-request-map function returns an empty dict#2022-05-1516:44ericdalloIs there any way to disable the Daad REPL exist. Reuse? (y or n) question? I found this is only related with reuse a old cider buffer right, and usually to me typing n or y would result in the same#2022-05-1517:26yuhanThere's a github issue about this: https://github.com/clojure-emacs/cider/issues/3076
Personally I also found it annoying and simply edited the function, replacing the (y-or-n-p ...) form with t
https://github.com/clojure-emacs/cider/blob/3eff4f9b10f9b748d752ff70a68b0ffa3be06419/cider-connection.el#L772#2022-05-1517:36ericdalloThanks! Will keep an eye on that issue and probably do your workaround too :)#2022-05-1717:11frozenlockIf I use M-. to go to a var definition, is there a shortcut to come back to where I was?#2022-05-1717:19dpsuttonM-, i believe#2022-05-1717:20frozenlockAh, yes! Thanks#2022-05-1808:07yuhanI was investigating some performance issues with a long running repl in Cider and found that the buffer local variable nrepl-pending-requests was choked full of tens of thousands of entries - does this happen to anyone else?#2022-05-1808:30jumarMine is empty#2022-05-1809:02vemvhadn't heard of that! Feel free to sample them (first, last, a few in the middle) and create an issue#2022-05-1911:08practicalli-johnI assume pending requests backlog would arise if multiple evaluation commands had been issued whilst a long running (perhaps infinitely looping) expression was running.
If the REPL buffer is open, there is a spinner displayed in the mode line bar if an evaluation is taking more than a few seconds.
The cider-interupt command will stop a long running process, although it may take a few seconds to stop. I am unsure if that interupt will clear pending requests as well.#2022-05-1914:22yuhanI just had a chance to test this again on an empty repo - right after jacking in and evaluating / typing a couple of forms, the nrepl-pending-requests starts growing again, without any signs of clearing old values.
In case it wasn't clear, this is a local variable in the cider-repl ... buffer, and there were no pending eval commands.
Value in #<buffer *cider-repl repro/repro:localhost:63257(clj)*>
#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data
("22"
(closure
((status)
(response dict "status"
("done" "no-eldoc")
"id" "22" "session" "c363b5e7-7ea0-4f2f-9fd6-95a6fe789467")
(time0 25222 20710 362122 0)
(tooling)
(abort-on-input . abort-on-input)
(connection . #<buffer *cider-repl repro/repro:localhost:63257(clj)
*>)
(request "op" "eldoc" "ns"
#("repro.core" 0 10
(fontified t face clojure-definition-face))
"sym" "m")
cider-special-mode-truncate-lines cider-print-quota cider-buffer-ns cl-struct-nrepl-response-queue-tags t)
(resp)
(nrepl--merge response resp))
"6" cider--debug-response-handler "10"
#[257 "\205\301\302!\207"
[cljr--debug-mode message "Artifact cache updated"]
3 "\n\n(fn _)"]
"16"
(closure
((causes . t)
cider-required-middleware-version t)
(response)
(setq causes
(cider--handle-stacktrace-response response causes)))
"26"
(closure
((status)
(response dict "id" "26" "session" "c363b5e7-7ea0-4f2f-9fd6-95a6fe789467" "status"
("done" "no-eldoc"))
(time0 25222 20710 456284 0)
(tooling)
(abort-on-input . abort-on-input)
(connection . #<buffer *cider-repl repro/repro:localhost:63257(clj)
*>)
(request "op" "eldoc" "ns"
#("repro.core" 0 10
(fontified t face clojure-definition-face))
"sym" "m")
cider-special-mode-truncate-lines cider-print-quota cider-buffer-ns cl-struct-nrepl-response-queue-tags t)
(resp)
(nrepl--merge response resp))
"28"
(closure
((status)
(response dict "status"
("done" "no-eldoc")
"id" "28" "session" "c363b5e7-7ea0-4f2f-9fd6-95a6fe789467")
(time0 25222 20711 478964 0)
(tooling)
(abort-on-input . abort-on-input)
(connection . #<buffer *cider-repl repro/repro:localhost:63257(clj)
*>)
(request "op" "eldoc" "ns"
#("repro.core" 0 10
(fontified t face clojure-definition-face))
"sym" "ma")
cider-special-mode-truncate-lines cider-print-quota cider-buffer-ns cl-struct-nrepl-response-queue-tags t)
(resp)
(nrepl--merge response resp))
"29"
(closure
((status "done")
(response dict "status"
("done")
"added" "1.0" "arglists-str" "[form]" "column" 1 "doc" "If form represents a macro form, returns its expansion,\n else returns form." "file" "jar:file:/Users/yuhan/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar!/clojure/core.clj" "id" "29" "line" 4018 "name" "macroexpand-1" "ns" "clojure.core" "resource" "clojure/core.clj" "see-also"
("clojure.core/macroexpand" "clojure.walk/macroexpand-all")
"session" "c363b5e7-7ea0-4f2f-9fd6-95a6fe789467" "static" "true")
(time0 25222 20711 482763 0)
(tooling)
(abort-on-input)
(connection . #<buffer *cider-repl repro/repro:localhost:63257(clj)
*>)
(request "op" "info" "ns"
#("repro.core" 0 10
(fontified t face clojure-definition-face))
"sym"
#("macroexpand-1" 0 1
(ns "clojure.core" type "function" face
(completions-common-part))
1 2
(face
(completions-common-part))
2 3
(face
(completions-first-difference))))
cider-special-mode-truncate-lines cider-print-quota cider-buffer-ns cl-struct-nrepl-response-queue-tags t)
(resp)
(nrepl--merge response resp))
"30"
(closure
((status)
(response dict "id" "30" "session" "c363b5e7-7ea0-4f2f-9fd6-95a6fe789467" "status"
("done" "no-eldoc"))
(time0 25222 20711 517791 0)
(tooling)
(abort-on-input . abort-on-input)
(connection . #<buffer *cider-repl repro/repro:localhost:63257(clj)
*>)
(request "op" "eldoc" "ns"
#("repro.core" 0 10
(fontified t face clojure-definition-face))
"sym" "ma")
cider-special-mode-truncate-lines cider-print-quota cider-buffer-ns cl-struct-nrepl-response-queue-tags t)
(resp)
(nrepl--merge response resp))))
#2022-05-1914:24yuhanIn particular, it seems that every exception thrown will add another entry to this hash table in the form of :
("17"
(closure
((causes . t)
cider-required-middleware-version t)
(response)
(setq causes
(cider--handle-stacktrace-response response causes)))
"6" cider--debug-response-handler "10"
#[257 "\205\301\302!\207"
[cljr--debug-mode message "Artifact cache updated"]
3 "\n\n(fn _)"]#2022-05-2015:26yuhansubmitted an issue: https://github.com/clojure-emacs/cider/issues/3206#2022-05-1814:36robert-stuttafordi am up to no good with looping and testing Datomic transactions with datomic.api/with . i'm getting a StackOverflowException, which serves me right.
however, i'm only seeing the first 1000 or so frames of this exception in *cider-error* , which is hiding the genesis of the stacktrace. is there a way to see the full stacktrace, no matter how long it may take my undeserving computer to produce for me?#2022-05-1814:43vemvperhaps you can just operate on *e on the repl?#2022-05-1815:02robert-stuttafordgosh. guess who's never used *e before -blush-#2022-05-1905:07robert-stuttafordyeah so the exception is occurring inside a ring handler, so i don't have *e available to me for it#2022-05-1905:08robert-stuttafordguess i need to repro via the repl!#2022-05-1905:28robert-stuttafordok so *e also only has 1000 frames#2022-05-1907:11vemvdo you think it's a display limitation or a jvm limitation in play?
For the latter there's "-XX:MaxJavaStackTraceDepth=1000000"#2022-05-2311:54robert-stuttafordthanks vemv!#2022-05-1820:43lilactownI'm in a clojure (deps.edn) project that includes shadow-cljs as a dependency and does some custom setup with it. I jack in using the clojure-cli option and and start a watch from the REPL. I'd like to drop down into that CLJS REPL after the watch is done building, but when I try and run (shadow.cljs.devtools.api/repl :app) it instead gives me an Stdin: prompt that I have to type directly into, rather than changing the buffer into a cljs REPL and allowing me to evaluate forms in CLJ(S|C) files#2022-05-2005:45thhellerif the nrepl middleware is not loaded repl defaults to using a regular REPL loop reading from stdin. I'm guessing you don't have the middleware loaded https://shadow-cljs.github.io/docs/UsersGuide.html#_embedded_nrepl_server#2022-05-2014:34lilactownaha#2022-05-2014:58lilactownhmm I can't tell yet if that fixed it#2022-05-1923:24richiardiandreaHi folks, starting to use the refactor-nrepl middleware again, I was wondering how to pass these options from CIDER to it
https://github.com/clojure-emacs/refactor-nrepl#configuration
Can I just add a key to .nrepl.edn?#2022-05-2006:55vemvIf you're on Emacs you can set each clj-refactor.el defcustom in .dir-locals.el
Otherwise as the doc says, Configuration settings are passed along with each msg i.e. they're up to the caller to pass with each invocation
You can also rebind these dyn vars if you find so more convenient:
https://github.com/clojure-emacs/refactor-nrepl/blob/c2f629d82879e12c8976c23b68008bacce72a68b/src/refactor_nrepl/config.clj#L4#2022-05-2015:26richiardiandreaThank you @U45T93RA6 will try both#2022-05-2015:27richiardiandreaGiven these are custom settings on my end probably the defcustoms are the best approach#2022-05-2014:58lilactownanother question, about multiple REPLs: how do I connect to an external REPL and have it be a "sibling" connection?#2022-05-2014:59lilactownwhen I try and run cider-connect-sibling-cljs it attempts to connect to the same port#2022-05-2015:14lilactownlike what I need is the ability to connect another REPL in the session but allow me to choose a hostname/port#2022-05-2015:26lilactownI think I got past this by writing myself a bit of elisp#2022-05-2015:27lilactownnow, I have two REPLs in the session. when I do cider-eval-last-sexp in a .cljc file it evals in... both REPLs?#2022-05-2015:27lilactownis there a way for me to easily toggle between them instead?#2022-05-2015:29yuhanI dabbled in a bit of cljs a few years ago and found this exact same issue - it seems that Cider assumes you want to send the form to all applicable repls all the time#2022-05-2015:30yuhanCalva has (I think) a more sensible approach of allowing you to toggle between clj / cljs via a button#2022-05-2015:30lilactownyeah#2022-05-2015:30lilactownif I want to eval the whole ns, it makes sense to do it in both. but per-form I often have an idea of specifically where I want to run it#2022-05-2015:31lilactownidk, I guess it forces me to rethink how I'm writing my code#2022-05-2015:31yuhanI have a commit on my local Cider which tried to emulate this Calva behaviour - let me try and push it to Github if you want to try it out#2022-05-2015:33yuhanhttps://github.com/yuhan0/cider/commit/385b5a754d94bd0706d4021cd62542d64fa5bbd8#2022-05-2015:34lilactowndumb q: how do I properly use a local copy of cider? I'm using spacemacs#2022-05-2015:35lilactownrn I'm editing the cider.el in my elpa folder which seems bad lol#2022-05-2015:38yuhanhmm, I use Doom emacs now, which uses straight.el under the hood - it uses git repos for everything and makes declaring local packages really easy#2022-05-2015:40lilactownhmmm. I'm 2 yaks deep rn - gonna leave Doom emacs on the shelf for the morning 😄#2022-05-2015:40lilactownI'll just edit my local elpa for now#2022-05-2015:41yuhanI used Spacemacs back in 2018, looking at my old dotfiles I had a custom "layer" with (:location local) symlinks to my local copy of Cider - not sure if things have changed in the meantime#2022-05-2015:44yuhanOf course there's always the least elegant solution of sticking a
Cwith-eval-after-load 'cider-connection
... (monkey patched code) ...
)
in your init file 🙂#2022-05-2015:48lilactownthat's probably what I ought to do vs. editing the file inside of elpa#2022-05-2015:34lilactownah neat!#2022-05-2015:53lilactownok, I think I can actually solve my problem another way: modifying the nrepl middleware passed to the jack in command when I start the clojure repl#2022-05-2015:53lilactownis there a way to do that using dir-locals?#2022-05-2016:09lilactownhmm why is cider-jack-in-nrepl-middlewares marked as a risky local variable?#2022-05-2016:41vemvsay you're checking out some repo, said repo could set the nrepl middleware to $spyware#2022-05-2016:41lilactownok sure, but marking it as risky doesn't prevent that#2022-05-2016:42lilactownor rather, doesn't do anything better#2022-05-2016:43lilactownall marking it risky does is ensures that I have to answer the prompt every time I open a new buffer, rather than saving my preference after I have reviewed it once#2022-05-2018:36vemvprobably the pref can be saved somewhere, worth reading the docs carefully
IIRC I hacked my way to disable this feature 🤷#2022-05-2018:42lilactownI found the docs to do it via M-x customize. it just seems like such an anti-feature. security theatre more than anything else#2022-05-2306:22bozhidarYeah, this was a controversial decision back in the day. Generally, I'm fine with dropping this, as I myself don't think that really help much.#2022-05-2306:23bozhidarThat's usually how things go - security and convenience rarely go hand in hand. 🙂#2022-05-2309:59David PhamHello, I wonder if anyone had the same issue: after I connect successfully to a clojurescript nrepl usinc C-c M-C in prelude with shadow-cljs, then the mode ofthe repl switch back to clj (before it was cljs-select) whenever I use cider-repl-set-ns?#2022-05-2310:01David PhamI can correct the behavior with cider-set-repl-type but it is a bit surprising.#2022-05-2418:10Jared NelsenI am having a problem with testing using CIDER while testing. Every time I run a test in the project I am working on I get something to the effect of:
java.io.FilenotFoundException: Could not local my_project/test__init.class, my_project/test.clj on classpath at clojure.lang.RT.load ...
Could this have something to do with the version of nrepl = 0.8.3 or cider-nrepl = 0.25.5 that I am on?
I am using deps.edn and not Leiningen#2022-05-2418:12jumarWhat's your test namespace and what is the filename?#2022-05-2418:14Jared NelsenTest namespace = test-project.test
Filename = test.clj#2022-05-2418:22jumarIt says Could not local my_project/test__init.class, my_project/test.clj on classpath so it's apparently looking for my-project.test ns.#2022-05-2418:33jumarA few more tips/questions:
• double check the namespace of the test you are running
• how exactly are you running the test (which cider command?)
• does it work with some other tests / test namespaces?
• can you share the test or even the project? if not, perhaps you can create an isolated reproducer?#2022-05-2420:36practicalli-johnalso check that the test code is on the class path
Take a look at https://practical.li/clojure/testing/unit-testing/ to see a common approach to structuring unit tests in clojure#2022-05-2418:12dpsuttonare your tests on the classpath?#2022-05-2418:16Jared NelsenIm not sure how to determine this. How would I do that?#2022-05-2418:24dpsuttonthey appear not to be. but your tests are most likely under test directory. Common to have that path under an alias that adds them. In your deps.edn do you have a :extra-paths ["test"] or something equivalent?#2022-05-2418:30Jared NelsenI do have an :extra-paths ["test"] entry but I just went and looked at the test directory and the tests are actually in a subdirectory called integration . I am guessing I need to specify that somehow in the :extra-paths vector? Something like :extra-paths ["test/integratioh"] ?#2022-05-2420:04vemvGrep for defcustom cider-clojure-cli here as well, understanding these is important for tools.deps users https://github.com/clojure-emacs/cider/blob/master/cider.el#2022-05-2420:46practicalli-johnNo need to read the cider code (and one of those cli values is deprecated, so shouldn't be used).
The cider-jack-in command can be edited by using C-u before calling the command/key binding
Or create a .dir-locals.el file and use cider-clojure-cli-aliases to define aliases to include when calling cider-jack-in
https://practical.li/spacemacs/clojure-projects/project-configuration.html#2022-05-2420:50vemvNo need to read the cider code is bit of an overstatement though - defcustom declarations are documentation!
Also I can't find a make-obsolete-variable for one of those variables - maybe something could be improved?#2022-05-2420:56Jared NelsenI've added the "`test/integration"` entry to the :extra-paths vector and there was no change. I took your advice and used C-u before cider-jack-in and saw that looks every different from my deps.edn . I am beginning to suspect I might not be following the right workflow:
I am:
1. cider-jack-in
2. cider-load-all-project-ns
3. Navigating to the test file
4. C-c C-t t to run individual test
Is there something I have to do differently when I jack in in order to use the deps.edn configuration?#2022-05-2420:57Jared NelsenOr am I missing a step? I do that same workflow for our other projects and it seems to work fine#2022-05-2420:59dpsuttonno it uses the deps.edn to understand your project. My suggestion. ignore cider. start a repl from a command line. get to a point where you can
• start the repl (`clj -A:<whatever-aliases-you-need`)
• require the test namespace (`(require 'my.namespace-test)`)
• get in the test namespace (`(in-ns 'my-namespace-test)`)
• run the tests there (`(clojure.test/run-tests)`)
Once you can achieve all of these, you will understand what CIDER needs in order to run the tests. And if any of these steps fail, you know that CIDER would fail similarly.#2022-05-2421:00dpsuttononce this works
• start up CIDER. Did you need to add any aliases to ensure your test namespaces were on the classpath? You’ll need to add them for CIDER
• then just go to the test namespace you are interested in and require it
• try running ns tests at this point#2022-05-2421:34Jared NelsenI got things to work in Calva but still no luck with Emacs. I will revisit this with Emacs when I have time. The same problem was happening with Calva until I used the right click and Load Current File and Dependencies. After I did that the tests worked fine. Is there an analog to this in Emacs that I can try?#2022-05-2421:35dpsuttoncider-load-file#2022-05-2421:44Jared NelsenStill nothing. I am just going to go with Calva for now but will revisit this. Thanks all for the help!#2022-05-2503:10onetomis there some common way to redirect messages coming from CIDER commands, like cider-load-buffer (`C-c C-k`), into the corresponding REPL window?
it would be really helpful for understanding whether a NS was reloaded/refreshed before evaluating some expression, with cider-insert-defun-in-repl (similarly to how Cursive does it).#2022-05-2505:26vemvIf I understand the question correctly, you want to understand step by step what CIDER is doing JVM-wide, right?
If so the best approach would be to enable nrepl-log-messages in cider.el.
Then for each message, you'd have to relate it to a https://github.com/clojure-emacs/cider-nrepl op. And then read its source#2022-05-2505:28vemvIt's not an automated approach, but it's what we have :) perhaps Cursive has it easier because IntelliJ itself runs in the JVM, I don't know.
It might also be a good idea to simply ask specific questions or even create issues directly (any issue that can result in improved docs or UX is certainly welcome)#2022-05-2510:24onetom@U45T93RA6 no, i didn't mean nREPL messages.
i was specifically thinking about these kind messages, which are just going into the *Messages* buffer now:
https://github.com/clojure-emacs/cider/blob/0dcc5b079a79a928b791cc9cd9bbd2e3bef92d0d/cider-eval.el#L1501
i would think it's a good idea to see them in REPL buffers.
but then again, i might want the wrong thing.
how Cursive works makes a lot of sense to me and 80-90% of the time, that's what I think I want,
so I would like the Emacs+CIDER combo work more like that.
however, in those 10-20% of cases, i would really like to use CIDER's flexibility and its advanced ways of evaluations.
but thanks for bringing up nrepl-log-messages; that might be a better direction for achieving what i want!#2022-05-2511:20vemvyeah probably getting them into the repl would a bit fragile, because you'd be mixing auxiliary code execution (the messaging) with namespace reloading
One could affect the other, e.g. blocking them or having output interleaved#2022-05-2511:22vemvMaybe a nice UI would be to reflect current ns state in the mode line . How to build that, IDK :)#2022-05-2506:50thhelleris the info op in cider getting called incorrectly? the ns seems broken?
(-->
id "20"
op "info"
session "46f71837-9369-45db-bf99-09cd0250a74a"
time-stamp "2022-05-24 16:06:38.095747000"
ns #("repro.core" 0 1 (fontified t help-echo cider--help-echo wrap-prefix " " face font-lock-type-face) 1 10 (fontified t help-echo cider--help-echo wrap-prefix " " face font-lock-type-face))
sym "test-fn-b"
)#2022-05-2506:51thheller(log from this issue https://github.com/thheller/shadow-cljs/issues/1016)#2022-05-2506:51thhellerseems like it is trying to send the correct thing but ends up sending garbage?#2022-05-2506:52thhelleror is the something the middleware actually uses?#2022-05-2507:32bozhidar@thheller The Emacs text properties get ignored, so only a regular string gets sent in the end.#2022-05-2507:32bozhidarStill, I typically aim to clean those on the client, so the logs don't seem confusing.#2022-05-2507:34thhellerah ok. I was assuming the nrepl log shows stuff actually sent over nrepl.#2022-05-2507:55bozhidar@thheller No, it's the log from CIDER's perspective.#2022-05-2515:48Sam Ritchiehey all - I am migrating from leiningen to tools.deps. can someone help me figure out the correct way to set nrepl.middleware.print/*print-fn*
for cider on startup?#2022-05-2515:48Sam Ritchiein leiningen I had
:welcome (set! nrepl.middleware.print/*print-fn*
sicmutils.expression/expression->stream)#2022-05-2515:48Sam RitchieI am assuming there is something I can do with dir-locals.el but can’t find a list of all variables..#2022-05-2516:09Sam Ritchiefound the list! https://github.com/clojure-emacs/cider/blob/11156e7b0cab470f4aab39d3af5ee3cb1e0b09d0/cider.el#L101#2022-05-2516:19Sam Ritchiestill not clear where I would do this particular setting#2022-05-2517:30respatializedYou could create a start namespace with a function like config that invokes your desired startup expressions and add that as an alias config to your deps.edn when launching the REPL - clojure -M:config:cider/nrepl
In emacs you can prefix the cider-jack-in command with a universal arg (`C-u` by default) to add aliases to the default ones.#2022-05-2517:35respatializedIIRC there's a way to get that alias picked up automatically via .dir-locals.el but I don't recall what it is#2022-05-2605:41bozhidarCIDER 1.4.1 is out https://github.com/clojure-emacs/cider/releases/tag/v1.4.1#2022-05-2606:55borkdude@bozhidar Thanks for the nREPL improvements. I just tried connecting to an nbb server with CIDER 1.4.1 but it still didn't work for me#2022-05-2606:56borkdudeWell, connecting worked :)#2022-05-2606:58borkdudeI still have to go into clojure-mode to be able to evaluate things from a .cljs buffer. Connecting with clojurescript-mode and then choosing the custom REPL type doesn't do it either#2022-05-2606:58borkdudecc @U07SQTAEM - Perhaps also try with Hubble?#2022-05-2607:25mkvlrthanks for the release from me as well!! Also tried it with the clerk nrepl and connecting worked but not eval so the same behavior that you saw @U04V15CAJ #2022-05-2705:51bozhidarThat's a different problem and it will be addressed separately. Basically the issue is that CIDER now thinks that the connection in Clojure not ClojureScript. There are a couple of ways to solve this, but I'm still wondering what's the best option.#2022-05-2706:02bozhidarI'm guessing that manually setting the type of the connection should fix this problem as well.#2022-05-2706:03bozhidarStill, I'm thinking that probably a better fix would be to just dispatch to whatever connection there is if there's a single connection within a session and just disregard the connection type check.#2022-05-2706:03bozhidarDecisions, decisions... 😄#2022-05-2706:25borkdudeHow to set the connection type?#2022-05-2707:48David PhamIs it cider-set-repl-type emacs function?#2022-05-2708:39bozhidarYep. More on the subject - https://docs.cider.mx/cider/repl/configuration.html#repl-type-detection#2022-05-2708:43bozhidarYou can ignore the part about the middleware, as this is only relevant to hosted ClojureScript REPLs.#2022-05-2708:44jackrusherWhile I agree with @U04V15CAJ that it shouldn't matter whether it's a clj or cljs REPL for connect to work, in the meantime should we be able to use cider-connect-cljs?#2022-05-2708:45mkvlrwhat’s this needed for? Might be nice if we could get at least the https://nrepl.org/nrepl/ops.html (especially eval + completions) could work without a repl detection?#2022-05-2708:48borkdude@U07SQTAEM No, cider-connect-cljs didn't work either :/
You still need the custom snippet, I documented that here:
https://github.com/babashka/scittle/tree/main/doc/nrepl#cider#2022-05-2708:49borkdude> could work without a repl detection
Yes, that's the whole point of just using nREPL as a protocol, there should be no REPL type detection necessary, or at least, if you try to do it, fall back on something that assumes nothing specific.#2022-05-2708:53bozhidarcider-connect-cljs doesn't work for non-hosted REPLs yet, which is part of the problem.#2022-05-2708:54bozhidar@U04V15CAJ The REPL type is needed mostly because a common workflow was to have 2 different REPLs for the same project and we needed some way to figure out which evaluations to go into which REPL. That's not really related to nREPL, but was rather an artefact of how people were using CIDER.#2022-05-2708:55bozhidarIn hindsight I almost regret moving away from the early design where you simply had to select what REPL you want to use manually. This worked flawlessly, but required people to do some manual work when running multiple REPLs.#2022-05-2708:56borkdudeIsn't that managed by sesman now?#2022-05-2708:56bozhidarAll the logic to detect automatically which REPL is related to which source file resulted in some problems.#2022-05-2708:57bozhidar@U04V15CAJ Yep. Sesman replaced the old code in CIDER, but it didn't really solve anything related to the REPL types. It's main focus what to simplify the grouping of REPLs by mapping them to project paths.#2022-05-2708:58bozhidarYou can still have different types of REPLs in the same project and you need to figure out which one you want to use.#2022-05-2708:59bozhidarAnyways, all of this is fixable, I'm just trying to explain that this time around the problem is not really nREPL-related. I'm still wondering how to best address this in CIDER.#2022-05-2709:01bozhidar@U5H74UNSF This detection is mostly for the purpose of not sending the code to be evaluated in the wrong REPL. This may or may not be a problem depending on one's perspective.#2022-05-2709:03bozhidar(e.g. you're in a ClojureScript source file, but you have two REPLs running)#2022-05-2709:10mkvlrI see, yeah this would become less automatic but maybe manual selection is actually good here? I’m often confused when things get evaluated in two repls.#2022-05-2709:34jackrusherSeems like a buffer-local variable binding would be good for this — though less convenient than magical auto-detection, obvs.#2022-05-2709:35borkdudesesman-link-with-buffer should also work, I think?#2022-05-2805:53bozhidarYeah, there are workarounds, but ideally things should just work out-of-the-box for everyone. I'll keep thinking about a proper solution.#2022-05-2805:56bozhidarTo give you a bit more context - the problem is the cider-repls functions, which we happen to be discussing in a PR currently https://github.com/clojure-emacs/cider/pull/3201/files#2022-05-2805:57bozhidarAs you can see it filters the available REPLs by their session and by their type to decide which are the valid options.#2022-05-2814:32CarloI have a problem with the clojure.repl/source function in CIDER. Consider:
(ns omicron.core
(:require [clojure.repl :as repl]))
(defn foo [a] (inc a))
(repl/source omicron.core/foo)
When I eval this buffer in CIDER, it will print in the repl Source not found , while if I require the file via clj it will print the source. What could the problem be?#2022-05-2814:46vemvwhen you eval code interactively, especially via a repl, the source is the repl, so it makes sense for the source not to be found
What specific cider ops are you using to load code? Those that are related to files should preserve source info, and those that are more 'free form', not so much#2022-05-2814:48CarloI am using both cider-eval-buffer and cider-eval-defun-at-point . What should I be using instead?#2022-05-2814:49CarloSame with cider-eval-file#2022-05-2814:53vemvcider-refresh is one that would almost certainly work, however if that's not your jam, I wouldn't want to suggest a change of workflow
probably cider-eval-buffer/`cider-eval-defun-at-point` might be fixable although I'd imagine we cannot always guarantee that the file will be associated.
cider-eval-file surprises me more, and it could make a stronger guarantee
Could you create a (single) issue for this? Perhaps it's never been implemented to begin with, IDK#2022-05-2814:54vemvOne has to bind *file* as one loads code, perhaps cider forgot to do that#2022-05-2814:55vemvAlso, one additional question, does jump-to-source work in these cases?#2022-05-2814:56CarloIndeed, cider-ns-refresh does the right thing. Yes, jump-to-source works (but I'm not sure which function is used to get that in doom emacs+lsp, so maybe that's not CIDER's merit)#2022-05-2814:57CarloI find this behavior counterintuitive because:
> (meta #'omicron.core/foo)
{:arglists ([a]),
:line 40,
:column 1,
:file "/home/carlo/code/clojure/omicron/src/omicron/core.clj",
:name foo,
:ns #namespace[omicron.core]}
so at some point we know that the var belongs to the file (and where)#2022-05-2814:58Carlomy point being that I would like cider-eval-defun-at-point to try to associate the right informations, at least#2022-05-2814:59vemvyes indeed would be a bug as hinted in https://clojurians.slack.com/archives/C0617A8PQ/p1653749641225689?thread_ts=1653748360.112699&cid=C0617A8PQ#2022-05-2814:59Carloopening an issue#2022-05-2815:50CarloHere's the issue https://github.com/clojure-emacs/cider/issues/3210#2022-05-2816:24vemvThanks!#2022-05-2816:35vemvI verified and described what has to be done. I might give it a shot, however I don't have much time in my hands (and other priorities for cider dev!) so this would be both a pretty easy task and a very appreciated one.
Up to you :)#2022-05-2817:00CarloThank you @U45T93RA6, much appreciated 🙌#2022-05-3110:15dergutemoritzHeya, what's the recommended way to evaluate an expression right after having successfully connected to an nrepl server?#2022-05-3110:50practicalli-johnThere are https://docs.cider.mx/cider/usage/code_evaluation.html. For just an expression, use the cdier-eval-defun-at-point command with the cursor anywhere on the expression.
However, I would recommend evaluating the current namespace as the first step after connecting to the REPL via nrepl. This will load Clojure core into CIDER and ensure docs and jump-to actions work correctly.
Either evaluate the (ns ,,,) expression, or evaluate the whole buffer, cider-load-buffer (C-c C-k).
Note: If you evaluate the whole buffer, put any code you do not want to run into a (comment ,,, ) expression (especially if that code doesnt evaluate correctly).#2022-05-3111:13dergutemoritzSorry, I meant automatically / non-interactively#2022-05-3111:50practicalli-johnAh, then use the user namespace. Expressions included in the user namespace are loaded into the REPL
For example : https://practical.li/clojure/clojure-cli/projects/configure-repl-startup.html
user.clj also works for Leiningen projects too, just ensure that the user.clj file is included in the classpath, usually with a dev profile in Leiningen#2022-05-3111:52practicalli-johnI use the user.clj namespace to launch data inspectors such as portal, e.g. https://practical.li/spacemacs/clojure-repl/portal-data-visualization.html#rich-comment-block-for-portal#2022-06-0110:00dergutemoritzRight, there's one more catch: The code in question is a call to a CIDER middleware API which requires me to pass in my current CIDER session-id. Currently I obtain it via CIDER'S elisp API call (cider-nrepl-eval-session) and then use that to construct the function call I pass on to (cider-interactive-eval). Not sure if there is a way to do that from the Clojure side, too? Also, I want to be able to use this when connecting to an already running remote REPL which of course wouldn't repeatedly load the user namespace whenever I connect. Hope I'm making sense 🙂#2022-05-3113:43FiVoHey, I upgraded to emacs 28 a couple of days ago and realized today that the spinner for "evaluation in progress" wasn't showing up. Upgraded to Cider 1.4.1 (was on 1.2 before), but still no luck. Anybody ran into this?#2022-05-3113:45FiVoJust checked cider-show-eval-spinner is set to true#2022-05-3115:25vemvthis is the package in question, you might want to check in isolation whether it works in e28#2022-05-3115:25vemvhttps://github.com/Malabarba/spinner.el#2022-05-3122:05FiVoYes works in vanilla emacs.#2022-06-0108:11FiVoFixed it by removing my elpa cache.#2022-06-0119:21Drew VerleeWhen I eval any s-expression from my nRepl client/emacs buffer it don't see the output as expected. I also don't see an Nrepl message that I would expect if the message was being correctly received.
However if i save the file, then fighweel-main is correctly tracking the change and updating the browser application with the changes. Any idea how i can get client to nrepl server evalutaion back for expressions that don't require browser feedback?#2022-06-0119:22Drew VerleeHistorically when this happens I believe i usually just kill my repl session and restart it, ill try that here to, but it would be nice to know why this is happening and potential avoid or fix it more gracefully.#2022-06-0119:22Drew Verleeif i try to kill the repl i'm told there is no repl in the current session. It feels like somehow the client gets dissconnected#2022-06-0119:23Drew Verleei can't connect to it because it's already running though. which is confusing...#2022-06-0119:27Drew Verleei think i want to connect-sibling#2022-06-0119:27Drew Verleebecause i'm like a long lost brother#2022-06-0119:28Drew VerleeI'm rejected because a build is already running. Which doesn't make sense to me, i didn't want to start a new build, i wanted to join an existing session.#2022-06-0119:29Drew Verleedespite the error message/reject above, it seems my buffer/client is now correctly connected though as i can send expressions and get back results.
So all is well.#2022-06-0211:33borkdudeI'm trying cider-jack-in but I'm getting:
[nREPL] Starting server via /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:201).
Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
Full report at:
/var/folders/j9/xmjlcym958b1fr0npsp9msvh0000gn/T/clojure-16565661702086264971.edn
error in process sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:201).
Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.#2022-06-0211:33borkdudeThis is a very basic project, just an empty deps.edn and a src file#2022-06-0213:17magnarsI did the same on my machine, and that worked. Mine, however, included refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} in the -Sdeps string.#2022-06-0213:17magnarsIt seems like your --middleware and -Sdeps are not playing nicely with each other, since one includes refactor-nrepl, and the other doesn't. Could be some emacs settings?#2022-06-0213:33vemvThis is the whole logic, it should be easy to detect what's wrong https://github.com/clojure-emacs/clj-refactor.el/blob/f368c56c83843396b160440f472a661a3b639862/clj-refactor.el#L4200-L4221
Basically you want either:
• refactor-nrepl added to cider-jack-in-dependencies
• refactor-nrepl.middleware/wrap-refactor removed from cider-jack-in-nrepl-middlewares#2022-06-0213:35borkdudeNote that this all happened automatically. I'm not sure if I added any config that made it behave different than it should#2022-06-0213:35borkdudeI don't see anything in my init.el that should mess with this#2022-06-0213:39vemvIt would be appreciated if you could eval those simple forms and detect what went wrong :)#2022-06-0213:40borkdude@U45T93RA6 I appreciate you trying to help! Which forms should I evaluate? cljr--inject-jack-in-dependencies) inside an elisp session?#2022-06-0213:42vemvMy suggestion is to try determining why cider-jack-in-dependencies doesn't include refactor-nrepl according to those lines of code#2022-06-0213:42vemvI'd simply eval the two conditions for those when s#2022-06-0213:43borkdudeELISP> cljr-inject-dependencies-at-jack-in
t
#2022-06-0213:43borkdudeELISP> (fboundp 'cider-add-to-alist)
t
#2022-06-0213:44vemvspecifically:
(and cljr-inject-dependencies-at-jack-in
(fboundp 'cider-add-to-alist)
(boundp 'cider-preferred-build-tool)
(boundp 'cider-jack-in-dependencies)
(boundp 'cider-jack-in-lein-plugins)
(boundp 'cider-jack-in-nrepl-middlewares))#2022-06-0213:44vemvand (not (eq cider-preferred-build-tool 'lein))#2022-06-0213:45vemvM-: is your friend btw, a repl can have a slightly different context https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html#2022-06-0213:45borkdudeAll of those eval-ed to true#2022-06-0213:45vemvwhat's the val of cider-jack-in-dependencies?#2022-06-0213:46borkdudenil#2022-06-0213:47vemvthat's strange, considering the two conditions evaled to true
maybe you switched projects as you started Emacs, sth like that?
Or otherwise, somehow things evaled differently before (around Emacs init time) and now#2022-06-0213:49vemv(some quick measures: ensure emacs and clj-refactor.el are both at latest stable, and remove .elc files)#2022-06-0213:51borkdudeAaah, that was it. I had to upgrade clj-refactor.el#2022-06-0213:51borkdudeThanks @U45T93RA6 ❤️#2022-06-0213:54vemvyeah breaking changes suck... wish we had fewer of them 😑#2022-06-0312:38daveliepmannI came to the channel to ask about this same issue. Glad to see this thread — thanks folks 🙂 Upgrading from clj-refactor from 3.2.2 to 3.5.2 fixed my environment as well. I suspect this behavior arose when I last upgraded CIDER.#2022-06-0411:09pyrHola friends of the apple nectar! I wanted to get your thoughts on the idea behind https://github.com/clojure-emacs/cider/pull/3212 before going further with figuring out the tests#2022-06-0413:00pyrNevermind, @U07FP7QJ0 made it obvious this isn't necessary, cheers!#2022-06-0413:22plexusHappy to help ☺️ I can see a use case for making this more explicitly available to tools. E.g. lambdaisland.classpath.watch-deps could use that too.#2022-06-0622:03agbtw, in the latest version something seems messed up with cider-nrepl. I'm not sure if anyone reported this, but I'm getting nrepl middleware warnings and cider-switch-to-repl-buffer won't work for .cljs files.
I pinned on "CIDER Kyiv", and it still works for me.#2022-06-0700:25vemvwhat are the warnings in question?#2022-06-0715:14agthat regular middleware warning, you know? The one with the link that takes you to https://docs.cider.mx/cider/basics/middleware_setup.html#2022-06-0716:44vemvplease paste it :)#2022-06-0716:46agnope. for that I'd have to unpin the package and get the latest again. I'll wait for something else to break and then, if I have no choice but to debug it, I'll probably come here crying again 🙂#2022-06-0720:02nixin72Anyone ever have this pop up in Emacs when doing Clojure? Sometimes I do something (idk what) and suddenly it constantly pops up when I’m typing and I’m not sure what it is? Entering input into it doesn’t seem to do anything? And the only way to get rid of it seems to be to kill CIDER and restart or restart Emacs. I have no idea what triggers this mode or what it’s called or anything, but it’s frustrating. Anyone know what it is, how to stop or, or how to use it?#2022-06-0720:03vemvyou can find Lisp expression a few times in the cider issue tracker, hopefully that will hint what could be wrong#2022-06-0720:07nixin72Thanks, I’ll take a look#2022-06-0720:10Carsten BehringI have that as well quite often. Did not realy find a solution.
Looking for any solution#2022-06-0720:13Carsten BehringI "think" it is related to "lispy mode" which interacts as well with a Clojure session or similar. Very annoying.#2022-06-0801:29agDamn, I broke something, again. Now I can't jack-in:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Picked up JAVA_TOOL_OPTIONS: -Dapple.awt.UIElement=true
Jun 07, 2022 8:27:48 PM org.eclipse.jetty.util.log.JettyAwareLogger log
INFO: Logging initialized @3501ms to org.eclipse.jetty.util.log.Slf4jLog
Unexpected error (NoSuchFieldError) macroexpanding if-ns at (cider/piggieback.clj:22:1).
UNNECESSARY_ESCAPE
on CIDER 1.5.0-snapshot (package: 1.5.0-snapshot)
it starts like this:
[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.4"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[shadow.cljs.devtools.server.nrepl/middleware,refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:shadow-cljs:dev:test:cider/nrepl
but fails, anyone has a clue?#2022-06-0803:03vemvfrom the stacktrace alone it looks like a dependency conflict of some java dep, piggieback expects version x and shadow-cljs causes y to be resolved instead#2022-06-0803:06vemvcould you determine the exact cause and then create an issue in https://github.com/nrepl/piggieback ?
Easiest fix would be to mranderson ize some deps in that project. Although @U051BLM8F is less keen on that sort of solution lately.#2022-06-0804:53bozhidarPiggieback has only provided deps, btw.#2022-06-0804:54bozhidarAnd no direct ties to shadow-cljs (it doesn't use piggieback directly, it simply emulates its API)#2022-06-0813:51Carsten BehringUsing the cider-inspector with a repl I connected to with cider-connect gives me always an error like:
Inspector error for: ./validation/exportOpinions.csv.gz [10762 39]:
#2022-06-0813:57vemvI'd suggest creating an issue with a more generous description#2022-06-0814:50Carsten Behringyes, thanks. I was hoping somebody has seen it and has a solution.
It happens on "all" vars but only if I do cider-connect towards a already running repl.
Code evaluations works as usual.#2022-06-0815:21Carsten BehringI solved it. I was missing the cider-nrepl middleware in my setup.#2022-06-0817:05yuhanJust curious, what command did you use to start the server without cider-nrepl middleware installed?#2022-06-0817:07yuhanThe error message can probably be improved - I thought that it's missing a call to cider-ensure-op-supported but actually the inspector middleware taps directly into the eval op#2022-06-0817:08Carsten BehringI Just had repl/repl in the deps.edn. So this starts nrepl server and emacs connects to it.
(but prints a warning on missing cider-nrepl, which I ignored ...)
clojure -m nrepl.cmdline starts then sucessfully a nrepl server.#2022-06-0817:07yuhanThe error message can probably be improved - I thought that it's missing a call to cider-ensure-op-supported but actually the inspector middleware taps directly into the eval op#2022-06-1012:35SturmIf I evaluate something broken in a Shadow CLJS Cider buffer like (1) with cider-eval-last-sexp, it shows :repl/exception! . Is there a way to see the full error? I can't see it in either the "cider-repl" or "nrepl-server" buffers.#2022-06-1107:06thheller@ben735 shadow-cljs sends the error via stderr or :err messages in case of nrepl. dunno where that goes in cider though. cider might be expecting different messages. I didn't know where to send them.#2022-06-1122:57Sturmthanks @thheller!#2022-06-1503:38Sturm@thheller if I evaluate something that isn't bound like foo or (foo) with cider-eval-last-sexp, it shows nil rather than complaining about not being able to resolve the symbol. Is that likely to be related to your answer above too?#2022-06-1506:48thheller@ben735 with regular shadow-cljs node-repl I get
cljs.user=> foo
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:1
Use of undeclared Var cljs.user/foo
--------------------------------------------------------------------------------
cljs.user=> (foo)
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:2
Use of undeclared Var cljs.user/foo
--------------------------------------------------------------------------------
#2022-06-1506:48thhellercider is getting the same info. if it doesn't show it I don't know where it goes#2022-06-1506:50Sturm@thheller thanks - and I appreciate that you don't use cider - I might report a bug for cider and see what others think#2022-06-1506:52thhellershadow-cljs might be doing something cider doesn't expect. could easily change that if somebody tells me what it expects instead.#2022-06-1506:52Sturmthanks!#2022-06-1519:13Drew VerleeWhen i start cider via cider-jack-in how is it picking a version of java and clojure to use? this is what i see at the top of the buffer in emacs
;; CIDER 1.5.0-snapshot (package: 20220531.616), nREPL 0.9.0
;; Clojure 1.9.0, Java 11.0.11
#2022-06-1519:15Drew Verleethe clojure version matches the one in my deps.edn file, so i'm curious about the java version.#2022-06-1519:16Drew Verleei'm guessing emacs is just searching my OS according to some set of rules. This is frustrating because it's probably not going to play nice with jenv#2022-06-1519:16dpsutton• java: it just invokes whatever process your project is based on: clj, lein, etc and does that. It doesn’t choose, just execs the program. Same as if you typed into a terminal clj. The environment dictates the java version
• clojure: always from the project tool you are using, lein or clj#2022-06-1519:16dpsuttoneasiest way to figure this stuff out is to start an eshell and then which java#2022-06-1519:17dpsuttonWelcome to the Emacs shell
~/projects/work/metabase $ which java
/Users/dan/.sdkman/candidates/java/current/bin/java
~/projects/work/metabase $
#2022-06-1519:18dpsuttonan easy way to remove this indirection. cider-jack-in. grab the jack in command from the *Messages* buffer. Save this form into a shell function. Then use that shell function to start the process and cider-connect to it#2022-06-1519:18dpsuttonoh, and that startup form is also at the top of the repl banner message#2022-06-1519:22Drew Verleewhich java from my emacs shell is saying ..jenv/shims/java and jenv version is openjdk...1.8 but the repl was starting with java 11.0.11 maybe it's ideal to just cider-connect (which is what your saying i suppose)#2022-06-1519:23dpsuttonyeah i’d say its far more predictable without the extra exec-path of emacs#2022-06-1519:23dpsuttonyou might have to get into nitty gritty as to why you are getting different versions#2022-06-1519:23dpsuttonmight be the default java at the time you launched emacs#2022-06-1519:24dpsuttonemacs might not be “in the directory” you expect when it execs the process so maybe not getting the settings for that dir?#2022-06-1519:25Drew Verleeit's a thought, ill look into it more later 🙂 thanks for the help.#2022-06-1618:05practicalli-johnI believe the Clojure executable file will search the operating exec path, $PATH, to look for a java executable, so it may find a java on the PATH before it finds jenv
Also check to see if JAVA_HOME is set to a particular path (although this is less used now)#2022-06-1618:09practicalli-johnTo use cider-connect there is an example deps.edn alias here (remove the -i option if you want a headless process (i.e. no repl prompt in the terminal)
https://github.com/practicalli/clojure-deps-edn/blob/live/deps.edn#L118#2022-06-1618:49Drew VerleeThanks John. I'll take a look. Maybe i should use something that updates path to...#2022-06-1620:10practicalli-johnDepending on the environment, it may also be possible to set the java.runtime.version=17 or other version of Java in a system.properties file in the root of the project, which can be useful when several versions of Java are available to the system. There are other properties, but it depends on the tooling as to if these properties are consulted.
https://practical.li/clojure-web-services/app-servers/java-system-properties.html#2022-06-1620:21practicalli-johnOr that property may be able to be set with a -J option on the command line, or with Cider including a :jvm-opts key in an alias that is added to the cider-jack-in command (i.e. https://practical.li/spacemacs/clojure-projects/project-configuration.html). I am assuming an alias would be something like the following (but I havent tried this myself yet)
:jvm/report {:jvm-opts ["-Djava.runtime.version=17"]}
This might need "-Djava.home;/path/to/directory/containing/java" to work, or that may work by itself...#2022-06-1718:30lilactownwhen I run cider-jack-in-cljs, and using the built in browser REPL, is there a way to tell it to open a different browser (or give me a chance to copy URL to the clipboard) instead of opening the default browser#2022-06-1718:33lilactownby default I use safari, but want to REPL in chrome rn 😅#2022-06-1718:34DerekI’ve been using https://www.choosyosx.com/ for this, so would love a simpler solution#2022-06-1718:43lilactownI think we could add a prompt#2022-06-1718:48lilactownin cider.el
(browser "(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env)))")
we can pass {:launch-browser false} to the repl-env call there#2022-06-1718:50DerekSince it’s just calling browse-url, I think there’s some ability to customize a var there#2022-06-1719:00DerekThis looks promising — https://assortedarray.com/posts/browse-url-sites-custom/#2022-06-1719:10lilactownhere's what I added to my .spacemacs config
(defun spacemacs/user-config ()
,,,
(with-eval-after-load 'cider
(cider-register-cljs-repl-type
'browser-no-open
"(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env :launch-browser false)))")))#2022-06-1719:11lilactownnow I can run cider-jack-in-cljs and select browser-no-open as the REPL type#2022-06-1719:11lilactownafter the nREPL server is launched and connected, the REPL buffer has the URL in it that I can copy paste into Chrome#2022-06-1719:11lilactownsuffices for my needs 🙂#2022-06-1719:22dpsuttonthere’s also
(defcustom cider-offer-to-open-cljs-app-in-browser t
"When nil, do not offer to open ClojureScript apps in a browser on connect."
:type 'boolean
:safe #'booleanp
:version '(cider . "0.15.0"))
not sure if you’re also hitting that?#2022-06-1720:26lilactowni don't think that's used for the browser REPL#2022-06-1720:27lilactownyou can see the snippet i pasted above, (repl-env) is called with no arguments meaning that it is actually CLJS that opens the browser, not CIDER#2022-06-1720:27lilactownand there's no parameterization of it#2022-06-1720:27lilactowni think it would be great for CIDER to add the prompt to the browser REPL type, but my elisp-fu is quite weak#2022-06-1808:51bozhidar@U4YGF4NGM File some ticket about this and we can make it happen.#2022-06-1916:11lilactownhttps://github.com/clojure-emacs/cider/issues/3216#2022-06-1719:10lilactownhere's what I added to my .spacemacs config
(defun spacemacs/user-config ()
,,,
(with-eval-after-load 'cider
(cider-register-cljs-repl-type
'browser-no-open
"(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env :launch-browser false)))")))#2022-06-2006:20bozhidarFYI - there's a new release of compliment (the library that powers code completion in CIDER) and it's already available in CIDER's master branch for those curious to try it out (https://metaredux.com/posts/2022/06/20/compliment-0-3-13.html)#2022-06-2111:53practicalli-johnWhen using CIDER on a Mac (OSX 12) I am unable to evaluate top-level expressions using cider-eval-defun-at-point within a (comment ,,,) expression, the comment expression is evaluated, even though clojure-toplevel-inside-comment-form is set to t (tried in 3 different places)
Howerver, the same CIDER version 1.5.0-snapshot (package 20220531.616) on Linux allows for evaluating top-level forms in comments.
I wonder what could be causing the difference in behaviour (and how to diagnose it)#2022-06-2111:54practicalli-johnI’ve checked the value with describe-variable
clojure-toplevel-inside-comment-form is a variable defined in 'clojure-mode.el'.
Its value is t
Original value was nil
#2022-06-2113:57solfIt works with me on whatever the last version of osx is and CIDER 1.5.0-snapshot (package: #2022-06-2113:57solfI have an outdated cider-nrepl though (v0.26.0)#2022-06-2114:15dpsuttonsee if you can upgrade clojure-mode?#2022-06-2204:33jumarWhen using cider debugger after I press l to show "locals" while I'm inside an anonymous function form,
I can't see the value of the anon. function arguments (such as %)
Is this something that could be fixed in the debugger itself?#2022-06-2616:14chrisetheridgehas anyone ever had an issue with Cider and println not being outputted to the terminal? if i place a println in code, its output is seen in my terminal as expected, when i start a Clojure process. as soon as i connect via nrepl however, any subsequent println 's are not outputted to the terminal, but they are outputted in the repl buffer in Emacs#2022-06-2713:19Martynas MaciulevičiusHey. How do I prevent values from REPL appearing in my echo area (the one at the bottom)? It doesn't give me much use and it also lags the UI as I have fat structs in REPL. And then everything jumps around without much point because when I move my cursor again the echo area clears up and then reappears in one second.
It takes about 1 second to render that bottom result so I may move several times and experience lag. And then it jumps because the bottom suddenly expands after some time when I stop moving my cursor.
If you look at the attached screenshot and press <left> key then the bottom result would immediately disappear and will happen to be rerendered after one second. This is not good.
The only thing I want is that nothing would jump as I investigate the data structure by moving with my text cursor. So I simply want to disable this. I also use the result buffer constantly because it's predictable and I don't use this bottom expanding-collapsing one.
Reproduction:
1. Print this into REPL:
(println (->> (range 1000)
(map (juxt identity (constantly {:key :item})))
(into {})))
2. Go to REPL buffer and move your cursor onto the map's key or on the starting/ending paren of the data structure.
3. Result in the snapshot:#2022-06-2715:08Martynas MaciulevičiusIs it possible to enable evil-motion-state for cider-inspector-mode? I want to have the keybindings for movement but at the same time I want to use the default keybindings for the mode.
It's also fine if I could use evil-motion-state and define my own keybindings. But all my tries to enable this mode failed because this code doesn't work:
(add-hook 'cider-inspector-mode-hook (lambda () (evil-motion-state)))
It doesn't enable the evil-motion-state and instead it triggers it when I navigate to the child parts of my data. I see this because the cursor changes the color for a brief moment.#2022-06-2715:34tomdAre you a user of evil-collection? If so, that may be interfering:
(add-hook 'cider-inspector-mode-hook #'evil-normalize-keymaps)
from evil-collection/modes/cider/evil-collection-cider.el#2022-06-2717:07Martynas MaciulevičiusI'm a user of evil-mode-based editing if you meant that.
I think it didn't do anything. I evaluated this in eval-expression and the nopened the inspector. And it didn't have the keybindings. Namely what I'm looking for is to use f and repeats 5j.
Do you have a full solution or is it simply an attempt to help? What should it do? The major mode there is a special-mode which prevents editing. So when I click number 5 it says in the bottom that buffer is read-only. And this where f command fails too.
Edit: I didn't restart emacs though. Did it work for you?#2022-06-2811:26Martynas MaciulevičiusWhen I try the same expression and restart emacs it still doesn't work add w and other key bindings to cider-inspect mode.
I also tried this but it still didn't work:
(spacemacs-evil :variables
spacemacs-evil-collection-allowed-list
'(cider-inspector-mode)
)
#2022-06-2811:29tomdI mean https://github.com/emacs-evil/evil-collection which is a separate package from evil. I'm not a spacemacs user, but it does look like spacemacs includes it, so I guess you are using it.#2022-06-2811:30tomdI would find some way of disabling it and then trying your code. I may be barking up the wrong tree, but it seems to be worth eliminating it as a cause. I can't (easily) test any of this because I don't have spacemacs.#2022-06-2811:35Martynas MaciulevičiusI think the problem is that the mode is re-applied when the buffer loads after it runs all of the hooks. Because if I could add a hook and in it enable evil-motion mode then I would be done. Then I would need to set up several function call bindings and that would be it.
But as the mode is re-applied every time then the hook can't be run at the end and I even see the cursor blink in pink color which signals that the evil-motion state is enabled for a brief moment and then disabled again.
Basically this is me fighting spacemacs and emacs where all I want is VIM style editing and motions in all of the buffers with less magic keys that you somehow need to remember and which are different for every occasion.#2022-06-2811:42tomdYeah I totally understand. I take the other route - I only use evil for editing text in programming buffers, and accept the emacs keys for nearly everything else. evil-collection is supposed to allow you to do exactly what you are trying to do, so I'd recommend making an issue on their https://github.com/emacs-evil/evil-collection/issues - this is exactly the sort of thing they should know how to fix.#2022-06-2811:46Martynas Maciulevičius(but it never worked, not for Clojure's exceptions, not for test reports, not for this one too. I expected to at least try something and hope for the best.)
The only thing that evil bindings work correctly on is cider-result and that has been a flawless one. You can find, you can move by word, you can multiply commands... I'll try to file the issue later. I think that evil-collection is about configuring each mode separately but I hope it's not.#2022-06-2718:48nixin72Is there a way to automagically run my tests for a given function whenever I recompile that function? I see that there’s cider-auto-test-mode for running all the tests for a given namespace whenever I reload the whole namespace, but I just want to run my tests for a specific function#2022-06-2719:02dpsuttonyou can do this natively in clojure:
❯ clj
Clojure 1.11.1
user=> (use 'clojure.test)
nil
user=> (defn foo [x] (inc x))
#'user/foo
user=> (deftest foo-test (is (= 4 (foo 3))))
#'user/foo-test
user=> (add-watch #'foo ::testing (fn [_ _ _ _] (foo-test)))
#'user/foo
user=> (defn foo [x] (* x 2))
FAIL in (foo-test) (NO_SOURCE_FILE:1)
expected: (= 4 (foo 3))
actual: (not (= 4 6))
#'user/foo
user=> (defn foo [x] (+ x 32))
FAIL in (foo-test) (NO_SOURCE_FILE:1)
expected: (= 4 (foo 3))
actual: (not (= 4 35))
#'user/foo
user=> (defn foo [x] (inc x))
#'user/foo
user=>
#2022-06-2719:23nixin72Ohhh interesting, thanks!#2022-06-2719:46nixin72There we go!
(doseq [[name ref] (ns-interns 'my-ns)]
(let [test-fn (resolve (symbol (str "test-" name)))]
(when (and (fn? @ref) test-fn)
(add-watch
ref
name
(fn [_ _ _ _]
(test-fn))))))#2022-06-2809:17bozhidarCIDER's browse-ns functionality just got reworked in a major way https://github.com/clojure-emacs/cider/pull/3217#2022-06-2809:17bozhidar(the name of the PR is a bit misleading)#2022-06-2819:07magra@bozhidar Thank you for cider! I had a lazy-seq getting realized and did not know where it got called from. Putting a #break before a function it called and I can press c continue to the next call or press s to get a nice stack-trace to see where it gets called from. Nice!!! Just needed once every two years but boy is it nice to have it be there when I do need it!!!!#2022-06-2819:10bozhidarBetter late than never. 😉#2022-07-0105:39Toni TuominenHello. I would like to set a hotkey to send a code snippet to the repl. How do I do that? I need to restart my servers and it would be nice to have a hotkey to do it anywhere instead of going to a file and evaluating a comment block.#2022-07-0106:26robert-stuttafordhttps://github.com/robert-stuttaford/.emacs.d/blob/master/cider.el#L56-L72#2022-07-0107:00Toni TuominenThanks!#2022-07-0107:09robert-stuttafordsure thing!#2022-07-0114:12dpsuttonI use something equivalent in inf-clojure where i store forms in registers. This would work for CIDER: https://gist.github.com/dpsutton/7556cf1f4ecfc97da7b7e9d6dbf210c6#2022-07-0114:13dpsuttonhighlight a form you want to save and then hit C-x r s <register>#2022-07-0114:14dpsuttonI’ll put
• queries in q
• clojure.test/run-tests in t
• an individual test in i
• (run! tap> (repeat 3 "****")) in c to clear my tap view#2022-07-0115:17robert-stuttaford😮#2022-07-0115:17dpsuttonIndispensable for my workflow now#2022-07-0208:43robert-stuttafordgonna give this a go, thanks @U11BV7MTK#2022-07-0214:20lispers-anonymousWhen I use cider and eglot, cider's implementation of xref-find-references is used, but I would prefer to use eglot's xref implementation. Is there a way for me to tell emacs to use eglot instead of cider? Or a maybe a way to disable cider's xref implementation completely?#2022-07-0214:55aptI’m not sure how to configure this, but just one warning. eglot does not handle definitions of external projects (as of today), while cider does.
https://github.com/joaotavora/eglot/issues/661#2022-07-0214:56aptThat said, I use eglot and live with that.
For external definitions, I use clojure.repl/source or clojure.repl/doc or even open the source code, since it’s usually a lib from my own company.#2022-07-0214:57aptAlso, maybe there’s a way of assigning higher priority to eglot’s backend, supposing it’s hooked into xref. I’m not too familiar with xref so I don’t know if it’s possible.#2022-07-0214:58lispers-anonymousI am aware, but cider's xref-find-references only leads me to the top level form, usually a function, that references something. Clojure-lsp and eglot take me directly to the reference.
For external projects, I just use cider-find-var .#2022-07-0214:58lispers-anonymousA solution I just came to after reading some cider source was to redefine this function after cider is loaded
(defun cider--xref-backend () nil)
#2022-07-0214:59lispers-anonymousWhen it always returns nil cider doesn't set any xref stuff, but the other commands cider provides for navigation continue to work. Feels like a hack but I like it better than what I had before.#2022-07-0215:00aptGreat. That looks easier, indeed.#2022-07-0311:06iarenaza@UDVJE9RE3 Did you look at https://docs.cider.mx/cider/usage/misc_features.html#xref-integration ?#2022-07-0417:20lispers-anonymousWow I feel so dumb. All that searching and I somehow didn't find that. It's exactly what I'm looking for. The xref-fn-depth specifically. Thank you for sending that to me!#2022-07-0616:47Benjaminjo how to define jvm-opts in deps.edn so cider uses them?
{:paths ["src"]
:jvm-opts ["-Xms" "32g"]
:deps
{techascent/tech.ml.dataset {:mvn/version "6.091"}}}
#2022-07-0616:48dpsuttonjvm opts cannot be top level. they must be in an alias. Add them to an alias and then use that alias#2022-07-0616:51Benjaminyea thanks#2022-07-0812:53Toni Tuominenis there a way to set indent style for a whole namespace?
similar to (put-clojure-indent 'my-ns/do 1) but with a wildcard?#2022-07-0813:26vemvsounds an odd thing to want. A ns can have all sorts of macros (and it's subject to future changes), each with a different indent style.#2022-07-0813:28Toni Tuominenhttps://github.com/fulcrologic/semantic-ui-wrapper
there's a ton of ui-* components and I'd like to set a style for all of them in one go instead of having to list each one individually#2022-07-0813:37vemvcan you post an example var from that repo?#2022-07-0813:38Toni TuominenI would use it like this
` (sui/ui-table-row {}
(sui/ui-table-cell {:singleLine true} name)
(sui/ui-table-cell {} net-multiplier)
(sui/ui-table-cell {:singleLine true}
(sui/ui-button {:color "blue"} "Muokkaa")
(sui/ui-button {:color "red"} "Poista"))))`#2022-07-0813:39Toni Tuominensince it makes highly nested structures it's not that nice that it formats them like function args#2022-07-0813:39vemvok, please post the namespace in question, I need to see their code#2022-07-0813:40Toni Tuominenhttps://github.com/fulcrologic/semantic-ui-wrapper/blob/master/src/main/com/fulcrologic/semantic_ui/factories.cljc#2022-07-0813:43vemvthanks!
I think the use case is pretty exceptional. Have you considered creating a PR adding :style/indent 0metadata to all those vars?
You could complete it with a deftest asserting that all vars in that ns have that metadata, that way it will be future-proof#2022-07-0813:46vemvYou could even do it programatically in one go, e.g. (doseq [v (ns-publics (the-ns 'fulcro-blah))])
CIDER will pick it up
Best of all, you can try it locally before creating a PR (and you can refrain from a PR at all)#2022-07-0813:47Toni TuominenI'll give it a go thanks#2022-07-0816:15borkdudeWhen I am not in a cider-connect buffer, but I want to eval something against the most recently used JVM Clojure, can I do this in elisp, and how?#2022-07-0816:16borkdudeThe use case, I'm in a .cljs buffer which is not connected to a REPL, but the JVM Clojure project does use the .cljs file so I want to send a command to that REPL to process it#2022-07-0816:18borkdudeor evaluate something in a buffer, that's not currently focused, would also be good#2022-07-0816:20borkdudelike (cider-eval-in-buffer "foo.clj" "(+ 1 2 3)")#2022-07-0818:35aptI don’t know the answer, but just if it’s useful for anyone: inf-clojure works like that by default [1]. I do that a lot for developing libs and testing them on the fly on its clients.
But then, of course, by using inf-clojure you loose all nrepl and cider goodies.
[1]: https://github.com/clojure-emacs/inf-clojure/#2022-07-0818:21fentonMy goal is to have both clj&cljs repls working in a single project. Currently I run shadow in a terminal so would like to connect to it. What is the right workflow to achieve this? Do I cider-jack-in-clj and cider-connect-cljs. Should these be in the same session. My understanding is that sessions group client nREPLs to use the same nREPL server. But don't I have two nREPL servers, on for shadow (cljs) and one for the backend clojure?#2022-07-0820:24codeasone@fenton here's how I've set things up for full stack work in the past in case it provides some pointers https://github.com/codeasone/starter-cider-tools-deps-shadow - been using the approach for over a year now with no workflow issues under cider, taping out to the shadow cljs inspector from both clj and cljs contexts in particular is great.#2022-07-0908:43Toni TuominenLink doesn't work#2022-07-0908:46codeasoneAh, sorry about that. Should be available now.#2022-07-0910:24Toni TuominenYeah works now thanks#2022-07-0917:46fenton@U191H9E5C how do I buy you a beer? Thanks for clearing the path buddy, very much appreciated!#2022-07-0917:58codeasoneHa ha, and I thought I was a bit mad for going off-piste originally, glad you've found something that works for you.#2022-07-1009:50codeasone@fenton another (more mainstream?) approach to getting your REPLs in order with respect to clj(cs) files and sesman https://gist.github.com/codeasone/6b2edf963915621ee66f938364875cd6. I'm considering switching to this for my work project, as it seems behaves well.#2022-07-0912:34KimoIs there a one-liner to silently jack in?
Hoping to make this work for a client without dealing with dir-locals.
Tried this, but I don't think the bindings apply to cider's process:
(defun my-project-jack-in () (interactive)
(let
((cider-preferred-build-tool 'shadow-cljs)
(cider-default-cljs-repl 'shadow)
(cider-shadow-default-options ":my-build")
(cider-offer-to-open-cljs-app-in-browser nil)
(cider-repl-pop-to-buffer-on-connect nil))
(cider-jack-in-cljs '(:project-dir "~/my-project"))))#2022-07-1117:47Joshua SuskaloIs there a particular reason you're trying to avoid dir locals?#2022-07-1222:44jon rostrandoes someone know how to inspect an object with cider-inspect-last-result ?#2022-07-1303:08jumarEvaluate some expression and after it's done invoke cider-inspect-last-result#2022-07-1320:09jon rostranthanks, actually p key needs to be pressed instead of M-x cider-inspect-last-result#2022-07-1405:27jumarAh, I see, you were talking about calling it during debugging.
Yes - and it gets trickier when you use spacemacs in evil-mode : then you need to switch to emacs mode and only then press p 🙂#2022-07-1222:45jon rostraninvoking that fn in debugger opens up a buffer but doesn’t actually show the returned (truncated in the file buffer) object#2022-07-1222:48jon rostranideally pretty printed as well#2022-07-1320:10jon rostrandoes someone know how to pretty print a collection in a *cider-inspect* buffer?#2022-07-1320:31jon rostrannvm this is unnecessary just figured out how to use the inspector tool#2022-07-1405:37jumarThere are also several cider pprint functions which show the result in a separate buffer #2022-07-1415:11jon rostrandoes someone know how to setup cljfmt in cider? I setup the hook and it works (it’s there after running C-h v before-save-hook ) but it’s not following the rules I set for it in cider-format-code-options#2022-07-1415:12jon rostranif my cljfmt looks like this {:split-keypairs-over-multiple-lines? t } how do I encode into emacs plist#2022-07-1415:25jon rostranor rather, what’s the way to inspect that cljfmt indeed runs and inspect it’s config settings?#2022-07-1415:40jon rostrannvm cider doesn’t support this see: https://github.com/clojure-emacs/cider/issues/3209#2022-07-1910:16witekHallo. I have a problem seeing exceptions when evaluating in buffer.
I am connected to shadow-cljs with a runtime on Google Firebase Functions emulator. I can evaluate in REPL and in buffers. Here is an example: When I evaluate in the REPL, I get the following output:
Execution error (TypeError) at (<cljs repl>:1).
shadow.js.shim.module$twilio.default is not a function
;; => :repl/exception!
Which is what I need. But when I evaluate in the buffer, I only see the result, which is :repl/exception and I can not see the error itself. Is there a way to make the error visible somewhere when I eval in buffer? Thank you!#2022-07-1912:00thhellernormally the full error is printed to the console, so it should be somewhere in the emulator logs?#2022-07-1912:00thhellerbut cider seems the hide the error for some reason. someone else asked about this not too long ago#2022-07-1913:28bozhidarIt's more likely that it gets printed in the nREPL server buffer or something like this. CIDER definitely doesn't do anything to hide some of the error output that would normally end up the REPL. The output bindings can get messy.#2022-07-1913:46witekHow do I get access to the nREPL server buffer?#2022-07-1914:37thheller@U2ERGD6UD FWIW the error above means that you probably used (require '["twilio$default" :as x]) or (require '["twilio" :default x]) or via ns and then (x ...) somewhere. but x wasn't actually a function.#2022-07-1914:37thhellerso in this case there isn't really more to this error it could show#2022-07-1914:41witek@U05224H0W Thank you. I figured this out. But this was not the point of my question here. I have the problem with the missing exception contents all the time. Every time I eval something in a buffer and it fails, I have no idea what it is, because I only see :repl/exception , as output after the eval. Which is completely useless. I would like to see the error instead. The exception itself. But this is only visible when I evaluate in the CIDER-REPL.#2022-07-1914:42witekSo I think this is a CIDER problem. Because it shows the error when evaluating in CIDER-REPL, but swollows it, when evaluating in a buffer.#2022-07-1914:45thhellersorry, don't know what CIDER-REPL is so can't comment on that front#2022-07-1914:46witekI mean the REPL that CIDER provides after connected. It probably is just the emacs buffer which allows interaction with the REPL.#2022-07-1914:56witek@U051BLM8F I tried to simplify the problem. I will try to explain:
When I evaluate (println "hello") in the buffer, I get ==> nil as output in the buffer. And I can see hello printed into the REPL (in emacs).
When I evaluate (throw (js/Error. "boom")) in the buffer, I get ==> :repl/error as output in the buffer. And NOTHING is printed into the REPL.
But when I evaluate (throw (js/Error. "boom")) in the REPL, then the error IS printed into the REPL.
So it seams a successful evaluation from a buffer "happens" in the REPL, while a failed evaluation does not.#2022-07-1919:02bozhidar@U2ERGD6UD Can you file a ticket about this?#2022-07-2111:58eplokoHey all, when I run cider-pprint-eval-last-sexp and the result is a huge map, the resulting buffer prints everything on a single line, which is really inconvenient and is hard to navigate through. Is it possible to change it so the result value is pretty printed somehow?#2022-07-2112:04eploko#2022-07-2113:33eplokoThis all happens in a shadow-cljs cljs REPL. Skimming through https://github.com/thheller/shadow-cljs/issues/716 it seems to be related, yet I can't figure out what exactly is broken in my setup...#2022-07-2113:35eplokoI'm running CIDER 1.5.0-snapshot (package: 1.5.0-snapshot), nREPL 0.9.0, shadow-cljs 2.17.4.#2022-07-2209:36FarisHi everyone, is anyone using Cider with a M1 Mac? Are you able to run the cider debugger?#2022-07-2210:31jmayaalvNo problem when running the debugger on a M1, using
openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing)
#2022-07-2210:47FarisThank you!#2022-07-2210:48jumar@U014JMH21NK what specific problem you have?
What kind of error are you getting?
I don't have M1 chip but maybe it's not related to the architecture?#2022-07-2210:55FarisI get a stack overflow error whenever I call the function. Though it seems to only happen when I make a http call via the browser
java.lang.StackOverflowError
at clojure.lang.AFn.applyToHelper(AFn.java:148)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$pr_str.invokeStatic(core.clj:4724)
at clojure.core$pr_str.doInvoke(core.clj:4724)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cider.nrepl.print_method$eval2092$fn__2093.invoke(print_method.clj:94)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr_on.invoke(core.clj:3656)
at clojure.core$print_prefix_map$fn__7352.invoke(core_print.clj:233)
at clojure.core$print_sequential.invokeStatic(core_print.clj:66)
at clojure.core$print_prefix_map.invokeStatic(core_print.clj:229)
at clojure.core$print_map.invokeStatic(core_print.clj:238)
at clojure.core$fn__7381.invokeStatic(core_print.clj:266)
at clojure.core$fn__7381.invoke(core_print.clj:263)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr_on.invoke(core.clj:3656)
at clojure.core$print_prefix_map$fn__7352.invoke(core_print.clj:233)
at clojure.core$print_sequential.invokeStatic(core_print.clj:66)
at clojure.core$print_prefix_map.invokeStatic(core_print.clj:229)
at clojure.core$print_map.invokeStatic(core_print.clj:238)
at clojure.core$fn__7381.invokeStatic(core_print.clj:266)
at clojure.core$fn__7381.invoke(core_print.clj:263)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr_on.invoke(core.clj:3656)
at clojure.core$print_prefix_map$fn__7352.invoke(core_print.clj:233)
at clojure.core$print_sequential.invokeStatic(core_print.clj:66)
at clojure.core$print_prefix_map.invokeStatic(core_print.clj:229)
at clojure.core$print_map.invokeStatic(core_print.clj:238)
at clojure.core$fn__7381.invokeStatic(core_print.clj:266)
at clojure.core$fn__7381.invoke(core_print.clj:263)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr.invokeStatic(core.clj:3665)
at clojure.core$pr.invoke(core.clj:3665)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$pr_str.invokeStatic(core.clj:4724)
at clojure.core$pr_str.doInvoke(core.clj:4724)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cider.nrepl.print_method$eval2092$fn__2093.invoke(print_method.clj:94)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr.invokeStatic(core.clj:3665)
at clojure.core$pr.invoke(core.clj:3665)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$pr_str.invokeStatic(core.clj:4724)
at clojure.core$pr_str.doInvoke(core.clj:4724)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cider.nrepl.print_method$eval2068$fn__2069.invoke(print_method.clj:39)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr_on.invoke(core.clj:3656)
at clojure.core$print_prefix_map$fn__7352.invoke(core_print.clj:233)
at clojure.core$print_sequential.invokeStatic(core_print.clj:66)
at clojure.core$print_prefix_map.invokeStatic(core_print.clj:229)
at clojure.core$print_map.invokeStatic(core_print.clj:238)
at clojure.core$fn__7381.invokeStatic(core_print.clj:266)
at clojure.core$fn__7381.invoke(core_print.clj:263)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at clojure.core$pr_on.invokeStatic(core.clj:3662)
at clojure.core$pr_on.invoke(core.clj:3656)
at clojure.core$print_prefix_map$fn__7352.invoke(core_print.clj:233)
#2022-07-2210:57Farisoh no, it happens when I invoke functions via the repl as well.#2022-07-2211:05FarisIf it helps , this is in my .lein/profiles.clj
{:user {:plugins [
[cider/cider-nrepl "0.28.3"]
[mx.cider/enrich-classpath "1.9.0"]]}}#2022-07-2211:27jumarWhy do you have cider-nrepl in profiles?
Afaik, that hasn't been necessary for a long time.
I'd also remove enrich-classpath just in case...#2022-07-2211:34FarisI see, so should I leave it empty? or just delete everything? I dont have anything else in profiles.clj#2022-07-2211:35jumarIt shouldn't matter - you can just keep it empty, or comment that stuff out with a comment.#2022-07-2211:44FarisI get this warning though, when I connect my repl on Emacs
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it
#2022-07-2213:31ennI think it's still required in your profile if you use cider-connect instead of cider-jack-in#2022-07-2214:46jumarOh, yeah, that might be the case - I don't use cider-connect at all.#2022-07-2510:05bozhidarTo my knowledge CIDER should work fine with M1, so I guess the problem is something else.#2022-07-2510:05bozhidarIs this a problem you can reproduce with any Clojure project?#2022-07-2816:18FarisSorry for the late reply, yes I can reproduce it in another Clojure project.
I works if I evaluate an expression via the Repl.
But it doesn’t work if I try to call a function by running the app in the browser.#2022-07-2717:38Jeongsoo Lee(Cross-posted from #clojure)
If I have a clojure project with compilation errors such as failing to macroexpand, and want to load it in an nREPL instance in CIDER, nREPL fails to start (of course!) with the message like:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Exception in thread "main" Syntax error macroexpanding at (chulsooboardv2/handler.clj:1:1).
In this case, I have to debug this project without a REPL, which is painful. Just like Emacs started with malformed init.el, I would like a rudimentary REPL instance running that can be used to inspect the issue. Is there a way to achieve this?#2022-07-2717:41dpsuttonI don’t remember the middleware loading code on your behalf during startup. Do you use any profiles when starting up? or have anything in user.clj that does anything wonky?#2022-07-2717:45Jeongsoo LeeI have fixed the issue itself just now: It was caused by an outdated symbol referring to a renamed namespace in an ns macro. The nREPL instance was started via M-x cider-jack-in-clj. I guess this triggers lein repl , which in turn triggers firing up an nREPL instance.#2022-07-2717:46dpsuttonah. well then running clojure didn’t tell you anything interesting#2022-07-2717:46dpsuttondoes your project.clj have some startup namespace in its config?#2022-07-2717:47Jeongsoo LeeOops, although it does not contain any startup namespaces, the dev profile was declared as:
:project/dev {:jvm-opts ["-Dconf=dev-config.edn"]
:dependencies [[org.clojure/tools.namespace "1.2.0"]
[pjstadig/humane-test-output "0.11.0"]
[prone "2021-04-23"]
[ring/ring-devel "1.9.5"]
[ring/ring-mock "0.4.0"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.24.1"]
[jonase/eastwood "0.3.5"]
[cider/cider-nrepl "0.28.4"]]
:source-paths ["env/dev/clj"]
:resource-paths ["env/dev/resources"]
:repl-options {:init-ns user
:timeout 120000}
:injections [(require 'pjstadig.humane-test-output)
(pjstadig.humane-test-output/activate!)]}#2022-07-2717:48Jeongsoo LeeIt strongly seems like :repl-options {:init-ns user
:timeout 120000}
is the culprit. Oh no!#2022-07-2717:48dpsuttonyeah so you add “env/dev/clj” to the classpath which presumably contains a user.clj file and that blows up#2022-07-2717:48Jeongsoo Leeexactly!@#2022-07-2717:49dpsuttonsetting an init-ns to user doesn’t do anything since that’s the default. I think just having a user.clj on the classpath is what is killing you#2022-07-2717:53Jeongsoo LeeAh, I think I get it. at {classpath}/env/dev/clj/user.clj, the ns macro at the top requires the core.clj of my entire application, and requiring that core.clj triggered an require chain down the dependency tree which finally triggered loading the file with the problematic namespace.#2022-07-2717:54vemvbtw, that Eastwood is far behind 1.2.4 , you might want to check out what it finds now#2022-07-2717:55Jeongsoo Lee@U45T93RA6 Ooh, thanks. This project.clj is actually straight from creating a new app with Luminus framework.#2022-07-2718:05vemvMuch useful! I created https://github.com/luminus-framework/luminus-template/pull/566 accordingly :)#2022-08-0104:38jumarIs there a way with cider/clojure-mode to quickly copy the ns name?
Often, what I want is, for a specific function under cursor, produce a fully qualified name, like my.ns/my-function.
At least being able to quickly copy the ns name and function name would be nice.
Or ideally copy the fully qualified var symbol name in one go.#2022-08-0104:48bozhidar@jumar There's nothing like this right now, but it should be easy to build it using the output from cider-var-info. For the buffer's ns there's clojure-find-ns.#2022-08-0109:10Martynas MaciulevičiusHey. How can I do formatting on save? I use formatting using = (in evil mode) but I've set up nvim and there they format on save by default which is pretty alright. So how do I do that?
Also is it possible to use a different formatting backend? I couldn't find this option in docs :thinking_face:#2022-08-0109:13roltthere is a before-save-hook in emacs you could use#2022-08-0109:18Martynas MaciulevičiusYes but then I need to find out whether it's Clojure file. Does it also save the file? I found that with current ~undo-history~ files my file saving takes quite a bit of time already. I would like that the formatting would not save the file and would happen before it :thinking_face:#2022-08-0109:18tomd(defun cider-format-buffer-back ()
(save-excursion
(cider-format-buffer)))
(defun add-cider-format-before-save ()
(add-hook 'before-save-hook 'cider-format-buffer-back t t))
(add-hook 'clojure-mode-hook 'add-cider-format-before-save)
something like this makes sure the hook is only added locally to clojure buffers#2022-08-0109:20tomdThe formatting does not "save the file" - it is done to the buffer before your save command writes the buffer to disk.#2022-08-0111:53bozhidarAre you talking about cljfmt or in general. In case of cljfmt - https://docs.cider.mx/cider/usage/misc_features.html#formatting-code-with-cljfmt#2022-08-0111:53bozhidarThis case was already covered by @UE1N3HAJH as well.#2022-08-0111:55Martynas MaciulevičiusI have created for myself nvim config where they format code using LSP server on each file save.
So I wanted to mirror the workflow and compare. Previously I was using = to format but = is broken on nvim and it's also not a good idea to spam around = for formatting.
So formatting on save looks kind-of sensible.
So I also try to find out which tool is more configurable.
Also I don't know why but nvim navigation (just basic jumping around) in clojure files (even ones with 2k LOC) seems incredibly fast (even at this moment I have a test file which has 1134lines... wow) (probably it's because in Emacs evil mode is interpreted on higher layer; weird feeling).#2022-08-0112:17tomd@U028ART884X if you notice specific performance issues which are easy to replicate, please don't hesitate to drop an issue on evil's github page. Some things like recursive macros and ex commands are already known, but new issues remind me what things annoy users the most 🙏#2022-08-0112:44Martynas MaciulevičiusI can name several from the top of my head even now (mostly not related to CIDER).
For me the most annoying thing is that when I use layout saving (in spacemacs you can find it at <SPC>l or layouts-transient-state) it takes forever to load. I think it unzips some kind of undo-history files and loads all buffers that I had which is a lot. So when I start emacs it's fast but then I click to load my previous layout and it locks the editor for about 30s or something. CIDER is not related to this one.
But on nvim I don't have workspace reload option. So I can't compare it.
Also one more thing is the ~undo-tree files which prevent me from using regular good old grep from command line.
CIDER-specific ones are (or somehow directly related):
Formatting large output in the bottom modeline buffer and displaying it twice - in the buffer itself (near the line) and in the buttom modeline buffer too. So the formatting is also probably done twice. So if I eval a list that has 1000 integers it takes 200ms+ to display it but at least it doesn't lock up the editor and that's what's important.
Huge REPL outputs are slow. If I start my server and it produces several hundred lines of output I deliberately close the REPL buffer because it's very slow to render it. I think it can sometimes unrecoverably lock up the editor so I learned to avoid large outputs there or in the bottom minibuffer. I think that over time this improved quite a bit, I think I've had not that many editor lockups for past 1-2 years.
I remember that I had some kind of bash command to kill Emacs running process without killing the whole of it. I don't remember what it was (there is no Ctrl-g when main thread locks up).
And if you accidentally produce about 10k LOC of output while REPL is open your editor can lock up for quite some time or even for good.
I don't know if these are fixable. I didn't report them because I know that these must be incredibly hard to fix.
But the double buffer display one could be fixed by having a variable that says "display either in here or in here". Only one variable and not two variables so that there would be only one place to display it.#2022-08-0113:00Martynas MaciulevičiusWhat throws me off a bit is that when I reevaluate my expression and send it into the result buffer it doesn't blink anymore. It's a performance fix but actually it decreased my usability because I don't know when it finally reevaluated the form. Yes, I tend to reevaluate the same form over and over (e.g. if I insert/delete something from DB).
So that little blink was actually useful for me because evaluation takes time and much of the times it's not immediate.
And without the blink I tend to wait and not know if it worked at all. Maybe my command was bad.
So IMO if you fixed performance there then I would like to have some kind of indication that the newest evaluation succeeded.
Also I like that result more than cider-inspect one because it's basic and displays only what I want.
(and it can lock up the editor if there is a lot of output there but I prefer it over cider-inspect because it's as basic as I expect it to be; also I can browse it and walk inside using evil mode keys)
Also instead of the rendering into the fixed buffer why not allow to render into the floating one as you render exceptions? Could be a config option :thinking_face:
But then you won't be able to view the code and the output side-by-side and it doesn't really work that well.
But it would work for copying.
Oh right. I like the test result buffer very much. But I can't use evil mode there. But the buffer works.
From CIDER I mostly use cider-result and test-result. Conjure doesn't have test-result#2022-08-0113:15tomd> I remember that I had some kind of bash command to kill Emacs running process without killing the whole of it.
probably pkill -usr2 emacs or similar#2022-08-0113:17Martynas MaciulevičiusI don't remember what command it was. I don't want to boot up my old laptop.
I remember that if I kill it then something may not be usable (for instance treemacs wouldn't work anymore). So that's not a good thing to do. But restarting a REPL is also not a good thing. 😕#2022-08-0113:17tomdMost of the above are more cider/emacs related actually (which is fitting for this channel 😄 ) - I'll have a more thorough read at some point and make evil issues out of anything worth taking a look at for evil. Lots of good stuff there - thanks for taking the time to type it all out!#2022-08-0113:21tomdWhat version of emacs are you using @U028ART884X? I realise some professional environments force use of older versions, but if possible I would recommend upgrading to the latest version you feel comfortable using. Undo/redo is now properly implemented (undo tree is no longer necessary), native-compilation speeds up lots of things a bit, and files with long lines no longer slow down emacs so much (on very recent versions). Worth taking a look if you can.#2022-08-0113:23Martynas MaciulevičiusCurrently
GNU Emacs 28.1
Spacemacs develop branch 2e897fcc8
It's possible that the branch has already advanced. I have to git pull manually.#2022-08-0113:23Martynas MaciulevičiusI can generate the spacemacs issue debug info for you if you want. It's very descriptive.#2022-08-0113:24tomdAh you should have most of the above in emacs 28 afair#2022-08-0113:24Martynas MaciulevičiusI'll paste it here.
#### System Info :computer:
- OS: gnu/linux
- Emacs: 28.1
- Spacemacs: 0.999.0
- Spacemacs branch: develop (rev. 2e897fcc8)
- Graphic display: t
- Running in daemon: nil
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
elisp
(windows-scripts asciidoc yaml
(python :variables python-test-runner 'pytest)
javascript
(typescript :variables typescript-backend 'lsp typescript-linter 'eslint typescript-fmt-on-save t)
html yaml
(go :variables go-use-golangci-lint t go-format-before-save t gofmt-command "goimports" go-tab-width 2)
(lsp :variables lsp-ui-doc-enable nil lsp-ui-sideline-enable t lsp-ui-sideline-show-code-actions t lsp-headerline-breadcrumb-enable nil)
(clojure :variables clojure-enable-clj-refactor t clojure-backend 'cider clojure-enable-linters nil clojure-pprint-fn 'fipp)
react
(java :variables java-backend 'lsp lsp-java-vmargs
'("java.format.settings.url" : "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml"))
(auto-completion :variables auto-completion-enable-help-tooltip nil)
(plantuml :variables plantuml-jar-path "~/bin/plantuml.jar")
emacs-lisp helm lsp
(syntax-checking :variables syntax-checking-enable-tooltips nil)
treemacs sql
(spacemacs-evil :variables spacemacs-evil-collection-allowed-list
'(cider-inspector-mode))
(dotspacemacs-additional-packages 'nil dotspacemacs-frozen-packages 'nil dotspacemacs-excluded-packages
'(evil-search-highlight-persist)
dotspacemacs-install-packages 'used-only))
- System configuration features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
#2022-08-0113:33Martynas MaciulevičiusI think that things are improving over time and stability is slowly improving. Maybe it's Emacs 28, maybe it's something else. I'm not sure. That's the thing with these tools. They change all the time.#2022-08-0116:38apt(I haven’t read the full thread, sorry if I missed anything)
If you don’t mind using LSP for formatting, I have this (uses eglot, will need small tweaks for lsp-mode):
(defun apt-eglot-format-if-clojure
(&rest _)
(when (and buffer-file-name
(derived-mode-p 'clojure-mode)
(bound-and-true-p eglot-managed-mode-hook)
(bound-and-true-p inf-clojure-minor-mode)
(buffer-modified-p))
(eglot-format)))
and there’s how you would use it:
(dolist (command '(other-window
other-frame))
;; TODO: might timeout and make Emacs lag
(advice-add command :before #'apt-eglot-format-if-clojure))
Using LSP makes sense for my case because that’s what the CI will do for running the linter tasks.#2022-08-0116:39aptHowever, as the TO-DO says, it might cause some performance issues if the server takes too long to respond. So I stopped using it.#2022-08-0116:55rolti had the undo-tree thing happen after an update. you can disable the history file or set a different folder (i disabled it, i don't really care about undos after an emacs restart).
For the repl output being slow, i thing something improved last year, some modes now stop working when the blob of text is too large. But yeah I do feel like there is room for improvement here
the other points i can't comment i don't think i've encountered it (and i don't use evil mode)
undo-tree fix: https://www.reddit.com/r/emacs/comments/tejte0/undotree_bug_undotree_files_scattering_everywhere/#2022-08-0210:17jumarI'm not sure what happened but cider-pprint-* commands no longer work for me.
They simply print everything on the same line - the same result when I pprint in a comment or in a separate buffer.
(cider--version)
"1.5.0-snapshot (package: 20220628.551)"
I use spacemacs if it matters.#2022-08-0210:19jumarjust updated cider package but still the same:
Version: 20220731.522
#2022-08-0210:27jumarAnother minor problem with pprint functions printing to a comment I noticed a long time ago:
unlike cider-eval-defun-to-comment, cider-pprint-eval-defun-to-comment will consume the next line;
that means it should be an empty line, because otherwise it simply prepends the evaluation result to the stuff on the next line
which means it's commented out.
Example:
This
(comment
(map inc (range 10))
.)
is Ok with cider-eval-defun-to-comment
(comment
(map inc (range 10))
;; => (1 2 3 4 5 6 7 8 9 10)
.)
but is not with cider-pprint-eval-defun-to-comment
(comment
(map inc (range 10))
;; => (1 2 3 4 5 6 7 8 9 10).)
#2022-08-0211:42bozhidarI can't think of any recent changes that would have affected them.#2022-08-0216:21jumarPprinting in general definitely worked for me not that long ago.
The odd behavior of Pprint to the comment may have been there for a very long time#2022-08-0310:43bozhidarAh, I missed this part. Might be best to file a ticket then. Admittedly I've never used this functionality much myself.#2022-08-0310:02CarloWhat's the suggested way of asking cider to jack-in with Java 17 instead of Java 11?#2022-08-0310:14Martynas MaciulevičiusHaving java 17 in your path. So PATH=...:path/to/java_17_executable emacs
Or you could set it system-wide
But probably you could edit this env var from emacs (somehow) and then set it before you run your jack in
But well... these options are not great. Probably I miss something.#2022-08-0310:25jkxyzI use direnv and emacs-direnv to set JAVA_HOME or PATH. You can also launch the REPL in your shell, or a Docker container or whatever, and use cider-connect #2022-08-0310:29jumarit's best to use a "manager" for this like jenv or sdkman.#2022-08-0310:32jkxyzIndeed it's probably best to use a version manager in your shell and then use cider-connect instead of cider-jack-in #2022-08-0310:45bozhidarHa, just noticed we've got exactly 1,888 people in the channel. Must be a good omen, right? cider#2022-08-0316:49Michaël SalihiNot a cider but it may be an opportunity to toast ! 😁#2022-08-0516:01Drew VerleeHow would i tell cider to run some clojure code everytime cider-jack-in completed. i'm looking at cider-repl-init-code but i can't be sure#2022-08-0617:32bozhidarDoes this work https://docs.cider.mx/cider/config/basic_config.html#nrepl-connection-hooks ?#2022-08-0819:33richiardiandreaclojure code could go into user.clj as well, depending on the use case#2022-08-0820:02Drew VerleeI think those both might be options. Thanks a lot for the help. I'll probably circle back to this as it's a convince measure for me and i'm not sure where to fit it in 🙂#2022-08-1107:42Martynas MaciulevičiusHey.
The docs of cider-nrepl say that test is deprecated: https://github.com/clojure-emacs/cider-nrepl/blob/389cc1bf126134f941030a1c8343c1384f19eeb5/src/cider/nrepl.clj#L452.
What is it replaced with? Could docs say which function should be used instead?
Also I'm digging into CIDER source code and it's hard to understand what are the inputs and what are the actual API calls that are intended.
Any examples?
Also CIDER seems to use the deprecated test function: https://github.com/clojure-emacs/cider/blob/dd4c555fd88834581306ac54f1aaefe2b0efec99/cider-test.el#L663
I want to test the current namespace from REPL and get results (I expect to add it as Leiningen dependency and simply execute the test somehow).#2022-08-1108:13Martynas MaciulevičiusI tried this but it didn't work:
((cider.nrepl/wrap-test :hi)
{:op "test-all"
:session :hi
:namespace *ns*})#2022-08-1111:40dpsuttonI'd suggest the easiest way to get the exact message is to start a sample project, turn on nrepl logging, and see what message it sends for test all#2022-08-1112:51Martynas MaciulevičiusNice. I didn't know it was a thing.
But now there is a problem because CIDER uses "test" which is marked in code as deprecated:
(-->
id "88"
op "test"
session "dca8aa06-8163-49af-be06-0d0e0b9ad605"
time-stamp "2022-08-11 15:47:00.045844547"
load? "true"
ns #("_-test" 0 42 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
tests ("_-test")
)
And I somehow need to understand how to make a session.#2022-08-1114:36Martynas MaciulevičiusI managed to see the log and describe the session of my other nREPL connection but it gives me this short list of operations:
add-middleware,load-file,swap-middleware,ls-middleware,close,sideloader-provide,stdin,sideloader-start,lookup,clone,ls-sessions,completions,eval,describe,interrupt
And in CIDER it gives me very many more. It also gives the version of the nREPL plugin. Any ideas what could it be? Maybe it's somehow the type of the connection?
They reply with this list for me: https://github.com/clojure-emacs/cider-nrepl/blob/a8fd4f929844c42f3c4700dcc95a719c2d645e72/maint/cider/nrepl/impl/docs.clj#L44#2022-08-1114:40dpsuttoncider has more middleware. Did you add the cider-nrepl to your nrepl session?#2022-08-1114:41dpsuttonI think reading the docs would be very helpful if you haven’t#2022-08-1114:41dpsuttonhttps://docs.cider.mx/cider-nrepl/usage.html#via-embedding-nrepl-in-your-application#2022-08-1114:42Martynas MaciulevičiusI'm trying to run Conjure and I want to find out how it connects to REPL. And it doesn't have some functionality so I think how to make it work. I haven't touched any docs. I'll try them.#2022-08-1114:50Martynas MaciulevičiusThanks for the doc.
I managed to run add-middleware from here: https://github.com/clojure-emacs/cider/blob/dd4c555fd88834581306ac54f1aaefe2b0efec99/cider-eval.el#L347
So I have to add them by hand upon start :thinking_face:
This one is what I wanted to add: https://github.com/clojure-emacs/cider/blob/dd4c555fd88834581306ac54f1aaefe2b0efec99/cider-eval.el#L332#2022-08-1203:16eplokoHey all, does anyone have a clue why eval results sometimes fail to be pretty-printed?
relm.main.dev> (meta #'int)
;; => {:ns cljs.core,
:name int,
:file "cljs/core.cljs",
:end-column 10,
:column 1,
:line 2835,
:end-line 2835,
:arglists ([x]),
:doc "Coerce to int by stripping decimal places.",
:test nil}
relm.main.dev> (system/instance)
;; => {:server {:opts {:resources-path "resources", :port 50000}, :instance #object[Server [object Object]], :endpoint-urls {:api "", :resources "", :ws ""}, :ws-server #object[cljs.core.Atom {:val {:clients {}}}]}}
relm.main.dev> #2022-08-1203:17eplokoThe meta output prints fine. But the second one does not.#2022-08-1318:54pppaulthe pprinter may not know how to print #objects#2022-08-1318:55pppauli get pretty ugly printing when debugging stuff from yada (ctx is a special type)#2022-08-1413:43eplokoIt was my original guess. In a repl, cljs.pprint/pprint can format the same object with no issues, though. It's only the eval results and the results in cider-pprint-eval-last-sexp buffer that are not formatted.#2022-08-1205:15tatutthere’s some interaction with cider showing the docs of a function in the echo area and lsp showing an error… for example typing (format in a source file, I expect to see the function args but it is immediately replaced with an invalid arity message…#2022-08-1205:26tatutor rather, flycheck#2022-08-1208:39BenjaminYea if 2 things call 'message' you only see the last in the echo area.#2022-08-1208:46Benjaminpersonally, I like flycheck disabled by default and enable as desired. An instance of the theme "slow and deliberate"#2022-08-1208:47tatutall the checks are fast enough that I like them to be “live” all the time#2022-08-1208:47tatutbut this one instance is an unfortunate case of 2 messages competing for the echo area#2022-08-1208:47Benjaminthere are alternative displays for flycheck. Little popup window for example#2022-08-1208:51Benjaminhttps://github.com/flycheck/flycheck-popup-tip here is one.
You can set flycheck-display-errors-function#2022-08-1208:52tatutgreat, thanks#2022-08-1208:52tatutthat looks like a good solution#2022-08-1208:53BenjaminI just checked doom and seems like it has a choice between flycheck-popup-tip and flycheck-posframe#2022-08-1208:53Benjaminbut yea :thumbsup:#2022-08-1211:59ericdalloI suggest you disable cider or LSP eldoc integration: https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/#hover#2022-08-1505:31tatuthmm… I set both cider-eldoc-display-for-symbol-at-point and lsp-eldoc-enable-hover to nil, I am still getting the hovers from somewhere… they are coming from eldoc, since disabling eldoc mode removes them.#2022-08-1512:26ericdalloWeird, I only know those 2 packages that changes eldoc#2022-08-1604:43tatutI’ll try to put some advice in eldoc to see if I can figure out what is causing it#2022-08-1216:42Drew VerleeMy goal is to have cider help reload my stuart's components via reload.repl so i believe i either want to do this:
(cider-refresh-before-fn . "reloaded.repl/suspend")
(cider-refresh-after-fn . "reloaded.repl/resume")
or this
(cider-refresh-after-fn . "reloaded.repl/restart")
But when i do either, i get a stacktrack i can't figure out the root of (see thread for S0)
I understand the issue is that something is trying to read "#db/id" and it doesn't know how, but what? cider nrepl? Do i need to tell it about the readers somewhere?#2022-08-1216:44Drew VerleeSO
1. Unhandled clojure.lang.ExceptionInfo
No reader function for tag db/id.
{:type :reader-exception, :ex-kind :reader-error}
errors.clj: 34 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/throw-ex
errors.clj: 24 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/throw-ex
RestFn.java: 442 clojure.lang.RestFn/invoke
errors.clj: 40 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/reader-error
errors.clj: 36 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/reader-error
RestFn.java: 460 clojure.lang.RestFn/invoke
errors.clj: 205 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/throw-unknown-reader-tag
errors.clj: 204 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader.impl.errors/throw-unknown-reader-tag
reader.clj: 869 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-tagged
reader.clj: 856 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-tagged
reader.clj: 71 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-dispatch
reader.clj: 66 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-dispatch
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 196 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 189 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 241 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-map
reader.clj: 237 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-map
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 196 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 189 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 225 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-vector
reader.clj: 221 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-vector
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 196 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 189 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 207 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 203 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 196 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 189 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 207 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 203 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 196 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 189 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-delimited
reader.clj: 207 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 203 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read-list
reader.clj: 933 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 915 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read*
reader.clj: 986 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read
reader.clj: 959 cider.nrepl.inlined-deps.toolsreader.v1v3v6.clojure.tools.reader/read
parse.cljc: 52 cider.nrepl.inlined_deps.toolsnamespace.v1v3v0.clojure.tools.namespace.parse$read_ns_decl/invokeStatic
parse.cljc: 36 cider.nrepl.inlined_deps.toolsnamespace.v1v3v0.clojure.tools.namespace.parse$read_ns_decl/invoke
file.clj: 23 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/read-file-ns-decl
file.clj: 15 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/read-file-ns-decl
file.clj: 61 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/files-and-deps/fn
protocols.clj: 168 clojure.core.protocols/fn
protocols.clj: 124 clojure.core.protocols/fn
protocols.clj: 19 clojure.core.protocols/fn/G
protocols.clj: 31 clojure.core.protocols/seq-reduce
protocols.clj: 75 clojure.core.protocols/fn
protocols.clj: 75 clojure.core.protocols/fn
protocols.clj: 13 clojure.core.protocols/fn/G
core.clj: 6886 clojure.core/reduce
core.clj: 6868 clojure.core/reduce
file.clj: 60 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/files-and-deps
file.clj: 59 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/files-and-deps
file.clj: 79 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/add-files
file.clj: 72 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.file/add-files
dir.clj: 39 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/update-files
dir.clj: 33 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/update-files
dir.clj: 65 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/scan-files
dir.clj: 42 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/scan-files
dir.clj: 89 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/scan-dirs
dir.clj: 68 cider.nrepl.inlined-deps.toolsnamespace.v1v3v0.clojure.tools.namespace.dir/scan-dirs
refresh.clj: 167 cider.nrepl.middleware.refresh/refresh-reply/fn/fn
refresh.clj: 161 cider.nrepl.middleware.refresh/refresh-reply/fn
AFn.java: 22 clojure.lang.AFn/run
session.clj: 218 nrepl.middleware.session/session-exec/main-loop/fn
session.clj: 217 nrepl.middleware.session/session-exec/main-loop
AFn.java: 22 clojure.lang.AFn/run
Thread.java: 833 java.lang.Thread/run#2022-08-1216:48Drew Verleereloaded.repl/restart works as expected if i just call it without trying to attach it to cider-refresh-after-fn.
Which i assume i trigger from the function cider-ns-refresh . Maybe i should just setup a shortcut to call reloaded.repl/restart directly? it's not clear to me how these things overlap 😕 .#2022-08-1216:48Drew Verleebut it's also likely the reader error should get fixed regardless, just can't figure out where it is coming from.#2022-08-1216:53vemvDo reloaded.repl/restart and friends work for you in a vanilla repl? (preferrably try this without cider in it)
check if your System gets reset, picks up code changes, etc
Then I can eye things again 👀#2022-08-1216:54vemvbtw I don't know what reloaded.repl is - I normally use https://github.com/stuartsierra/component.repl#2022-08-1216:57Drew Verleehttps://github.com/weavejester/reloaded.repl/reset* (typo above) does work fine if i call it from emacs cider-eval.#2022-08-1216:57Drew Verleeill try it without cider#2022-08-1217:00Drew Verleeseems to work fine.#2022-08-1217:01vemvHave you set refresh-dirs ? You should (100% of the times) so that (refresh) won't load extraneous code
set it to "src" "test" , or more dirs if you have them
Include tools.namespace as a vanilla dependency in your project, and invoke clojure.tools.namespace.repl/set-refresh-dirs in user.clj. CIDER will pick up this when performing cider-refresh#2022-08-1217:06Drew VerleeI don't see a refresh-dirs var to set. Is it https://github.com/clojure-emacs/cider-nrepl/blob/4d79be8a3769f5b1959eebb5538ddb8242ac8bed/src/cider/nrepl/middleware/refresh.clj#L25?#2022-08-1217:09vemvinvoke (clojure.tools.namespace.repl/set-refresh-dirs "src" "test" "<any other source dir>") yes#2022-08-1217:10vemv(and reset jvm/cider)#2022-08-1217:48Drew Verleecalling clojure.toolsnamespace.repl/set-refresh-dirs followed by refresh doesn't throw, but calling cider-ns-refresh does. Do i need to tell cider about the refresh-dirs?#2022-08-1217:49vemvno, the discovery is automatic
is the error the same as before?
also, what cider-nrepl version are you using?#2022-08-1217:50Drew Verleecider version prints CIDER 1.5.0-snapshot (package: 20220731.522)#2022-08-1217:52Drew Verleesame error.
i should probably make a small project to play around with.#2022-08-1217:53vemvyes, good idea to get the hang of it :)
anyway that #db/id should come from somewhere - are you sure it's not anywhere in your project dir?#2022-08-1217:54vemvmaybe it's somewhere contrived (use vanilla grep which doesn't ignore anything. Also watch out for Lein checkouts or other symlinks)#2022-08-1217:58Drew Verlee#db/id does appear in my src directory in a (comment ...) though i think the reader doesn't care about that. I'm probably unsure of a couple things. Why would that character throw an error when doing refresh? I assume because something is trying to read it, and it can't. But why would that happen with cider-ns-refresh and not when i required the ns?#2022-08-1218:06vemvMaybe there's a subtle bug in how cider-refresh wraps tools.namespace.repl/refresh (which does the actual heavy work of reading a file and loading it into the clojure runtime)
Still, you shouldn't have invalid data readers in a comment. The reader doesn't know what a comment is - it runs in an earlier phase.
In a correct codebase, data readers are defined early (e.g. in resources/), if you don't define them you cannot use them#2022-08-1218:09vemv#2022-08-1218:09vemvthis also happens in vanilla tools.namespace so there's no bug in cider
(as I hint, I believe there's no bug at all)#2022-08-1501:20Drew VerleeHow would i eval clojure code in the context of a specific nrepl (the one started from the project), from a cider/elisp function? I was thinking `hmm, any chance you know how to have cider eval some clojure code in the repl it just started? the only thing i see is
(cider-read-and-eval "(println 'hi')")
To add some context, i want to either start my http server with a emacs short cut or just have it turned on by default when i start a repl from the project.#2022-08-1504:55vemvI would use nrepl-sync-request:eval or nrepl-request:eval
> To add some context, i want to either start my http server with a emacs short cut or just have it turned on by default when i start a repl from the project.
I think the idiomatic thing would be to have a shortcut to Component-/Integrant- (reset) your system. That way you use the same shortcut at repl startup and later on#2022-08-1510:27djm(cider-insert-in-repl "(println 'hi')" t) ?#2022-08-1513:07Harri KiiskinenI'm trying to get the following to work: I'm on Emacs Windows, the code is on a Linux box, and I open it using Tramp. I'm trying to cider-jack-in-clj but first the call fails with error in process sentinel: Could not start nREPL server: /bin/sh: 2: powershell: not found. The command used is clojure-cli . According to docs (https://docs.cider.mx/cider/basics/up_and_running.html#working-with-remote-hosts), CIDER should handle remote files transparently, but in this case this is not true. This I can override by manually setting cider-clojure-cli-command to clojure .
But the process still fails: the ssh tunnel to access the remote nrepl is not created correctly. CIDER calls this to set up the tunnel: start /b cmd /c "\Program Files\Emacs\x86_64\libexec\emacs\27.2\x86_64-w64-mingw32\cmdproxy.exe" -c "c:/Windows/System32/OpenSSH/ssh.exe -v -N -L 35627:localhost:35627 'my.server.name'" . This gives the error "'\Program' is not recognized as an internal or external command, operable program or batch file." If I remove the whole start /b cmd /c from the beginning, and just call cmdproxy on command line, there is no problem; except that the host name should not be surrounded by single quotes.
By setting up the tunnel manually, everything seems to work out fine, so there's something wrong with how the tunnel is set up.
I don't know much about Windows (I'd rather work with Linux, but you work with the tools your given.) so I don't know what is the correct way the construct this tunnel, but this does seem a bit complicated.
Is there something in the CIDER configuration that I could set to fix this?#2022-08-1513:52Harri KiiskinenThe single quotes are added in the function nrepl--ssh-tunnel-command . I wonder if these are really necessary? When removing from this, a tunnel can be started with start-process-shell-command as is done in nrepl--ssh-tunnel-connect .#2022-08-1519:29Brian Marco#2022-08-1603:11vemvAre you able to obtain the whole stracktrace?#2022-08-1613:00Brian Marco#2022-08-1613:02Brian MarcoI am getting this error on all my projects, but I am running it in this case my deps.edn looks like
{:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
:paths ["src" "resources"]
}#2022-08-1613:07vemvare you on linux? see https://docs.cider.mx/cider/about/compatibility.html#java#2022-08-1613:08Brian MarcoI am on linux. I am running PopOS, but using guix as my package manager#2022-08-1613:09vemvyeah you'll need to install a full jdk
you can find the command for guix in the link#2022-08-1613:09Brian Marcothanks#2022-08-1613:15Brian MarcoThat was exactly it! Thanks I just needed to add the :jdk to my manifest#2022-08-1616:12solfDoes CIDER provide js autocompletion with clj-suitable and shadow-cljs?
The README says no: https://github.com/clojure-emacs/clj-suitable#emacs-cider
But the issue referenced seems closed/fixed
*Edit*: After poking everywhere in the stack (cider, cider.piggyback, suitable.js_introspection, …) it’s now working. But I haven’t actually changed anything so I’m a bit worried it just randomly started working.
I see js_introspection being loaded when I try to auto-complete
shadow-cljs: load JS cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs
I which I think I didn’t see before#2022-08-1618:00solfOh, after reloading the page, completion doesn’t work#2022-08-1618:00solfand the message doesn’t appear anymore in the console#2022-08-1618:01solfthat seems like an easier problem to solve#2022-08-1618:03solfNow I can’t find how to show that shadow-cljs: load JS ... message again#2022-08-1618:04solfBut if I manually eval the functions inside cider.nrepl.inlined-deps.suitable.v0v4v1.suitable.js-introspection completion works on emacs#2022-08-1618:12chrisetheridge@U7S5E44DB do you use clojure-lsp or solely CIDER?#2022-08-1618:14solfonly cider#2022-08-1618:15chrisetheridgeah okay. i'm trying to get this to work myself too, but i use lsp. going to try the eval trick you did#2022-08-1618:20solfLoading the file via normal means doesn’t work, but I don’t know enough about load-file to know if that’s expected:
(cljs.core/load-file "/Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs")
FileNotFoundException: /Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs (No such file or directory)
#2022-08-1618:26vemv"/Users/solf/.m2/repository/cider/cider-nrepl/0.28.5/cider-nrepl-0.28.5.jar:cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs"
is not a file (note the jar: bit)
if you find a trick feel free to mention it in the issue you linked.
Other than that most things related to suitable and shadow-cljs are not quite maintained 😞 someone who actively uses those would ideally step up#2022-08-1618:27vemv(I contributed some things to Suitable, but I just don't use cljs at work so it's harder for me to maintain a motivation)#2022-08-1618:29solfI noticed it’s in a jar, but then it’s a mistery how shadow-cljs managed to load it at some point ❓
shadow-cljs: load JS cider/nrepl/inlined_deps/suitable/v0v4v1/suitable/js_introspection.cljs
#2022-08-1618:29vemvprobably because it's a resource#2022-08-1618:30solfYeah, I’m probably missing some basic information about how shadow / cljs work 🙃#2022-08-1618:31solfIt’s so close to working though!#2022-08-1618:31solfI just need to find how that file is supposed to be loaded#2022-08-1618:34vemvif you get stuck feel free to create an issue in suitable and cc/ the Shadow author (`@thheller`)
i.e. if you solve this, just mention it in https://github.com/clojure-emacs/clj-suitable/issues/15; if you don't, create a new issue#2022-08-1621:28Brian MarcoI am trying to use
((clojure-mode . ((cider-clojure-cli-aliases . "-A:dev"))))
in .dir-locals.el to inject an alias for cider-jack-in. it doesn't work, but there is no error either#2022-08-1702:37Drew VerleeThat looks right to me. Try restarting emacs to make sure it has taken effect. In spacemacs i can do SPC o R to rever the buffer and that seems to work (though it might have some cases where it doesn't).#2022-08-1702:38Drew Verleeerr maybe you dont need the first "." with clojure-mode?#2022-08-1702:38Drew Verlee((nil . ((cider-clojure-cli-aliases . "-A:dev"))))
nil just means "match any mode" so if you only use it for clojure it will behave the same#2022-08-1702:39Drew Verleethis website is helpful, your dir-locals.el looks fine based on the examples and what i use as well... https://practical.li/spacemacs/clojure-projects/project-configuration.html#2022-08-1716:16Brian MarcoIt actually did work after restarting emacs. I didn't realize .dir-locals.el wasn't reread every time i reran cider-jack-in. I had been restarting emacs so many times I just sort of assumed I had tried that already.#2022-08-1716:16Brian Marcowhat does the . do in elisp btw?#2022-08-1716:44Drew Verleehttps://www.gnu.org/software/emacs/manual/html_node/elisp/Dotted-Pair-Notation.html#2022-08-1716:46Drew VerleeI'm not sure why the list syntax isn't used#2022-08-1621:28Brian MarcoI very much don't know any elisp so apologies#2022-08-1712:20agigaoHello folks, does Cider support suggesting libraries/namespaces for specific function that isn't under :require yet but we're trying use anyway? For example writing pprint in the namespace and Cider suggesting that I can import it from clojure.pprint?#2022-08-1712:27vemvyes, clj-refactor has a few related features
magic-requires, add-libspec, cljr-slash#2022-08-1713:04agigaoThanks!#2022-08-1714:58Alex Miller (Clojure team)https://ask.clojure.org/index.php/12117/with-emacs-cider-what-the-way-have-local-javadocs-available#2022-08-1715:07vemvanswering#2022-08-1815:30Chris O’DonnellDoes anyone know of a good way to wrap the lein command that cider uses to jack in with sops? I tried setting cider-lein-command to sops exec-env env-file ‘lein and finishing the quote in cider-lein-parameters, but cider checks that the lein command is an executable, rejecting that.#2022-08-1815:43Chris O’DonnellOh maybe I could write a wrapper script and set that as the lein command#2022-08-1815:47bozhidarI think that's the simplest way to do it.#2022-08-1815:48bozhidarA better long-term solution would be to make CIDER a bit smarter about the command - it can check if it has multiple words in it, split it and check for the presence only of the first part of the command.#2022-08-1815:48bozhidarI wonder why I haven't done this already - probably I was just lazy. 😄#2022-08-1815:56dpsuttonI find these situations almost always easier to just cider-connect. Do whatever you need in the terminal. You can copy the command from a cider-jack-in (it’s in the messages buffer and also at the top of the repl banner). At one point i started making a way for CIDER to copy the startup command easily for you without starting up a repl. I think that would still have a lot of value#2022-08-1816:19bozhidarYeah, that'd be useful indeed.#2022-08-1922:26TreyI’m having trouble cider-inspect ing with a shadow cljs app. I’ve narrowed the problem to cider-nrepl-send-sync-request returning the evaluation result in an unexpected form. I’ve compared it to another non-js app where inspecting works.
working nREPL return value: (\"Class\" \": \" (:value \"clojure.lang.PersistentArrayMap\" 0) (:newline) \"Contents: \" (:newline) ...
erroring nREPL return value: { :id "abc" … }
The former is in an Elisp-parsable form; the latter is a direct Clojure representation.#2022-08-2015:12Drew Verleeas far as i know, cider-inspect doesn't always play nice with shadow-cljs. The easiest thing is to use shadow's built in inspect console with tap>, or you could look at portal or reveal.#2022-08-2103:32Drew VerleeI don't want to jump to the cider error buffer (when there is an error) to i set cider-auto-select-error-buffer to nil and it still happens. Is there something else i should do or try?#2022-08-2117:33pppaulI used this before to do exactly what you describe, maybe there has been a regression#2022-08-2117:44vemvfeel free to create an issue cc/ @U0DJ4T5U1#2022-08-2303:14Drew VerleeWill do. Likely it's just me not doing something right so I'll double check.#2022-08-2206:36bozhidarI don't recall any changes to this code in years.#2022-08-2206:36bozhidarBut regressions are always possible. 🙂#2022-08-2303:16Drew VerleeYep, I'll double check, then try to file a report.#2022-08-2313:53donyormI'm having an issue where I'm using cljs-jack-in to a figwheel-main project, which works, but when I run any commands (something simple like (+ 3 3)) I don't see the results being printed out. I assume they're working, since I don't see errors but I'm not sure. Things work normally if I make a clj repl outside of a project. Any idea what could be going on?#2022-08-2419:39aptHi folks. Is there any cider feature that requires following the convention of adding a -test suffix to unit tests names?#2022-08-2421:05pithylessI'm not aware of cider features that assume the convention -test for deftests.
There is an assumption that the namespace ends in -test to automatically infer test namespaces (configurable via https://docs.cider.mx/cider/testing/running_tests.html#test-namespace-naming-convention) and the macros that define tests (configurable via https://docs.cider.mx/cider/testing/running_tests.html#macros-used-to-define-tests)#2022-08-2419:44dpsuttonmost test runners use that as an indicator i think#2022-08-2423:08vemvnot really, test runners and CIDER look at ^:test metadata, as emitted by deftest and many other popular macros. So you can use whatever you please - I've never seen the opposite being an issue
cc/ @U976F1AR2#2022-08-2423:09dpsuttonOh I read that as for the namespaces. Not for the vars#2022-08-2502:04aptThanks, folks.
In this case, any ideas on why there’s this convention of using -test in test vars names? In principle, it would be redundant so I suppose there must be some good reason for it.#2022-08-2508:09bozhidarJust a lot of history. 🙂#2022-08-2508:10bozhidarPlus it sounds a bit more descriptive e.g. `test-this-and-that" or "this-and-that-test".#2022-08-2513:38aptGot it. So it’s for humans, not machines. Not what I expected. Thanks!#2022-08-2505:01jumarIs it possible to evaluate an expression and paste the result under?
Like cider-(pprint-)eval-defunt-to-comment but without commenting out the result.
So instead of this:
(+ 1 2)
;; => 3
I want this:
(+ 1 2)
3
Or maybe this:
(+ 1 2)
;; =>
3
#2022-08-2507:39iarenazaFor the first use-case, I think C-u M-x cider-eval-print-last-sexp is what you are looking for.
For the second use-case, you could play with the variables cider-comment-prefix , cider-comment-continued-prefix and cider-comment-postfix to achieve it. but I'm not sure how easy it is to embed a new line character in cider-comment-prefix.#2022-08-2600:44mbarillierI'm looking for docs on setting up a clojure dev environment in a docker container on a remote host, and being able to access it from my local box. I've currently got an nrepl running in the container with the port exposed so I can connect my local emacs to it using cider-connect (specifying the remote box and exposed port). the source is mounted in the docker container using --mount so I can use tramp to edit the source on the remote box and have the changes visible inside the docker container. if I'm editing source in /ssh:remote:/path/to/src/foo.clj, how do I tell cider to send the expressions to the remote cider repl session?
if there's a better/easier way I'd like to hear about it, this seems like it's kinda convoluted. I just want to be able to connect to a remote repl, edit code on the remote host, and evaluate forms remotely .... surely someone has figured out how to do this ... maybe?#2022-08-2601:13mbarilliergot it sorted: running cider-connect from the source dir links the two. also: https://docs.cider.mx/cider/usage/managing_connections.html#context-links#2022-08-2611:17sw1nnwrt cider use-package .dir-locals.el cider-clojure-cli-aliases and lazy loading (maybe not really a cider issue per se)
What is the correct way to set this up?
I noticed that sometimes when emacs loads .dir-locals.el it complains about cider-clojure-cli-aliases not being safe, but the defcustom for that var specifies a :safe? 'stringp predicate so it shouldn't warn on a value like ":dev"
Investigating this I notice that because of the lazy loading, when I open a clojure file, emacs hasn't yet loaded cider, doesn't (yet) know about cider-clojure-cli-aliases and thus assumes it's unsafe. Once cider is loaded, if I then (somehow) retrigger the loading of .dir-locals.elit will then load successfully without warning about safety.
I tried different values for the mode in the CAR of the .dir-locals.el list but to no avail.
I suspect what is required is use-package supporting some sort of auto/pre-load for customizable vars (like it does for commands with :commands), but I wonder if there is something I am missing?
To be clear if I eager load clojure and cider mode all works well.
For reference here is my .dir-locals.el
((clojure-mode . ((cider-clojure-cli-aliases . ":sw1nn/dev:aws/sso:integrant/repl"))))
#2022-08-2813:42ossosoI wanted to tap> test names to match them with other tapped data. When running the tests with CIDER I had to replace the method in the snippet: clojure.test/report to cider.nrepl.middleware.test/report .#2022-08-2813:45ossoso(defmethod cider.nrepl.middleware.test/report :begin-test-var [m]
(swap! cider.nrepl.middleware.test/current-report update-in [:summary :var] inc) ; from the source method
(tap> (-> m :var meta :name)))
#2022-08-3015:25pmooserFor a long time, I've relied on the fact that when I do M-x cider-connect it reads the nrepl port out of .nrepl-port - when I updated recently, I notice that it is also reading the port from .shadow-cljs/nrepl.port ... so whereas before it could usefully autocomplete, now I have to go read the port files myself to see which is which.
Is there a way to disable it?
I assume the related code is:
(defun nrepl-extract-ports (dir)
"Read ports from applicable repl-port files in directory DIR."
(delq nil
(list (nrepl--port-from-file (expand-file-name "repl-port" dir))
(nrepl--port-from-file (expand-file-name ".nrepl-port" dir))
(nrepl--port-from-file (expand-file-name "target/repl-port" dir))
(nrepl--port-from-file (expand-file-name ".shadow-cljs/nrepl.port" dir)))))#2022-08-3106:16bozhidarYep. Other than reverting this change locally there's nothing else you can do.#2022-08-3106:18bozhidarThe change was made so that CIDER would consider every possible nREPL that's running for a particular project, which is the better behavior IMO.#2022-08-3113:10pmooser@U051BLM8F I think it would make more sense if metadata about where the port came from was maintained, because a list of a large integers isn't really useful as an enduser if I can't distinguish which one belongs to which sort of process. Or maybe some kind of preference mechanism could exist?#2022-08-3114:05bozhidarI'm always open to ideas for improvements, so feel free to file a ticket about this. I agree that pairing the port number with the file it came from makes sense.#2022-08-3114:08pmooserOk, thank you - I will see if I can file a ticket!#2022-09-0710:28pmooserOk, ticket filed.#2022-08-3015:32Sam Ritchiehey all… I am running into
error in process filter: user-error: ClojureScript is not available. See for details
error in process filter: ClojureScript is not available. See for details
on a project that has worked for years. obviously emacs must have upgraded something on me; and yes I have gone to that link!#2022-08-3015:32Sam Ritchieit’s totally unclear to me what is going wrong locally, and unfortunately nothing on the page, paired with that generic message, is illuminating.#2022-08-3015:33Sam Ritchiesending full error message…#2022-08-3015:34Sam Ritchie[nREPL] Starting server via /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.4"} cider/piggieback {:mvn/version "0.5.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:test:dev/repl:cider/nrepl
[nREPL] server started on 52185
[nREPL] Establishing direct connection to localhost:52185 ...
[nREPL] Direct connection to localhost:52185 established
error in process filter: user-error: ClojureScript is not available. See for details
error in process filter: ClojureScript is not available. See for details#2022-08-3015:34Sam Ritchieafter running cider-jack-in-cljs and selecting node#2022-08-3015:34Sam Ritchienode is present#2022-08-3015:46dpsuttonis this a shadow project or figwheel or bare cljs?#2022-08-3015:46Sam Ritchiebare cljs, but shadow fails as well#2022-08-3015:46Sam Ritchieshadow starts but then that same error comes up#2022-08-3015:46Sam Ritchienpx shadow-cljs node-repl
works fine at the command line#2022-08-3015:46dpsuttonignore shadow for a second then. do you have clojurescript on your classpath?#2022-08-3015:47Sam Ritchiedo you mean clj, clojure?#2022-08-3015:47Sam Ritchieis there a cljs binary?#2022-08-3015:47dpsuttonno i mean clojurescript on your classpath#2022-08-3015:47Sam RitchieI didn’t even know that that was a thing!#2022-08-3015:48Sam Ritchiehttps://clojurescript.org/guides/quick-start#2022-08-3015:48Sam Ritchieno mention of a standalone cljs command anywhere here and I’ve never done that. that would be an obvious issue then since I don’t have it 🙂#2022-08-3015:48dpsuttonthis puts clojurescript on your classpath#2022-08-3015:49dpsuttoni am not talking about a standalone cljs command. I’m talking about the clojurescript jar present on your classpath#2022-08-3015:49Sam Ritchiecan you give me a way to see what the classpath is, in the context of the command that cider-jack-in-cljs is running?#2022-08-3015:49Sam Ritchieah#2022-08-3015:50Sam Ritchiesorry, missed your image#2022-08-3015:50Sam Ritchieokay that’s closer. I have (cider-clojure-cli-aliases . ":test:dev/repl") in dir locals;#2022-08-3015:50Sam Ritchiebut the cljs dep is under a different alias#2022-08-3015:51Sam Ritchiesounds like I need to get the cljs alias in there too#2022-08-3015:51dpsuttonthen the error message that it cannot find clojurescript seems very apt#2022-08-3015:51dpsuttonyeah. you are asking it to start up a clojurescript repl but it cannot possibly do so#2022-08-3015:53Sam Ritchieyes, but think of the debug steps:
• that image is saying to put the clojurescript dep at the top level of deps.edn, which is poor form for any library;
• realistically it’s always in an alias, which you can tune with an emacs variable documented somewhere else
• that alias is set in a .dir-locals.el file, and named cider-clojure-cli-aliases, which you might imagine is separate from some cljs variable
• that all requires some knowledge of how deps.edn aliases are layered, which is fine;#2022-08-3015:54Sam Ritchie“:yeah. you are asking it to start up a clojurescript repl but it cannot possibly do so”
this was clear from the behavior 🙂#2022-08-3015:54Sam RitchieI appreciate the help, just pushing back on the hint, maybe misperceived, that the deduction chain here was super obvious#2022-08-3015:54dpsuttonThat image is from the document you linked me. I pointed to the step I was talking about#2022-08-3015:55Sam Ritchiea better error might say
“the clojurescript jar is missing from the classpath. you’re currently using deps.edn with the following aliases configured: <blah blah>. make sure that an entry like [clojurescript “blah”] is present in the :deps` value for one of those aliases.”#2022-08-3015:56dpsuttonThat’s an excellent suggestion. If you made an issue I suspect there would be some interest#2022-08-3015:56Sam Ritchie> “then the error message that it cannot find clojurescript seems very apt”
it was apt! just not as helpful as you were!#2022-08-3015:57dpsuttonSorry. I’ve seen this error pop up when things will actually work out. So part of my diagnosis is finding out if this is correctly erroring and it cannot work, or if it is erroring but it would have worked if we weren’t trying to be clever#2022-08-3015:58Sam Ritchiesure, that makes sense. definitely not an easy problem, with so many editors, build setups etc#2022-08-3016:00dpsuttonfound an old issue about it: https://github.com/clojure-emacs/cider/issues/2230#2022-08-3016:31richiardiandreaHi there, I started to use cider-clojure-cli-aliases and the repl starts fine in the terminal but in Emacs I see:
[nREPL] server started on 35395
[nREPL] Establishing direct connection to localhost:35395 ...
[nREPL] Direct connection to localhost:35395 established
error in process filter: cider--gather-connect-params: This is not a REPL or SERVER buffer; is there an active REPL?
error in process filter: This is not a REPL or SERVER buffer; is there an active REPL?
Does anybody know what is going on?#2022-08-3016:34richiardiandreaNever mind, I restarted Emacs and I don't see the error anymore#2022-09-0103:01zhuxun2When the cider is connected to an external clojure repl, and the repl process exits, the cider buffers (nrepl buffers) in Emacs are left as zombies. Is there a way to quickly kill them all?#2022-09-0113:17zhuxun2M-x kill-matching-buffers cider-repl seems to do the job#2022-09-0806:42robert-stuttafordhas anyone perhaps found a way to script with clj-refactor's jvm-side middleware?
we'd love to run all our code through cljr-clean-ns on-pre-commit. wondering if anyone has done any work in this direction#2022-09-0807:00borkdudeYou could also do this with the Clojure LSP binary #2022-09-0807:00borkdudeWell, then it is the LSP-organize-imports equivalent which takes into account clj-kondo #2022-09-0807:06robert-stuttafordunfort the lsp impl doesn't do as good a job as cljr does when it comes to .cljc files#2022-09-0807:06robert-stuttafordyou're right though, that would have been ace#2022-09-0807:06robert-stuttafordmy colleague @U0HJ7CX6H will file an lsp issue about it at some point 🙂#2022-09-0807:06borkdudeYou could maybe run eMacs as a binary #2022-09-0807:07robert-stuttafordnot sure if you're joking haha#2022-09-0807:12chrisetheridgei half considered just calling the emacs binary to do the thing 😄 clojure-lsp almost does the right thing, but struggles with namespace reader conditionals, specifically ones that don't use splicing but rather two different require sets for clj and cljs#2022-09-0807:13borkdudeI wasn't joking :)#2022-09-0807:59robert-stuttaford😅#2022-09-0809:17vemvhi, refactor-nrepl (clj-refactor's backend) maintainer here 👋
refactor-nrepl is a vanilla clojure library which you can simply invoke however you please.
https://github.com/clojure-lsp/lein-clojure-lsp and similar do a nice job as well
refactor-nrepl is accurate indeed, but the formatting is a bit wacky for .cljc files.
What I do in my daily workflow is run refactor-nrepl first, then a formatter of choice (I happen to use https://github.com/nedap/formatting-stack but anything will do)#2022-09-0809:18vemv(maybe in a future refactor-nrepl will use zprint internally so nothing wacky is spat)#2022-09-0809:49robert-stuttafordwow didn't know about formatting-stack!#2022-09-0809:53robert-stuttafordthis is amazing#2022-09-0809:53chrisetheridgeformatting-stack looks amazing! thank you @U45T93RA6#2022-09-0810:18vemvCheers 🍻 It's quite underpromoted (even though @UHJH8MG6S and me keep it alive), we have some finishing touches pending (like an easier CI setup)#2022-09-0904:16jumarThanks for sharing formatting-stack.
I wanted to try it on our repo but just (require '[formatting-stack.core]) caused a huge CPU usage spike (800% for minutes until I killed the REPL)#2022-09-0906:46vemv@U06BE1L6T probably it's the cost of running clj-kondo analysis in a project for the first time
(which is done here https://github.com/nedap/formatting-stack/blob/8b0482d95d22628eeb8991d8503268b650089c17/worker/formatting_stack/background.clj)#2022-09-0906:48vemvI always run f-s in all projects I work on / open (I have dozens of random clones, besides from work) - it doesn't have a generalized perf issue - much the opposite.
Perhaps your project is particularly large?#2022-09-0911:53jumarIt's not a huge project but it is a bit larger.
I simply ran (format!).
How does it decide what to analyze?#2022-09-0912:15vemv(taking this to DM to avoid further thread hijacking 🏴☠️)#2022-09-0806:44robert-stuttafordfirst prize would be with babashka but normal jvm options are worth trying too 😄#2022-09-0821:55zhuxun2Is there a way for me to display a non-root-level error in the cider-error buffer, but without actually throwing it at the repl root level?#2022-09-0821:58zhuxun2Not sure if my question makes sense, but what I want is to nicely format an error that is caught (but not re-thrown)#2022-09-1020:52Daniel CraigHow can I set environment variables in cider? I want to be able to jack-in and have my repl to start with the AWS Access key and secret key that I set in my env vars. I would just use ~/.aws/credentials, but I'm using a https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html now and it doesn't appear to play nicely with cider#2022-09-1022:01vemvthat's not cider-specific
You will find the answer in the archives for #cider or #emacs#2022-09-1306:43jrychterHmm. I've just (painfully) migrated my app to figwheel-main and I'm trying to figure out if I can start using a ClojureScript REPL after all these years with CIDER. But the standard connect- functions complain about being unable to find build-id.cljs.edn files, which is correct, because I don't have any. My figwheel-main is started manually from Clojure code. I start the Clojure REPL using leiningen (launched from a Makefile), then connect using cider-connect, then run init code which does a bunch of things and starts figwheel at the end. Any suggestions/directions as to where to look next to connect?#2022-09-1306:54jkxyzI think you could use cider-connect-clj and then call figwheel.main.api/cljs-repl#2022-09-1307:17magnarsThat would still look for build-id.cljs.edn#2022-09-1307:18magnarsNo, maybe I'm mistaken.#2022-09-1307:18jkxyzAs long as you're running it from the same process which has started the build, it should find it in the registry#2022-09-1307:19magnars(figwheel.main.api/start build)
would certainly look for it, but
(figwheel.main.api/cljs-repl build)
connects to an existing build, so that might circumvent the problem.#2022-09-1307:20magnarsAnother solution would of course be to add the .cljs.edn-file, but I guess you have your reasons to stray from the defaults.#2022-09-1307:20jkxyzIt should, yes. You can also configure CIDER with a custom REPL type for your project so that you can just run cider-connect-cljs and it will initialize the CLJS REPL for you#2022-09-1307:23jkxyzI would probably go with the approach of setting up the build EDN files and launching Figwheel as a separate process from your main Clojure app. It seems like a nice idea to have everything in the same process but you have to add a lot of CIDER-specific configuration to get it to "just work"#2022-09-1308:12jrychterIt's a complex app and there are a number of init steps that need to happen (things like database connection, mount initialization, migrations, etc), and I'd much rather start figwheel from inside the init function. I am using figwheel.main.api/start to start the build and configuration is supplied to that function. If I have to, I can move this configuration to a file, but… well, it seems rather strange to rely so heavily on things being stored in a single file with a "magic" name.#2022-09-1308:12jrychterAlso, I'm guessing CIDER needs that file just to parse it and get the port number?#2022-09-1308:41jkxyzIt seems like CIDER doesn't have a specific REPL type for connecting to a running figwheel-main build. It expects to call figwheel.main/start and uses the build files to find the build name to pass to that function. Since you're calling start already, to get a CLJS REPL you need to call figwheel.main.api/cljs-repl inside of a Clojure REPL to "upgrade" it. Then you can run cider-set-repl-type to mark it as a CLJS REPL (so that eval works correctly in CLJS buffers). To simplify things, you can configure something like the following in .dir-locals.el:
((nil
(cider-custom-cljs-repl-init-form . "(do (require 'figwheel.main.api) ((resolve figwheel.main.api/cljs-repl) "build-id"))"
(cider-default-cljs-repl . custom)))
https://docs.cider.mx/cider/cljs/configuration.html#defining-custom-clojurescript-repl-types
That lets you start your regular Clojure REPL, and then run cider-connect-cljs to launch the CLJS REPL.
The benefit of magic file names is that it's a convention that makes it work more easily with tooling without manual configuration 😄#2022-09-1308:53jrychterHmm. Very confusing. I might just postpone this — ClojureScript REPL have been so problematic that I've never used them for the last 7 years or so, which means I can get around without them for a while longer 🙂#2022-09-1308:59jkxyzThere are infinite ways to setup your REPL and tooling so I've found it helps me work faster if I just stick to the default approach 🙂 FWIW I've had no problems with ClojureScript REPLs for a long time. But I've used the above approach before with success#2022-09-1418:56Jeongsoo LeeIt would be nice to easily promote a local function from a letfn to the top-level and vice versa.#2022-09-1502:54jumarI found letfn usages to be rare - do you often need to do that?#2022-09-1503:12Jeongsoo LeeI was using it during some mutually recursive work that combines several functions and trampolining around them. You're right; these kinds of work rarely pop up, and I ended up declare instead of letfn for that, as the latter hinders testability of each function.#2022-09-1421:49zhuxun2Whenever I do cider-repl-set-ns against the cljs repl, it turns into a clj repl. Has anyone run into something like this before?#2022-09-1421:50zhuxun2It seems to have just overwritten the cider-repl-type variable. The repl itself is still perfectly connected to the cljs instance. I can do js/console and it gives me the correct output#2022-09-1502:56Drew Verleei'm in a buffer with a .clj file. The repl server is running and i'm sending expressions to it.
I would expect those expressions to show up in the 'cider-nrepl-history' when i run that command from the .clj buffer, but instead i get nothing.
What is the correct way to see my nrepl history?#2022-09-1503:00Drew Verleealternatively, i can just use an atom to keep track of what i have run in a session. But loading the history would be nice as a generic solution within easy reasch.#2022-09-1603:32OknoLombardaHi. I'm working on a clj/cljs project right now and most of the time start both REPLs at the same time (cider-jack-in-clj&cljs), but clj REPL always starts in shadow.user namespace. Can I change it somehow? I mean, so that it automatically switches to other namespace on startup#2022-09-1607:36macrobartfastDoes anyone know of a way (cider or not) to apply a function to the result of the function under the pointer on the fly without changing the code? For instance, if one wanted to count the number of elements in the vector returned by a function without having to surround the function in question with (count <the function>)? I’m thinking of a shortcut that would prompt for a command in the minibuffer and apply it to the result. I often surround a function with another function just to apply it once then delete it and I’d like to avoid the typing. Forgive me if this is not clear.#2022-09-1608:04magnarsWhen you say function, do you mean a function invocation that you've already typed out?#2022-09-1608:05magnarsIf you've invoked a function, and would then quickly like a count of the last result you could use C-c M-: which gives you a clojure prompt, and type (count *1)#2022-09-1619:42macrobartfastThat’s what I meant (a function invocation that you’ve already typed out)… I’m thrilled there’s a route to this… currently C-c M-: seems bound to cider-read-and-eval (looking at the binding reveals C-c M-: runs the command cider-read-and-eval )… do you know which cider command your binding invokes?#2022-09-1619:43macrobartfastoh wait… disregard my last comment… stand by.#2022-09-1619:51macrobartfastIt works! Thank you so much!#2022-09-1619:52macrobartfastcider-read-and-eval, of course, is what you were suggesting.#2022-09-1710:01magnarsIndeed. I'm glad it was what you were looking for 🙂#2022-09-1713:41puchaczhi, I connected cider-cljs and I have REPL, but my source buffer says cider[not connected], and I cannot use commands like M-. (jump to definition) or C-z (go to REPL). the REPL works all right though. and the sesman-browsser shows my session with suspicious message (pending-cljs):#2022-09-1713:41puchacz1: projects5/bubrary-gui:localhost:9000
linked-to: proj(~/projects5/bubrary-gui/)
objects: cider-repl %s(pending-cljs)#2022-09-1713:41puchacz(I asked the same question on shadow-cljs channel)#2022-09-1718:02Carsten BehringHi, when use teh cider inspector on a map like this:
{:id "2",
:refid "10",
:author "",
:title
"Going wild with fermented food: The tastiest what's-old-is-new-again trend",
:abstract
"<a style=\"color:red\">If</a> you're not yet familiar with how delicious and <p style=color:green;>healthy</p> fermented foods can be, we introduce you to one of the industry's leading <a style=\"text-decoration: none;color:orange\">sustainable</a> , fermented <span style=color:red;>food</span> producers: California-based wildbrine, which specializes in wild-fermenting <mark>organic</mark> produce.. <br>\r\n Rick Goldberg and Chris Glab, founders of wildbrine.. \r\n "Wild" fermentation is what makes wildbrine's products unique. \r\n<div style=\"color:red;\">a</div>\r\n<h1 style=\"color:red;\">a</h1>\r\n<div style=\"color:red;\">a</div>",
:level "1"}#2022-09-1718:03Carsten BehringI get an error thrown by the cider-inspector:
Inspector error for: {:id "2", :refid "10", :author "", :title "Going wild with fermented food: The tastiest what's-old-is-new-again trend", :abstract "<a style=\"color:red\">If</a> you're not yet familiar with how delicious and <p style=color:green;>healthy</p> fermented foods can be, we introduce you to one of the industry's leading <a style=\"text-decoration: none;color:orange\">sustainable</a> , fermented <span style=color:red;>food</span> producers: California-based wildbrine, which specializes in wild-fermenting <mark>organic</mark> produce.. <br>\r\n Rick Goldberg and Chris Glab, founders of wildbrine.. \r\n "Wild" fermentation is what makes wildbrine's products unique. \r\n<div style=\"color:red;\">a</div>\r\n<h1 style=\"color:red;\">a</h1>\r\n<div style=\"color:red;\">a</div>", :level "1"}#2022-09-1720:59puchaczwhat event changes REPL status from pending-cljs to cljs?#2022-09-1720:59puchaczthis is what I am missing#2022-09-1721:03puchaczit is probably a bug in cider; however it is strange that there are no results about it when I google. can it be something specific to my environment? I made it as simple as I could#2022-09-1721:17puchaczOMG! I did it! Second weekend!
one has to be in the repl buffer, then M-x cider-set-repl-type Enter cljs Enter (in minibuffer)
then the part of the name of the REPL buffer changes from pending-cljs to cljs:shadow
and my source buffer eventually is associated with the session, so evaluating there works, C-z works and M-. works (I tried on +)
it took me to core.cljs#2022-09-1721:18puchaczwhat on Earth is going on? why didn't it get called automatically in cider--connected-handler in cider-connection.el?#2022-09-1722:02puchaczI raised this issue: https://github.com/clojure-emacs/cider/issues/3246#2022-09-1908:45rolti tried to reproduce but couldn't, it works on my setup with your example (tried eval in source code, go to definition)
i didn't check with the exact versions though#2022-09-1910:13puchaczthanks. I can live with the workaround for now, I am not sure what is wrong with my setup. I figured out that the functionality I am missing is pretty basic, so people would have noticed if it was widespread.#2022-09-1802:29lilactownI use cider-jack-in-cljs every day. not sure if there's something weird going on in your local environment#2022-09-1802:29lilactowndoes it show a cljs.user> prompt?#2022-09-1821:06macrobartfastI just wanted to thank all of you working on, and helping with, Cider. It’s so helpful to me.#2022-09-1907:05robert-stuttafordwhen i connect both clj and cljs repls, and eval anything in a .cljc file, it evals in both the clj and cljs repl. how do i control this behaviour to target the one repl i care about?#2022-09-1911:27bozhidar@robert-stuttaford See cider-map-repls. That dispatch is there, but I don't remember if it was configurable or not.#2022-09-1912:21robert-stuttafordthanks Bug!#2022-09-1912:24robert-stuttafordyeah it's not configurable at the moment#2022-09-1912:28robert-stuttafordi trust this illuminates the situation sufficiently well, @bozhidar? 😃
https://github.com/clojure-emacs/cider/issues/3248#2022-09-2012:32jpmonettasHi everybody! I'm missing some printlns in my multithreaded application and trying to make everything to use the same PrintWriter I see cider nrepl is returning a different PrintWriter in *out* every time I call it, which is different from the clj repl behavior.
user> *out*
#object[java.io.PrintWriter 0xfd3434c "java.io.PrintWriter@fd3434c"]
user> *out*
#object[java.io.PrintWriter 0x2229c88a "java.io.PrintWriter@2229c88a"]
user> *out*
#object[java.io.PrintWriter 0x1a8cdc5e "java.io.PrintWriter@1a8cdc5e"]
Is this because the nrepl server is creating a new PrintWriter for every request? what is the correct way of using printlns in cider repl without missing some printlns outputs?#2022-09-2019:43torgeirIs it possible to have cider (or clojure-lsp) support code navigation and autocomplete for npm packages and native node modules like "fs" through shadow-cljs? (I was directed here from #shadow-cljs where I asked a similar question)#2022-09-2100:21ericdalloat least for clojure-lsp, ATM no, but would be a nice addition to cljs ecosystem#2022-09-2209:53PanelCould cider-result keep history ? When I use cider-pprint-eval-last-sexp I wish to keep the previous result.#2022-09-2211:49pmooserIt used to work for me, but using cider-connect-cljs in my project results in a parsing error from parseclj ... What is it even trying to parse ?#2022-09-2211:50pmooserAh, maybe my shadow-cljs file?#2022-09-2211:56pmooserYup, this was it. I had introduced a syntax error that bugged cider but didn't bug shadow-cljs itself.#2022-09-2213:54nixin72Hi, is there a way to get CIDER to cache compilation or to AOT the code and then just have CIDER redefine the small handful of things I'm working on? I'm working on a very large project (100k+ LoC) and starting the REPL can take upwards of 3 minutes. Having an older computer I like to stop my REPL when I'm not working on this code because it takes a large amount of memory, so I need to start and stop my REPL several times a day.#2022-09-2216:03vemvI'd say this guide applies https://clojure.org/guides/dev_startup_time
...I use my own, more automated variation of it . I'd say the official way is a bit manual
However, when applied+understood carefully, it should be a good gain#2022-09-2216:04vemvIt also can be a good idea to avoid as many requires as possible in user.clj
If you have "dev niceties" over there, prefer a delayed requiring-resolve to a require#2022-09-2216:05vemvAnd last but not least, it is very customary under clj/emacs/lisp tradition to have repl sessions that last days (weeks, for the most hardcore users) :)
Worth the hammock if your workflow is excessively "stateless"#2022-09-2313:06nixin72I totally get that a lot of people like to leave REPL sessions running for a very long time, and I used to with smaller projects, I just can't with such a large application, it takes too much memory on my old computer#2022-09-2313:07nixin72Thank you though, I'll take a look at the link and see what I can do#2022-09-2313:09vemv👀 how much memory are we talking about?#2022-09-2313:16nixin722-3gb on an 8gb machine#2022-09-2313:17nixin72Plus LSP is using an extra 1.5gb of memory#2022-09-2313:18nixin72So I just close Emacs entirely#2022-09-2313:20vemvyeah honestly 8gb is peanuts 😅 and running cider and lsp has its cost
I'd recommend to use a machine up to the job you're doing - human time is more valuable than material costs :) i.e. it will avoid hacking/headaches.#2022-09-2313:21nixin72I don't disagree, I just don't want to dish out for a new computer yet. I've spent too much the past few months as is! 😅#2022-09-2315:19batomsCan anyone else verify that if you evaluate a buffer with a leading space before the top leve (ns..) then the namespace doesn't get set and *ns* is still namespace[user] for that buffer?#2022-09-2315:57pavlosmelissinosJust tried that with CIDER 1.5.0 (babashka REPL) and I can confirm that the ns doesn't get loaded#2022-09-2404:42ahungryHi all - No assertions (or no tests) were run.Did you forget to use 'is' in your tests? - this is with the brand new repo from using clj-new (a deps.edn scaffolding) - anyone know what I may need to add to my Emacs config or project config to fix?#2022-09-2405:31vemvYou likely should activate the test alias so that the test/ dir is in the classpath#2022-09-2406:21ahungryThanks - i'm really new to deps.edn - what does that mean? (activate the test alias?) in regards to cider? I see I run my tests with clj -T:build test#2022-09-2406:21ahungry(I found that a bit odd but sensible - running tests with a clj tool external to the repo deps themselves - but then it seems deps.edn isn't using my own defined alias to do tests)#2022-09-2406:25ahungry(setq cider-clojure-cli-aliases ":env/dev:test")#2022-09-2406:25ahungryfound it, ty 🙂#2022-09-2406:25ahungry(it worked)#2022-09-2406:39vemvyeah that's the right setting :thumbsup:#2022-09-2404:43ahungryI can still hop into myapp/test/myname/myapp_test.clj and manually invoke a single test#2022-09-2520:34Drew VerleeIn emacs, how would i clear cider's enlighten-mode value? It just sticks around even after i remove the expression (see picture)#2022-09-2520:35Drew VerleeI can delete the output. i guess, but i recall that not working all the time. And in cases where the output is littered through an expression that makes it not worth using the mode.#2022-09-2607:50bozhidarI think it currently clears only when you disable the mode.#2022-09-2607:50bozhidarIf there's some clear overlays Emacs command that will do as well.#2022-09-2705:07Drew Verleeso i had cider-overlays-use-font-lock set to t and it was causing the overlays to stick around even after i turned off the mode and re-evaled things.
That along wasn't an issue, but sometimes the overlays would, and i'm not sure how to describe this, block the cursor from traveling around. it was odd. 😕#2022-09-2921:51Drew VerleeWell it seems like the overlays can get stuck regardless. they just hang out and nothing removes them short of restarting emacs that i know of.#2022-09-2814:43andrzejsliwaHey, is there any way of selecting profile on cider-jack-in? On deps.edn project#2022-09-2814:48dpsuttonhttps://docs.cider.mx/cider/basics/up_and_running.html#clojure-cli-options details cider-clojure-cli-aliases`` which should be what you want#2022-09-2814:51andrzejsliwayou mean together with .dir-locals.el ? or there is any fancy way of asking for selection#2022-09-2814:52dpsuttonno fancy way of asking for selection. For one-off’s you can use a prefix arg when jacking-in to manually edit the jack in string in the minibuffer. Otherwise you’ll need to set that cider-clojure-cli-aliases in dir-locals.#2022-09-2817:06ennWhen running multiple REPLs and using sesman-link-with-buffer to attach Clojure buffers to them, the sesman sessions seem to survive after the REPL buffers are killed. I only have a single REPL open now, but sesman-link-with-buffer gives me four options, and none of my buffers is connected to the sole actual running REPL. Is there a way to clean up these stray sessions without restarting emacs?#2022-09-3005:15Drew VerleeDoes this seem like an issue or i'm I confused about the proper behavior?
(comment
;; cider eval and replaceing this ...
{'f/a 1
'f/b 2}
;; gives this
#:f{a 1, b 2}
;; and i expected this
{'f/a 1
'f/b 2}
;;because #:f{} if for a fully qualified map, and 'f/a is a symbol
nil)#2022-09-3005:46hiredmanuser=> (keys '#:f{a 1})
(f/a)
user=>#2022-09-3005:47Drew Verleei don't understand.#2022-09-3005:49Drew Verleeerr, i guess i do.#2022-09-3005:50Drew Verleeyou know, my real question, the one that put me on this path, is why is deps using a symbol instead of a keyword.#2022-10-0103:43Drew VerleeHow do i learn more about cider enlighten mode? I was able to describe function and find this
(define-minor-mode cider-enlighten-mode nil
:lighter (cider-mode " light")
:global t)
But i'm confused on how to understand more of what's going on. How does that relate to the results getting displayed on the screen. (or at least where should i be looking to learn more?)#2022-10-0211:42Benjamin(defn foo [i] i)
(defn bar [x]
(dotimes [i x]
(foo i)))
(bar 10)
try some code like this with enlighten mode turned on. It is more like a tracing debug feature.
The default results on the screen is separate from this#2022-10-0211:45Benjaminhttps://docs.cider.mx/cider/debugging/enlighten.html I saw this in the manual#2022-10-0214:57Drew Verlee@U02CV2P4J6S thanks. Let me clarify, I'm trying to debug an issue im having with it, where it won't clear the results ever. Even if i turn the mode off. Im trying to find out how it works, but all i can find is the elisp above, I'm not sure how to trace it to anything else.#2022-10-0215:50Benjamin(remove-overlays (point-min) (point-max) 'category 'enlighten)
this should do it. Alternatively you kill the buffer and find the file again 🤷#2022-10-0304:49Drew Verleeill give that a try! ty ty.#2022-10-0304:51Drew Verleei'm such a noob, how do i "try that" can i just execute that elisp code anywhere? i guess so? ill give that a try#2022-10-0307:04BenjaminM-: -> paste it. Or define a command:
eval, or paste into an elisp buffer e.g. scratch buffer and eval defun
(defun remove-enlighten-overlays ()
(interactive)
(remove-overlays
(point-min)
(point-max)
'category
'enlighten))
#2022-11-0904:04Drew Verlee@U02CV2P4J6S i just got back to trying this, and it works. Thanks a ton!#2022-10-0211:31Benjamincider nrepl + clojurescript completions: Not sure if I miss something here an example:
(ns
app.main
(:require
["node:child_process" :as p]))
p/|
no completions for cursor at | and I also don't see any javascript specific stuff in cider.nrepl or compliment.
#nbb’s nrepl server actually has a piece that calls js/Object.getOwnPropertyNames of the object recursively#2022-10-0211:32Benjaminso the question is if I am missing the javascript specific part, or if that is a growth area for cider middleware to add such completions#2022-10-0310:32roltthere should be: https://github.com/clojure-emacs/clj-suitable
but it doesn't seem to work on my setup either, I will try to look into it this week. I'll have to do a bunch of js interop soon#2022-10-0310:33BenjaminCIDER will always use the static code completion provided by suitable, regardless of the ClojureScript runtime, but the dynamic completion is not currently available with shadow-cljs. (See this ticket for more details)
#2022-10-0310:33Benjaminthat'd be my usecase#2022-10-0310:34roltyeah me too, but the related issue seem fixed
https://github.com/clojure-emacs/clj-suitable/pull/18#2022-10-0310:34Benjaminyea true#2022-10-0310:35Benjaminthis dynamic completion really instantly gives it a more magic feel. I might also check later this week.#2022-10-0307:43Carsten BehringWas there ever a discussion in the Cider community about "rendering" of Clojure data in browser being part of Cider ?
I know there are several external projects on this, but nothing inside Cider itself.
I would see this as an alternative to "cider-inspect" or "pretty-print into repl output".
With the potential advantage of a browser having far superior rendering capabilities compared to Emacs itself.#2022-10-0310:09BenjaminDid you try #portal ? Currently the biggest downside to portal are the keybinds I suppose#2022-10-0312:21Carsten BehringI am aware of Portal, Clerk and others.
But none of it is integrated deeply in Cider.
So they are not "out-of-the-box".#2022-10-0312:24BenjaminYea that's true#2022-10-0313:36Carsten BehringI think an "extension point" in Cider could be interesting which allows to hook in custom Clojure code, which gets called with the "JVM object under cursor"
Or is this maybe possible already ?#2022-10-0313:37Carsten BehringMy use cases is indeed a "replacement" for cider-inspect.#2022-10-0316:34Benjamin(defun my-cider-inspect ()
(interactive)
(cider-nrepl-sync-request:eval "(spit \"/tmp/my-cider-inspection.edn\" (prn-str *1))")
(find-file "/tmp/my-cider-inspection.edn"))
cider eval + *1 comes to mind#2022-10-0321:49zhuxun2It seems that cider-set-repl-type in a cljs file will change the repl type to clj. Is there a way to prevent this?#2022-10-0407:55pesterhazyHeya! Is there a way to make cider-connect use localhost and the port in .nrepl-port without me asking any questions? I'd like it to be as fast as possible#2022-10-0407:56pesterhazyI use this:
(defun cider-force-connect ()
(interactive)
(let ((repl (cider-current-repl nil nil)))
(when repl
(cider-quit repl))
(cider-connect '(:host "localhost" :port 48888))))#2022-10-0407:56pesterhazyThis works great... but it requires me to hardcode the nrepl port, which gets annoying with multiple projects#2022-10-0407:58robert-stuttafordhttps://github.com/robert-stuttaford/.emacs.d/blob/master/cider.el#L48-L63#2022-10-0408:30pesterhazySpeaking of which, I find this super useful. I call it cider-force-eval-buffer, and it connects and evals, all in a single shortcut (no questions asked)
https://github.com/pesterhazy/emacs.d/blob/master/elisp/my-functions.el#L20#2022-10-0408:31pesterhazyBecause always the first thing I do is to eval the current buffer, so I might as well connect then as well#2022-10-0408:34pesterhazyJust tried your snippet, works great @U0509NKGK!#2022-10-0409:08robert-stuttafordnice!#2022-10-0507:49robert-stuttafordhas anyone perhaps got the output of Eval last sexp and insert C-u C-x C-e matching the formatting of the Eval last sexp in popup buffer C-c C-p ?
when i use the popup, sorted maps print sorted and i get nicely pretty printed output.
when i use insert, it's sorted but not pretty printed, which when i use cider-format-edn-region on it it loses the sorting because of course it's no longer a sorted-map.#2022-10-0621:16Erick Bodinestarted in #C053AK3F9 , it was suggested to go here#2022-10-0621:25Erick Bodine^ turned out to be a bad maven download#2022-10-0705:39Drew Verleewith cider debug defun applied to (defn lol [x] (inc (foo/foo x))) i first
1. next
2. in
And the result is (inc (foo/foo x)) => 5, when i was hoping for it to go "in" the foo/foo function and let me move throw the internals of that expression. How do i do that? if i call debug on foo/foo then when i do next, next i will get into the function like i wanted. But i want to a way to step into functions without having to instrument them first.
Put another way, what does "in" do if not go into a function?#2022-10-0710:18jpmonettasthe cider debugger can only step thru instrumented functions, so you need to instrument all the stuff you want to step into before executing anything. As far as I know there is no way to instrument entire namespaces or an entire codebase#2022-10-0816:51oskarkvI have a problem with CIDER and Shadow-CLJS. Don't know what's wrong. Maybe it's not CIDER's fault. The problem is that evaluating with cider-eval-defun-at-point or cider-load-buffer sometimes doesn't work. Then it starts working for no apparent reason, only to stop working again soon after. I recorded a gif of the problem. If you look at the minibuffer, when it says Loading <file>... is when cider-load-buffer is not working, and when it says SPC e t is when cider-eval-defun-at-point is not working. When it says => something it is working. For some reason switching buffer to the REPL and back seems to make it work. Any ideas?
EDIT: Oh, now I noticed that cider-swich-to-repl-buffer changes the repl type from cljs:shadow to clj, but when I type something in the repl it becomes a cljs:shadow repl again. And while it's a clj repl evaling doesn't work. Still, it is annoying.#2022-10-0817:27ahungryHowdy all - I seem to remember on old lein projects, on jack-in I would end up with a user.clj file that was evaluated, or at the very least, the initial file I jacked in on would be loaded into the running cider repl session. I've built up a project from deps.edn, and that doesn't seem to be the case - how do I force loading of some files on initial cider connection? I'm feeling like it may be somewhat defined here https://docs.cider.mx/cider/config/project_config.html - with one of the clj flags#2022-10-0817:45vemvsay you have user.clj in a dev dir as usual.
then dev should be in your deps.edn :paths (for a :dev alias or however you want to name it) and then make sure you activate that alias in cider#2022-10-0818:04ahungryit's loadable via manual measures, or with a fn like:
(defun my-cider-connected-hook ()
(interactive)
(cider-switch-to-last-clojure-buffer)
(cider-load-buffer)
(cider-repl-set-ns (cider-current-ns))
(cider-switch-to-repl-buffer))
but it seems weird it doesn't load anything by default and I have to force the load#2022-10-0819:09vemvit's the :paths thing for sure, cider generally won't load code that isn't in your classpath (which is the correct behavior!)#2022-10-0823:52ahungryAnother QQ - when using .dir-locals.el, I want to let the cljs jack-in action know what REPL type so I don't have to choose 'figwheel-main', and subsequently 'dev' (env) at the REPL - what var would this be? I thought it was going to be:
(cider-cljs-repl-type . figwheel-main)
(eval . (cider-register-cljs-repl-type 'figwheel-main "(do (require 'figwheel.main) (figwheel.main/start :dev))"))
but that didn't seem to work out - I think the latter line may not even be correct (adjusted from cider doc page, but it seems more like maybe to define a brand new repl type)#2022-10-0906:09rolti have this config for shadow:
((nil . ((cider-default-cljs-repl . shadow)
(cider-shadow-default-options . ":dev")
(cider-offer-to-open-cljs-app-in-browser . nil)
(cider-preferred-build-tool . shadow-cljs))))#2022-10-0906:25PanelAny suggestion on how to keep cider-result previous values ?#2022-10-1009:26Benjaminevaling *1 might be an option
(nrepl-dict-get
(cider-nrepl-sync-request:eval "*1")
"value")
#2022-10-0917:07Benjamincan i "trace" a function with cider? Just logging the input and output. Or how would you do achieve it?#2022-10-0917:59vemvit might be possible but personally I'd just reach for Tufte which emphasizes being fast / non-invasive#2022-10-1009:29Benjamin👀#2022-10-1010:15djmhttps://docs.cider.mx/cider/debugging/tracing.html#2022-10-1010:15Benjaminsick#2022-10-1020:07Franco Gasperino@U015KH5ENEM can that be done with an anonymous fn / lambda#2022-10-1020:10djm@U01RGC7177E I don't know - try it and see. If not, I have found https://github.com/philoskim/debux to be a nice library.#2022-10-1020:12Franco Gasperinoi've tried it and it appears if cider needs a globally defined var. I've also tried to name the fn - however, it doesn't like that either. it wants the defn..#2022-10-1020:13Franco Gasperinolooking @ that library#2022-10-1020:15Franco Gasperinoquite interesting. thanks for the tip#2022-10-1213:36eggsyntaxAnyone else have trouble navigating to code in a .jar dependency?
I can pull up documentation for a function in a dependency with spacemacs/evil-smart-doc-lookup, and the *cider-doc* buffer shows the jar file location (`jar:file:/root/.m2/repository/...`) at the bottom, but if I put the cursor over it and press return, I get "user-error: Can’t find the source because it wasn’t defined with ‘cider-eval-buffer’".
Pretty sure that used to work for me -- anyone have a clue why it wouldn't now? The project I'm in switched fairly recently from lein to deps.edn, and I wonder whether that might be related.#2022-10-1215:24vemv> Can’t find the source because it wasn’t defined with ‘cider-eval-buffer’
that's an odd thing to say. Have you grepped which .el code is saying this?#2022-10-1216:30eggsyntaxYeah, the message shows up in both https://github.com/clojure-emacs/cider/blob/master/cider-xref.el#L90-L104 and https://github.com/clojure-emacs/cider/blob/master/cider-doc.el#L231-L245 and I'd guess it's the latter. A colleague suggested they might not be honoring cider-path-translation, which seems plausible (I do use it because we're running in docker).
In any case it turns out that I can get there with evil-goto-definition (or xref-find-definitions) so fortunately it's not a blocker. Will hopefully find time to file an issue later.
Thanks!#2022-10-1216:35vemvyeah the error message is somewhat confusing. It should say instead "Can't find the source because it wasn't defined with cider-eval-buffer or otherwise found"#2022-10-1216:36eggsyntaxI was a bit baffled when I saw it 😆#2022-10-1216:36vemvcider-path-translation is a good lead yeah. Honestly over the years I've learned to run the JVM locally and the services within Docker.
it might not satisfy purists but life is simply better that way :)#2022-10-1216:35Alex Miller (Clojure team)https://ask.clojure.org/index.php/12308/passing-command-arguments-clojure-cider-jack-gnuemacs-cider#2022-10-1216:35Alex Miller (Clojure team)^^ in case anyone can help there#2022-10-1305:11macrobartfastI just discovered cider-browse-ns… I like that the list shows docstrings (and this feature will encourage me to add them to my functions). Is there a way to jump to the function in that list from the list? Or is there another approach to seeing the functions (with or without docstrings) that exist in the current buffer, or another one… or globally organized by ns, and jump to it? +1 if there would be fuzzy narrowing by typing the function name.#2022-10-1322:02sreekanthb• You can open function cider-doc buffer by pressing Enter/Return, from there you can go to function definition.
• You can try https://github.com/bmag/imenu-list , It works with most of the programming languages.#2022-10-1402:57macrobartfastI’m ecstatic about imenu-list… thank you!#2022-10-1311:50Álmos ZöldHi guys! I'm looking for a way to use cider-jack-in-clj&cljs to use the same REPL for both frontend and backend. I'd like to only use deps.edn for managing dependencies, because as I saw in other issues, threads, cider-jack-in-clj&cljs does not really work well when using deps.edn + shadow-cljs.edn. My problem is that I don't really find the way to configure the two. The official docs are sparse, and shadow-cljses docs point to CIDER's docs, CIDER's docs point to the shadow-cljs docs, both of them lack the necessary config.
I know that I can just start the REPL-s separataly and connect with cider-connect but this is less than ideal if we have cider-jack-in-clj&cljs :)) What is the canonical way nowadays to achieve this?#2022-10-1312:34Álmos ZöldOr is it possible to even have a "combined" clj and cljs repl? Because I thought this way the function of cider-jack-in-clj&cljs. Right now, if I want to edit code on the frontend and the backend at the same time, and I switch, I have to open the respective repl, do something in it, and then does evaluation work in the source code buffers#2022-10-1806:40bozhidarRight now it's possible, but it's something that can be done potentially https://github.com/nrepl/piggieback/issues/73#2022-10-1809:24Álmos ZöldWell I solved it with setting the cider-merge-session variable to 'project so cider actually sends the evaluation to the correct repl and I can even switch to the correct one depending on the source buffer!
Which is actually an even better solution than the one I wanted in the first place.
It took some searching in the documentation, maybe it should be a bit higher for us beginners :)) Anyway, thank you for your work on the package, it really makes developing Clojure a relative breeze in Emacs.#2022-10-1313:14ericdallois it possible to make cider understand a test macro without explicitly set cider-test-defining-forms ?
At Nubank we have some test macros variations like defflow-x defflow-y and we need to keep adding to that variable, I'd love to make those macros have some test metadata which cider would understand#2022-10-1806:39bozhidarIt's possible, but it's not currently supported. Basically we'd need to apply the same mechanism we have for cider/indent to test-defining-forms for this to work. I felt this wasn't particularly important due to the limited number of test defining forms, but it's certainly doable.#2022-10-1812:17ericdalloGlad that makes sense to you! It'd be really handful for us indeed, should I open a issue on cider ? If it's not that hard I can try to help if provided some guidance :)#2022-10-2009:19bozhidarSure.#2022-10-2009:20bozhidarI definitely won't have time for this, but I think it won't be hard to do.#2022-10-1610:16Jakub Arnoldhey guys, any idea what could be wrong when I'm getting thi when I cider-jack-in-cljs in a simple shadow-cljs project? happens with this <https://github.com/shadow-cljs/quickstart-browser>#2022-10-1611:47lassemaattaDid you remember to start the watch process with npx shadow-cljs watch app?#2022-10-1619:06Jakub Arnoldbut that's the thing, I've already asked in other places and it seems cider-jack-in-cljs should detect shadow-cljs and start the watch when you jack in automatically, no?#2022-10-1619:12Jakub Arnoldeven if I do start it manually with npx shadow-cljs watch app and then cider-connect-cljs and it does connect it doesn't seem to work, as eval-ing expressions "doesn't do anything", for example if I eval (js/alert "foo") it won't open an alert, even though emacs acts like if it did eval ... I do get recompile/reload on save, but that's coming from npx shadow-cljs watch app that runs independently from CIDER/emacs, seems nothing on the emacs side works
but in a similar project that uses figwheel I can eval things with CIDER the same way, and "it works", as in eval-ing things actually evaluates them as expected
if I open a similar example project with#2022-10-1722:39vemvIf you happen to be using Midje:
with today's release, you can set in advance (e.g. in your user profile) the "-Dmidje.check-after-creation=false" JVM property, and CIDER no longer will run tests as it loads/evals test code, leaving the user experience on par with clojure.test.#2022-10-1806:15bozhidar@vemv I guess we should mention this somewhere in CIDER's user docs as well.#2022-10-2004:50hifumi123Is it possible to use cider-jack-in-cljs with lein-shadow? Maybe adding a custom task for the lein repl action?
EDIT: I ended up replacing shadow-cljs with figwheel-main in the end. And it works perfectly with CIDER#2022-10-2009:26andrewzhurovM-. jumping to a definition of a symbol of a .jar dependency opens that file, however when doing C-x C-f you're not inside of that dependency's source code, but in a folder with its .jar
Is there a way to M-. into its source code?
I heard in LSP they unpack .jar and navigate there, for example, and that sounds good, can it be done with cider? (I'm using eglot instead of LSP)#2022-10-2009:29vemvare you asking about clj or java code?#2022-10-2009:34andrewzhurovclj#2022-10-2009:40vemvwhat practical problem are you experiencing?#2022-10-2011:21andrewzhurovI jumped to a function definition of aws/invoke and wanted to search project-wide (aws cli) usage of that function's arg#2022-10-2011:22andrewzhurov(I ended up not needing it, but I thought that having project's source at hand is useful, as I recalled wanting to explore project's source a couple of times before, and came to ask how to)#2022-10-2011:23andrewzhurovatm to do so I'm clonning projects locally and using :local/root to point to them, which is tedious#2022-10-2012:27vemv> I jumped to a function definition of aws/invoke and wanted to search project-wide (aws cli) usage of that function's arg
For clarity: so for dependency foo and function bar you want to find usages of bar within foo (and not within your project)?#2022-10-2012:48andrewzhurovyes#2022-10-2012:50andrewzhurovand explore project foo in other ways as-though it is another project source on disk#2022-10-2013:29vemvFor full-blown interactive functionality, CIDER / refactor-nrepl aren't the best tool for the job. The reason being: they're based on runtime info, and we can't preemptively eval the whole classpath.
clojure-lsp is fine for this use case.
If you clone the repo as of the relevant commit/tag, of course you can have the full CIDER project for that repo, provided that you started a dedicated repl for it. I wouln't recommend :local/root as much: it still doesn't mean that CIDER will analyze all those namespaces (it only has direct access to stuff that has been require d or otherwise evaled)
And as a quick hack, you might have luck with a jar-specific grep. It might not hard to build a little custom emacs feature: "grep within the jar containing the current buffer"#2022-10-2013:30vemvThis might sound like a big limitation in CIDER, but IME your use case is very much rare. For those rare occasions you can clone, start a repl, and use interactive functionality all in the same Emacs session - no restarts!#2022-10-2013:33vemvIt's also worth noting that CIDER has no real reason to "unpack" .jar to disk. In fact doing so would be very much dangerous - it can easily alter the classpath, resulting in opaque issues that would backfire later.
tldr CIDER, because it co-habitates with the jvm/clojure runtimes, has to use certain cautions.#2022-10-2018:41Chris ClarkI hit this same limitation all the time. I’m maybe spoiled from other languages (like emacs-lisp and python) where it’s totally normal to M-. into a 3rd-party library and then just poke around, maybe check out the README, etc.
In jars: I’ve noticed that dired actually handles the jar pretty well. If I dive into some 3rd-party library clojure code, then open dired, then hit <enter> on the .jar that it suggests, it goes into “Zip Archive” mode and allows me to see all the files in the jar and open any of them. Not as great as a git repo, but that has still been really useful for me!#2022-10-2015:04João Pedro de Amorim Paulahi guys. i have a project in which i start it with cider-jack-in-clj&cljs, using a shadow as my preferred build tool because it already starts the nREPL and configures the middleware and etc. but i'm noticing that, because of that, whenever i try to print something from the Clojure part of my application, it shows up on the ClojureScript REPL instead of the Clojure one. do you know if there's a way to configure so that it prints to the correct REPL?#2022-10-2123:56lispers-anonymousHello, I am doing some research for this issue https://github.com/joaotavora/eglot/issues/661 and was wonder how cider manages to jump to definitions inside jar files. I have a solution that is working for me. However, I am looking for prior art and am having trouble finding the relevant code.#2022-10-2200:00lispers-anonymousAnswered my own question!!! https://github.com/clojure-emacs/cider/blob/20debc82696bdd5ce807618d02665b92a4274492/cider-common.el#L396#2022-10-2314:31OknoLombardawhat is v-user here? Can I change it somehow?
https://github.com/clojure-emacs/cider/blob/master/nrepl-client.el#L605#2022-10-2318:17bozhidar@noraburo See with-parsed-tramp-file-name.#2022-10-2319:08OknoLombardaaah, elisp still looks too alien to me. Thank you#2022-10-2407:24OknoLombardatake a look when you have time, please
https://github.com/clojure-emacs/cider/issues/3261#2022-10-2401:44yuhanDoes anyone else have issues with using cider-apropos? Selecting anything in the apropos buffer just throws a "not connected" error#2022-10-2406:43bozhidarSelecting how? Seems to work just fine for me.#2022-10-2406:52yuhanStrange, now it's working for me.. will file an issue if I ever get to reproduce it#2022-10-2409:12furielIs there a way to automatically add the jenv exec string to the beginning of the cider-jack-in commands? I can edit the command manually during cider-jack-in, but maybe there is a way to override the default.#2022-10-2608:27pieterbreedMaybe this package can help you? https://github.com/shellbj/jenv.el#2022-10-2812:18furielThanks for the idea! I check it out.#2022-10-2815:07dev-hartmannhello folks, I’m trying to create a cider addition for clojure-cli to run aliases if present in the deps.edn, pretty much what is already available for shadow-clj builds#2022-10-2815:07dev-hartmann(defun cider--deps-parse-aliases (hash)
(let* ((builds (when (hash-table-p hash)
(gethash :aliases hash)))
(build-keys (when (hash-table-p builds)
(hash-table-keys builds))))
(append build-keys '(:none))))
(defun cider--deps-get-aliases ()
(let ((deps-edn (concat (clojure-project-dir) "deps.edn")))
(when (file-exists-p deps-edn)
(with-temp-buffer
(insert-file-contents deps-edn)
(let ((hash (car (parseedn-read '((map . identity))))))
(cider--deps-parse-aliases hash))))))
(defun cider-get-deps-aliases ()
(interactive)
(let ((options (completing-read "Select alias to run: "
(cider--deps-get-aliases))))))
#2022-10-2815:21dpsuttonlets move this to a thread#2022-10-2815:21dpsuttonyou’ll need to figure out how this fits into the jack in process overall. Presumably you only ever want to do this when its a deps.edn project. Sometimes there can be multiple so you might have to check the var that sets a preferred build tool. What do we do if there is no preferred build tool and a project.clj file and a deps.edn file. If the clojure-cli-aliases defvar (forget the exact title) is set, do you offer this? Presumably not. But if that is set, can you supply a prefix to override it? If so, do they combine or completely override.
Build this locally, iron out the kinks, and then PR or open an issue with this proposed strategy and iron out the decision points in the issue then implement#2022-10-2815:21dev-hartmannall valid points
[5:19 PM] will try to figure out the happy path first, to see If i am capable of building this and then work through the branches
[5:20 PM] I know that leiningen needs the with-profile args
[5:20 PM] and I now that theres the prefered build tool var
[5:21 PM] And I think before the jack-in process if prefered build tool is nil there’s a selection which kind of process you want so this will be set#2022-10-2815:22dpsuttonBuild this locally, iron out the kinks, and then PR
[10:18 AM] or open an issue with this proposed strategy and iron out the decision points in the issue then implement#2022-10-3021:30lilactownI need to run a custom main when starting my REPL, but I'd still like CIDER to inject the version of deps and middleware to it. I have setup my main to pass in the CLI options to the nREPL cmdline -main, so I can modify this to be the jack in command:
/opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.28.6"}}}' -M:dev -m user --middleware '[cider.nrepl/cider-middleware]'
where the :dev alias is just
{:dev {:extra-paths ["dev"]
:extra-deps {org.clojure/tools.namespace {:mvn/version "1.3.0"}}
:jvm-opts ["-ea"]}}
the problem I'm having now is trying to automate this via .dir-locals.el. It would be pretty handy to allow me to specify everything after the -Sdeps {,,,} map, but I don't think this is possible given the customizations cider.el provides#2022-11-0214:53dev-hartmannjust a quick question, cider jack in doesn’t respect my entry in dir-locals#2022-11-0214:54dev-hartmann(cider-clojure-cli-global-options . "-M:repl")
#2022-11-0214:54dev-hartmannthat’s what i have#2022-11-0214:54dev-hartmannusing cider jack in I get#2022-11-0214:54dev-hartmann/opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.28.6"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.5"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl#2022-11-0214:55dev-hartmannwould have expected : -M:repl:cider/repl#2022-11-0214:57jkxyzHave you verified the value of cider-clojure-cli-global-options in the buffer with M-x describe-variable?#2022-11-0214:57dev-hartmannyes, it’s set#2022-11-0214:58vemvI think you need escaped double-quotes https://github.com/clojure-emacs/cider/pull/3224#2022-11-0215:03dev-hartmannOk, i just found out it’s not picked up, globally it’s nil#2022-11-0215:07dev-hartmannok, neither global-options nor cli-aliases variables are picked up#2022-11-0215:07dev-hartmannafter changing I did a rever-buffer on the open buffer I was trying the jack in on#2022-11-0215:14dev-hartmannhm, is there a way to check if dir-locals is loaded?#2022-11-0215:20jkxyzI normally just kill the buffer (make sure it’s properly gone), reopen it, and inspect the variable #2022-11-0215:22jkxyzI’d also check in the docs which variables do the thing you want - looks like there’s also cider-clojure-cli-aliases #2022-11-0215:22dev-hartmannI think cli-alies is the correct one#2022-11-0215:23dev-hartmannhm, still not picked up … restarted emacs completely#2022-11-0215:24jkxyzAlso check the value of enable-local-variables #2022-11-0215:24jkxyzI think it should be t to warn you on unsafe local variables #2022-11-0215:25dev-hartmannit’s set to t#2022-11-0215:26jkxyzNot sure what else to check apart from the syntax of your dir-locals.el #2022-11-0215:26dev-hartmannIf I set the var via set-variable it works as expected#2022-11-0215:28dev-hartmann(clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . ":repl")))#2022-11-0215:29dev-hartmannthat’s all there is to the .dir locals#2022-11-0215:30jkxyzHm what if you use nil instead of clojure-mode? #2022-11-0215:33dev-hartmannnope, still not picked up#2022-11-0215:36dev-hartmannhm, maybe doom emacs is the issue#2022-11-0313:07BenjaminHow do I communicate url for cider info lookup? trying
(defn foo {:url ""} [])
this does not do it.
What I really want to achieve is cider rendering a url in the help doc view buffer for foo . Just putting a remote url in the doc string doesn't turn out the way I want it. It ends up trying to resolve it as symbol#2022-11-0419:05ennI think I’ve found a bug: if there is anything before, but on the same line as, the ns form in a file, CIDER doesn’t recognize tests defined by cider-test-defining-forms and you get the error “No test at point” even when the point is in a test. Minimal example:
1 (ns some-test
(:require [clojure.test :refer [deftest is]]))
(deftest unrecognized-test
(is (= 1 1)))#2022-11-0517:03bozhidar@enn Please, file a ticket about this.#2022-11-0517:14ennDone: https://github.com/clojure-emacs/cider/issues/3265#2022-11-0604:26Drew VerleeI followed the instructions to get fuzzy candidate matching in cider here https://docs.cider.mx/cider/usage/code_completion.html#fuzzy-candidate-matching
here is the variable
cider-repl-mode-hook is a variable defined in 'cider-repl.el'.
Its value is
(cider-company-enable-fuzzy-completion spacemacs/toggle-evil-safe-lisp-structural-editing-on spacemacs//activate-smartparens eldoc-mode spacemacs//init-company-cider-repl-mode company-mode)
But i don't get fuzzy matching. (see picture) What should i try next?#2022-11-0604:44Drew Verleecomplete does seem to have the fuzzy matches
(cider.nrepl.middleware.complete/complete {:ns 'core
;; grab all functions starting by c:
:prefix "mi"})
;; => ({:candidate "min", :type :function, :ns "clojure.core"}
;; {:candidate "min-key", :type :function, :ns "clojure.core"}
;; {:candidate "map-indexed", :type :function, :ns "clojure.core"}
;; {:candidate "mix-collection-hash", :type :function, :ns "clojure.core"})#2022-11-0604:45Drew Verleethis is going to be because lsp is doing the completion or something. I remember this being annoying like a year ago.#2022-11-0604:51Drew Verleesame...
ELISP> (cider-sync-request:complete "mi" (cider-completion-get-context) )
((dict "candidate" "min" "ns" "clojure.core" "type" "function")
(dict "candidate" "min-key" "ns" "clojure.core" "type" "function")
(dict "candidate" "map-indexed" "ns" "clojure.core" "type" "function")
(dict "candidate" "mix-collection-hash" "ns" "clojure.core" "type" "function"))
#2022-11-0604:29Drew VerleeOnly slightly related, i also tried to follow the instructions here to change my https://nrepl.org/nrepl/usage/misc.html#code-completion
You can either specify a custom completion function in the requests (via the complete-fn key) or by setting nrepl.middleware.completion/*complete-fn*.
user=> (set! nrepl.middleware.completion/*complete-fn* my.namespace/my-completion)
And it threw an exception when i called set! (see picture ty 🙂 )#2022-11-0604:30Drew Verleecider version 1.5.0.#2022-11-0611:54vemvgenerally only a few dyn vars (those bundled with a clojure repl) can be freely set!-table
you need to use binding instead#2022-11-0621:37Drew Verlee@U45T93RA6 i'm starting to think that nrepl doesn't use the compliment library directly sense version 0.8.
I traced nrepl.middleware.completion/complete-fn to
This
(ns nrepl.util.completion
"Code completion functionality.
The functionality here is experimental and
the API is subject to changes."
{:author "Bozhidar Batsov"
:added "0.8"}
(:require [clojure.main]
[nrepl.misc :as misc])
(:import [java.util.jar JarFile]
[ File]
[java.lang.reflect Field Member]
[java.util.jar JarEntry]
[java.util.concurrent ConcurrentHashMap]))
;; Code adapted from Compliment ()
and I'm going to be reading this post from 2020 about completion changes.
Just sharing with you in case it's news to you as well.
https://metaredux.com/posts/2020/06/15/nrepl-0-8-evolving-the-protocol.html#2022-11-0621:54vemvyou are assessing nrepl, while you should be assessing cider-nrepl
for what concerns us here, nrepl.util.completion powers completions in e.g. lein repl completions, but is otherwise irrelevant to cider's machinery#2022-11-0621:54vemv(sorry if that is confusing!)#2022-11-0621:55vemvin the end nrepl can be thought of simply as a pipe - https://github.com/clojure-emacs/cider-nrepl has most if not all of the features you get to use in CIDER#2022-11-0622:22Drew VerleeBy lein repl, were talking about the repl started at the command line by lein?#2022-11-0622:49vemvyes#2022-11-0607:18bozhidar@drewverlee I’d suggest filing a couple of tickets, so we can properly follow up on both issues.#2022-11-0610:26Drew VerleeHow do i ask emacs to tell me what's doing the completion?
I suspect this might not even be a cider issue.
This has been nagging me for years and i can't seem to figure it out, in part because i don't know how to get good diagnostic info to share with anyone. :(#2022-11-0611:15Drew Verleei think the completion-styles-alist might be what lists all the completion functions (the name is misleading if so)#2022-11-0611:20Drew Verleefwiw, i more or less did https://github.com/clojure-emacs/cider-nrepl/issues/732 a year ago, and though the context (shadow-cljs) was slightly different, i don't think those differences matter much here, and I think my confusion and the reason completion doesn't work as expected in multiple areas is probably the same.
fwiw trying the completion across two emacs profiles. Spacemacs and a nearly fresh install of Doom.
but sure ill open another ticket in the morning 🙂 .#2022-11-0816:12Applein emacs, when i connect to a shadow-cljs repl initially, cider thinks that i'm connected to a clj repl. all good.
then if i does a switch like this
shadow.user> (shadow/repl :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user>
then cider notices that i'm connected to a cljs repl while at the same time thinks i'm disconnected from a clj repl
i can start a second clj repl to the same shadow-cljs and leave it in clj mode, but cider is not to be able to recognize that i'm connected to both clj and cljs repl.
when i activate either the clj or cljs repl buffer, cider thinks i'm connected to the respective repl but disconnected from the other.
how to make cider support both repls at the same time?#2022-11-0816:13dpsuttonmy memory is that it supports both. There is a bug that it only sees that last repl you put your cursor in though. But just highlighting the clj or cljs repl buffer will make it “see” that one. A bug in that regard but it will work#2022-11-0816:15Apple"it only sees that last repl you put your cursor in" precisely#2022-11-0816:33Applethanks to Ag in #C099W16KZ channel. the solution is to use cider-connect-sibling-cljs after the clj repl is up#2022-11-0816:33Applebeautiful!#2022-11-0907:54bozhidarAll of this is documented here - https://docs.cider.mx/cider/usage/managing_connections.html#2022-11-0913:53Applei've always wondered: can i read the doc today say at ver 0.1.0, and come back 3 months later and see that the version has been bumped to 0.3.0 and the system can just show me the diff between them.#2022-11-0917:47pavlosmelissinosWhat would that look like? I assume you need something more sophisticated than git diff?#2022-11-0919:22AppleSince documentation is mostly text, so output to the like of "diff -y --left-column" is fine to me, with the different lines either inline or on the side.#2022-11-0919:47jumarYou can use magit on a text selection/region#2022-11-0920:04pavlosmelissinosMagit is amazing but if you just want a git diff in emacs, the built-in vc-version-diff may also get the job done (vc is quite decent, check it out if you haven't!).
(The question doesn't seem to be related to cider, so perhaps #emacs would have been a better place for it?)#2022-11-1017:42vlnnHi. Did anyone bothered to add evaluation time to the cider’s eval overlay? I suspect i should store the timer between calls in cider-before-eval-hook and cider-after-eval-hook — or is there some already invented wheel for that? @bozhidar?#2022-11-1017:49bozhidar@vlnn-github There’s none, although this was proposed several times. That’s fairly easy to do both on the client and the server side. Probably it should be done server-side to be more accurate, though. (otherwise the encoding/decoding + network time will skew the elapsed time a bit).#2022-11-1017:50vlnnso the time should/could be returned by let’s say nrepl as metadata?#2022-11-1017:50bozhidarI think we added some client-side timestamps to the nREPL messages in the server log in the past - something similar can be the basis for a client-side implementation if one wishes to pursue one.#2022-11-1201:28Drew Verleeis there a way to get information about a dep i have added to my deps.edn, after i have started my nrepl, but before i require it? For example, will something tell me the required expression thats needed e.g (require '[clj-http.client :as client]) . Or do i have to go to github, like i have been dong all these long years. No be clear, this isn't a major headache, just asking in case there is some tiny productivity win i'm missing out on.#2022-11-1201:32vemvhaven't heard of any such feature
however, it'd doable (implementable) like this:
• add dep
• start nrepl
• identify the .jar corresponding to the dep within the classpath that is found at runtime
• search for README.md within .jar
• open it in emacs, maybe jumping directly to the first (require call (using regex)#2022-11-1201:33Drew Verleethats super helpful. I need to start recording these todo items in a list so i can rank them.#2022-11-1201:34vemv🍻 . looking forward to a few PRs :)
this one sounds to me like a nice one for clj-refactor.el (which has some project.clj / deps.edn goodies)#2022-11-1203:31vemvsadly I was wrong - README.md files aren't typically bundled in .jars (project.clj files are, which is mistook them for)#2022-11-1203:33vemvhowever you can do something pretty similar:
• add dep
• start nrepl
• identify the .jar corresponding to the dep within the classpath that is found at runtime
• identify all the .clj files contained within that .jar
• sort them by likelihood of being the "main" ns (e.g. foo.core), and let the user choose one of them, using Elisp completing-read .
• finally, copy the selection to the clipboard so that one can paste that into an actual ns buffer (since the whole op was triggered from project.clj)#2022-11-1622:20Drew VerleeI'll give this a try over the weekend, thanks for the head start.#2022-11-1321:40frozenlockIs there a way to get cider/eldoc to display a Reagent component expected arguments?
(The vector form, like this: [my-component "hello-world"])#2022-11-1322:05frozenlockHmmm... looks like it can't be done unless this line is modified https://github.com/clojure-emacs/cider/blob/master/cider-eldoc.el#L341#2022-11-1422:25mister_mare there any doom emacs users here that are using CIDER? I am seeing some weird behavior when typing almost any type of form for example (nth ...) I am expecting to see the nth method signature in the minibuffer that guides me to what the next parameter for nth is but I am seeing it show for like a few milliseconds then get cleared. Wondering if anyone knows what doom-emacs specific thing might be messing with this. I'll take it to the doom emacs discord, but was just curious if anyone's seen that.#2022-11-1508:52djmIs Doom using lsp-mode? Try (setq lsp-enable-hover nil) if so.#2022-11-1517:57mister_mI am using lsp! I'll give that a try a little later, thank you#2022-11-1500:50mister_mActual cider specific question: I have a deps.edn file that previously had zero dependencies. I've just added a :dev alias with a single item extra-paths vector to ["src/dev"]. I've also added an :extra-deps key with a library. When I try to evaluate a namespace form that uses this dependency I understandably find that this thing isn't found on the classpath.
I know dependencies are injected on cider-jack-in - but I've already previously done that. What is the shortest path to getting this new dependency on my classpath so I can use it in this src/dev/blah.clj file?#2022-11-1503:10mister_mI was able to do this with C-u C-u M-x cider-jack-in then adding :dev to the existing server commadn#2022-11-1503:10mister_mprobably could also add this to an elisp auto load file for the whole project#2022-11-1617:38johnny.martinCider is great because it does a lot of automatic stuff for us, and sometimes i forget where and what Cider does. I believe the extra paths will only stick if you cider-jack-in using argument -A:dev#2022-11-1617:42johnny.martinAnother way to confirm is instead to manually start clojure from the command line, clj -A:dev then do a cider-connect. Once your up and running in a Cider session you can try to diagnose your classpath by doing M-x cider-classpath Hope this helps...#2022-11-1605:22GeorgeI've been playing around with tracing, and wondering about the difference between C-c M-t v tracing and invoking the debugger, exiting with trace, which seems to show a more detailed trace#2022-11-1605:26Georgefor example, with regular trace, it looks like,
TRACE t9036: (rich4clojure.easy.problem-090/__ #{1 3 2} #{4 5})
TRACE t9036: => #{[2 5] [3 4] [1 4] [1 5] [2 4] [3 5]}#2022-11-1605:29Georgecomparing that to https://docs.cider.mx/cider/_images/tracing.png it seems less detailed?#2022-11-1605:31Georgemaybe it's just that first example is so simple I guess#2022-11-1819:26jumarIsn’t that because the function in the picture is recursive?#2022-11-1605:24Georgethe trace I get with the regular tracing doesn't look like the trace in the CIDER docs either, maybe I'm missing something?#2022-11-1810:10pavlosmelissinos;; ns x
(def foo "something")
;;ns y
(def foo x/foo)
;;ns z
(println y/foo)
Changing the value of x/foo to "something else" requires reevaluating y/foo otherwise ns z doesn't pick up the change. This was a bit unintuitive but I suppose it is expected because vars != refs (?)... I get the same behaviour when x/foo is a function.
Is there a cider function that will reload all of the nses in between automatically? cider-load-buffer and cider-ns-refresh don't work.#2022-11-1811:04Rupert (All Street)If you use integrant -then you can use a library called https://github.com/weavejester/integrant-repl - that will detect all files that have changed and reload them correctly according to their dependency graph. I have it set to a hotkey in emacs.#2022-11-1811:13pavlosmelissinosThanks, I'll check it out!
I thought cider-ns-refresh was supposed to do that as well (both use clojure.tools.namespace under the hood)
I'm starting to suspect there's something wrong with my setup :thinking_face:#2022-11-1815:46pithylessThis is why sometimes you'll see things like:
(ns x)
(defn foo [] "something")
(ns y)
(def foo #'x/foo)
(ns z)
(y/foo)
Now, if you change x/foo, you will always get the newest value, since y/foo is a reference to the var and not a specific implementation.
BTW: This works kind of by magic, because Clojure will silently deref vars if you treat them as function calls. If foo was a def not a defn in namespace z you would need to first deref: @y/foo#2022-11-1815:52pithylessI think a good example of this in practice is in the reitit docs, where it shows how to differentiate between a dev router (recompiling on request/save/whatever) and a production router (compiled and memoized).
https://cljdoc.org/d/metosin/reitit/0.5.18/doc/advanced/dev-workflow?q=dev#an-easy-fix#2022-11-1815:56pithylessNotice in particular, that if you think through the cases where this kind of behavior may be beneficial (dev vs prod, dynamic vs static) - you can architect a REPL-friendly system without having to rely on specific tooling (like integrant-repl or clojure.tools.namespace.refresh).#2022-11-1816:11pavlosmelissinos> you can architect a REPL-friendly system without having to rely on specific tooling (like integrant-repl or clojure.tools.namespace.refresh).
Indeed! To be honest I'd rather not use either 🙂#2022-11-1821:02ghadihow can I control the default print output of byte arrays?#2022-11-1821:04dpsuttontry
(def ^:dynamic *pretty-objects*
"If true, cider prettifies some object descriptions.
For instance, instead of printing functions as
#object[clojure.core$_PLUS_ 0x4e648e99 \"clojure.core$_PLUS_@4e648e99\"]
they are printed as
#function[clojure.core/+]
To disable this feature, do
(alter-var-root #'cider.nrepl.print-method/*pretty-objects* not)"
true)#2022-11-1821:04dpsuttoni’m not 100% sure this is the cause but a good first attempt#2022-11-1821:22dpsuttoni think this is the default pretty printer?
(clojure.pprint/pprint (.getBytes "foo"))
[102, 111, 111]
#2022-11-1821:22dpsuttonhttps://docs.cider.mx/cider/usage/pretty_printing.html#configuring-a-printing-function#2022-11-1821:23ghadiohhhhh#2022-11-1821:23ghadipprint is doing this!?#2022-11-1821:24dpsutton❯ clj
Clojure 1.11.1
user=> (require '[clojure.core.server :as server]
'[clojure.string :as str]
'clojure.test
'clojure.pprint)
nil
user=> (clojure.main/repl
:prompt (fn [] (printf "%s=> " (peek (str/split (str *ns*) #"\."))))
:eval (fn [f] (binding [clojure.test/*test-out* *out*] (eval f)))
:read server/repl-read
:print clojure.pprint/pprint)
user=> (.getBytes "foo")
[102, 111, 111]
user=> :repl/quit
nil
user=> (.getBytes "foo")
#object["[B" 0x3bb8aabc "[B@3bb8aabc"]#2022-11-1821:24dpsuttonyup#2022-11-1821:25dpsuttonswitch the pretty printer to fipp and it’ll be what you expect#2022-11-1821:29ghadigreat, thanks @U11BV7MTK!#2022-11-1821:02ghadithey are showing up as if by (seq byte-array)
[-8, -64, 77, 61, 79, 96, 76, -112, -93, 67, -57, -7, 76, 124, 30, 121]
#2022-11-1919:52macrobartfastIs there anything like cider-pprint-read-and-eval-defun-at-point?
I use cider-read-and-eval-defun-at-point and I also use cider-pprint-eval-defun-at-point but if I am using the latter I end up typing out a call to function so that I can call it then deleting it. Now that I have gotten used to pprint I tend to do this every time.#2022-11-2218:56bhaumanhey I’m getting “Are you sure you want to run cider-jack-in without a clojure project?” Looking at the source this seems to only come up if the project-dir can’t be found? Why would the project dir not be found?#2022-11-2218:58bhaumanmore context: I just updated cider to the latest and this is a new project generated by clj new#2022-11-2218:58dpsuttonupdate clojure-mode. it probably isn’t aware of deps.edn#2022-11-2218:58dpsutton(and ps, great to see you again!)#2022-11-2218:59dpsutton(defcustom clojure-build-tool-files
'("project.clj" ; Leiningen
"build.boot" ; Boot
"build.gradle" ; Gradle
"build.gradle.kts" ; Gradle
"deps.edn" ; Clojure CLI (a.k.a. tools.deps)
"shadow-cljs.edn" ; shadow-cljs
)
"A list of files, which identify a Clojure project's root.
Out-of-the box `clojure-mode' understands lein, boot, gradle,
shadow-cljs and tools.deps."
:type '(repeat string)
:package-version '(clojure-mode . "5.0.0")
:safe (lambda (value)
(and (listp value)
(cl-every 'stringp value))))
if you find this bit in your current clojure-mode it is probably missing deps.edn entry#2022-11-2219:02bhaumanah ah ah#2022-11-2219:03bhaumanAnd thanks @dpsutton!!#2022-11-2219:08bhaumanAnd that did it! It’s too bad that clojure-mode didn’t get updated when I updated cider. That was a tough one to solve.#2022-11-2219:09dpsuttonluckily there is a great #C0617A8PQ channel for questions before you spend too much time on tooling 🙂#2022-11-2219:10dpsuttonits usually pretty quiet in here so any questions are always more welcome#2022-11-2219:11hifumi123M-x straight-pull-all followed by M-x straight-build-all gives me lots of bleeding-edge versions of Emacs Clojure packages, but it's also let me avoid these kind of situations#2022-11-2219:11bhaumanSo Vscode is really taking over heh?#2022-11-2219:11hifumi123Right now, I'm dealing with a nasty issue with CIDER where dir-local variables do not influence how CIDER injects the enrich-classpath middleware#2022-11-2219:14vemvenrich-classpath author here.
LMK if I can help in any way.
since Enrich is disabled by default at the moment, knowing about unforeseen interactions would be incredibly helpful :)#2022-11-2219:18hifumi123woah... First of all thanks for the blazing fast response! Secondly, I think the issue is actually with CIDER rather than your awesome library 🙂
Here's how my .dir-locals.el looks like
((nil . ((cider-enrich-classpath . nil)
(cider-preferred-build-tool . lein))))
When I run M-x cider-jack-in-cljs on my project, CIDER still decides to inject the enrich-classpath middleware. I have it enabled by default but I disable it for CLJS projects since figwheel currently breaks with it.
When I explicitly (setq cider-enrich-classpath nil) in e.g. IELM, the problem goes away. So I'm not sure what's really going on here.#2022-11-2219:21vemvLet's say you open a directory with those dir-locals.
If you M-: (https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html) and type cider-enrich-classpath , what is the output?
If it evaluates to anything other than nil , basically that's the problem: .dir-locals are are not working as configured#2022-11-2219:22hifumi123Hm... it evaluates to nil yet CIDER invokes lein as follows:
/opt/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.0.0\"\] -- update-in :dependencies conj \[cider/piggieback\ \"0.5.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.28.7\"\] -- update-in :plugins conj \[mx.cider/enrich-classpath\ \"1.9.0\"\] -- update-in :middleware conj cider.enrich-classpath/middleware -- repl :headless :host localhost
#2022-11-2219:25vemvThat's pretty weird because cider-enrich-classpath only exists in cider.el, in exactly 3 places: the defcustom declaration and 2 call sites.
Those call sites are inside defuns, so they're using whatever value was last set.#2022-11-2219:27vemvMaybe use this pattern:
(advice-add 'the-cider-relevant-function ':around 'my-spy)
where my-spy is a defun that prints the current value of the cider-enrich-classpath defcustom#2022-11-2219:35hifumi123It evaluates to t in the advice function yet when I eval in the buffer it's set to nil.#2022-11-2219:36hifumi123Here's the specific function I added.
(advice-add 'cider-jack-in-cljs :around (lambda (&rest args)
(message (format "%s" cider-enrich-classpath))))
#2022-11-2219:41vemvhmm... try printing default-directory also. Perhaps it's bound to something other than your project directory and therefore its dir-locals are disregarded?
(kind of a crazy hypothesis but also plausible :) )#2022-11-2219:45hifumi123Updated advice function
(advice-add 'cider-jack-in-cljs
:around (lambda (&rest args)
(message (format "%s, %s" default-directory
cider-enrich-classpath))))
And I get the output ~/Developer/Clojure/project/, t . The default-directory is in the correct directory.#2022-11-2219:48hifumi123Oh I think I know what might be happening. Here's my init.el for CIDER:
(use-package cider
:commands cider-jack-in
:config (setq cider-use-tooltips nil
cider-enrich-classpath t
cider-lein-parameters "repl :headless :host localhost"))
Maybe CIDER is being lazily loaded by straight.el and it runs the config when I finally invoke a function defined in CIDER?#2022-11-2219:49vemvit does sound very likely :)#2022-11-2219:49hifumi123That looks to be the culprit so far: a freshly restarted Emacs is telling me cider-enrich-classpath is unbound.#2022-11-2219:50hifumi123Removing the :commands bit fixed my issue 😄#2022-11-2219:50vemvyup that's the smoking gun
happy you got it!
Would be curious about your fix later#2022-11-2219:51vemvI would have guessed that the
cider-enrich-classpath t
bit was the one to be tweaked. Dunno how use-package can dir-locals can interact#2022-11-2219:53hifumi123I think the :commands key in use-package makes the package lazily loaded (though you can force it to load with a supplied command). So the situation must've been something like:
1. Emacs starts up, but cider is neither loaded nor configured.
2. dir-locals sets cider-enrich-classpath to nil.
3. cider-jack-in-cljs forces cider to be loaded and configured.
4. cider-enrich-classpath gets set to t
#2022-11-2219:54vemvYes, that makes sense.#2022-11-2219:11hifumi123also IME i see cursive + intellij taking over#2022-11-2220:42cflemingI would love that to be true, but Cursive use has been astonishingly consistent at almost exactly 30% for several years now (according to the community survey).#2022-11-2219:12dpsuttoni love emacs and don’t care for text editors that are focused around a project directory. But the beginner experience of vs code is leagues ahead of emacs for sure#2022-11-2219:13hifumi123At my work place, IntelliJ and Emacs is pretty evenly split, then there's that one person using Vim. I've surprisingly not seen VS Code used anywhere, yet... but I do know it's popular in the "outside world", so to speak (e.g. luminus template generates a bunch of vs code specific files for you)#2022-11-2219:13bhaumanIt’s funny how much time it takes to learn the lesson that if you have a data problem and any DATA problem (code is data, text is data), emacs has a solution.#2022-11-2219:15bhaumanI just had to ingest a bunch of information related to passing a citizenship test and emacs of course has org-drill. which has a spaced repetition, flash cardy quizzing functionality#2022-11-2219:15vemvtoday I was about to M-x sort-lines and got to discover M-x solitaire#2022-11-2219:16bhaumanCopy and paste the study manual and the a few emacs macros and I’ve got a test in a few hours.#2022-11-2219:16bhaumanyeah good ol solitaire#2022-11-2219:17dpsuttonwow. @bhauman i would love to read an article about that. i don’t have that much emacs-fu but would love to see it#2022-11-2219:18bhaumanhttps://gitlab.com/phillord/org-drill/#2022-12-0507:39jackrusher@bhauman I'm quite embarrassed to say that I hallucinated the wrong name! 😳 No obituary required!#2022-12-0517:38bhaumanGood to know!!! Wish I hadn’t sent that card!#2022-11-2219:19bhaumanIt’s really worth looking into, also learning about incremental reading.#2022-11-2219:19bhaumanits on the page#2022-11-2219:19hifumi123Also check out Anki if you want an SRS solution that works outside of Emacs#2022-11-2219:24bhaumanI will! Incremental learning is fascinating.#2022-11-2317:01pmooserI'm just starting to use CIDER with cljs, and I'm running into a problem.
Using cider-connect and cider-connect-cljs, I connect to a clj and cljs process.
I have a cljs buffer open, as well as 2 repl buffers. If I click on my clojure repl, it will immediately update my cljs buffer so that the modeline will say "not connected". If I click again on the cljs repl, the cljs buffer will update to show its correct connected state again.
Any idea why cider is doing this, or how I can address it ?#2022-11-2319:01Jelle Lichthttps://github.com/clojure-emacs/cider/issues/3236 something similar to this issue perhaps?#2022-11-2319:01Jelle LichtOr something else entirely 😅 #2022-11-2508:26pmooserHmmm, it could be ! Interesting. Thanks for the info.#2022-11-2322:24mister_mIs there any way to customize how the inspector "inspects" certain types of data I ask it to inspect? For example, if I provide the inspector a binary tree could I customize it to show a graphviz representation of it? This would probably need a significant amount of glue.#2022-11-2507:36micoThis could be an interesting feature!#2022-11-2507:45micoThe documentation is pretty limited for the inspector and there are no references to this kind of customization. I guess currently when you run inspect it will execute cider-inspector--render-value at the end (check out https://github.com/clojure-emacs/cider/blob/master/cider-inspector.el ) and there a few function right after this definition which might be interested to you.#2022-11-2522:00Georgeis there a CIDER way to re-def a local in a function? Like if you had a let binding but wanted a shortcut to just writing a (def local ...) above the let in the source file#2022-11-2602:29hiredmandefs always define a global name#2022-11-2605:37johnny.martinI am doing something wrong and am stuck. I get an odd error when evaluating the following two lines GNU Emacs after a cider-jack-in.
(s/def ::thing number?)
(s/gen ::thing)
1. Unhandled java.io.FileNotFoundException
Could not locate clojure/test/check/generators__init.class,
clojure/test/check/generators.clj or
clojure/test/check/generators.cljc on classpath.
These work just fine when I do, clj from the command line, but fail inside my GNU Emacs Cider session.
Thinking (wrongly perhaps) Cider wanted to use test.check, I followed this link, https://search.maven.org/artifact/org.clojure/test.check, guessed the correct, latest version, is 1.1.1 and so I included this line in my deps.edn,
org.clojure/test.check {:mvn/version "1.1.1"}
In my spec source files i also commented out the clojure.spec.gen.alpha and instead include test.check namespace declarations,
(:require [clojure.spec.alpha :as s]
; [clojure.spec.gen.alpha :as gen]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
...
Still, the Cider REPL grumbles with the same error about not finding test.check's missing namespace. (Again in contrast this works just find when I start a REPL from the command line).
Where am I going wrong? Does Cider need to be told to do dynamic class loading or something?#2022-11-2606:45dpsuttonwhen you say a bare clj repl, how are you actually starting that repl?#2022-11-2606:49dpsuttonbecause you cannot generate things using s/gen without org.clojure/test.check on your classpath#2022-11-2606:49dpsuttonthere's nothing specific to CIDER at play here#2022-11-2607:08jumarYou may invoke cider-jack-in with the prefix (C-u) and then it lets you see and customize the run command.
You can try to run the same command from the shell and see what happens #2022-11-2607:24johnny.martinWhen I run clj at the command line, i get this:
(require '[clojure.test.check.generators :as gen])
nil
(gen/sample (s/gen ::thing))
(0.5 0 0 -0.875 -2.5 0 -1.65625 -5 0.25 -1)
But then inside cider i get
Unhandled java.io.FileNotFoundException
Could not locate clojure/test/check/generators__init.class,
clojure/test/check/generators.clj or
clojure/test/check/generators.cljc on classpath.
#2022-11-2607:27johnny.martinWhen I do C-u cider-jack-in, i see the jack-in command is, /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.5"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.5"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl#2022-11-2607:29johnny.martinSorry, cut-paste twice...
that should be,`/usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.5"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl`#2022-11-2607:35johnny.martinOk, now i am most confused... I enter the command, /usr/local/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.5"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl at the command line and do a cider-connect instead of cider-jack-in and it works!#2022-11-2607:39johnny.martin@U06BE1L6T and @U11BV7MTK Thank you for your prompt replies! I must have had some stale buffer or something left over cruft in deps.edn file that I missed. Something that has now mysteriously dissapeared. Sorry for bugging you all with this. For some curious reason now all is working as expected. I must humbly admit to stupid programmer error on my part. Again thank you both for your prompt replies!#2022-11-2608:15jumarNo problem- great that you solved it!#2022-11-2616:13vlnnI have a question on formatting maps and key alignments. Let’s say I have a set of maps aligned like that.
(def map-to-format
#{{:ones "1" :twos "22222" :threes "3333333333"}
{:ones "11" :twos "22" :threes "3333333333"}
{:ones "111" :twos "2" :threes "3333333333"}
{:ones "1111" :twos "22222" :threes "3333333333"}
{:ones "111111" :twos "22222" :threes "3333333333"}})
Cider reformats it to
(def map-to-format
#{{:ones "1" :twos "22222" :threes "3333333333"}
{:ones "11" :twos "22" :threes "3333333333"}
{:ones "111" :twos "2" :threes "3333333333"}
{:ones "1111" :twos "22222" :threes "3333333333"}
{:ones "111111" :twos "22222" :threes "3333333333"}})
Where can I disable this behavior or make some custom rules?
UPD: maybe there’s a possibiliy to mark sexps so they are skipped while formatting the buffer?#2022-12-0616:42rolta bit late but cider can use cljfmt:
https://github.com/clojure-emacs/cider/blob/b11991245f6fb6e183757da66f47cc5d04221ae1/doc/modules/ROOT/pages/usage/misc_features.adoc#formatting-code-with-cljfmt
If you want a really customizable experience, I'd recommend dropping cider indentation and using zprint instead#2022-12-2203:26vlnnThanks, will try that!#2022-11-2621:58Applehttp://paredit.org/cgit/paredit/commit/?h=maint-25&id=5615023023aea50683f5725284fb9bc6cbbd64ec
paredit 25 breaks cider repl.
repl buffer no longer works.
repl still works.#2022-11-2702:35Volodymyr AnokhinHave you check 26th?#2022-11-2703:07Applesame thing#2022-11-2716:39DerekCan reproduce. RET doesn’t send forms to the REPL, but C-RET still does.#2022-11-2716:42DerekI believe RET was previously unbound by paredit so it would be bound to cider-repl-return but now it’s bound to paredit-RET#2022-11-2716:47DerekI unbound “RET” from the paredit-mode-map and all works in CIDER again#2022-11-2716:53AppleGood to know C-RET works.#2022-11-3015:51ghadibtw how do you unbind "RET" @UPEKQ7589?#2022-11-3015:51DerekI’m using leaf.el, but I believe whichever mechanism you use, you bind it to nil#2022-11-3015:52Derekhttps://github.com/dpassen/dotfiles/commit/6a33dbe6e91c76670530ad6986229c3b1f4fcab0#2022-12-0420:37normanfor use-package:
(use-package paredit
:bind (:map paredit-mode-map
("RET" . nil))
:init
(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode))#2023-01-1717:47dpsuttonjust seeing this now. I think that still leaves you at the mercy of other modes deciding what RET might do. I always did this
(use-package cider
:demand t
:load-path "~/projects/dev/cider/"
:init
(load "cider-autoloads" t t)
:config
(setq cider-invert-insert-eval-p t)
(setq cider-switch-to-repl-on-insert nil)
(setq cider-auto-select-test-report-buffer nil)
(setq cider-font-lock-dynamically t)
(setq cider-show-error-buffer nil)
(setq cider-repl-display-help-banner nil)
(setq cider-repl-pop-to-buffer-on-connect 'display-only)
(setq cider-repl-tab-command (lambda () (company-indent-or-complete-common nil)))
:bind (:map
cider-repl-mode-map
("RET" . cider-repl-newline-and-indent)
("C-j" . cider-repl-return)
("C-c SPC" . clojure-align)
;; :map
;; paredit-mode-map
;; ("C-j" . cider-repl-return)
))
makes sure that "RET" adds a newline, C-j sends the repl input. Looks like i hacked around paredit at some point?#2022-11-2701:17mister_mwhat command do I need to execute to load all the definitions in a file so they are accessible in that file's namespace in the repl? I am a little confused about the difference between eval/load/require.#2022-11-2701:19mister_mSide question, I have a defmulti where my dispatch function has changed , but it doesn't appear that C-x C-e is replacing the old one with the new changes. Do multimethods work differently here than other functions? With other functions after C-x C-e I see what looks like the "address" of the function returned like #'ns/fn-name but when I evaluate the defmutli I see nil#2022-11-2701:21mister_mTo get everything loaded up and usable in the repl it should only take doing C-c C-k, once I am already in that namespace?#2022-11-2701:37dpsuttondefmulti acts like a defonce. redefining it does not redefine the dispatch function#2022-11-2701:39dpsuttonto your original question, you just require the namespace like you would in a regular repl.#2022-11-2701:40dpsuttonyou should require or load the file. if you want to be in the namespace, then call (from memory, forget exactly what the function is) cider-set-ns#2022-11-2709:47jumarFor redefining defmulti's dispatch fn you can use the trick with def:
(def my-multi nil)
(defmulti my-multi ...)
(defmethod my-multi ...)
#2022-11-2804:30GeorgeDoes clj-refactor rename file/dir work in cljs files in some way? It's telling me "cider not connected", I guess because it requires the nrepl middleware which maybe is only on clj side?#2022-11-2806:51vemvit certainly works, but it needs a cider-nrepl connection (since a nrepl middleware powers this stuff)#2022-11-2809:09vlnnWe need cider connection even to look for docs or apropos — of course clj-refactor needs even more/#2022-11-2900:54Georgethanks, I did have a repl up but maybe some config was off -- first use of cljr. I'll try again.#2022-11-2901:33GeorgeI have a repl running and loaded my clj source named coder.clj, and loaded the test files named coder_test.clj, however when I run C-c C-t l I get "No assertions (or no tests) were run.Did you forget to use ‘is’ in your tests?"#2022-11-2901:34GeorgeThe test file looks like
(ns alphabet-cipher.coder-test
(:require [clojure.test :refer :all]
[alphabet-cipher.coder :refer :all]))
(deftest test-encode
(testing "can encode a message with a secret keyword"
(is (= "hmkbxebpxpmyllyrxiiqtoltfgzzv"
(encode "vigilance" "meetmeontuesdayeveningatseven")))
(is (= "egsgqwtahuiljgs"
(encode "scones" "meetmebythetree")))))#2022-11-2901:35Georgerunning the test at point with C-c C-t t does work#2022-11-2901:36Georgeany idea why the run loaded tests isn't working?#2022-11-2901:40Georgealso C-c C-t n does work#2022-11-2902:13vemvit could be because the test dir isn't in your classpath? It's a common pitfall, especially for deps.edn users#2022-11-2906:19Georgeyep that was it, the project was assuming I would run the tests in the CLI, thanks for the tip#2022-11-2908:48pieterbreedIs there a way to suppress the prompt for cljs that says Visit ':xxxx' in a browser? (y or n) ?#2022-11-3004:53mister_mI messed around with my config quite a bit and I seem to be running into a situation using a clj repl with cider-jack-in-clj both within a project and outside of a project where entering an expression in the repl and then hitting enter just takes the point to a new line instead of executing the expression -- anyone know what might cause that?#2022-11-3004:54mister_mI just remembered the interactive help. I did a C-h k then hit enter - it is paredit mode#2022-11-3004:54mister_m(paredit-RET) specifically#2022-11-3005:09Applehow about C+RET#2022-11-3005:12mister_mOh cool that works#2022-11-3005:12mister_mI didn't previously have paredit active in the REPL buffer#2022-11-3005:12mister_mthanks#2022-11-3005:44Applehttps://clojurians.slack.com/archives/C0617A8PQ/p1669499882069549
latest paredit breaks cider.#2022-12-0109:40pavlosmelissinosMy REPL suddenly replaced the binding of the return key to paredit-return (used to be cider-repl-return).
Looking at the https://github.com/clojure-emacs/cider/blob/5064287ba71c4c8ede169b0f561d707f4a365c55/cider-repl.el#L1697, this shouldn't be happening. Any ideas where I should look?
I can use C-RET (or force the binding in my init.el), so it's not a huge issue but for a moment I thought it broke completely 🙂#2022-12-0114:30DerekIt’s related to a change in paredit. See https://clojurians.slack.com/archives/C0617A8PQ/p1669499882069549#2022-12-0115:38pavlosmelissinosThanks!
(Damn, the person above me had the exact same problem, should have read the channel before I asked the question 😞)#2022-12-0708:59mpenetI just hit that one as well...#2022-12-0710:55pavlosmelissinosThere are dozens of us... Dozens!#2022-12-0416:17bozhidar> pkg-info-version-info
CIDER stopped using pkg-info a while ago, which leads me to believe that you have some outdated packages.#2022-12-0416:18bozhidarAh, that's coming from Flycheck itself. Once again I didn't read things carefully enough. 😄#2022-12-0510:16Christian JohansenA colleague just upgraded cider to <tel:202212031148|20221203.1148> and now can’t start the REPL. I have <tel:202111032049|20211103.2049> and can start the REPL from the same project just fine. We have nrepl/nrepl {:mvn/version "0.8.3"} in our deps.edn, but nothing else cider/nrepl-related. In my Emacs, this ends up running:
/opt/homebrew/bin/clojure -A:dev:test -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0-beta3"} refactor-nrepl/refactor-nrepl {:mvn/version "3.1.0"} cider/cider-nrepl {:mvn/version "0.27.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
He’s Emacs runs this command on jack in:
/opt/homebrew/bin/clojure -A:dev:test -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.28.7"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
This fails due to missing refactor-nrepl-stuff, which is no surprise given that refactor-nrepl isn’t included in the command.
Why is refactor-nrepl included in my startup command and not in his? :thinking_face:#2022-12-0511:17andersA workaroud is having your colleague do (cider-add-to-alist 'cider-jack-in-dependencies "refactor-nrepl/refactor-nrepl" "3.1.0")#2022-12-0511:17Christian JohansenI’ll be sure to let him know 😅#2022-12-0514:36vemvcider and clj-refactor.el should be upgraded simultaneously - if using both.
if you happen to not be interested in clj-refactor, then remove it from your setup so that refactor-nrepl will not be injected#2022-12-0514:37Christian Johansenwe are interested in clj-refactor, I guess the confusion was around where it was coming from#2022-12-0519:55Drew Verleei added a new require to my namespace, and evaled it, but i'm not getting auto complete on that ns. Is there anything more i have to do?
Is there such a function as cider-refresh-dynamic-completions-in-current-ns` or is chatGPT just making things up?#2022-12-0520:09dpsuttonyou can use m-x find-function to find out#2022-12-0520:57vemvyou might have clojure-lsp mixed in with cider? The former is not affected by the load ed environment#2022-12-0521:36Drew VerleeYep, i did check find-function. i guess i should have asked, did it ever exist. But it seems the answer is no.
I guess i'm back to programing the old fashion way for the time being!#2022-12-0521:37dpsuttonno worries. i mentioned find-function so you know about that functionality. It wasn’t meant to be passive aggressive but to indicate how to answer your question#2022-12-0521:43Drew VerleeI didn't take it as such, my question was lazy, it assumed readers had a lot more context. At the moment i was in shock that the AI lied to me and then defended its lie.#2022-12-0521:44Drew Verleeit told me that function used to exist.#2022-12-0521:47dpsuttongpt answers are banned from stack overflow right now because they sound good but are just gibberish#2022-12-0521:47dpsuttoni think you might have gotten one of those.#2022-12-0521:13Patrick WinterHow do I reset all breakpoints after instrumentig code with cider-debug-defun-at-point?
(I've tried to reavluate with cider-eval-last-sexp , but on execution I still get a debug prompt)#2022-12-0521:14dpsuttonjust re-evaluate the form(s)#2022-12-0521:15Patrick WinterHmm, I've tried that but I still entered the debug prompt. Let me restart the REPL and see if it happens again.#2022-12-0521:16Patrick WinterOkay, now it works. No idea what the problem was 🙂. Thank you @U11BV7MTK#2022-12-0521:30dpsuttonmaybe you reevaluated the whole namespace and another function had taken the instrumented function rather than just the var#2022-12-0606:12GeorgeI think you need to re-eval with C-M-x to reset. C-x C-e won't do it afaik.#2022-12-0712:12andrea.crottidid anything change regarding cider-register-cljs-repl-type ? we have a custom repl type (shadow-repl) with has an init form that used to be evaluated when the repl starts.
Since today probably cider prints in the repl buffer the form it should evaluate, but is not evaluating it anymore.#2022-12-0712:14andrea.crottiactually I wonder if it's related with https://github.com/clojure-emacs/cider/issues/3236
since now it looks like the repl type is wrong even after starting it, not just when I switch from a code buffer to the repl#2022-12-0717:52aiba@andrea.crotti I'm also experiencing this. my shadow cljs repls become clj repls and then cannot evaluate cljs code anymore. I reverted cider to commit "5064287ba71c4c8ede169b0f561d707f4a365c55" to get it working again.#2022-12-0810:40Benjamindo you know if you tried it with b11991245f6fb6e183757da66f47cc5d04221ae1 ?#2022-12-0810:41andrea.crottias a side note, what's the easy way to use cider from source with use-package?#2022-12-0810:42Benjamindo you use straight?#2022-12-0810:42andrea.crottiI tried to pin it to stable as well actually but it didn't really work either#2022-12-0810:42andrea.crottino I'm not using straight#2022-12-0810:43Benjamincan only think the readme of use-package will say 😅#2022-12-0810:47Benjaminok can confirm what you said, it stays clj instead of upgrading#2022-12-0810:58Benjamin;; cider-repl--state-handler sets it to clj when we eval
;; cljs.core/demunge
;; this is why we see the broken behavior (new)
cider-set-repl-type("clj")
cider-repl--state-handler((dict "changed-namespaces" (dict) "id" "11" "repl-type" "clj" "session" "f5122c13-5224-482a-8a35-d243e1d80357" "status" ("state")))
run-hook-with-args(cider-repl--state-handler (dict "changed-namespaces" (dict) "id" "11" "repl-type" "clj" "session" "f5122c13-5224-482a-8a35-d243e1d80357" "status" ("state")))
nrepl-client-filter(#<process nrepl-connection<5>> "oneeed18:changed-namespacesde2:id2:119:repl-type3:...")
accept-process-output(nil 0.01)
nrepl-send-sync-request(("op" "eval" "code" "cljs.core/demunge") #<buffer *cider-repl clojure/acme-app:localhost:43155(cljs:shadow)*> nil tooling)
nrepl-sync-request:eval("cljs.core/demunge" #<buffer *cider-repl clojure/acme-app:localhost:43155(cljs:shadow)*> nil tooling)
@U051BLM8F
;; how does it decide the repl-type here?
(nrepl-dbind-response response (repl-type changed-namespaces)
)
#2022-12-0811:03Benjaminchecking in cider-nrepl and it comes from (cljs/grab-cljs-env msg) maybe I need to say something in the message that I want to eval cljs or something#2022-12-0811:16Benjaminpretty sure from ciders perspective the difference is whether ns is passed to the eval request. When I pass cider-current-ns I get repl-type cljs , else clj . I suppose this is basically a feature that is good.
I will try around to figure out the correct way to check demunge being present.#2022-12-0811:17bozhidarThe repl-type is the responses comes from the track-state middleware in cider-nrepl.#2022-12-0811:18bozhidarBasically it starts to return the cljs-type once a hosted cljs REPL gets started.#2022-12-0811:21bozhidarThis was considered the only reliable way to be sure that a connection's type actually got changed back in the day - is the ClojureScript env actually in the session or no.#2022-12-0813:48BenjaminI have an okay fix I think. On the level of detail I understand it, I could fix it by changing the ordering so the "demunge" eval call is not the last, but the repl-init-form is the last (which sets the repl type).
https://github.com/clojure-emacs/cider/pull/3282#2022-12-0810:36bozhidar@andrea.crotti My guess is that your problem is related to https://github.com/clojure-emacs/cider/pull/3272#2022-12-0810:36bozhidar@benjamin.schwerdtner ^^#2022-12-0811:19bozhidar> as a side note, what's the easy way to use cider from source with use-package?
@andrea.crotti I do this from time to time https://emacsredux.com/blog/2015/05/10/building-melpa-packages-locally/#2022-12-0813:52andrea.crottiyeah but I have some extra complications like the fact that I have to use elpa-mirror (since I can't access directly the various repositories)#2022-12-0813:52andrea.crottibut well for now I just pinned to 1.5.0#2022-12-0813:52andrea.crottiwhich solves all the issues I had so far#2022-12-0921:59hifumi123Has someone here figured out how to get auto-complete for node modules working in a shadow-cljs project? Wondering what config is necessary to attain it#2022-12-1119:52phronmophobicI'm setting up cider+emacs on an aws ubuntu linux instance. When I enable paredit M-x paredit-mode in the cider repl, it hangs and no longer responds or returns results. If I disable paredit, then it starts working again.
Has anyone else run into this? Does anyone have any tips on how to debug this?
I've been able to reproduce it from a fresh ubuntu instance.#2022-12-1121:12dakraFrom https://github.com/clojure-emacs/cider/issues/3288
The new version of paredit map RET key to paredit-RET command. You can either unset this key in paredit-mode-map or use C-RET in REPL buffer#2022-12-1121:18phronmophobicthat worked!#2022-12-1318:03Carsten BehringHas anybody come across a nrepl middleware which sends all evaluated values to tap> ?#2022-12-1410:43BenjaminLol chat gpt knows cider code
(defun cider-jack-in-nbb-2 ()
(interactive)
(cider-jack-in '(:jack-in-cmd "nbb nrepl-server")))
add a docstring
Here is a suggested docstring for the cider-jack-in-nbb-2 function:
(defun cider-jack-in-nbb-2 ()
"Start a Cider nREPL server with the `nbb nrepl-server` command."
(interactive)
(cider-jack-in
'(:jack-in-cmd "nbb nrepl-server")))
This docstring describes what the function does and how it is used. It specifies that the function starts a Cider nREPL server using the nbb nrepl-server command. It also indicates that the function is interactive, which means it can be called directly from the user interface.#2022-12-1515:49Valentin MouretHello 🙂
Initially, I had three different «subprojects» frontend, backend, domain, each with their own deps.edn. I just refactored everything into one project and it works fine if I spawn a REPL for the frontend (shadow) and a REPL for the backend.
However, as far as I understand, I should be able to spawn a single REPL for both now, with cider-jack-in-clj&cljs.
This opens two windows that both seam to run shadow:
1:
;; ClojureScript REPL type: shadow
;; ClojureScript REPL init form: (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))
;;
2:
;;
;; ClojureScript REPL type: shadow
;;
I will put the Emacs messages in the thread.
Can someone help me understanding what I did wrong and how to fix it?#2022-12-1515:50Valentin MouretThis is the Emacs message I get:
[nREPL] Starting server via /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.28.7"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"} cider/piggieback {:mvn/version "0.5.2"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}}' -M:cider/nrepl
[nREPL] server started on 49951
[nREPL] Establishing direct connection to localhost:49951 ...
[nREPL] Direct connection to localhost:49951 established
[nREPL] Establishing direct connection to localhost:49951 ...
[nREPL] Direct connection to localhost:49951 established
Connected! Clojure isn't a language, it's a building material.
error in process filter: user-error: The shadow-cljs ClojureScript REPL is not available. Please check for details
error in process filter: The shadow-cljs ClojureScript REPL is not available. Please check for details#2022-12-1515:56dpsuttonyour understanding is half right and half wrong. cider-jack-in-clj&cljs will attempt to use the same process to run two different repls.
Since you are using shadow you are using npx shadow-cljs … for one process and presumably clj -A:… for the backend process. You will need to continue to start both processes separately#2022-12-1515:57Valentin MouretThat makes sense! Thanks.
What is the purpose of cider-jack-in-clj&cljs then?#2022-12-1515:58dpsuttonfigwheel and figwheel main can be run from a regular clj repl. shadow technically can as well but you have to do a bit more work. But the idea is that if a clj repl can become a cljs repl by just running something like (figwheel/run! <build>) then you can just make two repls into the same process#2022-12-1515:59dpsuttonshadow does it’s own startup from its own process. this brings many nice things to the table and thomas has made incredible software. But because it is a separate process, your cljs repl is in one process and the clojure repl in another. So the “trick” of clj&cljs doesn’t work there#2022-12-1516:00dpsuttonhonestly, cider-jack-in-clj&cljs usually brings more questions and headaches than the purported benefit. I’d be in favor of removing it#2022-12-1516:00Valentin MouretThanks so much for the details. :man-bowing:
The tooling around Clojure is a bit hard to navigate at times. But when it works it’s great. 🙂#2022-12-1516:00Applehttps://clojurians.slack.com/archives/C099W16KZ/p1668002441531949?thread_ts=1667924045.274949&cid=C099W16KZ check this out.#2022-12-1516:01Valentin MouretHaha, that was already me asking the question back then. 😄#2022-12-1516:01AppleOh yeah that was you.#2022-12-1516:01AppleI just realize.#2022-12-1516:04Valentin MouretI am coming from non-lispy languages, so managing a REPL is new world.
Writing code to handle «REPL specific» things is not intuitive to me yet.
+ Clojure + ClojureScript + Emacs + Shadow + …
🤯
So, when I read your suggestion, it’s not evident where/how this should be written or launched.#2022-12-1516:05Valentin MouretWhat I understand is that: I would need a file somewhere (cljs?), where I describe the shadow REPL to be created. Then, this would be the target of my shadow «entrypoint»?#2022-12-1516:05dpsuttonYeah. That’s why i’m not a fan of the clj&cljs style. You don’t know where to go and what documentation to read to fix your issues. I added the startup command: info at the top of repls to hopefully demystify how CIDER works#2022-12-1516:06Valentin MouretIt’s not a hard requirement on my side at all. When I discover something new, I don’t want to reinvent the wheel. Conformism isn’t always bad. 🙂#2022-12-1516:06dpsuttonbecause CIDER is just starting your repls the same way you would ever start a repl:
clojure -Sdeps '{cider/nrepl <cider-nrepl-dep>}' -M:your:aliases:cider/nrepl . And it is just calling nrepl.cmdline as the main and puts some middleware as an arg to nrepl.cmdline#2022-12-1516:09Valentin MouretNot sure I get everything you said, but thank you for taking the time.
I don’t have a reason to spawn only one REPL besides potential environment simplicity, but to be honest the overhead makes the tradeoff not worth in my opinion.
Two REPLs is perfectly fine. 🙂#2022-12-1516:14AppleNot a good writer myself.... Whenever you are ready to revisit this, just put the cider dependency in your dev related lein profile/deps alias, and the clj code in your dev startup code.#2022-12-1516:30Valentin MouretNow, I am having a funky problem. I run cider-jack-in-clj, and I get a working REPL for my backend. Then, cider-jack-in-cljs, and I get a working REPL for my frontend.
Everything looks right. But, when I navigate to a backend file (`.clj`), the buffer is not connected to the Clojure REPL anymore.
I navigate to the CLJ REPL buffer, it’s there. I navigate back to the .clj file and it’s connected, but .cljs files are not connected anymore. 🤯#2022-12-1516:32dpsuttonCIDER has a bug that it considers itself connected to the last repl you had your point in. So visit the cljs buffer and then cljs files will see it is connected. for clj files, visit the clj repl and it will behave as you like#2022-12-1516:37Valentin MouretOk! So, what do people do to work with projects that have Clojure and ClojureScript?#2022-12-1516:37dpsuttonexactly what i just said. just have the clojure repl visible and the last repl you touched when doing backend, and similar when working in the frontend#2022-12-1516:39dakraIf you use the infamous cider-jack-in-clj&cljs then it works as expected and you don't have to select the clj or cljs repl first.
I think there are multiple issues for this already. I commented in one how I solved it with shadow: https://github.com/clojure-emacs/cider/issues/2946#issuecomment-768140666#2022-12-1516:39Valentin MouretSo, if I constantly navigate between cljs and clj, I need to navigate to their respective REPLs in between?#2022-12-1516:40AppleI had the exact problem and asked the question. The solution was to use one shadow repl to support both clj and cljs repl, and use cider-connect-sibling-cljs
https://clojurians.slack.com/archives/C099W16KZ/p1667924263389159?thread_ts=1667924045.274949&cid=C099W16KZ#2022-12-1516:40Valentin MouretI am not using jack-in-clj&cljs, I use jack-in-clj and jack-in-cljs.#2022-12-1516:40Valentin Mouret> la boucle est bouclée#2022-12-1516:41dakraI meant if you use jack-in-clj and separately jack-in-cljs you hit that bug that cider gets confused about where to eval. So the solution is to use jack-in-clj&cljs or connect-sibling..#2022-12-1516:42dpsuttonah maybe my info is outdated. sorry about that#2022-12-1516:43Valentin MouretOk! So, I will experiment with your solutions to make shadow play nice with Cider.#2022-12-1516:43Valentin MouretThank you all for your time and answers. 🙂#2022-12-1516:44Valentin MouretI will probably be back at some point with annoying questions. 🙂#2022-12-1516:44AppleTwo repls are fine. When you have free cycles...#2022-12-1516:45dakraI agree that it's definitely confusing working with shadow and tools.deps in the same session. This area could need a bit more love and documentation 😄#2022-12-1516:45Apple@UFAP0C8KU how to setup to use jack-in-clj&cljs?#2022-12-1516:46dakraAs I wrote in that github issue.
E.g. my current .dir-locals.el for one of my projects contains this currently:
((clojure-mode . ((cider-clojure-cli-global-options . "-A:dev:cljs")
(cider-preferred-build-tool . clojure-cli)
(cider-custom-cljs-repl-init-form . "(do (require '[shadow.cljs.devtools.api :as shadow]) (require '[shadow.cljs.devtools.server :as server]) (server/start!) (shadow/watch :app) (shadow/nrepl-select :app))")
(cider-default-cljs-repl . custom))))#2022-12-1516:47dakrabut then you also need to add shadow.cljs.devtools.server.nrepl/middleware to your nrepl-middlewares#2022-12-1516:47dakraI do that for every project that uses the :cljs alias.#2022-12-1516:48dakraMy Emacs config for this is here: https://github.com/dakra/dmacs/blob/ca8f80f411cb15d3ec9cfed445d5fde164be50b7/init.org?plain=1#L5718-L5723#2022-12-1516:49Valentin MouretI am not 100% clear on what the purpose of the :cljs alias is.#2022-12-1516:49dakraNothing. That's just an arbitrary deps.edn alias where I specify additional deps etc.#2022-12-1516:50dakraBut as I always use :cljs alias for my cljs projects I use this to decide if I add the shadow nrepl middleware or not.#2022-12-1516:51Valentin MouretYeah, that’s the other part that’s not 100% clear… 😄#2022-12-1516:52dakracider-jack-in-nrepl-middlewares is a variable that specifies what nrepl middlewares to inject in your session. And for shadow cljs to work it needs "shadow.cljs.devtools.server.nrepl/middleware" added#2022-12-1516:53Valentin MouretOk, I am starting to piece things together now.#2022-12-1516:54Valentin MouretAs far as I understand, this middleware will also be in your clj REPL.
So, most likely it’s not breaking stuff.#2022-12-1516:54Valentin Mouret(for this clj REPL)#2022-12-1516:55dakrayes, shadow itself runs also on the jvm. (afaik the npx shadowcljs command is just a wrapper around the java stuff)#2022-12-1516:57AppleI feel we are doing essentially the same thing. Difference is that your code goes to .emacs and mine goes to dev startup code.#2022-12-1516:59dakraProbably. I think jack-in-clj&cljs is just a shortcut for jack-in and connect-sibling?!#2022-12-1517:05Valentin MouretI am getting:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:220).
Could not locate shadow/cljs/devtools/server/nrepl__init.class, shadow/cljs/devtools/server/nrepl.clj or shadow/cljs/devtools/server/nrepl.cljc on classpath.
I am missing some dependency, but it’s not clear which.#2022-12-1517:05Valentin MouretI added nrepl/nrepl to both deps.edn and shadow-cljs.edn, but it does not change things.#2022-12-1517:06dakrayou need the shadow-cljs dep as well. e.g. thheller/shadow-cljs {:mvn/version "2.20.14"}#2022-12-1517:07Valentin Mouret🥳#2022-12-1517:08Valentin MouretThanks! That was not very obvious. But now it looks like it’s working!#2022-12-1517:08Valentin MouretIt’s alive! 👻#2022-12-1517:08dakra🎉#2022-12-1517:11Valentin MouretI am using re-frame’s 10x with preloads inside shadow-cljs.edn.
It’s used in my code, so the build actually fails.
Is it something I should add to the (do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :app) (shadow/nrepl-select :app))?#2022-12-1517:13dakraI think you have to set more.. see my dir-locals from above. e.g. (cider-custom-cljs-repl-init-form . "(do (require '[shadow.cljs.devtools.api :as shadow]) (require '[shadow.cljs.devtools.server :as server]) (server/start!) (shadow/watch :app) (shadow/nrepl-select :app))") and (cider-default-cljs-repl . custom)#2022-12-1517:14Valentin MouretAh so.
I’ll give it a shot. Thanks.#2022-12-1517:15Valentin MouretYeah, that’s already what I had.#2022-12-1517:16Valentin MouretProbably this is not handling «preloads» from shadow, which are loading re-frame 10x.#2022-12-1517:17Valentin Mouretboy, this is getting out of hands#2022-12-1517:17dakrahehe. surely not simple and straight forward 😕#2022-12-1517:18dakrahow does the build fail?#2022-12-1517:19Valentin Mouret[:app] Compiling ...
[:app] Build failure:
The required namespace "day8.re-frame-10x.preload" is not available.
#2022-12-1517:20Valentin MouretHaaa#2022-12-1517:20dakrais re-frame-10x in your classpath / deps?#2022-12-1517:20Valentin MouretI had dependencies in shadow-cljs.edn and I think I need to move them all to deps.edn now.#2022-12-1517:23dakraIf you have all deps in deps.edn (like I have) then another gotcha might be that I had to explicitly specify guava dependency, otherwise shadow 2.20.11+ crashed for me. Took me also a while to figure out. So currently I have this for shadow in my deps.edn:
:cljs {:extra-deps {com.cognitect/transit-cljs {:mvn/version "0.8.280"}
day8.re-frame/http-fx-alpha {:mvn/version "0.0.2"}
day8.re-frame/tracing {:mvn/version "0.6.2"}
re-frame/re-frame {:mvn/version "1.3.0"}
thheller/shadow-cljs {:mvn/version "2.20.14"}
;; Maybe explicitly add deps for shadow.
;; For more info why this is needed
;; See
;; You can check what deps are needed on
;;
;; And maybe use
;; as a template and experiment what's missing/wrong.
;; Since 2.20.11 guava is not explicitly required by
;; shadowcljs anymore but apparently it's still needed
;; because it doesn't start without this pinned version.
com.google.guava/guava {:mvn/version "31.0.1-jre"}
}}
:cljs-dev {:extra-deps {binaryage/devtools {:mvn/version "1.0.6"}
com.lambdaisland/dom-types {:mvn/version "0.5.37"}
day8.re-frame/re-frame-10x {:mvn/version "1.5.0"}}}#2022-12-1517:24Valentin MouretNow I understand the cljs namespace. 🙂
Thanks for this. I stumbled upon this new YouTube series of people showing their REPLs. Looks like a missing piece of the puzzle indeed.#2022-12-1517:28Valentin MouretThank you so much for your time! Now everything works perfectly and I have a working setup!#2022-12-1517:32dakraNo problem. Great it's working:)#2022-12-1614:32bozhidarFYI - I’m planning to cut a new CIDER release soon (e.g. within a week), so now it’s a good time to play with the current snapshot or get your last minute patches submitted. 🙂#2022-12-1614:35dpsuttonexcited to see which city you’ve been hanging out in#2022-12-1614:53bozhidar@dpsutton Lot’s of good options this time around (I’ve been on the move a lot lately), so it will be hard to chose. 😄 I think I’m leaning towards Berlin or Naples, but we’ll see what I’ll decide in the end.#2022-12-1617:03Ben SlessNaples for Italian food!#2022-12-1614:55dpsuttonha you have to bias towards the city you are less likely to visit again in the future when it could serve as a release city#2022-12-1620:24Matthew OdendahlI'm trying to use the CIDER debugger inside a deftest, but nothing seems to be working. Does CIDER not support that? E.g. #break is completely ignored when I run the test with , t t (Spacemacs calls cider-test-run-test, I think). I need to inspect resources bound by test fixtures, so I do need to use the test runner. What's the usual method?#2022-12-1620:51hiredmanDid you re-eval the test definition after adding #break?#2022-12-1620:54Matthew OdendahlYep. Eval'ed form; buffer; saved the file and killed the REPL, jacked in again. Nothing works.#2022-12-1621:15Matthew OdendahlAlso updated cider package.#2022-12-1621:22jumarThe problem is that if you use cider-test-run-test it will load the test namespace before running the test
so your instrumentation is gone.
You need to use (clojure.test/test-vars [#'your-test]) or something like that manually from the REPL.
Then your breakpoint inside the deftest your-test will work.#2022-12-1621:24jumarThis is at least the case when using cider-debug-defun-at-point and the workaround above works reliably, for me.#2022-12-1621:27jumarI'm not exactly sure why it also ignores #break and #dbg but the workaround works for those too#2022-12-1621:31Matthew Odendahltest-vars works 🙂#2022-12-1621:33Matthew OdendahlI wish it were easier, but I can work with this.#2022-12-1706:49bozhidarFeel free to open a ticket about this. Might also be good to document what @U06BE1L6T mentioned. As I rarely debug tests it never crossed my mind we need to improve something on this front.#2022-12-1709:43bozhidarFeedback about this idea would be appreciated https://github.com/clojure-emacs/cider/issues/3295 (relatively small change, but I’m still wondering if someone thinks this is a bad idea)#2022-12-1815:58bozhidarFYI - https://github.com/clojure-emacs/cider/pull/3275 was merged, which means support for nbb just got a lot better 🙂#2022-12-1815:58borkdudeThanks! Shared to #nbb#2022-12-1817:33Benjamindon't forget you can also connect to nbb/scittle/ joyride with cider-connect#2022-12-1817:35BenjaminHow do I nicely jump to the place where an exception is thrown? actually what I desire is to have all the locals bound to vars. Ok I can def everything or use one of the libs that make a macro for that#2022-12-2113:11bozhidarFYI - CIDER 1.6 ("Buenos Aires") is out https://github.com/clojure-emacs/cider/releases/tag/v1.6.0 Cheers! cider#2022-12-2117:17Ben Liebermanhey folks, I previously have used Emacs w/ CIDER on WSL2 without issues. I have since switched to a Linux box and am trying to configure Emacs. I have Clojure and the Temurin JDK installed and all that (I can use Calva perfectly fine), but when I try to start a REPL in Emacs it gives me the error "the clojure executable isn't on your exec-path". I modified that variable in my config (pointing it to my Clojure install) but no dice.#2022-12-2117:40pezCalva bundles a ”backup” way of starting Clojure with the help of deps.clj. You can check in the VS Code development console for messages about this and see if it falls back in this or not. #2022-12-2117:42pezDepending on how you start Emacs it might or might not have the correct PATH. If you start it from terminal where you know you can run the clojure command, CIDER should find it too.#2022-12-2117:44Ben LiebermanThanks @U0ETXRFEW. I'll investigate. I'm not that committed to getting this fixed (because Calva is great :face_with_cowboy_hat: ) but I do like Emacs, too.#2022-12-2118:32dpsutton> I modified that variable
what does this mean?#2022-12-2118:33Ben Liebermanin my .emacs file I put "/usr/local/bin/clojure" in the exec-path` list#2022-12-2118:33Ben Liebermanmy ELisp skills are very poor though, so I'm guessing I screwed something up#2022-12-2118:33dpsuttoni don’t think it wants executables on exec-path but paths on the exec path. just like your PATH variable i na shell#2022-12-2118:34dpsuttonwhat are the other values in that list?#2022-12-2118:35dpsuttonfor example, a few of mine are
"/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/"
note these are not individual executables but directories where executables are found. Compare to "/usr/local/bin/clojure" (and this would not find clj even if it worked like this#2022-12-2118:35dpsutton> List of directories to search programs to run in subprocesses.
> Each element is a string (directory name) or nil (try default directory).#2022-12-2118:36Ben Liebermanyeah I'm noticing that the other executables (eg. Cargo and Node) have the form of /cargo/bin and /node/bin and not the other way around#2022-12-2118:36dpsuttonthose aren’t executables#2022-12-2118:36dpsuttonthose are directories containing lots of executables#2022-12-2118:36Ben Liebermanshould Emacs be looking for clj or for clojure because they are both co-located on my machine#2022-12-2118:36dpsuttonemacs will look for whatever program it needs to. All it needs are places to look for programs#2022-12-2118:37dpsuttonso give it "/usr/local/bin/"#2022-12-2118:38dpsuttonbut by default CIDER will look for clojure (as clj is the same thing essentially but with rlwrap included for niceties like backspacing and pressing up for history)#2022-12-2118:38Ben LiebermanI had that in there already, restarted Emacs but no change#2022-12-2118:39dpsuttonopen up an eshell window with m-x eshell and type which clojure#2022-12-2118:40dpsuttonif that can’t find it you won’t be able to start. Emacs is still unable to find clojure. Can you post the value of exec-path?#2022-12-2118:41Ben Lieberman'(exec-path
'("/app/bin" "/usr/bin" "/usr/local/bin/" "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.1/x86_64-pc-linux-gnu"))
#2022-12-2118:41dpsuttonwhat is that?#2022-12-2118:42Ben Liebermanyeah which clojure in eshell is looking in the app/bin directories#2022-12-2118:42dpsuttonwhy is it quoted and prefixed with exec-path?#2022-12-2118:42Ben Liebermanwhen I was looking up how to do this it showed this form on EmacsWiki#2022-12-2118:43Ben Liebermanyeah nvm I'm conflating things, this is not on EmacsWiki#2022-12-2118:44Ben Liebermanshould I be using the setq exec-path form instead?#2022-12-2118:44dpsuttoni’m completely lost. can you tell me what the value of exec-path is currently?#2022-12-2118:44dpsuttonm-x describe-variable [ret] exec-path#2022-12-2118:44dpsuttonlet’s find out what the value currently is first#2022-12-2118:45Ben Liebermansame as the quoted list above#2022-12-2118:46dpsuttonfor me it is
exec-path is a variable defined in 'C source code'.
Its value is
("/Users/dan/.nvm/versions/node/v17.9.1/bin/" "/Users/dan/.sdkman/candidates/java/current/bin/" "/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/" "/usr/local/bin/" "/usr/bin/" "/bin/" "/usr/sbin/" "/sbin/" "/opt/homebrew/Cellar/emacs-mac/emacs-28.1-mac-9.0/libexec/emacs/28.1/aarch64-apple-darwin21.5.0/")
Original value was
("/Users/dan/.nvm/versions/node/v17.9.1/bin" "/Users/dan/.sdkman/candidates/java/current/bin" "/Users/dan/bin" "/opt/homebrew/bin" "/opt/homebrew/sbin" "/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/opt/homebrew/Cellar/emacs-mac/emacs-28.1-mac-9.0/libexec/emacs/28.1/aarch64-apple-darwin21.5.0")
can you post your output like this?#2022-12-2118:47Ben Liebermanexec-path is a variable defined in 'C source code'.
Its value is
("/app/bin" "/usr/bin" "/usr/local/bin/" "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.1/x86_64-pc-linux-gnu")
Original value was
("/app/bin" "/usr/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.2/x86_64-pc-linux-gnu")
#2022-12-2118:48dpsuttonok. that looks great. now we know that value is being set correctly. and in an eshell buffer what is the output of which clojure?#2022-12-2118:48Ben Lieberman~/Documents/clojure/scratch $ which clojure
which: no clojure in (/app/bin:/usr/bin:/home/slothrop/.var/app/org.gnu.emacs/data/node/bin:/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin:/home/slothrop/.var/app/org.gnu.emacs/data/python/bin)
#2022-12-2118:49dpsuttonok i have a theory: emacs doesn’t have permissions to look at /usr/local/bin ? Open up a dired buffer and navigate to that folder. See if emacs can see it#2022-12-2118:50Ben Liebermanyou are correct#2022-12-2118:50dpsuttoni’m guessing perhaps that’s why it is not looking in there?#2022-12-2118:51Ben Lieberman/usr/local/bin is inaccessible or nonexistent#2022-12-2118:51dpsuttonok. what do you get from a terminal ls /usr/local/bin?#2022-12-2118:52Ben Liebermanslothrop@pop-os:/usr/local/bin$ ls
aws aws_completer bb clj clojure corepack ng node npm npx
#2022-12-2118:53dpsuttonok. so there’s some permissions thing. i’m not sure#2022-12-2118:53dpsuttoneverything is configured correctly at the emacs level. just can’t see that directory#2022-12-2118:54Ben Liebermanso this really has nothing to do with Emacs in particular then?#2022-12-2118:55dpsuttondoesn’t sound like it. the executable is there. But emacs cannot see the directory /usr/local/bin.#2022-12-2118:55Ben Liebermanthis is my personal machine so I can change whatever I want#2022-12-2118:55dpsutton“is inaccessible or nonexistent”#2022-12-2119:07Ben LiebermanI'll have to explore this. I suspect this was not an issue on WSL bc I was launching Emacs from the terminal, as opposed to now launching it from the desktop. Thanks for your help @U11BV7MTK#2022-12-2211:38Matti UusitaloI've been able to jack in to clj programmatically like this:
(with-temp-buffer
(cider-jack-in-clj '(:project-dir "~/projektit/foo")))
I can't seem to do the same with clj&cljs projects as it asks for the profile that figwheel-main should use. Is there a noninteractive function that I could use?
In my project I need five clj repls and two of them also cljs repl. I built a command that starts all the clj repls but haven't been able to launch the cljs ones#2022-12-2211:46magnarsSet the cider-default-cljs-repl variable to avoid the question.#2022-12-2214:03Matti UusitaloOn that note:
(defvar jogo3000-start-repls-queue '())
(defun jogo3000-start-repls ()
(let ((head (car jogo3000-start-repls-queue)))
(when head
(apply head nil)
(setq jogo3000-start-repls-queue (cdr jogo3000-start-repls-queue)))))
(add-hook 'cider-connected-hook #'jogo3000-start-repls)
I do it like this. The queue holds functions to start the repls using the technique above. For some reason starting the repls in parallel didn't work out properly. Should it work?#2022-12-2217:44jmvi am having some odd behavior with the cider error buffer. i have two frames, A and B, with different projects in each frame. i am seeing a situation where all exceptions pop up the error buffer in frame A, which is a pretty jarring transition when i'm in frame B.
is there a way to configure the error buffer to stay with the current frame?#2022-12-2306:21bozhidar@jmv305 I don’t recall any frame-related settings, so this might be some bug worth reporting. Admittedly I never use multiple frames, so I don’t test such scenarios. There are some workaround ideas here https://docs.cider.mx/cider/usage/dealing_with_errors.html#2022-12-2306:21bozhidar(e.g. you can display the errors as overlay only)#2022-12-2310:07pmooserI'm having a problem ever since upgrading with 1.6.0, where my REPLs don't work (both clj and cljs) - when I hit return, it's as if nothing is ever being sent to the connected process (so the cider repl buffer just hangs there).#2022-12-2315:06pavlosmelissinosIt's a paredit issue! https://paredit.org/cgit/paredit/commit/?id=5615023023aea50683f5725284fb9bc6cbbd64ec
There have been some threads about this:
• https://clojurians.slack.com/archives/C0617A8PQ/p1669499882069549
• https://clojurians.slack.com/archives/C0617A8PQ/p1669784037979889
• https://clojurians.slack.com/archives/C0617A8PQ/p1669887613502019
You can a) disable paredit in REPL buffers, b) use C-RET instead, c) unbind paredit-RET (like you said) or d) ask the paredit author to remove the default binding. What would you consider a "right" fix?
> I'm not quite sure how to debug it otherwise
I depend a lot on describe-key to find out what keys I press do. It's quite handy!
Also could you please use threads to keep conversations tidy? 🙂#2022-12-2310:08pmooserThis can't possibly be a widespread problem, but I've removed and reinstalled it, but I'm not quite sure how to debug it otherwise.#2022-12-2310:14pmooserIt's something in my configuration ...#2022-12-2310:17pmooserAh ok. My return is sending paredit-RET, whereas evidently it needs to be sending cider-repl-return. Not sure what changed.#2022-12-2310:19pmooserI don't specifically bind paredit-RET myself - I'd love any advice from someone who knows the "right" fix to this, rather than me manually making a keymap entry to override the paredit one.#2022-12-2310:34pmooserEvidently my emacs/elisp isn't quite good enough to force overriding that in cider-repl-mode.#2022-12-2310:56pmooserI can't believe how hard simple things in emacs still are.#2022-12-2318:28ricI added a new dependency in deps.edn. I expected that cider-jack-in-clj would include it in the startup string and download it, but it didn't. How to debug?#2022-12-2318:29frankdid you add that dependency under an alias?#2022-12-2318:29frankadding a dependency in deps.edn shouldn't affect the startup string#2022-12-2318:30frankbut your dep should be downloaded if it wasn't added under an alias#2022-12-2318:30ricI added at the root:
{:deps
{net.mikera/core.matrix {:mvn/version "0.63.0"}}#2022-12-2318:31ric> adding a dependency in deps.edn shouldn't affect the startup string
oh? how does it download it then? I thought clj is the one that does all the magic, and that is managed through the startup string.#2022-12-2318:33dorabCider just starts clojure. Clojure then does whatever downloads it needs.#2022-12-2318:34ricah I see.. -Sdeps merges with me deps.edn then#2022-12-2318:35ricSo I suppose cider is not finding my deps.edn#2022-12-2318:35dorabThe startup string would be changed (and you'd have to change it explicitly) if you wanted to use a different alias.#2022-12-2318:37dorabOne way to debug is to try running the clj command from the shell prompt and see what happens.#2022-12-2318:37ricah! I forced projectile to use the correct path, now it's working.#2022-12-2318:37dorabGreat. Glad it worked out.#2022-12-2318:38ricnew to emacs, it's a bit confusing heh#2022-12-2318:38ricthanks folks#2022-12-2523:07mister_mIs it possible for cider to tell me things like whether or not I have any open file handles, or active thread pools, etc?#2022-12-2606:40Ben SlessSomething like this doesn't exist now AFAIK but you can use the jvm's mxbeans to get this data
I should probably add it to my tools.jvm library#2022-12-2606:41Ben Slesshttps://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/UnixOperatingSystemMXBean.html#getOpenFileDescriptorCount()#2022-12-2609:17vemvsince this is abundant and constantly-changing data, a profiler will show it in a particularly usable manner
I use YourKit (for other reasons), it's a premium product which as every xmas, you will find for a nicer price#2022-12-2913:07simonkatzIt seems that the CIDER REPL doesn't understand ANSI control sequences for movement. Is that right?#2022-12-2913:07simonkatzSome more detail…
For example, using Kaocha’s kaocha.report.progress/report reporter, I get something like the following:
autotest: 0% [ ] 0/5
autotest: 20% [========== ] 1/5
autotest: 40% [==================== ] 2/5
autotest: 60% [============================== ] 3/5
autotest: 80% [======================================== ] 4/5
autotest: 100% [==================================================] 5/5
autotest: 100% [==================================================] 5/5
In a terminal, or with eshell or vterm in Emacs, I get a single line that gets updated over time.
I have added advice to cider-repl--emit-output to fix things in this particular case by checking each line and deleting the previous line when appropriate.#2022-12-3010:18dakraI made a fix for it a while ago in my local cider version.
I just committed it so you can check it out if you want: https://github.com/dakra/cider/commit/93c9a22db864abb81a119e4d807268434b3576b2
But it's a bit hacky and probably needs more polish (and tests) before I can turn it into an PR.#2022-12-3011:19simonkatzThanks! That works great.#2022-12-2920:09zarkonetried the actual apple cider first time today. then went coding and instead of intended clojure work I've spent all evening hacking cider, making it more convenient for me, some small thing here and there..
it took me one hour to realize what happened#2023-01-0410:10jumaris it somehow possible to change the namespace where a var is defined when pressing d inside https://docs.cider.mx/cider/debugging/inspector.html?
Right now, I don't seem to be able to change it - it's always prefixed with the default repl namespace.#2023-01-0410:11jumarIn most cases, what I want is to define it in the namespace where the function being debugged is#2023-01-0415:00Jordan BrooksAny pointers on debugging error in process filter: cider--render-stacktrace-causes: Wrong type argument: sequencep, t ?
My *cider-error* buffer is always empty and any eval that causes an exception leads to the above with no stacktrace.#2023-01-0416:41jumarMaybe try this: https://docs.cider.mx/cider/troubleshooting.html#debugging-cider-commands#2023-01-0417:10Jordan BrooksThanks - kind of narrowed it down but can't say I understand what the issue is..
I've updated to the latest version of cider and it appears to be working now#2023-01-0419:02Zachary FontenotI’ve only really briefly looked around, so I’m sorry if I’ve overlooked something simple, but are Java completions supported in cider? I get nothing when I try java.[TAB] or .[TAB]#2023-01-0419:09vemvfor static members/methods, yes
for instance ones... sometimes? https://github.com/alexander-yakushev/compliment powers this, IIRC it honors type hints up to point#2023-01-0419:18Zachary FontenotI don’t get completion on anything prefixed with .
I can see classes, but not static methods. I’m using corfu, but I don’t see why this would matter#2023-01-0419:21Zachary FontenotOH, maybe my deps.edn needs to be better setup#2023-01-0419:22Zachary FontenotBut also I don’t see why that would be an issue?#2023-01-0419:30Zachary Fontenotokay, it’s this issue https://github.com/clojure-emacs/cider/issues/3006#2023-01-0419:32Zachary Fontenotsetting completion-styles to '(orderless basic) allowed me to see the completions, but it’s a little wonky to have both orderless and basic#2023-01-0515:01robert-stuttafordis there a trick to stopping clj-refactor's clean-ns from injecting newlines inside libspecs, usually when the line would be very long?
edit: found it! cljr-print-right-margin#2023-01-0515:05robert-stuttafordyay, it works#2023-01-0517:30vemvyes it has a few options for that area, some of them new#2023-01-0518:10robert-stuttafordgrateful for this one!#2023-01-0700:41Matthew OdendahlThe cljr-move-formhttps://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-move-form is frustrating. It usually https://github.com/clojure-emacs/clj-refactor.el/issues/433, and misses references it should update.#2023-01-0700:43Matthew OdendahlI'm having better luck with the Clojure LSP's equivalent, but it's not working right either, and I usually have to manually clean up the parts it misses.#2023-01-0711:39vemvI could have a look at it, it's been a while since last time we went fixing stuff on refactor-nrepl#2023-01-0711:43vemvtbh I'd just cut and paste the form from ns to ns
for any token with a / (e.g. foo/bar) I'd use cljr-slash - you can delete the / there , type / again and it will offer sensible completions (or just autocomplete the single possible option if there's just one)
And for symbols that need to be refer ed, I'd use the cljr-add-missing command over each such symbol.
Both commands are very much polished.
I know it's slightly manual, but if you've built some muscle memory around these two commands (which is much worthwhile), it should be all pretty quick :)#2023-01-0722:53Matthew OdendahlFor moving one form, sure. For splitting up a thousand-line namespace in a large application into five pieces, it gets really tedious. Took me days using an approach similar to what you suggest (using both the Clojure LSP and CIDER in Spacemacs, plus command-line kondo to catch anything I missed). Wouldn't have been that hard in e.g. Python with PyCharm.#2023-01-0817:01vemvThere's also https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-rename-file-or-dir which unlike move-form did receive some love over the last year#2023-01-0923:45Matthew OdendahlThe cljr-stop-referring refactoring removes all the refers from a ns, but only fixes the references for the first one.#2023-01-1001:09vemvPlease create an issue for it
I'll try to work on it eventually#2023-01-1017:30Matthew OdendahlMaybe it wasn't the first one?#2023-01-1017:31Matthew OdendahlI figured out the trick! The entire refer vector has to be on one line for it to work.#2023-01-1008:08motformI'm trying to create a command that connect to the project default unix domain socket, but it does not seem to register my params. Am I doing anything wrong, should this go in configuration variables somewhere else?
(defun cider-connect-default-unix-socket ()
"Connect cider to the default unix socket in `PROJECT-CURRENT'."
(interactive)
(let ((socket-file (concat (car (last (project-current))) "nrepl-socket")))
(cider-connect-clj '(:host "local-unix-domain-socket" :socket-file socket-file))))
#2023-01-1109:24lassemaattais it possible to disable (or preferably limit the amount of) the printing of the last sexp evaluation when I eval a buffer with cider-eval-buffer?#2023-01-1109:26lassemaattaI have a ns with some macros-within-macros-within-macros -type stuff which generate a lot of noise in the minibuffer when evaluating the ns. (and cider--display-interactive-eval-result eats my cpu while doing that)#2023-01-1109:27lassemaattaI found some old https://github.com/clojure-emacs/cider/issues/1934#issuecomment-425243546 which may relate to this, but they seemed to be quite complex for my liking#2023-01-1215:03mbertheauCan I get macro expansion for CLJS target in cider? I.e. where (contains &env :locals) is true.#2023-01-1216:24Alex Miller (Clojure team)https://ask.clojure.org/index.php/12541/cider-error-classnotfoundexception-javadoc-doclet-doclet#2023-01-1316:39pmooserI'm seeing a weird overlay when cider pops up a stacktrace buffer, and it has a light colored background that makes it hard to read the stack trace. Does anyone have any tips about tracking down this sort of thing? I've tried to identify the face under the cursor with C-u C-x = but either it's not there or I'm not able to interpret it correctly.#2023-01-1316:41pmooserLooks like an overlay:#2023-01-1316:41pmooserThere is an overlay here:
From 142 to 1937
font-lock-face (:background "#f332f332f332" :extend t)
#2023-01-1316:42pmooserhttps://github.com/jackrusher/dotemacs/issues/33#2023-01-1316:44pmooserI have no idea what this is coming from, but he works around it by setting this:#2023-01-1316:44pmooser(set-variable 'cider-stacktrace-frames-background-color "#161616")
#2023-01-1320:27moe#2023-01-1413:35wcalderipeHey 👋
I've installed https://github.com/clojure-emacs/clj-refactor.el but when I try to jack-in in on one of my Clojure projects, I keep getting the error below. I did some research, but I couldn't find a solution alone.
error in process sentinel: Could not start nREPL server: Error while parsing option "--config-data {:deps {refactor-nrepl/refactor-nrepl {:mvn/version \"3.6.0\"} nrepl/nrepl {:mvn/version \"0.8.3\"} refactor-nrepl/refactor-nrepl {:mvn/version \"3.6.0\"} cider/cider-nrepl {:mvn/version \"0.25.9\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]\"]}}}": java.lang.IllegalArgumentException: Duplicate key: refactor-nrepl/refactor-nrepl
Would someone please point me in the right direction?#2023-01-1413:36wcalderipeI'm using deps.edn and I don't have refactor-nrepl/refactor-nrepl installed on either my project nor ~/.clojure/deps.edn#2023-01-1413:42moeYou could try (setq cljr-inject-dependencies-at-jack-in nil)#2023-01-1414:00vemvwhat's your cider.el version?#2023-01-1416:09wcalderipe> what's your cider.el version?
1.1.0-snapshot#2023-01-1420:26moe@UHD67JRL4 Any luck with that?#2023-01-1512:50vemvhttps://github.com/clojure-emacs/cider/tags
yeah 1.1.0 sounds fairly outdated
cider had some breaking change so make sure to also update cider#2023-01-1518:27wcalderipe> @UHD67JRL4 Any luck with that?
No, unfortunately, I still have the same issue. Thanks for the hint!
I'll try to bump CIDER version by version to see if that fixes the problem at some point.#2023-01-1518:37wcalderipeIt's working after I bumped CIDER straight to 1.6 and set cljr-inject-dependencies-at-jack-in to nil in my emacs.d
Thanks, folks#2023-01-1423:14mister_mis there a writeup anywhere about how the cider debugger was implemented ?#2023-01-1608:00bozhidarOnly this I think https://docs.cider.mx/cider/debugging/debugger.html#debugger-internals#2023-01-1813:34bozhidarThere’s also this talk, which is probably an even better resource https://drive.google.com/file/d/1YhnPBJOXbUzXfVOEojICFTwhCt_3u6Ss/view#2023-01-1817:36mister_mthank you#2023-01-1519:34moeI don't get company completion suggestions for namespaced vars, is that like a regular thing? I only really just noticed.#2023-01-1520:35moeI do in the repl, but not anywhere else#2023-01-1717:41browecompany completion has been broken for me for a long time…#2023-01-1717:41moedo you have. working setup w/ something else?#2023-01-1717:42broweno. for me clojure has no completion in emacs#2023-01-1717:50browe… it used to many years ago#2023-01-1717:51dpsuttonare you using lsp and CIDER at the same time?#2023-01-1717:51broweno#2023-01-1717:51moei'm using LSP + Cider#2023-01-1717:52moeas noted, namespaced completion works well in the REPL buffers#2023-01-1717:54dpsuttonIf you disable lsp does completion come back? They by default fight over it I think and you end up with empty caches of completion#2023-01-1717:55moei'm guessing it will, let me check#2023-01-1718:01moeunfortunately duty calls, i'll have to come back to this. do you have a suggestion if disabling lsp-mode fixes the completion issue?#2023-01-1718:21dpsuttoni’ll have to look for it but there’s a way to say use one over the other#2023-01-1718:22dpsuttonhttps://docs.cider.mx/cider/usage/misc_features.html#xref-integration#2023-01-1717:40browehas the repl broken for anyone else? My STR: 1. Start a repl with cider-jack-in in a project 2. when the repl prompt appears type 1 and hit enter#2023-01-1717:42dpsuttonin the repl buffer can you type m-x describe-key and then press enter? Want to see what [RET] is bound to in your repl#2023-01-1717:42dpsuttonits possible it is sending a newline and not “hey CIDER eval this input” so you’re not seeing a hanging repl but a waiting repl#2023-01-1717:43browegood thought.#2023-01-1717:43broweit seems to be bound to paredit-RET#2023-01-1717:43dpsuttonyeah that doesn’t seem helpful#2023-01-1717:43browewhat’s the cider function to invoke?#2023-01-1717:44dpsuttoncider-repl-return i think#2023-01-1717:44broweyup! you’re right#2023-01-1717:44browewhy would that have magically changed…#2023-01-1717:44browe(i don’t rly expect an answer to that lol)#2023-01-1717:44dpsuttontry control-j#2023-01-1717:44browethanks for your help!#2023-01-1717:45dpsuttonthat’s actually my preferred setup. enter enters newlines so i can easily make multi-line stuff. control-j sends the input#2023-01-1717:45browectrl-j is bound to paredit-C-j#2023-01-1717:45browethe weird thing is, it was working fine on friday#2023-01-1717:45browetoday was the first time i started working on clj since then#2023-01-1717:45browewhatever#2023-01-1717:45dpsuttondoes control-j work? paredit-C-j might delegate out#2023-01-1717:45browenope#2023-01-1717:46Derekhttps://clojurians.slack.com/archives/C0617A8PQ/p1669905047154439?thread_ts=1669887613.502019&cid=C0617A8PQ#2023-01-1717:46dpsuttonwomp#2023-01-1717:46Derekyou’ve recently updated paredit#2023-01-1717:46browesame behavior as paredit-RET#2023-01-1717:46browe@UPEKQ7589 thanks#2023-01-1717:46broweemacs is great but also horrible lol#2023-01-1717:47browepackages shouldn’t randomly update#2023-01-1717:47Dereklol, I wish packages didn’t declare such common keybindings#2023-01-1717:47broweindeed#2023-01-1717:48dpsuttonhttps://clojurians.slack.com/archives/C0617A8PQ/p1673977679531389?thread_ts=1669499882.069549&cid=C0617A8PQ#2023-01-1717:48browei greatly appreciate both of your help#2023-01-1717:49broweyeah up until now i haven’t needed to do that.#2023-01-1717:49browethis is my cider config currently:#2023-01-1717:49browe(use-package cider
:bind (:map cider-mode-map
("C-c M-p" . cider-pprint-eval-last-sexp)
:map cider-repl-mode-map
("C-c M-o" . cider-repl-clear-buffer)
("C-c M-l" . cider-repl-switch-to-other))
:config
(require 'bind-key)
(add-hook 'cider-repl-mode-hook #'company-mode)
(add-hook 'cider-mode-hook #'company-mode)
;; (setq org-babel-clojure-backend 'cider)
)
#2023-01-1717:50browelooks like i’ll have to add another entry to cider-repl-mode-map#2023-01-1717:40browethe repl hangs at this point.#2023-01-1717:40browethis just started happening today. has anyone else experienced this?#2023-01-1717:50moeAnyone feel like chiming in on this?#2023-01-1717:53DerekWhat do you mean? Like ::namespace-alias/?#2023-01-1717:53DerekIn addition, I think you’ll find a lot of us have moved from company to corfu#2023-01-1717:55moeNo, like ns/ e.g. clojure.core/#2023-01-1717:56DerekUsing cider and corfu, I see this:#2023-01-1717:57moeare you using LSP?#2023-01-1717:57DerekNope#2023-01-1717:59Derekcompletion-at-point-functions is a variable defined in 'minibuffer.el'.
Its value is (cider-complete-at-point t)
Local in buffer core.clj; global value is
(tags-completion-at-point-function)
#2023-01-1719:12browe@UPEKQ7589 is corfu generally preferred over company by most emacs users these days, or mainly just by cider users?#2023-01-1719:13DerekI don’t know if I’m really any sort of authoritative source here. I’ve seen corfu usage mirror the use of the vertico/marginalia/consult stack#2023-01-1719:13broweok. thanks#2023-01-1805:25didibusI use Ivy and company, no issue here#2023-01-1805:26didibusI doubt the lack of completion is from Emacs side, probably Cider not returning the candidates#2023-01-1805:28didibusThough it works fine for me#2023-01-1805:34didibusWhat's better about corfu?#2023-01-1815:49DerekI think corfu is just better integrated into emacs existing code completion utilities (completion-at-point)#2023-01-1815:49DerekFrom their README,
Corfu is a small package, which relies on the Emacs completion facilities and concentrates on providing a polished completion UI.
#2023-01-1817:03didibusHum, that's not saying much.#2023-01-1817:03moeBut dude, it's polished#2023-01-1818:30DerekThat emphasis comes from me. You’re welcome to read more about it https://github.com/minad/corfu#2023-01-1821:10didibusSeems the only difference with company is that Corfu takes over completion-at-point , I'm not sure I agree that's a good thing, Corfu monkey patches Emacs it seems, so that completion-at-point no longer behaves as standard, but is taken over by corfu. Is that really better?#2023-01-1821:16didibusCompany automatically includes all results from Emacs standard completion, so its compatible with all standard Emacs completions as well.
It probably is a bit of a personal preference matter. Thanks for showing it to me. I use spacemacs, so anyways I probably just need to wait for it to decide to switch#2023-01-1717:51browecider used to do completion pretty well many years ago#2023-01-1717:51browei have lost track of when that stopped working for me.#2023-01-1721:28wcalderipeHave someone passed through a similar situation with shadow-cljs?
https://clojurians.slack.com/archives/C6N245JGG/p1673990569056019#2023-01-1812:40tatutsay I have a vector of maps, could cider inspector print them as a table? (possibly utilizing clojure.pprint/print-table)#2023-01-1812:54tatutthere are fancy external tools that hook into tap> but that means I have to leave emacs to look at it#2023-01-1812:54tatutI like that inspector shows large vectors as paged, but sometimes a table would be good and it could even allow selection of columns#2023-01-1815:42jumarSo you want to see everything at once?
That would be cool especially for smaller collections of homogeneous maps with not so many keys
Having an option to change “viewers” ala Portal would be nice.
My ultimate wish is to be able to draw some charts, like with vega lite, without leaving emacs#2023-01-1815:43jumarWhen it comes to tabular data and filtering, aggregations, etc. we could draw some inspiration from tools like Visidata#2023-01-1815:46tatutnot necessarily everything at once, you can set the page size as it is#2023-01-1815:46tatutbut sometimes a tabular view is just easier to glance at#2023-01-1815:46tatutinstead of trying to read a list of edn maps#2023-01-1815:47tatutmy elisp fu might be a little rusty, but I could try to hack something if I know where to start#2023-01-1815:50tatutas emacs can show images, charting would definitely be doable, but that requires dependencies on the clojure side#2023-01-1816:45tatutok, I took a stab at orchard.inspect/inspect multimethod and while you can quite easily patch that to use table printing for a collection of maps… that doesn’t keep track of the values, would need to split that by lines and then output that like the emacs side needs it#2023-01-1817:09tatutI hacked together a variant of orchard.inspect/render-indexed-values that tracks the values so that you can drill down#2023-01-1817:10tatutthat’s showing a query result of some fake organization data#2023-01-1817:11tatutbut to be really useful, it would need to have support on the cider side to switch between table mode and regular mode, and ideally selecting the columns to show#2023-01-1817:13tatutif the table fits width wise to the buffer, it looks pretty nice#2023-01-1817:14tatuthere’s a gist https://gist.github.com/tatut/a0f4a88f3a86a030802b3ab2893e3b06#2023-01-2014:27jumarExactly this: https://clojurians.slack.com/archives/C0617A8PQ/p1674061903017969?thread_ts=1674045609.011549&cid=C0617A8PQ
But the experiment looks promising 🙂#2023-01-2116:48Sam Ritchie@U07SQTAEM had a Clerk view working inside of emacs, maybe someone has the link handy #2023-01-2117:55jackrusherIf you want to be able to visualize clojure data as various kinds of graphs inside emacs without adding any deps, consider:
https://github.com/applied-science/emacs-vega-view
It's also possible to open Clerk's front-end with *xwidget*-*webkit*-browse-url (assuming you've built your emacs with support). Using Clerk in your project does involve a dev dep, but that might change in the next few months 😉#2023-01-2223:03Carsten BehringI played a lot with cider-inspectorvs Clerk.
Given the multitude of potential non text formats, I can hardly see how cider-inspector could be improved to render "them all ". The table-format you ask for is just one example.
vega-lite an other.
Maybe cider-inspector could get a "send-to-external-tool" feature, where it would send on key press the current sub-data structure to a user defined EmacsLisp/Clojure function, which could then open the data with Clerk while asking for the viewer to use...
Similar to the way we can customize which clojure function to use for "pretty-print".#2023-01-2305:32jumar@U07SQTAEM thanks a ton for sharing the vega-view package!
I've been looking for something like this for a very long time.#2023-01-2306:18tatutvega looks nice, and if we can view charts inside emacs that is cool… but I still would want to keep the inspector drill down stuff, so launching an external tool is not quite the same#2023-01-2307:11jumarI agree with that - the inspector is already great but it could be become even better for quick ad-hoc data exploration.#2023-01-2314:16Carsten BehringI "live" as well in the inspector. It is kind of my "standard way" to evaluate expression in Cider.
But from time to time I would wish I could "branch" out of the inspector on a certain level and render the current data in a "rich interface".
I think this should be "rendered outside of Emacs". (due to the requirement of "full html compatible")
With Clerk we have now a tool which can render rich data structures into html. Even support viewer plugins and complex data viewers based on JavaScript.
The combination of the 2 would be fantastic.
The shortest way to this might then be to extend the cider inspector, so that it can call on keypress a user supplied function with the "current" detail of the data structure.#2023-01-2314:18Carsten BehringAn the original request of @U11SJ6Q0K would then be solved by using Clerk for render tables (= vector-of-maps) into html.#2023-01-2317:15Carsten Behring@U11SJ6Q0K At the end of this
https://clojurians.slack.com/archives/C0617A8PQ/p1674493870044519?thread_ts=1674486881.210099&cid=C0617A8PQ
is some EmacsLisp code which solves your original problem to a large extend as well.
You would need to "leave" Emacs, as Clerk renders in Browser..
Unless you have *xwidget*-*webkit*-browse-url working.#2023-01-2317:54Carsten BehringMaybe we could start a "clerk" mode, just for having a place to collect this functions.#2023-01-2008:43pithylessI’m running doom-emacs with latest unpinned cider (I’ve upgraded after seeing the same behavior on cider 1.5.0). I can connect via cider-connect-clj to an nrepl running from the terminal. After evaling one or a couple of expressions (hard to reproduce the minimum number of operations) the repl buffer closes and I see [nREPL] Connection closed in *Messages* . It could also be a timing issue - maybe it just closes after ~1 minute.
Does this ring a bell to anyone? Any tips on how I can debug this further?#2023-01-2008:45pithylessThis is on a new M1 macbook (in case that could be related); so I can’t say that it started happening after a certain upgrade, etc.#2023-01-2009:08pithylessI think it may be related to doom workspaces.#2023-01-2010:19daveliepmannCould the port be getting stomped by another process? And do you have https://docs.cider.mx/cider/troubleshooting.html#debugging-the-communication-with-nrepl turned on?#2023-01-2013:44pithylessThanks for following up; I’ve been struggling with this for a couple of days and I found a temporary workaround for now. It looks like this is somewhat related to doom-emacs (workspaces / doom / evil-mode / ???), such that it looks like some set of operations call evil-quit which then causes cider to disconnect after a short delay (presumably via cider-quit).#2023-01-2013:44pithylessThe workaround I discovered on doom-emacs discord is to switch the buffer repl and close it immediately:
(map! :map cider-repl-mode-map
(:localleader
"s" #'(lambda ()
(interactive)
(switch-to-buffer "*Messages*")
(delete-window))))#2023-01-2013:45pithylessThis is the way I like to work anyway (with the actual repl buffer hidden), so it is not a problem for me. And for whatever reason, this approach works: the repl sits quietly in the background and cider does not disconnect.#2023-01-2014:19daveliepmann👍:skin-tone-3:#2023-01-2219:57RollACasterHi 👋 whenever I run cider-pprint-eval-last-sexp from a cljs repl on a value which contains a #js literal everything is formatted on one line. I think I had this behavior for multiple cider versions and could reproduce that with emacs -q. Anybody got an idea how to fix that?#2023-01-2219:57RollACastere.g. for
{"K" 75,
"L" 76,
"G" 71,
"J" 74,
"M" 77,
"H" 72,
"E" 69,
"C" 67,
"F" 70,
"I" 73,
"D" 68
"Z" #js [1]}
I get
{"K" 75, "L" 76, "G" 71, "J" 74, "M" 77, "Z" #js [1], "H" 72, "E" 69, "C" 67, "F" 70, "I" 73, "D" 68}
But
{"K" 75,
"L" 76,
"G" 71,
"J" 74,
"M" 77,
"H" 72,
"E" 69,
"C" 67,
"F" 70,
"I" 73,
"D" 68}
works fine. I also tried different values for cider-print-fn but the result was the same#2023-10-1715:39Daniel GersonWoah! Thanks for writing this. Seems like this is still the case with CIDER 1.8.0-snapshot (package: 20230707.640). Anyone else figure this out?#2023-10-1715:43Daniel GersonHmmm, I think I've got the default with spacemacs (which I assumed after update was the latest). Will have to figure out how to get to a later version 😅#2023-10-1718:41vemvFeel free to create an issue#2023-10-1720:01Daniel GersonSure 🙂 https://github.com/clojure-emacs/cider/issues/3534#2023-10-1715:39Daniel GersonWoah! Thanks for writing this. Seems like this is still the case with CIDER 1.8.0-snapshot (package: 20230707.640). Anyone else figure this out?#2023-01-2315:14Carsten BehringI made a proof-of-concept to combine the cider-inspector and Clerk
and quite like it.
The idea is that while in the cider-inspector
I can press a key, and the current value gets then send to Clerk and is rendered in browser via Clerks tap inspector.
So I can still navigate complex data structures with the cider-inspector as usual, and at any given point in time render the current value with Clerk.#2023-01-2315:16Carsten BehringAs I have little clue on Cider and EmacsLisp I just hacked the existing
cider-inspector-def-current-val
and added a "tapping" of the value to it.
(just to see f it works)
(defun cider-inspector-def-current-val (var-name ns)
"Defines a var with VAR-NAME in current namespace.
Doesn't modify current page. When called interactively NS defaults to
current-namespace."
(interactive (let ((ns (cider-current-ns)))
(list (read-from-minibuffer (concat "Var name: " ns "/"))
ns)))
(setq cider-inspector--current-repl (cider-current-repl))
(when-let* ((value (cider-sync-request:inspect-def-current-val ns var-name)))
(cider-interactive-eval (concat "(tap> " ns "/" var-name ")"))
(cider-inspector--render-value value)
(message "%s#'%s/%s = %s" cider-eval-result-prefix ns var-name value)
))#2023-01-2315:21Carsten BehringThen I can setup the Clerk tap inspector:
(nextjournal.clerk/show! 'nextjournal.clerk.tap)
Now I can call cider-inspector-def-current-value while in cider-inspector and it will render the current value in Clerk.#2023-01-2315:26Carsten BehringSo I think it would be cool, if the cider inspector could gain a new function to tap the current value. cider-inspector-tap-current-value#2023-01-2315:30Carsten BehringTo have a "full integration" of Cider and Clerk, one piece is still missing:
When "render" a value like above in clerk, we need to have a way to "choose a Clerk viewer".
In Clerk itself this goes via code, using specific functions.
I made an other proof of concept, in which Emacs asks the user to select a viewer from a list and wrap the value with the needed metadata before tapping, and then Clerk would use the selected viewer in the tap inspector:
(setq clerk-viewer-list '("default"
":html"
":latex"
":table"
"nextjournal.clerk.viewer/html-viewer"
"nextjournal.clerk.viewer/vega-lite-viewer"
"nextjournal.clerk.viewer/map-viewer"
"nextjournal.clerk.viewer/markdown-viewer"
"nextjournal.clerk.viewer/katex-viewer"
"nextjournal.clerk.viewer/fallback-viewer"
"nextjournal.clerk.viewer/string-viewer"))
(defun clerk-tap-last-sexp-with-viewer (viewer)
(interactive
(list (completing-read "Choose viewer: " clerk-viewer-list nil t)))
(let ((tapped-form (concat "(clojure.core/->> "
(cider-last-sexp)
(if (equal "default" viewer)
(concat " (nextjournal.clerk/with-viewer {:transform-fn identity})")
(if (string-prefix-p ":" viewer)
(concat " (nextjournal.clerk/with-viewer " "(keyword \"" (substring viewer 1) "\")" ")")
(concat " (nextjournal.clerk/with-viewer " "(symbol \"" viewer "\")" ")"))
)
" (clojure.core/tap>))")))
(cider-interactive-eval tapped-form
nil
nil
(cider--nrepl-pr-request-map))))#2023-01-2315:31Carsten BehringThis code is Clerk specific, so should probably not be in Cider. But Cider would need to "call back" as part of the cider-inspector to ask the user to select the viewer, to get this nicely working....#2023-01-2315:36Carsten BehringBut maybe we could start by adding a function cider-inspector-tap-current-value to Cider ?
Then we could make a basic integration with Clerk's tap inspector (without viewer selection) outside cider#2023-01-2316:43Carsten BehringIf somebody want to play with it, the following emacs lisp function can be used while in cider-inspector without changing any cider code:
(defun cider-inspector-tap-current-val ()
(interactive)
(setq cider-inspector--current-repl (cider-current-repl))
(when-let* ((ns "user")
(var-name "cider-inspector-temp-hdhsad")
(value (cider-sync-request:inspect-def-current-val ns var-name)))
(cider-interactive-eval (concat "(tap> " ns "/" var-name ")"))
(cider-inspector--render-value value)
(message "%s#'%s/%s = %s" cider-eval-result-prefix ns var-name value)
))
It will def the current value of the cider-inspector (using a fixed var name) and then tap> it.
If the Clerk tap inspector is open, it will then render it.
Other Clojure value inspectors, like Portal and Reveal can as well be setup as tap> targets.
So it would work the same way for those, not only Clerk.#2023-01-2317:11Carsten BehringThe following add the interactive viewer selection to it:
(setq clerk-viewer-list '("default"
":html"
":latex"
":table"
"nextjournal.clerk.viewer/html-viewer"
"nextjournal.clerk.viewer/vega-lite-viewer"
"nextjournal.clerk.viewer/map-viewer"
"nextjournal.clerk.viewer/markdown-viewer"
"nextjournal.clerk.viewer/katex-viewer"
"nextjournal.clerk.viewer/fallback-viewer"
"nextjournal.clerk.viewer/string-viewer"))
(defun cider-inspector-tap-current-val-with-viewer (viewer)
(interactive
(list (completing-read "Choose viewer: " clerk-viewer-list nil t)))
(setq cider-inspector--current-repl (cider-current-repl))
(when-let* ((ns "user")
(var-name "cider-inspector-temp-hdhsad")
(value (cider-sync-request:inspect-def-current-val ns var-name)))
(let ((tapped-form (concat "(clojure.core/->> "
(concat ns "/" var-name)
(if (equal "default" viewer)
(concat " (nextjournal.clerk/with-viewer {:transform-fn identity})")
(if (string-prefix-p ":" viewer)
(concat " (nextjournal.clerk/with-viewer " "(keyword \"" (substring viewer 1) "\")" ")")
(concat " (nextjournal.clerk/with-viewer " "(symbol \"" viewer "\")" ")"))
)
" (clojure.core/tap>))")))
(cider-interactive-eval tapped-form
nil
nil
(cider--nrepl-pr-request-map)))
(cider-inspector--render-value value)
(message "%s#'%s/%s = %s" cider-eval-result-prefix ns var-name value)
))
Calling cider-inspector-tap-current-val-with-viewer while in cider-inspector will first ask for a viewer to pick (:table for table viewer) and then it tap> the current inspector value wrapped in Clerk metadata which chooses the viewer .
Clerk tap inspector will then show it as table (or in any other viewer selected before)#2023-01-2409:47Carsten BehringThe Portal docu assumes as well that the "correct viewer" can be selected automatically by "looking at the value". In my view this does not work "in general", for all cases. To detect that a "map" is "vega lite" is not easy and will not work for "all graphic formats". So the "user" need to be "asked" about the "viewer to use". (or we assume "code")#2023-01-2315:36Carsten BehringBut maybe we could start by adding a function cider-inspector-tap-current-value to Cider ?
Then we could make a basic integration with Clerk's tap inspector (without viewer selection) outside cider#2023-01-2418:38Carsten BehringShould I make a feature request in cider for a cider-inspector-tap-current-value as motivated above ?#2023-01-2419:01vemvPlease do, we do appreciate checking out well thought-out proposals more calmly cider#2023-01-2420:10Carsten Behringhttps://github.com/clojure-emacs/cider/issues/3311#2023-01-2420:22vemvLooking good, will comment on it. However please don't link to Slack from GH - we want something self-contained for future reference :)#2023-01-2510:27tatutthis would be great, and this brings utility to debugging as well, as you can inspect intermediate values when stepping thru code#2023-01-2510:27tatutthen you could visualize intermediate results graphically#2023-01-2609:36pmooserHow do I tell programmatically if there's a cider connection associated with the current buffer?#2023-01-2609:42pmooserReplying to myself as I try to investigate.#2023-01-2609:43pmooserI don't mean cider-reply-type-for-buffer , which will return a type even when we have no associated connection.#2023-01-2609:44pmooserI think I can use cider-current-repl ... if I am not mistaken.#2023-01-2615:01dpsutton(defun cider-connected-p ()
"Return t if CIDER is currently connected, nil otherwise."
(process-live-p (get-buffer-process (cider-current-repl))))
#2023-01-2621:13Carsten BehringHow can I evaluate a Clojure function from EmacsLisp with cider and get its result as a lisp list-of-string (assuming that the Clojure function returns a sequence of Strings) ?#2023-01-2622:29jumraiyaNot sure about cider but I used a elisp package called clomacs for calling clojure functions in emacs a while ago. It worked pretty well.#2023-01-2623:07vemvThe problem can be decomposed into two parts:
• evaluate a clojure expression string, and get a result string back
◦ very easy with CIDER, you can take a look around its eval functions
• use elisp's read (which clojurists would call read-string) to turn that string into elisp objects
◦ and cross fingers that one thing can be converted to the other without errors
If you don't want to "cross fingers" so much, change (clojure-eval-string "(foo)")
to (clojure-eval-string "(my.ns/adjust (foo))")where my.ns/adjust
is a custom function that will make data easier to convert, according to your requirements (e.g. turn sets into lists)
(and where clojure-eval-string is pseudocode - please look up the actual CIDER functions)#2023-01-2623:08vemvClomacs might just work, I never tried it. Personally I just like the simplicity of composing a few functions, so that I can understand the whole approach being used#2023-01-2623:37Carsten BehringCross post of Cider / Clerk integration
https://clojurians.slack.com/archives/C035GRLJEP8/p1674776078297589#2023-01-2723:43RAJKUMARHi#2023-01-2723:43RAJKUMARhow can I run single test in emacs using cider#2023-01-2723:44RAJKUMARI'm using emacs as clojure development environment. My emacs config is https://github.com/rajcspsg/emacs.d#2023-01-2723:44RAJKUMARI'm trying to run single test in my clojure project.#2023-01-2723:44RAJKUMARI've test file called core-test in the folder test/getting-started/core-test.clj folder. The contents of the file is -#2023-01-2723:44RAJKUMAR(ns getting-started.core-test
(:require [clojure.test :refer :all]
[getting-started.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 0))))
#2023-01-2800:22dpsuttonhi @U02PR896TMG. I think I see a few issues:#2023-01-2800:24dpsutton• filenames must use hyphens. getting-started folder needs to be getting_started. So the full path of your file should be test/getting_started/core_test.clj. This is a JVM limitation. The ns form is correct: use hyphens in the ns name.
• You have to require the namespace for everything to run. Clojure works based on repl state, not just file tree state. So make sure you run cider-load-buffer and then try again.#2023-01-2801:01RAJKUMARThanks @U11BV7MTK!!!#2023-01-2801:01RAJKUMARcider-load-buffer did the trick#2023-01-2801:01RAJKUMARnow I can run clojure tests like a charm#2023-01-2723:45RAJKUMARI would like to run this single test a-test.
I started cider using command cider-jack-in. Now I'm trying to run single test using command M-x cider-test-run-test.#2023-01-2723:45RAJKUMARNow I'm getting warning no test at point#2023-01-2723:45RAJKUMARI've asked this question emacs.stackexchange as well https://emacs.stackexchange.com/questions/75554/couldnt-run-single-clojure-test-instead-getting-warning-cider-no-test-at-point#2023-01-2723:45RAJKUMARAny help on this is appreciated#2023-01-2904:36ZedDoes running cider-load-buffer help?#2023-01-2912:05bozhidarI was going to suggest the same.#2023-01-2912:06bozhidarGenerally everything about tests is well documented here https://docs.cider.mx/cider/testing/running_tests.html (including common caveats)#2023-01-3115:08RAJKUMARLet me check this. Thanks @U051BLM8F#2023-01-2921:31macrobartfastI just discovered cider-clojuredocs (I had been using grimoire back when) and I’m thrilled! Thank you! Game changer for me.#2023-01-2922:04macrobartfastI blocked the repl in emacs cider with a core.async function; how do I unblock it from within emacs (or wherever is best)?#2023-01-2922:14phronmophobicC-c C-b runs the command cider-interrupt
#2023-01-2922:14phronmophobicso either M-x cider-interrupt or C-c C-b#2023-01-2923:44macrobartfastThat did the trick!
My entire world was momentarily frozen. I wandered away from the computer and out into the ‘sunlight’… is that bright thing in the sky what you call the ‘sun’?
Thanks for the help!#2023-01-3022:16hifumi123When using println as a callback function in ClojureScript code running on browser, is it possible to also print to my REPL?#2023-01-3119:45mister_mI have a mostly empty namespace definition that provides (:gen-class :extends java.lang.Exception) within the ns macro - am I able to tell cider to compile this for me?#2023-02-0214:48Chitradeep Dutta RoyHi I am both new to clojure and also CIDER. For experimenting I keep a project skeleton with clojure.tools.dep as dependency as a :dev alias for hot-loading stuff. I am looking for a way to :require it under user namespace when I launch a repl for the project with cider-jack-in. I have been able to launch a repl with the :dev alias using .dir-locals.el but can't figure out how to :require add-libs into user namespace. I have even tried creating a dev/user.clj file but it doesn't execute when I launch with the :dev alias#2023-02-0214:53Chitradeep Dutta RoyNevermind the issue was a spelling mistake, I was writing "extra-path" instead of "extra-paths" in the deps.edn.#2023-02-0216:23Patrick BrownEvery time I try to take from a deferred in manifold my cider repl blocks and I have to cider-interrupt. I'm using cider-connect to a standard nrepl. Everything is fully functional evaluating at the command line with the repl 'clj' provides me. Any info on how I'm futzing this up would be real cool of you.#2023-02-0216:28Patrick BrownI should add more context. That message was woefully baren. I do not block when I eval with cider-eval-last-sexp-in-buffer-as-current-region. I only block when I want to see the result in the repl buffer or in that little message next the the function when I do cider-eval-last-sexp or cider-eval-last-sexp-to-repl
CORRECTION: Sometimes it blocks on eval-ls-as-cb and sometimes it does not. It most definitely blocks as all times when I try to access the value on the stream
i.e.
@(s/take! s) blocks pretty much always, maybe not the first time in a fresh repl.
(s/take! s) will print to the buffer, but it's help is limited because the response in <<..>> (this is expected behavior.)#2023-02-0217:14Patrick BrownO.K. So, I think I've got a handle on what's up. It's a cider-interrupt thing. And largely my confusion was brought about by being dumb. If I try to take from an empty stream it hangs. I can expect that. But cider-interrupt only gives me the appearance of interrupt. I've still got a process open or something like that and any subsequent calls of any kind to the same channels hang. Is this expected? I've got to manually call (s/close! s) and re-eval things. Maybe I should be in #C02H9GF74CF. I'm confused, any insights?#2023-02-0314:25mister_mquick q about loading files after a cider-jack-in - I am trying to C-c C-k / "load buffer" in a file with a number of test cases which is require-ing a number of dependencies from elsewhere in my project. Naturally this does not work, as these dependencies have not been loaded into the new REPL session. What's the shortest path to load only required dependencies so I can execute tests in the current test file? Do I need to just run cider-load-all-project-ns to load all namespaces in the project? Is there a reason or a gotcha for why I shouldn't do that whenever I start a session?#2023-02-0314:28dpsuttonWhy doesn’t this work? Every file should be loadable. It will just require it’s own dependencies#2023-02-0314:33mister_mThe immediate failure I got was an FileNotFoundException for a dependency which ends in an unhandled CompilerException. I think this could be caused by a missing alias (I need to set up dir-locals). I'll report back if I can't resolve the problem. It doesn't appear that it is able to find a dependency on the classpath though which makes me think that not loading my "test" alias which defines the :extra-paths field where my tests live may be causing C-c C-k to fail#2023-02-0314:45mister_mfor completeness here is the trace https://gist.github.com/matt-y/5d9aa826ecb001b6646723c768fdc616#2023-02-0314:46dpsuttonit can’t find token.clj. Are you requiring a namespace called token?#2023-02-0314:46dpsuttonpresumably you are in a test file at test/token_test.clj#2023-02-0314:47mister_mCorrect in both deductions.#2023-02-0314:48dpsuttonso nothing cider related really. type in the repl (require 'token) if that fails nothing CIDER can do#2023-02-0314:48dpsuttonand your classpaths aren’t set correctly#2023-02-0314:49mister_mI'll figure out how to get them set up properly. Thanks @U11BV7MTK#2023-02-0314:49dpsuttonmy suggestion is to remove CIDER until it works#2023-02-0314:50dpsuttonclj from a command line. (require 'token-test) (clojure.test/run-tests 'token-test)#2023-02-0314:50dpsuttononce that works it should work in CIDER#2023-02-0314:50mister_mI'll take your advice and start there#2023-02-0314:55mister_mit was a bad path in the :paths attribute of my deps.edn ! I must not have noticed because I had loaded buffers one at a time when creating them the other day. Thanks for the direction#2023-02-0517:49mkvlrWhen augmenting an existing exception my cider doesn’t show me the new ex-message but only the original one. This makes it often hard to see what’s going on. Do other folks have the same behaviour? Is this intentional?#2023-02-0517:52mkvlrI can tap to a much nicer display, any way to make that the default?#2023-02-0518:03mkvlrif I rethrow without ex-cause I do see the more specific ex-message but I’d prefer to not lose the ex-cause#2023-02-0519:55dpsuttonHave to check how the source works. Probably comes from the underlying clojure tooling which behaves this way to show you the actual error and not the wrappers around it#2023-02-0520:32mkvlrshouldn’t it be the other way around? Augmenting and rethrowing should typically add information and improve the message?#2023-02-0520:49dpsuttonMaybe. If a tls connection throws so your connection throws so your query throws so your endpoint throws, you ideally want the tls connection issue. The others lack any context#2023-02-0922:07agI'm trying to do some lamebrain stuff. Evaling a list with over 60K maps in it. Emacs is screaming and I wouldn't budge. But Clojure went full Alex Miller and said "No!"... I'm getting "code too large” error. Is that fixable? How?#2023-02-0922:08pppaulis that in a resource file, or inline in a namespace?#2023-02-0922:09agIt's just in a buffer. HTTP response from an api endpoint.#2023-02-0922:09agwhy does it matter, if I save it in a file that would help?#2023-02-0922:10pppaulI do that for debugging logs. try to remove as many modes as I can, put it in scratch buffer, or file#2023-02-0922:10pppaulclojure mode and cider mode are heavy#2023-02-0922:11vemvis it a method code too large error? (which would seem unrelated to cider)#2023-02-0922:13agyeah, probably. Weirdly, I can't even test that hypothesis, my stupid terminal won't paste that much data#2023-02-0922:13pppauljvm has a method size limit, I ran into this when compiling to clojure code (translation). stay out of the jvm to avoid that#2023-02-0922:14vemvanyway, if you're Evaling a list with over 60K maps in it. you can reshape the code from:
• the code is defined in terms of 60k maps at compile-time
to:
• the code ingests 60k maps at runtime#2023-02-0922:14pppaultext mode isn't going to touch the jvm#2023-02-0922:28agAlright. Saving data into a file, slurp-read-stringing it worked.
Sorry for the noise, and thank you for your help, everyone.#2023-02-0922:28pppaulgood to hear.#2023-02-1011:05slk500#2023-02-1012:25vemvrename doesn't work in clojurescript. Other features like cljr-slash do
It would be helpful to know, does emacs literally freeze (as in, you can't do anything) or the operation simply is left there running indefinitely?
It might take some 10m in a particularly large project#2023-02-1014:58slk500Thank you for your explanation.
1. So how others rename functions in cljs ?
Emacs just freeze. It's my hobby project like 500 loc so size it;s no a problem.#2023-02-1015:11vemvI never heard of freezing, only of slowness. Sorry you experienced that. If you wish to generously contribute a report, you can M-x toggle-debug-on-quit and then C-g whenever the freeze happens.
clojure-lsp has very nice cljs functionality.#2023-02-1016:28slk500thank you. I will try with lsp-mode. about bug report I don't see any errors it just freeze, but I don't see any increase of resource usage top#2023-02-1016:29slk500I can easy cancel it with C-g#2023-02-1016:33slk500maybe we can add info to readme that clj-refactor doesn't work with clojurescript because it's not so obvious#2023-02-1015:06slk500I'm confused with cider-switch-to-repl-buffer in. eg.
1. I'm on cljs.user
2. switch to another namspace
3. just print value in atom : value
4. it automatically switching back to cljs.user ??? -> why? it's desired behavior? #2023-02-1105:24hifumi123Sounds like a possible issue with your middleware if anything… I don’t get this problem with shadow-cljs. Are you using figwheel-main?#2023-02-1112:27slk500yes#2023-02-1112:28slk500I need to manualy write (in-ns namespace) to stay on that namespace#2023-02-1117:19bschragI'd often like to trace a certain set of functions---not everything in the namespace. Is there a way to do this programmatically, instead of tracing each function individually using C-c M-t v (`*cider*-toggle-trace-*var*`)?#2023-02-1211:15BenjaminThis works I think:
(defun cider-crm-trace-vars ()
(interactive)
(mapc #'cider--toggle-trace-var
(completing-read-multiple "Trace them: "
(mapcar #'car (imenu--make-index-alist)))))
do you want to select from multiple namespaces or the current one?#2023-02-1211:16Benjaminah you type , btw to select multiple in completing-read-multiple (whatever value crm-separator is)#2023-02-1419:50bschrag@U02CV2P4J6S Even more programmatic: (mapc #'cider--toggle-trace-var '("<f1>" "<f2>")). Thanks!#2023-02-1608:50Benjaminwith <f1> etc you mean passing in symbol names right?#2023-02-2001:45bschrag@U02CV2P4J6S Exactly.#2023-02-2118:58OmarWhen calling cider-ns-refresh once, all my stdout now prints in a cider-ns-refresh-log buffer instead of the repl or terminal. How can I get it to not print there?#2023-02-2119:31vemvThat totally sounds like a bug! Please do report it 🙂#2023-02-2122:58Omarokay so here's the thing: I guess I don't really understand namespace refreshing very well, it's all been pretty automagic for me with using mount. I had tied integrant.repl/reset to cider-ns-refresh's after-fn and it all gets captured in some that log buffer. Actually calling reset by itself fixes everything. What I really want is just a keybinding that injects (reset) in my repl without any cider-refresh.#2023-02-2220:05winsomeI'd like to run eval a form in a new repl right after it has started, is there a way to configure cider-jack-in to do that? Specifically (set! *print-namespace-maps* false).#2023-02-2220:07vemvleveraging user.clj might suffice
Sometimes alter-var-root is more effective for these (even if altering clojure.core is yucky), dyn vars are funny, especially when considering a complex thing like nREPL#2023-02-2220:17winsomeuser.clj gave me some guff. Using (set! *print-namespace-maps* false) blows it up:
error in process sentinel: Could not start nREPL server: Exception in thread "main" Syntax error macroexpanding at (user.clj:37:1).
at clojure.lang.Compiler.load(Compiler.java:7665)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:368)
at clojure.lang.RT.maybeLoadResourceScript(RT.java:364)
at clojure.lang.RT.doInit(RT.java:486)
at clojure.lang.RT.init(RT.java:467)
at clojure.main.main(main.java:38)
Caused by: java.lang.IllegalStateException: Can't change/establish root binding of: *print-namespace-maps* with set
at clojure.lang.Var.set(Var.java:226)
at user$eval73697.invokeStatic(user.clj:38)
at user$eval73697.invoke(user.clj:38)
at clojure.lang.Compiler.eval(Compiler.java:7194)
at clojure.lang.Compiler.load(Compiler.java:7653)
... 6 more
And using (alter-var-root #'*print-namespace-maps* (constantly false)) didn't appear to work - it's still set to true.
In any case, I'd like to not force my preference on my coworkers if possible.#2023-02-2220:37ennNot sure if there’s a way to do this on the CIDER side. I solved the same problem using :main-opts in my ~/.clojure/deps.edn:
{
:aliases {:cider {:main-opts ["-e" "(set! *print-length* 50)"
"-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}
}
I don’t use cider-jack-in (I start Clojure separately and then cider-connect) but I think you can configure options to pass with the cider-clojure-cli-global-options customization (assuming you use the Clojure CLI).#2023-02-2220:42vemv> it's still set to true.
yeah there's a chance that cider or nrepl perform a binding internally, which one cannot override from the outside
Do feel free to create an issue for the print-namespace-maps problem - I've felt it too at times#2023-02-2405:36David Ackermanoh man, i was about to ask in here how to evaluate a clojure form into my current buffer because I am doing some exploratory programming and found that transforming my source code using clojure was easier than dong a complicated emacs macro to edit things (think reversing the key/value pairs in a map). I then realized it's probably easy to figure out myself and indeed it was! Instead of C-x C-e, I could just do C-u C-x C-e to set the optional OUTPUT_TO_CURRENT_BUFFER arg to the command and boom, there it is. I love emacs and cider so much :)#2023-02-2713:47hkjelsOrg-mode and ob-clojure would possibly also be a good option#2023-02-2613:35hifumi123Does CIDER support dynamic indentation in ClojureScript files? For some reason this example is failing:
(defn a-fn
"A docstring"
[& args]
{:style/indent 1}
args)
But I can clearly see :style/indent 1 when I run (meta #'a-fn)#2023-02-2616:10bozhidarThis data is relayed via the track-state middleware, which if I recall correctly was not Clojure specific. I might be mistaken, though. I haven’t touched this code in ages and I almost never do anything with ClojureScript.#2023-02-2616:13bozhidarBasically track-state passes some data to clojure-mode, so it can rebuild its indentation table.#2023-02-2616:12bozhidarFYI - Today I opted to make a small change that makes printing to the REPL a bit worse in a particular edge case (your REPL prompt is right at the top of the REPL window), but 10x faster https://github.com/clojure-emacs/cider/commit/2e213f92d7bd84da9bf3826a42edb43a4e2fe7b3#2023-02-2616:12bozhidarMore details - https://github.com/clojure-emacs/cider/issues/3219#2023-02-2716:23danielnealheya, is there a way, while debugging, of capturing the result of the current expression? i.e. I can press p to inspect, is there a way of capturing it to a var without introducing an extra binding in the expression#2023-02-2716:33Carsten BehringAre you looking for *inspect*-def-current-value ?#2023-02-2716:35danielnealYES! Thanks, and it’s bound to d, score! 🙂#2023-02-2718:28jumarThe trouble I had with this feature when I tried to use it a few times was that it used the default project namespace for the var instead of the current namespace and never really worked for me well #2023-03-0309:27iarenaza@U06BE1L6T If you call it interactively, it uses the current namespace (since at least CIDER 1.2.0, maybe even earlier): https://github.com/clojure-emacs/cider/blob/master/cider-inspector.el#L282-L284#2023-02-2716:35danielnealYES! Thanks, and it’s bound to d, score! 🙂#2023-03-0217:31michaeldrogalisHi! I'm a bit stuck. I created a new Leiningen project and started Cider with cider-jack-in . The repl never seems to fully load, though. I see the prompt for user> , but it simply hangs no matter what I do. Relevant information:
• Clojure 1.8.0
• Lein 2.10.0
• OpenJDK 14.0.1
• Cider 1.6.0
• Emacs 28.2
I enabled nrepl debug messages (Ill put that in this thread) and see a ClassNotFound exception, but Im a bit puzzled. Any thoughts?#2023-03-0217:32michaeldrogalis(-->
id "1"
op "clone"
time-stamp "2023-03-02 09:26:44.884140000"
)
(<--
id "1"
session "72b8c453-8101-4d09-b060-ab9d77709783"
time-stamp "2023-03-02 09:26:44.908802000"
new-session "162c524d-0aea-4cdb-b469-f10c30ae730b"
status ("done")
)
(-->
id "2"
op "clone"
time-stamp "2023-03-02 09:26:44.921373000"
)
(<--
id "2"
session "a0144c68-ba7f-4956-bbeb-4b26890dea85"
time-stamp "2023-03-02 09:26:44.923876000"
new-session "5493615d-3e40-430f-8c33-5ce377d6a808"
status ("done")
)
(-->
id "3"
op "describe"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:44.944951000"
)
(<--
id "3"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.037688000"
aux (dict ...)
ops (dict ...)
status ("done")
versions (dict ...)
)
(-->
id "4"
op "eval"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.052800000"
code "(when-let [requires (resolve 'clojure.main/repl-requires)]
..."
column 1
file "*cider-repl scratch/nrepl-test:localhost:64578(clj)*"
inhibit-cider-middleware "true"
line 43
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
)
(<--
id "4"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.246975000"
value "nil"
)
(<--
id "4"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.247273000"
ns "user"
)
(<--
id "4"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.254776000"
status ("done")
)
(-->
id "5"
op "out-subscribe"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.255751000"
)
(-->
id "6"
op "init-debugger"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.256197000"
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
)
(-->
id "7"
op "eval"
session "5493615d-3e40-430f-8c33-5ce377d6a808"
time-stamp "2023-03-02 09:26:45.256722000"
code "cljs.core/demunge"
)
(<--
id "5"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:26:45.348556000"
out-subscribe "162c524d-0aea-4cdb-b469-f10c30ae730b"
status ("done")
)
(<--
id "7"
session "5493615d-3e40-430f-8c33-5ce377d6a808"
time-stamp "2023-03-02 09:26:47.384644000"
err "CompilerException java.lang.ClassNotFoundException: cljs.core, compiling:(/private/var/folders/48/g78fw4lx1xx1tgvxn593vncc0000gn/T/form-init9308809819379948220.clj:1:7703)
"
)
(<--
id "7"
session "5493615d-3e40-430f-8c33-5ce377d6a808"
time-stamp "2023-03-02 09:26:47.385013000"
ex "class clojure.lang.Compiler$CompilerException"
root-ex "class clojure.lang.Compiler$CompilerException"
status ("eval-error")
)
(<--
id "7"
session "5493615d-3e40-430f-8c33-5ce377d6a808"
time-stamp "2023-03-02 09:26:47.386325000"
status ("done")
)
(<--
id "7"
session "5493615d-3e40-430f-8c33-5ce377d6a808"
time-stamp "2023-03-02 09:26:47.951987000"
changed-namespaces (dict ...)
repl-type "clj"
status ("state")
)
(-->
id "8"
op "eldoc"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:30:57.790151000"
ns "user"
sym "C-q>"
)
(<--
id "8"
session "162c524d-0aea-4cdb-b469-f10c30ae730b"
time-stamp "2023-03-02 09:30:57.830066000"
status ("done" "no-eldoc")
)#2023-03-0217:53michaeldrogalisThe strange part is that I don't have ClojureScript as a dependency in this project - only Clojure. Basically a blank Lein project.#2023-03-0218:56michaeldrogalisDoh, it's https://github.com/clojure-emacs/cider/issues/3288. Problem solved.
Thanks for Cider, it's great to see how far it's come!#2023-03-0219:48michaeldrogalisIs dynamic font locking supposed to work with ClojureScript? It seems to work with Clojure, but not Cljs - even for cljs.core functions.#2023-03-0309:01hkjelsAt work, I'm encountering difficulties trying to launch a cider-repl in one of our projects via cider-jack-in-clj. Specifically, I'm getting the following error message: Could not start nREPL server: java.io.IOException: Cannot run program "java" (in directory "....."): CreateProcess error=206, filename or extension is too long. However, running lein repl appears to work without any issues. I was wondering if anyone has any suggestions for how to address this problem?#2023-03-0309:31iarenazaI seem to remember seeing this problem before, and having to do with Emacs and your shell having different configurations for the PATH. Mainly, the directory where the java binary is, being part of the shell PATH, but not being part of it in the PATH Emacs uses to run thhe cider-jack-in-clj command.#2023-03-0309:34hkjelsI think it must be something else, as it works in other projects and there's no path fiddling in the project itself#2023-03-0309:36hkjelsOhh. It works in WSL. I can just avoid the issue altogether I guess#2023-03-0312:18David Ackermanis there a good way for me to find unused functions in my (ClojureScript) project to delete? Here's what I thought of:
• clj-kondo will tell me if a private function is unused in a file, but afaik doesn't help with public functions
• CIDER has fn-refs but i think it only works for Clojure
• clj-refactor seems like it should have the ability to do this but i'm unaware of a function for it and also not sure if it works on ClojureScript projects
it's okay if it's not 100% perfect (i.e. misses edge cases where you're doing super dynamic stuff). I just don't want to manually grep every function in my project that I think might not be used.#2023-03-0312:20borkdudehttps://github.com/borkdude/carve#2023-03-0312:20borkdudein addition to carve, #lsp has a unused public var linter which is on by default#2023-03-0312:21David Ackermanbeautiful, thank you!#2023-03-0421:31HendursagaHello everyone! I have a quick question. I see a year ago there was this thread https://clojurians.slack.com/archives/C0617A8PQ/p16455569922592 about a possible CL-style breakloop. What's the state-of-the-art today?#2023-03-0519:31enn@U04S798T3GW this isn't exactly what you are asking for, but I have found that https://github.com/vvvvalvalval/scope-capture has satisfied my desire for CL-style debugging. It lets you set "breakpoints" that don't break. That is, execution continues but all local bindings are captured and you can access them at the REPL after the fact.#2023-03-0519:35enn(apologies if that was previously discussed in the linked thread; that link isn't working for me for some reason)#2023-03-0600:57HendursagaI've found that project as well - I'll try it sometime#2023-03-0614:52ennThe only thing I miss with scope-capture (aside from restarts) is that I would love a way to automatically capture the local bindings when an unhandled exception is thrown, without having to add an sc.api/spy call into my code. Unfortunately I don’t think that’s possible because I don’t think it’s possible to access the binding environment where the exception is raised is available from any exception handler.#2023-03-0421:36HendursagaHonestly I can deal with not having CL-style restarts, I just want to drop into a REPL with all the local variables and such accessible.#2023-03-0522:24pavlosmelissinosI can't believe I just found out about cider-pprint-eval-last-sexp-to-comment (`C-c C-v f c e`) 🤯#2023-03-0603:34drcodeHi everyone, I'm not super familiar with the internals of cider/nrepl/etc, but I have a clojure project with a domain-specific language, and would like to be able to type DSL commands into the nrepl, and have custom clojure code that checks if it's a DSL command first, before forwarding it to the usual cider/clojure reader/evaluator.
I'd appreciate any quick pointers for how I would best go about doing this, if any of you folks understand these tools a bit better. Thanks!#2023-03-0607:38thhellersounds like you want a nrepl middleware. something that is sorted in before eval and can delegate to the regular eval, or just do something with the request itself. example: https://github.com/thheller/shadow-cljs/blob/af1a77099e69b09c3799a8b64e169cd24d379a72/src/main/shadow/cljs/devtools/server/nrepl.clj#L44-L50#2023-03-0607:39thhellerso the nrepl msg you get has a :op key. :op "eval" for evals#2023-03-0608:37Carsten BehringDo you have an "internal DSL" (so a DSL expressed in Clojure syntax) or an external DSL (not expressed in Clojure syntax) ?#2023-03-0609:53vemvProbably it should work like a clojurescript repl which can be understood as a "nested repl", i.e. there's a JVM Clojure repl in the above layer, and a clojurescript repl down the stack.
The idea is that you're either in one repl or the other, but you don't try complecting two evaluation modes into one. You could perfectly have two repls in your emacs, each with its own history, font-locking, autocompletions, etc.
Understanding https://github.com/nrepl/piggieback might be useful
https://github.com/gfredericks/debug-repl also comes to mind
IDK this stuff by heart but at least it should point in a good direction :)#2023-03-0610:21thhelleranother option I have done with cursive is wrapping what gets send to the REPL in the first place. so instead of "eval form before caret" I have a custom REPL command that sends (tap> ~form-before-caret). While this is a cursive feature https://cursive-ide.com/userguide/repl.html#repl-commands I'm sure emacs/cider could do something similar. very flexible and doesn't require messing with nrepl in any way 🙂#2023-03-0616:37drcode@U05224H0W thanks for the links, working through them now. As for your "wrapping in the first place suggestion" that's actually what I've been doing for the last couple of years with my dsl and wanted to see if I could make it a little fancier now#2023-03-0616:39drcode@U7CAHM72M external dsl, not clojure syntax#2023-03-0616:40drcode@U45T93RA6 thanks for those links, the gfredericks one is interesting, since he's a friend of mine and I can pester him for tips if need be :)#2023-03-0723:27Matthew OdendahlI'm trying to debug something with CIDER and I'm running into a weird issue. Did I find a bug or did I miss an important concept? I created a minimal example with steps to reproduce in 🧵.#2023-03-0723:29Matthew Odendahlalpha.clj
(ns oops.alpha)
(defn oops []
(if (= ::check :oops.alpha/check)
"Phew"
"BOOM"))
beta.clj
(ns oops.beta
(:require
[oops.alpha :refer [oops]]))
#dbg (defn do-oops []
(oops))
(comment
(do-oops)
:end)#2023-03-0723:30Matthew OdendahlGiven the above project files, these are the steps to reproduce (with commands for Spacemacs).
• jack in; , '
• send oops.beta buffer; , s b
• re-send do-oops to instrument; , e e on line 7 (Sending buffer seems to ignore the #dbg.)
• eval (do-oops); , e e on line 10
◦ debugger pops up, shows => "Phew" on line 6
◦ weirdly didn't let me step in to oops. Why?
• Hit i to step in anyway.
◦ shows => "Phew" on line 9.
• eval (do-oops); , e e on line 10 (again)
◦ weirdly debugger didn't pop up in oops.beta ns this time. Why?
◦ pops up in oops.alpha instead.
◦ shows => false for (= ::check :oops.alpha/check) on line 4. ⁉️
▪︎ (optional) Hit e to eval ::check.
• shows => :oops.alpha/check, as expected.
▪︎ (optional) Hit e to eval (= ::check :oops.alpha/check).
• shows => true. Contradiction!
• Hit c to continue
◦ Now back in do-oops
◦ shows => "BOOM" on line 6
• Hit c to continue
◦ shows => "BOOM" on line 9#2023-03-1209:50AkizHi, is there any way how to completely disable cider on-hover documentation? When i am runing eglot and cider, i still get cider documentation in echo area.#2023-03-1209:52bozhidar@zikajk Do you mean the eldoc documentation?#2023-03-1209:54bozhidarIf so - see the docs here https://docs.cider.mx/cider/config/eldoc.html#2023-03-1209:56bozhidarThe eldoc for the symbol at point can be disabled, but for the rest you'll need to stop eldoc completely or remove CIDER's hook from ElDoc:
(remove-hook 'eldoc-documentation-functions #'cider-eldoc)
#2023-03-1210:18AkizThank you, I’ve tried this as well but I am still getting it.
https://www.loom.com/share/da8dbe7359fd47beb0cb4d8df0db2350
Edit: sorry for the kids in the background 😄#2023-03-1210:20bozhidarIt has no effect because it's not coming from CIDER. 🙂#2023-03-1210:21bozhidarI'm guessing this is the ElDoc format that eglot or clojure-lsp are using, but CIDER's ElDoc messages look differently.#2023-03-1210:21AkizI disabled Eglot and you can see that I dont get this messages until i start Cider.#2023-03-1210:21bozhidarMight be best to just check what exactly do you have in eldoc-documentation-functions.#2023-03-1210:22Akizeldoc-documentation-functions is a variable defined in 'eldoc.el'.
Its value is nil
#2023-03-1210:22bozhidarSeems that's not eldoc then, but some on mouse hover functionality.#2023-03-1210:23bozhidarAre you running Emacs in a terminal?#2023-03-1210:24AkizNo… I don’t.
Hm, then I will dig deeper. I just disabled all modes and I still get it 😄#2023-03-1210:25AkizUntil i close REPL, then it dissapears#2023-03-1210:25bozhidarIf so try setting cider-use-tooltips to nil, but this showed the help in an overlay.#2023-03-1210:27bozhidarThat's how those on-hover tooltips look for me#2023-03-1210:27bozhidarBut if you're using some heavily customized Emacs distro god knows what settings were changed there. 😄#2023-03-1210:32AkizHa, disabling cider-use-tooltips is the way! Thank you.#2023-03-1210:32AkizI am ussing Vanila Emacs btw.#2023-03-1210:33bozhidarBy default this shouldn't go to the minibuffer IMO, as this was somehow tied with help-echo.#2023-03-1210:35AkizIf I ever find the time, I’ll try to replicate it, find out where the problem is. Thanks again for your help.#2023-03-1212:07AkizI got it, i had disabled tooltip-mode and so every tooltip was displayed in echo area (which I learnt just now ;-))#2023-03-1214:26AkizAnd because I like CIDER’s ElDoc messages quite a lot I am using this hook on cider-mode.
(defun my/remove-eglot-eldoc-from-cider-buffers ()
(remove-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function)
(remove-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function))
(I suppose that having fewer fns in eldoc-documentation-functions might help a performance little bit? Otherwise, it is not needed)#2023-03-1305:44bozhidarThe ordering of the functions there matters (the first that returns something is the one to provide some result), That’s why it’s not a bad idea in my book to be more explicit here if you already know which function you want to use all the time.#2023-03-1305:45bozhidarGenerally this ordering has always been somewhat frustrating to me as it’s a bit random and people have to be aware of it (tools can force the ordering priorities, but this might be weird for the end users as well).#2023-03-1310:42andrea.crottiwhen I start both babashaka and lein repls in the same project it gets quite confused, and it tries to evaluate bb files in the clj repl and vice versa, is there any way to make that a bit smarter?#2023-03-1310:42andrea.crottiin theory if I'm working on bb files it should always just use the bb repl right?#2023-03-1316:16edipofederleHello all, not sure if the right channel, but since it works when testing with Cider.. let me try here. I am using https://github.com/jgpc42/insn to generate Java Bytecode, I’m trying to have some tests like bellow. The thing is that it works fine when executing with cider-test-run-ns-tests but not when with lein test ( the (with-out-str (eval (. ~cname main)))` return empty string "" )
Any tip here?
Thanks
(require '[insn.core :as insn])
(defn make [& {:as m}]
(insn/new-instance m))
(defn sum-bt [n]
(make
:name 'my.pkg.Test
:methods [{:flags [:public :static], :name "main", :desc [:void]
:emit [[:getstatic java.lang.System "out" java.io.PrintStream]
[:ldc2 n]
[:ldc2 n]
[:ladd]
[:invokevirtual java.io.PrintStream "println" [:long :void] false]
[:return]]}]))
(deftest sum-bt-test
(let [cname 'my.pkg.Test
_ (sum-bt 4)
result (with-out-str (eval `(. ~cname main)))]
(is (= result "8\n"))))#2023-03-1607:15hkjelscider-apropos uses completing-read, but it's not handled by vertico ~corfu~ for some reason. Any of you got that combo working?#2023-03-1611:07hkjelsSo, cider-apropos-select and then hitting RET will actually do what I want. I can then interactively narrow to the function I'm interested in. Kind of weird behavior TBH. Would be much better to just skip the RET and start filtering immediately#2023-03-1611:08hkjelsI guess there are performance implications, but at least on this pc it is pretty much instant#2023-03-1621:23bozhidarSee this for context https://github.com/clojure-emacs/cider/issues/1541#2023-03-1621:24bozhidarGenerally cider-apropos mirrors the standard apropos interface in Emacs.#2023-03-1714:58hkjelsI get that, but shouldn't the cider-apropos-select just start with the completing read, so that you can just start typing and narrow your search without having to supply an empty query first?#2023-03-1813:18bozhidarAh, you mean this. I guess it was just done to be consistent with the other command. But also otherwise we’d have to dump every symbol that’s currently known which is going to be pretty slow. #2023-03-1813:19bozhidarThat’s a general problem with commands that operate on all known symbols. #2023-03-1617:30drcodeHere's some cider/nrepl middleware I just made https://github.com/drcode/nrepl-gpt#2023-03-1617:31drcodelets you ask chatgpt questions about clojure directly from the repl#2023-03-1715:03hkjelsIs there a way to make cider able to find implementations of protocol methods?#2023-03-1715:18iarenazaAs far as I know, there is no way. You need to use clojure-lsp for that.#2023-03-1809:10bozhidarFor the record - it's doable in CIDER, but we never got to implementing it. For reference https://github.com/clojure-emacs/cider/issues/1969#2023-03-1809:10bozhidarIt's a pity that a PR was opened, but never finished for this https://github.com/clojure-emacs/cider-nrepl/pull/568/files#2023-03-2014:19RichieHow do I get cider-jack-in-clj to use a new port if the one is already in use? Usually I look for java under emacs in windows task manager and kill it but today I'm not seeing it.
[nREPL] Starting server via c\:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -encodedCommand YwBsAG8AagB1AHIAZQAgAC0AUwBkAGUAcABzACAAJwB7ADoAZABlAHAAcwAgAHsAbgByAGUAcABsAC8AbgByAGUAcABsACAAewA6AG0AdgBuAC8AdgBlAHIAcwBpAG8AbgAgACIAIgAxAC4AMAAuADAAIgAiAH0AIABjAGkAZABlAHIALwBjAGkAZABlAHIALQBuAHIAZQBwAGwAIAB7ADoAbQB2AG4ALwB2AGUAcgBzAGkAbwBuACAAIgAiADAALgAzADAALgAwACIAIgB9ACAAYwBvAG0ALgBjAGUAbQBlAHIAaQBjAGsALwBwAG8AbQBlAGcAcgBhAG4AYQB0AGUAIAB7ADoAbQB2AG4ALwB2AGUAcgBzAGkAbwBuACAAIgAiADEALgAxAC4AMAAiACIAfQAgAHIAZQBmAGEAYwB0AG8AcgAtAG4AcgBlAHAAbAAvAHIAZQBmAGEAYwB0AG8AcgAtAG4AcgBlAHAAbAAgAHsAOgBtAHYAbgAvAHYAZQByAHMAaQBvAG4AIAAiACIAMwAuADYALgAwACIAIgB9AH0AIAA6AGEAbABpAGEAcwBlAHMAIAB7ADoAYwBpAGQAZQByAC8AbgByAGUAcABsACAAewA6AG0AYQBpAG4ALQBvAHAAdABzACAAWwAiACIALQBtACIAIgAgACIAIgBuAHIAZQBwAGwALgBjAG0AZABsAGkAbgBlACIAIgAgACIAIgAtAC0AbQBpAGQAZABsAGUAdwBhAHIAZQAiACIAIAAiACIAWwByAGUAZgBhAGMAdABvAHIALQBuAHIAZQBwAGwALgBtAGkAZABkAGwAZQB3AGEAcgBlAC8AdwByAGEAcAAtAHIAZQBmAGEAYwB0AG8AcgAsAGMAaQBkAGUAcgAuAG4AcgBlAHAAbAAvAGMAaQBkAGUAcgAtAG0AaQBkAGQAbABlAHcAYQByAGUAXQAiACIAXQB9AH0AfQAnACAALQBNADoAYwBpAGQAZQByAC8AbgByAGUAcABsAA==
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: #< CLIXML
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized
where the encoded command is
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version ""1.0.0""} cider/cider-nrepl {:mvn/version ""0.30.0""} com.cemerick/pomegranate {:mvn/version ""1.1.0""} refactor-nrepl/refactor-nrepl {:mvn/version ""3.6.0""}} :aliases {:cider/nrepl {:main-opts [""-m"" ""nrepl.cmdline"" ""--middleware"" ""[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]""]}}}' -M:cider/nrepl
#2023-03-2014:19Richie#2023-03-2014:20Richiedoom emacs#2023-03-2014:20RichieThanks!#2023-03-2014:23dpsuttoni think by default it uses a random open port. Have you configured it to use a definite port somehow?#2023-03-2014:27RichieI deleted the .nrepl-port file just in case.#2023-03-2014:30dpsuttonthat doesn’t affect anything. That file is created when the port is chosen. It doesn’t direct which port to choose#2023-03-2014:30dpsuttonthe standard workflow is “grab an empty port and start the nrepl server there. Then write that port to .nrepl-port so tooling knows which to use”#2023-03-2014:30dpsuttonif you are getting an error that the port is already taken, I think it means somewhere you are specifying which port to use.#2023-03-2014:30RichieI just made a new folder where deps.edn says {:paths ["src"] :deps {}} and src/core.clj says (ns core) (defn hello [] (println "hello world")) and I get:
[nREPL] Starting server via c\:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -encodedCommand YwBsAG8AagB1AHIAZQAgAC0AUwBkAGUAcABzACAAJwB7ADoAZABlAHAAcwAgAHsAbgByAGUAcABsAC8AbgByAGUAcABsACAAewA6AG0AdgBuAC8AdgBlAHIAcwBpAG8AbgAgACIAIgAxAC4AMAAuADAAIgAiAH0AIABjAGkAZABlAHIALwBjAGkAZABlAHIALQBuAHIAZQBwAGwAIAB7ADoAbQB2AG4ALwB2AGUAcgBzAGkAbwBuACAAIgAiADAALgAzADAALgAwACIAIgB9ACAAYwBvAG0ALgBjAGUAbQBlAHIAaQBjAGsALwBwAG8AbQBlAGcAcgBhAG4AYQB0AGUAIAB7ADoAbQB2AG4ALwB2AGUAcgBzAGkAbwBuACAAIgAiADEALgAxAC4AMAAiACIAfQAgAHIAZQBmAGEAYwB0AG8AcgAtAG4AcgBlAHAAbAAvAHIAZQBmAGEAYwB0AG8AcgAtAG4AcgBlAHAAbAAgAHsAOgBtAHYAbgAvAHYAZQByAHMAaQBvAG4AIAAiACIAMwAuADYALgAwACIAIgB9AH0AIAA6AGEAbABpAGEAcwBlAHMAIAB7ADoAYwBpAGQAZQByAC8AbgByAGUAcABsACAAewA6AG0AYQBpAG4ALQBvAHAAdABzACAAWwAiACIALQBtACIAIgAgACIAIgBuAHIAZQBwAGwALgBjAG0AZABsAGkAbgBlACIAIgAgACIAIgAtAC0AbQBpAGQAZABsAGUAdwBhAHIAZQAiACIAIAAiACIAWwByAGUAZgBhAGMAdABvAHIALQBuAHIAZQBwAGwALgBtAGkAZABkAGwAZQB3AGEAcgBlAC8AdwByAGEAcAAtAHIAZQBmAGEAYwB0AG8AcgAsAGMAaQBkAGUAcgAuAG4AcgBlAHAAbAAvAGMAaQBkAGUAcgAtAG0AaQBkAGQAbABlAHcAYQByAGUAXQAiACIAXQB9AH0AfQAnACAALQBNADoAYwBpAGQAZQByAC8AbgByAGUAcABsAA==
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: #< CLIXML
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [s\src\jdk.jdwp.agent\share\native\libjdwp\debugInit.c:734]
<Objs Version="1.1.0.1" xmlns=""><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">2</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="2"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="3"><TNRef RefId="0" /><MS><I64 N="SourceId">3</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs> ("finished")
error in process sentinel: Could not start nREPL server: #< CLIXML
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [s\src\jdk.jdwp.agent\share\native\libjdwp\debugInit.c:734]
<Objs Version="1.1.0.1" xmlns=""><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">2</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="2"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="3"><TNRef RefId="0" /><MS><I64 N="SourceId">3</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs> ("finished")
#2023-03-2014:36RichieI’m going to just reboot to make the error go away. It does happen somewhat regularly though so I'm interested in next steps for debugging it. I guess I can try debugging cider's elisp...#2023-03-2014:36dpsuttonHave you setup the configuration files by any chance?#2023-03-2014:36dpsuttonhttps://nrepl.org/nrepl/usage/server.html#server-configuration#2023-03-2014:37dpsuttonthere are two files:
• in your local directory .nrepl.edn`
• and globally at .nrepl/nrepl.edn`` #2023-03-2014:38RichieI don't have .nrepl.edn in my project dir nor .nrepl/ in my home dir.#2023-03-2014:39dpsuttonthen i do not understand why it cannot find a port. sorry#2023-03-2014:39RichieOk, thanks.#2023-03-2014:40RichieIt's good to know that I haven't messed up the configuration.#2023-03-2014:41RichieWhen cider tries to find an open port, how does that work? It's like a try/catch?#2023-03-2014:41dpsuttoncider does not#2023-03-2014:41RichieOh, clojure?#2023-03-2014:41dpsuttonnrepl itself tries. If you pass port 0 it will use a random port and tell you which#2023-03-2014:42dpsuttoni doubt it is a try catch. But not sure what parts are provided by OS and which in the application#2023-03-2014:42RichieWhat's the difference between passing in 0 and not configuring it?#2023-03-2014:42dpsuttoni don’t believe there is a difference. By not configuring it you get the default which will pass a 0#2023-03-2014:42RichieOk, thanks.#2023-03-2014:43RichieOh, so, as a debugging step, I should try configuring a port to see if it will work?#2023-03-2014:45dpsuttonIt’s a little difficult because you are on powershell and things have to be base64 encoded. But I would try to get everything running without CIDER and then add it in when you know everything works#2023-03-2016:21Patrick BrownIs there a way to just run cider-connect twice and connect to an already running clojure-cli and an already running shadow-cljs server. And then be able to have a workflow where I tell cider which repl I am trying to evaluate in buffer code to?
I hope this question isn't missing the plot, it's just, I'm struggling to the point of all out confusion. I'd like to be able to work primarily on clj/cljc code, but at moments add a little cljs code and be able to troubleshoot why it's broken in a repl instead of reading errors in the browser. Every attempt to try this whole sibling thing only enhances my confusion as to what I'm trying to accomplish and what my emacs is doing.#2023-03-2018:27hifumi123IIRC when I run shadow-cljs embedded in lein there is an nrepl middleware one has to add so CIDER can connect to the shadow-cljs REPL. But otherwise it should be as simple as something like M-x cider-connect-clj&cljs, if I remember the command correctly#2023-03-2018:28hifumi123Worst case scenario you can use dir-locals to set up a custom cljs REPL command that properly sets up shadow-cljs when you jack in#2023-03-2114:23AlejandroHello. I'm trying to make clojure cli to start both figwheel and nrepl. I can start the latter with cider-jack-in-cljs , no issues, but I'd like to run both with clj -M:my-alias and then do cider-connect instead. How to configure deps.edn for this? Right now I have the following:
:aliases {:fig {:main-opts ["-m" "figwheel.main"]}
:cider-cljs {:extra-deps ...
:main-opts ["-m" "nrepl.cmdline" "--middleware"
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}}#2023-03-2114:30dpsuttonyou can’t have two mains. gotta pick one#2023-03-2114:58Alejandro@dpsutton, hm. When I start it with clj -A:cider-cljs, it starts figwheel for me. Well, that's good, but a bit confusing haha#2023-03-2115:00AlejandroAh, I now get it, cider asks me about figwheel.main#2023-03-2222:44Drew VerleeI'm starting to brainstorm how I can improve my clojure project repl management. Basically, I want to bring all my repl management under one interface rather than have it spread out. It's spread out because my nrepl connection are run from bash shells, my nrepl connects are in emacs buffers and my shadow repl information are usually lost in chrome tabs, etc. I want one place to view all of that information, or at least tie it all together.
In my current workflow, I often find that I want to quit emacs, but I don't want to lose the nrpel server in that process. so I have started running the clj command that starts nrepl in a shell. This is fine, but there are some clear managerial improvements.
Sitting down at my computer, i can't quickly pull up a view of all my clojure projects and the state of their repl connections. And so that's what i would like to have, and i imagine it shouldn't be too hard, in fact, i'm guessing this functionality already exists in multiple formats, but maybe not one that quite brings everything into one place.
I imagine this UI (connection manager) would display and give the option to update:
• clojure project name
• if the nrepl was running
• if emacs were connected
• If a nrepl was busy (evaling something
• if it's a shadow project if the shadow server was running
• if it's a shadow project if the shadow server was connected.
Some functionality i'm not sure how to achieve...
• how to have emacs launch a process that doesn't die when it dies. I'm looking at the detached package though.
• How to get a list of nrepl connections.
• nearly everything 🙂
I'm looking at the sesman docs on the cider site as well, as i understand it's related to managing sessions, but i'm not sure yet how it will fit into this picture. Thanks!#2023-03-2223:13phronmophobic> • how to have emacs launch a process that doesn't die when it dies. I'm looking at the detached package though.
>
I'm away from keyboard, but check out emacs --daemon and emacsclient -nw#2023-03-2307:32hkjelsI agree with @U7RJTCH6J, there's really no need to exit Emacs 😁#2023-03-2312:48Rupert (All Street)Here's a few suggestions for dealing with REPL in emacs that may or may not be relevant:
• Agree with others suggesting emacs should generally be left open and just attach using emacsclient to continue where you left off.
• REPLs should also be left open - use something like https://github.com/weavejester/integrant-repl to reload your project.
• If you have multiple projects. you can sometimes create a top level project that depends on the other projects and then launch a REPL in this project (so you end up with fewer REPLs).
• In some situations use sesman-link-with-buffer to temporarily assign a namespace to a different REPL (good for updating a library namespace from a parent REPL).
• You can build many kinds of business and interactive websites entirely on the backed with hiccup and a sprinkling of HTMX and _HyperScript - if you do this then you can you don't need a ClojureScript/shadow REPL at all.
• You can add something like this to your .emacs file to start several REPLs at once in a single command:
(defun cider-init ()
(interactive)
(find-file "~/code1/project.clj")
(call-interactively 'cider-jack-in)
(find-file "~/code2/project.clj")
(call-interactively 'cider-jack-in-cljs))
(global-set-key (kbd "C-x C-y") 'cider-init)
#2023-03-2316:23Drew VerleeSo the emacs server is going to start the nrepl server independently of the emacs client?#2023-03-2316:23Drew Verleelets see if chat gtp can help#2023-03-2316:28Drew Verleethe site is so busy that i can't even upgrade to pro in order to get an answer. It's almost as if a universal flexible query model is going to bottleneck so quickly that it becomes meaningless.#2023-03-2316:29Rupert (All Street)I don't think you need chatgpt for this:slightly_smiling_face: - there's plenty of info on the web.#2023-03-2317:09Drew Verlee@UJVEQPAKS i know, it's more to test the waters.
Your insights were very helpful. I'm looking into a couple of them more before i ask another question.#2023-03-2317:35phronmophobicI wasn't trying to say that you shouldn't have to exit emacs. Only that you don't have to.#2023-03-2317:37phronmophobicI use a separate emacs for each project I work on. However, I use emacs --daemon when I'm working on a hobby project with a server. It means that my session persists even if I lose my connection. I'll often even use it to run the http server for the project.#2023-03-2317:38Drew VerleeI understand, starting emacs as a server and then starting the repl from the client seems to persist the repl server across clients. Which is a big part of what I wanted.#2023-03-2317:38Drew Verleeso thanks a ton 🙂#2023-03-2317:39phronmophobic> In my current workflow, I often find that I want to quit emacs, but I don't want to lose the nrpel server in that process
Just curious, why do you want to quit emacs rather than just leaving it open?#2023-03-2317:40phronmophobicI do think your centralized nrepl-connection-manager idea is neat.#2023-03-2317:52Drew Verlee@U7RJTCH6J, roughly the same reasons that i need to restart my computer, things start to get slow in various points and a restart will seem to improve the situation without having to do a more specific diagnosis as to why. I believe spacemacs suggests restarting after package installs and upgrades as well, though that might not be critical.#2023-03-2318:23Drew Verlee@UJVEQPAKS
> In some situations use sesman-link-with-buffer to temporarily assign a namespace to a different REPL (good for updating a library namespace from a parent REPL).
So for example, you want to update a libraries version, but that lib is currently being used as that's part of a running server, so you can't just bump it without restarting the server.
So instead you make a new clj project, with the library set to the newer version, and start a repl, then using sesman-link-with-buffer to attach the namespace in the server to the updated project?#2023-03-2319:52Rupert (All Street)Sort of.
Example: You have a REPL open in some code and you spot a bug in a library that you also have the code for: Use sesman-link-with-buffer to evaluate code that you have fixed in a library namespace in your current REPL session.#2023-03-2323:46Drew VerleeThere is a toolchain by lambda island that i'm looking into before I start trying to build my own thing https://github.com/lambdaisland/launchpad.#2023-03-2404:11Drew VerleeI would love to see some examples of Emacs code that's interacting with cider for project management purposes or really any reason at all. It will help me get a sense of how things can or do fit together.
No need to explain it, just drop links, i tried searching Google and failed hard to find examples.#2023-03-2409:27practicalli-johnhttps://practical.li/clojure/data-inspector/portal/#editor-nrepl-middleware
Portal uses nrepl from Emacs commands, see the Emacs configuration part for example code, e.g.
;; def portal to the dev namespace to allow dereferencing via @dev/portal
(defun portal.api/open ()
(interactive)
(cider-nrepl-sync-request:eval
"(do (ns dev) (def portal ((requiring-resolve 'portal.api/open))) (add-tap (requiring-resolve 'portal.api/submit)))"))
#2023-04-0314:17Rupert (All Street)I use some emacs -> cider code
This snippet let's me restart my integrant system from with just a hotkey.
(defun cider-reset ()
(interactive)
(cider-interactive-eval "(require 'dev)(dev/reset)"))
(global-set-key (kbd "C-x C-j") 'cider-reset)
This snippet lets me start a bunch of repls up at once:
(defun cider-init ()
(interactive)
(find-file "~/a/project.clj")
(call-interactively 'cider-jack-in)
(find-file "~/b/project.clj")
(call-interactively 'cider-jack-in)
(find-file "~/c/project.clj")
(call-interactively 'cider-jack-in-cljs))
(global-set-key (kbd "C-x C-y") 'cider-init)
#2023-04-0315:58Drew Verleethanks @UJVEQPAKS!#2023-03-2410:03Zmicier MisiukHi there!
I'm trying to working with cljs repl and clj (deps.edn and shadow). I found that there is cider-merge-sessions variable. How I can use this, can't find any doc.#2023-03-2412:31CarloWhen I want to start a repl in a remote machine, I issue:
$ /nix/store/yv4mc9dn4bs6hb4h6lsq345dnpgrv0xg-clojure-1.11.1.1224/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
Is there a way to specify a particular port instead of getting a random one?#2023-03-2412:38CarloFound it, I have to create an .nrepl.edn file with content:
{:bind "localhost"
:port 12345}#2023-03-2412:43jkxyzYou can also pass the --port arg in the main-opts#2023-03-2413:13dpsuttonI suspect you can just pass them as args at the end of the command as well. #2023-03-2415:23bozhidarYesterday I released CIDER 1.7 (https://github.com/clojure-emacs/cider/releases/tag/v1.7.0), but I forgot to announce it. facepalm Enjoy!#2023-03-2417:51hifumi123autocompleting lexical bindings in cljs is a great addition -- looking forward to using it today 😁 #2023-03-2417:53practicalli-johnWhat is cider-jack-in-dependencies used for?
I haven't been able to find anything in the cider docs.
I assume it's different to cider-clojure-cli-aliases#2023-03-2418:53dpsuttoncider-jack-in-dependencies is a variable defined in 'cider.el'.
Its value is (("nrepl/nrepl" "0.9.0"))
List of dependencies where elements are lists of artifact name and version.#2023-03-2420:20vemvMore broadly it's for adding stuff necessary for cider itself to work, e.g. cider-nrepl, refactor-nrepl (if using clj-refactor), piggieback (if using cljs), enrich-classpath (disabled by default)#2023-03-2420:21vemv@U05254DQM#2023-03-2418:53dpsuttonc-h v cider-jac-in-dependencies#2023-03-2420:47frozenlockWhen using CIDER with a cljs REPL, my namespace keeps getting reset to cljs.user.
Does it ring a bell?
I found a very old issue describing the problem, but apprently it's been fixed years ago.
https://github.com/nrepl/piggieback/issues/33#2023-03-2420:52frozenlockThis only happens when I set the namespace using cider-repl-set-ns (via C-c M-n M-n)#2023-03-2420:53frozenlockManually selecting it (ns my.ns) will make it stay#2023-03-2420:54frozenlockHere's how it looks when it automatically switches back to cljs.user:
my.ns> (+ 1 1)
2
cljs.user>
#2023-03-2421:13hifumi123I'm unable to reproduce this issue with CIDER 1.7.0 and shadow-cljs 2.22.2 running on Emacs 28.2#2023-03-2421:21frozenlockCIDER 1.7.0
Emacs 28.2
figwheel-sidecar 0.5.20#2023-03-2421:43hifumi123I want to say this is probably a bug with figwheel then#2023-03-2421:44hifumi123Actually, are you using figwheel or figwheel-main? IIRC figwheel-sidecar is a middleware for the former, and figwheel has been deprecated in favor of figwheel-main I think#2023-03-2421:57frozenlockFigwheel, the project only requires sporadic maintenance and wasn't worth the migration.#2023-03-2421:57frozenlockAnd if the problem is not with figwheel and I do migrate, I'll be a sad panda 😞#2023-03-2423:11hifumi123Doesn’t hurt to make an empty folder, npx shadow-cljs init , then M-x cider-jack-in-cljs 😉#2023-03-2423:46frozenlock> cider--update-jack-in-cmd: The npx shadow-cljs executable isn’t on your ‘exec-path’#2023-03-2423:47frozenlockHmmm...
I installed it with npm install -g shadow-cljs#2023-03-2423:58hifumi123What is the output of (executable-find "npx") in IELM?#2023-03-2423:58hifumi123This is basically a PATH issue and Emacs doesnt seem to know the directory where global NPM packages are installed#2023-03-2423:59frozenlocknil#2023-03-2500:00hifumi123Are you on Mac or Linux? I would probably just change cider-shadow-cljs-command#2023-03-2500:00frozenlocklinux#2023-03-2500:01hifumi123where do global npm packages get installed on linux? basically, we can either fix the PATH or we can just (setq cider-shadow-cljs-command "/full/path/to/shadow-cljs")#2023-03-2500:01frozenlockI have a .npm directory, but it looks like _npx is just weirdly named directories...#2023-03-2500:01hifumi123actually what is the result of (executable-find "shadow-cljs")#2023-03-2500:01frozenlockAlso nil#2023-03-2500:01hifumi123ok yeah just find whatever the full path is on your system and set it explicitly#2023-03-2500:02hifumi123im not very familiar with linux paths#2023-03-2500:02frozenlockThe path to shadow-cljs? Will it be a binary?#2023-03-2500:03hifumi123On my machine it seems to be a script
% file $(which shadow-cljs)
/opt/local/bin/shadow-cljs: a /usr/bin/env node script text executable, ASCII text
#2023-03-2500:03frozenlockok I think I got it#2023-03-2500:04hifumi123cool; now just make sure executable-find returns a non-nil value with the path, and if it does, try using it as your cider-shadow-cljs-command#2023-03-2500:06frozenlock> error in process sentinel: Could not start nREPL server: /usr/bin/env: ‘node’: No such file or directory#2023-03-2500:06frozenlocksigh#2023-03-2500:06frozenlockI'll try a fighweel-main project after all#2023-03-2500:19hifumi123out of curiosity, do you have the exec-path-from-shell package installed? if not, then that may help you with PATH issues with Emacs#2023-03-2500:19hifumi123otherwise I have no idea why emacs cant find anything on your system#2023-03-2501:28frozenlockAh great library. I added it to my config file, thanks!#2023-03-2501:29frozenlockI was able to run shadow-cljs via CIDER with a lein reagent template. It works well, so I guess lein-figwheel is indeed a potential source for my issue 😞#2023-03-2522:58frozenlockI just spent the day migrating to shadow-cljs, realizing it's way too reliant on npm , then migrating to figwheel-main ... and I have the same issue!#2023-03-2523:10thhellerthe only npm reliance shadow-cljs has the is the npm packages you use 😉#2023-03-2523:13frozenlockWouldn't I need to manually install most/all of my cljsjs dependencies?
> The shadow-cljsjs library only provides the shim files. You’ll still need to npm install the actual packages yourself.#2023-03-2523:15thhellermost libraries nowadays have been updated to properly declare :npm-deps, so they'll be installed automatically. although you still want to keep track of them#2023-03-2523:16frozenlock:thinking_face:#2023-03-2523:17frozenlockSo if react wasn't working, it was probably only because I didn't have shadow-cljsjs?#2023-03-2523:18thhellernpm install react is too much? 😛#2023-03-2523:18thhelleryou always have shadow-cljsjs, it comes with shadow-cljs#2023-03-2523:18thhellerreagent and others all declare their react dependency properly#2023-03-2523:18thhellerdon't know what you are using, so can't answer#2023-03-2523:19frozenlockFor a one-time, of course not.
But in the grand scheme of things, it's adding one more build tool.
In 4 years when I'll come back to the project, I will curse my past self 😕#2023-03-2523:20thhellernpm creates a package-lock.json, which ensures you get exactly the same dependencies in 4 years#2023-03-2523:20thhellerkeep that + package.json in git and things should be fine#2023-03-2523:20thhellernot keeping the lock file is the sin that will break everything next week 😉#2023-03-2523:21thhellerbut I understand the sentiment, not a fan of npm either myself.#2023-03-2523:22frozenlockSure, but I mean having to call npm install
I know it's small, but I'd rather avoid having it if possible. Adding more dev tools is always painful in the long run.#2023-03-2523:22hifumi123imo it’s much better than dealing with the (often errorneous) externs that ship with CLJSJS packages then debugging issues that only manifest in release builds#2023-03-2523:22frozenlockBut at least I have the shadow-cljs migration in a branch, so I can try to see if I had something else breaking things#2023-03-2523:25hifumi123i used to find shadow-cljs super complicated when I was coming to cljs from clojure, but once it clicked, i never want to go back to other build tools… having to npm ci on my machine or in a CI build is not a big deal at all IMO… if anything, I’d say leiningen is the extra build tool that can go away (for a cljs frontend at least) 😄#2023-03-2523:26hifumi123anecdotally, cljs projects have the most friction or ceremony to get running when people decide to mix them in with lein or deps.edn instead of just using shadow-cljs from npm directly#2023-03-2523:28frozenlockI'll try tomorrow morning then
I can't be far from getting it to compile 😅#2023-03-2523:28hifumi123if your project has managed to survive without needing to pull in any npm library that is not react, then I’d say there is a very good chance you should be migrating over to shadow-cljs#2023-03-2523:29hifumi123i know this is another anecdote, but ive seen a cljs codebase old enough to migrate from Om to Reagent then Prismatic Schema to clojure.spec then lein-cljsbuild to figwheel and so on…. and migrating it over to shadow-cljs wasn’t a big hassle, it actually simplified the steps needed to set up a development environment on the app’s frontend#2023-03-2523:30hifumi123of course not all cljs libraries out there are perfect… devcards has hard dependencies on cljsjs packages but you can shim them out and use the npm versions directly, but the only CLJS library that has given me issues with shadow-cljs has been, well, devcards. Everything else didn’t need me to put much effort or thought to add to my project.#2023-03-2523:30frozenlockVery interesting; my project is roughly the same age then#2023-03-2523:31frozenlockI do have a 'few' cljsjs deps
[cljsjs/codemirror "5.44.0-1"]
[cljsjs/filesaverjs "1.3.3-0"]
[cljsjs/moment "2.24.0-0"]
[cljsjs/react-beautiful-dnd "10.0.4-0"]
[cljsjs/react-grid-layout "0.17.1-0"]
[cljsjs/react-transition-group "1.2.0-0"]
[cljsjs/react-virtualized "9.21.2-1"]
[cljsjs/resize-observer-polyfill "1.4.2-0"]#2023-03-2523:32hifumi123all of those should be simple to install from npm, the only change needed to your codebase is that (require '[cljsjs.moment :as moment]) becomes simply (require '["moment" :as moment])#2023-03-2523:34hifumi123the good news is that you can just make shim namespaces so that you can “require” cljsjs.moment but under the hood its the npm version — this will greatly assist in migrating your codebase over#2023-03-2523:35hifumi123of course, I understand your original issue is mostly CIDER REPL suddenly changing namespace to cljs.user every time a form is submitted in a separate namespace#2023-03-2523:36hifumi123and while migrating to shadow-cljs is a non-trivial task — i think the benefits outweigh the costs here, assuming that CIDER plays nicely with shadow-cljs on your end (i.e. you can eval things without this namespace issue)#2023-03-2523:36frozenlockYeah it's far from my initial issue, but hey, if it can solve it AND prevent some painful migration later on 🤷#2023-03-2523:37frozenlockBy shimming namespaces, do you mean I should do (ns cljsjs.moment ...) , or is that something shadow-cljsjs does automatically?#2023-03-2523:38hifumi123I believe there is a shadow-cljsjs library that can automagically generate shims for you, but I’ve never used it. The shims are very simple to set up anyway#2023-03-2523:38thhellerI don't recommend creating cljsjs namespaces. they only exist to help with libraries that use them#2023-03-2523:39thhellerfor your own code it is best to start using the npm package directly#2023-03-2523:40hifumi123the use case here is to prevent having to refactor an entire project beforehand, basically try getting the npm package to work with the codebase, then refactor so that the shims can be safely deleted#2023-03-2523:40hifumi123but i guess rewrite-clj and related tools should help automate the process of changing the require s across files#2023-03-2523:41thhellersure that is an option#2023-03-2523:42frozenlockAlright, I try again in the morning.
Thanks to you both 🙏#2023-03-2522:59frozenlockIt keeps returning to cljs.user
my.ns> (+ 1 1)
2
cljs.user>
#2023-03-2523:05hifumi123possible figwheel issue then. what youve describe basically never happens to me with shadow-cljs#2023-03-2523:06hifumi123the only npm thing shadow-cljs needs is a websocket library; if invoking from lein then you will need an nrepl middleware for cider, but otherwise I dont see much reliance on npm#2023-03-2523:56David Ackermanis it possible to run a function that returns a promise from the cider repl and have it inspect the value inside the promise instead of the promise itself? I know i can manually def the result from within a then and then evaluate that separately, but i'm trying to get my regular data-exploration workflow to work with promises. (i'm using nbb in case that matters)#2023-03-2600:01David Ackermanmy actual use case right now: I want to interactively run some query selectors against my browser from a puppeteer connection, where nearly every command returns a promise. so i want to run a selector and see the output, tweak it and look again, etc. so the faster i can do that loop the better#2023-03-2607:37borkdude@david.w.ackerman You can use nbb.core/await for this :)#2023-03-2607:38borkdudeAlso this project contains a REPL+promise friendly macro:
https://github.com/borkdude/deflet#nbb#2023-03-2700:57David Ackermanthank you, i didn't expect it to be in the base library of nbb!
I guess since unwrapping the promise changes when the data is returned and is not just a pure transformation, it would have to be handled by the repl server instead of the client (i.e CIDER)?#2023-03-2706:50borkdudeNo, because nbb has support for this, it also works in normal code #2023-03-2706:51borkdudeAlso, deflect isn’t part of nbb but you can add it as a dependency in nbb.edn#2023-03-2820:37practicalli-johnI noticed curious cursor behaviour when evaluating Clojure code in the editor buffer, which happens irrespective of if cider-show-error-buffer is set to t or nil (except when t then q should be pressed to quit the error buffer)
I open a Clojure .clj file from a project which has a namespace definition:
1. Calling a function that is not defined will jump the cursor to the opening bracket of the call expression, (foo)
2. Calling an evaluated function with incorrect number of arguments does not move the cursor
3. Evaluating a non-existent symbol blahblah jumps the cursor to the top of the namespace
Is this the expected behaviour for Cider?
I assumed that 1. and 2. would behave the same, the cursor jumping to the start of the calling expression (or not moving)
Behaviour 3 feels quite strange, I dont know what value is provided by the cursor jumping away (I appreciate this situation would not happen very often though)
Is there a way to customise the cursor movement on error? Or is it simply the way its been implemented?
Thank you#2023-03-2821:55hifumi123I do not observe the behavior in (3) when I use *cider-scratch* buffer. But I am getting a “Beginning of buffer” message in my echo box#2023-03-3104:19Drew Verlee@U0479UCF48H what is the cider scratch buffer?#2023-03-3104:20hifumi123M-x cider-scratch
It’s a glorified scratch buffer. A bit quicker than C-x b , selecting *scratch* , then typing M-x clojure-mode#2023-03-3104:21Drew Verleeah, thanks, i found it. i guess i added the * for a second and it wasn't coming up#2023-03-3104:21Drew Verleewhat editor are you using, i also get the (3) behavior above, so I'm trying to narrow it down#2023-03-3106:52practicalli-johnBehaviour 3 occurs in a Clojure project, with namespace definition
The scratchpad is a buffer with no underlying file
https://docs.cider.mx/cider/usage/misc_features.html#using-a-scratchpad#2023-04-0408:43practicalli-johnI'll report this as an issue on the cider repository as it hasn't been confirmed as expected behavior#2023-04-0415:43Drew Verleethanks @U05254DQM, i should have done that a while back. I guess i assumed it was something on my end or else why wouldn't it have been reported before?
Maybe I'm just really good at hitting edge cases 😕#2023-04-0519:28practicalli-johnhttps://github.com/clojure-emacs/cider/issues/3331#2023-03-3000:15bschragIs there a way to get the trace facility to pretty print function calls? My nested record arguments don't read well on a single line.
With default print options, the records pretty-print now at the REPL, not in trace output.#2023-04-0405:24ZacharyI see in there is a tools.deps artifact. I’m trying to get java docs to be searchable, but haven’t figured out how to so. I’m seeing also in the cider source, cider-enrich-classpath says “Only available for Leiningen porjects at the moment”. Does anyone know of the status of doing java doc search locally within emacs?#2023-04-0405:43vemvEnrich author here. In theory if you replaced clojure with https://github.com/clojure-emacs/enrich-classpath/blob/master/tools.deps/src/cider/enrich_classpath/clojure.sh within your Emacs setup, it would work.
Because I haven't had the time to extensively test this, I don't want to particularly encourage people to use it.
However there isn't any fundamental reason why it wouldn't work nicely. I should get to it soon. I just feel it's a large responsibility and I don't want to break devs' laptops while I'm busy with my own life 🙂#2023-04-0500:39pppauldoes cider-profile-toggle work? when i use it i get a mini-buffer and it asks me if i want to toggle for my var, but i can't click enter or accept the prompt.#2023-04-0617:44macrobartfastIs there a way to send an eval output from a buffer to the osx clipboard easily? I can copy from the buffer with pbcopy but this crossed my mind as an alternative possibility.#2023-04-0703:09bherrmannNot exactly an emacs binding, but I do use this to have clojure use the java api to copy into the clipboard.
(defn to-clip [ s ]
(let [
string-selection (java.awt.datatransfer.StringSelection. s)
clipboard (.. (java.awt.Toolkit/getDefaultToolkit) (getSystemClipboard))
]
(.setContents clipboard string-selection nil)))#2023-04-0703:09macrobartfastThat’d work for me! I’ll give it a go. Thanks!#2023-04-0620:37pppauli just updated cider, and now when i press enter it adds a newline instead of evaluating code. this is also happening in the minibuffer with some cider commands, mainly undef symbol anyone have this issue as well?#2023-04-0620:43dpsuttoni think paredit changed some keybindings. Some details here:
https://clojurians.slack.com/archives/C0617A8PQ/p1671790072091949#2023-04-0620:44dpsutton(I personally am a fan of newlines and control-j to send for eval but you can configure as you like)#2023-04-0705:35pppaulmy biggest problem is not being able to undef symbols, new lines are just a new thing that also happened around the same time i lost the ability to undef symbols#2023-04-0706:13bozhidarYeah, that's coming from Paredit changes. Perhaps at some point I'll have CIDER override them, it's just kind of a bad practice for one library to change the defaults of another.#2023-04-0819:57pppaulmaybe I can disable paredit in the minibuffer. I haven't really configured that before, could paredit-everywhere-mode be a possible cause, or is there something else I should be looking at to fix this?#2023-04-0915:40Akiz@U0LAJQLQ1 I’d say so.
I just recently had to explicitly enable paredit for REPL, because I wanted the described behaviour. When paredit is disabled, enter evals..#2023-04-0915:41Akiz(use-package paredit
:ensure t
:hook ((clojure-mode . paredit-mode)
(clojurec-mode . paredit-mode)
(clojurescript-mode . paredit-mode)
(cider-repl-mode . paredit-mode))
...
This is my config. Without cider-repl-mode-hook it does what you want.#2023-04-1020:46pppaulthanks, my init.el already does what you suggested. my minibuffer is completely useless for many cider commands, and i don't think it's cider's fault. is there a way for me to see the minor-modes in the minibuffer? or is there some meta command i can use in the mini-buffer to get it to execute the commands i want? it is the case that only cider commands are breaking, and not all, mainly the undef command, but i assume that commands that require me to enter text will similarly break.#2023-04-1107:52AkizPressing , in Cider Repl and then C-h m should do it.#2023-04-0621:49lilactownare there any examples of writing custom commands that wrap a defun or symbol in some extra stuff before evaluating?#2023-04-0621:50lilactowne.g. if I wanted to bind a hotkey that evaled whatever symbol was under my cursor wrapped in (tap> ,,,)#2023-04-0700:32practicalli-johnSome examples of calling Portal Clojure commands from an Emacs interactive function using cider-nrepl-sync-request:eval
https://practical.li/clojure/data-inspector/portal/#editor-commands#2023-04-0707:48cwchriswilliamsMine probably aren't as clean as John's, but I do have one where you can call it with C-u to bring up a list of viewers for the tapped thing to display as https://github.com/cwchriswilliams/emacs-2023/blob/main/post-init.org#portal-extensions (these are particularly if you're using Portal, I should add)#2023-04-0708:23dakraIf you just want to tap> there's already cider-tap-sexp-at-point and cider-tap-last-sexp in the latest cider release.
The https://github.com/clojure-emacs/cider/blob/68709bc29b81fdd0b9d2cb8089cdd43a429a685f/cider-eval.el#L1036-L1045 is also very simple in case you want to customise it a bit. E.g. I have https://github.com/dakra/dmacs/blob/6dce0b73318a3b6666afa1b1aea502083e576b48/init.org?plain=1#L5723-L5736 in my config to tap the last sexp to clerk for their vega-lite viewer.#2023-04-0708:26cwchriswilliamsAwesome. I didn't know that had been added. 👍#2023-04-0716:47lilactown@UFAP0C8KU I was able to crib off of those built in functions to do what I wanted. Thanks!#2023-04-0819:26Drew VerleeWhat CALLBACK in:
(cider-interactive-eval '["1" "2"]' CALLBACK)
would let me store the above clojure list in a elisp list such that i could get the first element from it:
(car cloure-list-turned-elisp-list) => "1"
I'm trying to read the clojure docs to figure this out and I'm not sure how to understand what the callback function should do. the default is described as such:
Signature
(cider-interactive-eval-handler &optional BUFFER PLACE)
Documentation
Make an interactive eval handler for BUFFER.
PLACE is used to display the evaluation result.
If non-nil, it can be the position where the evaluated sexp ends,
or it can be a list with (START END) of the evaluated region.
Update the cider-inspector buffer with the evaluation result
when cider-auto-inspect-after-eval is non-nil.
I'm confused because this doesn't seem to take the results, it seems to just put them someplace on the emacs buffer.#2023-04-0903:52Drew Verleethis section in the docs looks promising https://docs.cider.mx/cider/usage/code_evaluation.html#storing-eval-results#2023-04-0919:10Drew VerleeWhat's the best way to get the clojure value from cider-interactive-eval? e.g 1 from (cider-interactive-eval "1")? I tried using the callback and it seem like it only deals with where to put the result, but doesn't actually get the clojure value passed to it.
I tried reading from the register, and while this works, it seems i have to handle the race condition aspect, which again, implies ideally i was using a callback.#2023-04-1110:18iarenaza@U0DJ4T5U1 You can leverage 'cider-after-eval-done-hook to avoid the race condition. This works for me (`core.clj` is a buffer that holds Clojure code and is connected to a CIDER REPL session):
(with-current-buffer
(get-buffer "core.clj")
(cider-interactive-eval
"(into {} [[\"key\" \"val\"]])"))
(defun iarenaza/cider-eval-done-hook ()
(let* ((eval-result-str (get-register cider-eval-register))
(parsed-result (parseedn-read-str eval-result-str)))
(message "value from register e: %S, parsed value (as EDN): %S, val from key: %S"
eval-result-str
parsed-result
(gethash "key" parsed-result))))
(add-hook 'cider-after-eval-done-hook #'iarenaza/cider-eval-done-hook)
The snippet assumes the evaluation result is something that can be parsed as EDN. I.e., plain data, as opposed to functions, records or more elaborate data types that can't be represented as plain data (and thus impossible to translate into Elisp equivalents).#2023-04-0917:22lilactownhas anyone gotten eglot and cider to play nice? I find that when I use them together, xref-find-references doesn't work and it shows both the LSP args/docstring and the Cider args/docstring.#2023-04-0917:23lilactownxref-find-references works as long as I only use LSP#2023-04-0917:37practicalli-johnI assume that eglot has similar crossover with cider that lsp-mode has, so where the same features are provides they should be disabled in either cider or LSP
E.g https://manueluberti.eu/2023/03/25/clojure-lsp.html
I would be interested in trying eglot (I'm running Emacs 29) so anythng you can share on getting eglt and cider to be happy is much appreciated#2023-04-1112:53AkizI do.
So for XREF I have this in my cider config and I use only Eglot for that (I haven’t found any advantage of using Cider for it).
(setq cider-use-xref nil)
And I have also this custom code
(defun my/remove-eglot-documentation-functions ()
(interactive)
(when (and (bound-and-true-p cider-mode) (cider-connected-p))
(remove-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function t)
(remove-hook 'eldoc-documentation-functions #'eglot-signature-eldoc-function t)
(remove-hook 'eldoc-documentation-functions #'eglot-completion-at-point t)
(setq completion-at-point-functions (remove 'eglot-completion-at-point completion-at-point-functions))))
which runs by this hook
hook ((cider-connected . my/remove-eglot-documentation-functions))
That’s because I’m not able to get as much documentation with Eglot as with Cider. But sometimes i want to edit CLJ without running REPL.
My pop-up in Corfu (alternative to Company) doesn’t work with Eglot and I also don’t have documentation in minibuffer. So this is handled by Cider only once it starts..#2023-04-1118:31lilactownI think this is exactly what I want @UBRV1HXPD 😄 sounds like we have similar configs#2023-04-1208:05AkizLet me know if you can configure Eglot to show CLJ documentation somewhere 😅. I was able to do this partially if I had yasnippets enabled, but I honestly never got to grips with snippets in clojure, so I have them disabled now...#2023-04-1210:25jmckitrickI can’t even imagine running both at the same time. How’s the resource usage and responsiveness of emacs?#2023-04-1210:28daveliepmannI like to run eglot for cljs and cider for clj (though ideally I'd pick and choose specific eglot features in clj, too) and haven't noticed any perf issues. I know LSP can be a big of a hog, but CIDER shouldn't be, right?#2023-04-1215:18Akiz@U061KMSM7 To be honest, the only performance issue I have got with Emacs is when Cider has to process some long output. When I got invalid malli schema for > 1000 entities (every with 20 keys) I can wait several minutes to get complete output… But yeah, Eglot is more lightweight than lsp-mode.
@U05092LD5 Me too. This is why my config disables Eglot features only when I am connected to REPL.#2023-04-1410:51jmckitrickHow can I diagnose this CIDER error?
error in process sentinel: progn: Unmatched bracket or quote
error in process sentinel: Unmatched bracket or quote
#2023-04-1716:43jmckitrickAnd I’m only seeing it in emacs 30#2023-11-1704:39cch1I’ve recently started seeing this same error in 29.1 when jacking in. Toggling the debugger to auto start on errors doesn’t catch it and I can’t find the mismatch (tried with several linters). Any ideas?#2023-04-1412:24jmckitrickAlso, are there any settings I could tweak in CIDER that might make it a bit less featureful but a bit more responsive?#2023-04-1412:58jmckitrickI just realized I had nrepl-log-messages set to t :man-facepalming::skin-tone-2:#2023-04-1412:58jmckitrickSo I’ll start there#2023-04-1413:09practicalli-johnI set these variables for cider and it runs very fast for me (not all variables are relevant for performance)
(setq
clojure-enable-kaocha-runner t ; enable Kaocha test runner
cider-repl-display-help-banner nil ; disable help banner
cider-print-fn 'puget ; pretty printing with sorted keys / set values
clojure-indent-style 'align-arguments
clojure-align-forms-automatically t
clojure-toplevel-inside-comment-form t ; may clash with lsp in (comment ) expressions
cider-result-overlay-position 'at-point ; results shown right after expression
cider-overlays-use-font-lock t
cider-repl-buffer-size-limit 100 ; limit lines shown in REPL buffer
nrepl-use-ssh-fallback-for-remote-hosts t ; connect via ssh to remote hosts
)
I set the REPL buffer limit really small as I dont use the REPL buffer at all (I shttps://practical.li/clojure/data-inspector/portal/`dev/user.clj`https://practical.li/clojure/data-inspector/portal/).
If there is a lot of info in the REPL buffer and its not cleared, it will eventually slow down Emacs, especially if there are very long lines sent to the REPL buffer.
puget is used to pretty print results and seems fast, although using the Cider Inspector is going to be more performant with larger data#2023-04-1413:33jmckitrickGreat suggestions, I’ll try a few of those, and put Portal on my list.#2023-04-1416:05practicalli-johncider inspector provides a nice way to explore data and if the inspector buffer is kept open then additional evaluation commands will update the cider inspector buffer. Its a nice gateway to full on portal features.#2023-04-1417:55jmckitrickI think I tried rebel and portal (or something like it) a year or so ago. I need to take another look and commit#2023-11-1704:39cch1I’ve recently started seeing this same error in 29.1 when jacking in. Toggling the debugger to auto start on errors doesn’t catch it and I can’t find the mismatch (tried with several linters). Any ideas?#2023-04-1520:10rschmuklerHeyo! I have been having an issue that has been plaguing me for a while and I am trying to figure out how to debug it further. Occasionally when evaluating an expression that throws an exception I get an issue where my nrepl session becomes unresponsive. My JVM still works (eg. I see log messages, web server responds, etc). but nrepl related functionality (eg. documentation) doesn't work. Turning on nrepl-log-messages reveals that requests are being sent but no replies are received. The first request that doesn't get a response is as follows:
(-->
id "628"
op "analyze-last-stacktrace"
session "231fae66-f907-4c94-b033-13baba6f9c96"
time-stamp "2023-04-15 14:05:20.094831744"
nrepl.middleware.print/buffer-size 4096
nrepl.middleware.print/options (dict ...)
nrepl.middleware.print/print "cider.nrepl.pprint/pprint"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? "1"
)
Anything that I can do to help debug this further? Unfortunately it's very inconsistent (ie. only 20% of exceptions cause this to happen, and it's inconsistent as to whether the same exception will do it... So perhaps its a race case?). As you can imagine, it's pretty disruptive to flow to have to completely restart the repl session when debugging an error.#2023-04-1520:20rschmuklerLooking at the code for: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/stacktrace.clj#L36
(defn- handle-analyze-last-stacktrace-op
"Handle the analyze last stacktrace op."
[{:keys [session] :as msg}]
(if (and session (@session #'*e))
(analyze-last-stacktrace msg)
(no-error msg))
(done msg))
I'm wondering if an exception being thrown in either analyze-last-stacktrace or no-error could cause the nrepl server to become unresponsive if (done msg) is never called.#2023-04-1608:07vemvanalyze-last-stacktrace is a relatively new addition so it's possible that it has some corner case.
I'd suggest creating an issue and cc/ing the author of https://github.com/clojure-emacs/haystack#2023-04-1716:19rschmuklerThanks for the suggested, created an issue on the GitHub: https://github.com/clojure-emacs/cider-nrepl/issues/771#2023-04-1712:50fmnoiseHi everyone! I updated to CIDER 1.7 (from pretty old one) this weekend and found out that M-. stopped going to var for fully qualified keywords. It shows No definitions found for: ... instead. I googled a bit and found out that since 1.2 CIDER integrates with xref for doing that, while before it simply redefined the key to do cider-find-var .
Is there anything I could do for going to definition for for fully qualified keywords without redefining key back to cider-find-var?#2023-04-1712:58fmnoiseeasiest is probably
(setq cider-use-xref nil)
but I think maybe there's a way to make keywords working (as it works for symbols)#2023-04-1716:40frank:thinking_face: what does it mean to go to var on a keyword?#2023-04-1716:41fmnoiseif I have a keyword :clojure.core/int?, I'd like to go to definition of clojure.core/int?#2023-04-1716:42frankI see (nothing to contribute, just curious 🙂 )#2023-04-1810:13Charliethere is a cider-find-keyword , but I find that having one key binding for both would be easier, like:
(defun cider-find-keyword-or-var (&optional arg var line)
"Try to find a keyword or a var."
(interactive "P")
(if (s-starts-with? ":" (cider-symbol-at-point 'look-back))
(cider-find-keyword arg) (cider-find-var arg var line)))#2023-04-1810:24fmnoise@U01838SNNKX cider-find-keyword doesn't go to definition of function, if I do that for example on :clojure.core/int?
it goes to clojure.core ns but doesn't position on int? function definition, which is my use case.
I ended up turning off cider-use-xref so it works as before.#2023-04-1810:51CharlieGot it. I actually had cider-use-xref off from a year ago but probably don't need that since I don't have this specific use-case (given a keyword, go to definition of function).#2023-04-2007:55magnars@U4BEW7F61 Dare I ask why you're navigating to functions from keywords?#2023-04-2008:12fmnoise@U07FCNURX I use them in graphql schema with Lacinia
:status {:resolve :app.resolvers/payment-status
:type :PaymentStatus}#2023-04-2221:20David Ackermanis there a way i can set the jvm memory for my cider repl? i can't seem to find the documentation for it#2023-04-2222:20Alex Miller (Clojure team)You can set :jvm-opts [“-Xmx=512m”] in an alias and then include the alias#2023-04-2222:21Alex Miller (Clojure team)Or just -J-Xmx=512m on the CLI command line, not sure which is easier#2023-04-2222:23David AckermanAh including an alias will probably work as I'm using cider-jack-in. Thanks!#2023-04-2221:22David Ackermanor is this maybe something i should specify in deps.edn? (trying that now)#2023-04-2519:33Peter Tonneris there a way to make the REPL require a specific namespace on startup? I tried adding "(require '[foo.bar])" to cider-repl-init-code but it doesn't seem to work#2023-04-2608:27practicalli-johnTool independent approach is to include a user.clj file on the class path when starting the repl.
The code in this user namespace will be loaded during the repl start, so other namespaces can be required, tools run or services started
An example for Clojure CLI
https://practical.li/clojure/clojure-cli/repl-startup/#2023-04-2608:29practicalli-johnThe same can be done for Leiningen by including the dev directory (that contains user.clj) on the class path via an alias / dev profile#2023-04-2608:39practicalli-johnI use the dev/user.clj to great effect in the Practicalli REPL Reloaded workflow, which launches Portal data inspector, starts a log publisher, requires namespaces for supporting dev tools, etc
https://practical.li/clojure/clojure-cli/repl-reloaded/#2023-04-2611:02Peter Tonneroh thanks duh! I have been using user/dev.clj for various operations but keeping them under a comment block so they didn't execute immediately. should have occurred to me to do the opposite for stuff I want to run automatically 😁#2023-04-2903:18Drew Verlee@U05254DQM what if you want a want a project user.clj and a global user.clj.
Where the global collects all the libs and functions that I use to build app, but don't want to be included in the app.#2023-04-2903:21Drew VerleeWhat will happen if there are two user.clj namespaces on the path? (i can try this but the behavior might not be obvious)
my goal isn't really to use a user.clj namespace, but to layer on development tooling. I can#2023-04-2907:11practicalli-john@U0DJ4T5U1 in my view the dev/user.clj is separate from the application, as it is not packaged along with it.
Clojure CLI aliases in the user (global) deps.edn provide project independent tools, or common tools can be installed as a Clojure CLI tool.
In theory a separate project could be used that contains just the user namespace code and include that as a development dependency (Clojure CLI alias). This could be effective if all the libs and functions were applicable to every project. Usually there are some project specific variations to manage. I have not tried this and cannot guarantee it works, especially if each project also has its own user namespace defined with different or conflicting function definitions. Tests would need to be done to see if the loading order is consistent, especially if one user namespace defined the same function name with a different body.
Having a user namespace with lots of libraries required will affect startup speed, although using reqiring-resolve may mitigate that issue to some extent
Using a project template that includes a dev/user.clj configuration is arguably the most effective way to provide a common set of libs and functions. The template can include rules to tailor how the project is created so that any specific function implementation or library require forms are used. This is what I'm doing with the https://github.com/practicalli/project-templates project#2023-04-2907:21Drew Verlee@U05254DQM that makes sense. I should probably not have any projects defining a user.clj ns and let the users do that 😕 .#2023-04-2907:28practicalli-johnSorry, I don't follow the reasoning to not include a dev/user.clj file
Are the 'users' not going to take advantage of the added develop tools you are using with the project?
Happy to discuss specifics in separate thread in #CJTRRQ857 channel#2023-04-2604:57bozhidarFYI - https://clojurians.slack.com/archives/C060SFCPR/p1682459907165049#2023-05-0118:09Oliver MarksI have been using this setup from the cider docs, https://docs.cider.mx/cider/cljs/shadow-cljs.html#using-shadow-cljs-with-deps-edn-and-custom-repl-initialization in user.clj it defaults to :app but it looks like it should be selectable or configurable when you jack in as the function has 2 forms. is it possible to change just setup portfolio and looking for a way to switch between :app and :portfolio if this is possible.#2023-05-0120:56winsomeIs there a way to use a certain jdk for just one project? I want to tinker around with virtual threads but I don't want to change my system jdk.#2023-05-0120:57Daniel CraigI've used a docker container / https://code.visualstudio.com/docs/devcontainers/tutorial for this#2023-05-0120:57Daniel CraigIf you're using VS Code/Calva and devcontainers, it's surprisingly straightforward#2023-05-0120:58Daniel CraigSee https://github.com/danielmartincraig/coffi-demo-deps for an example of how I used JDK 18 and https://github.com/IGJoshua/coffi to try out the new features of project panama#2023-05-0120:59Daniel CraigSorry, I know you asked in the Cider channel; maybe devcontainers can be used in emacs/cider too#2023-05-0121:00winsomecoffi certainly looks interesting, and I can take a look at the docker solution until another solution pops up.#2023-05-0121:01Daniel CraigIn case you didn't know, SDKMan makes changing the system jdk relatively pain-free#2023-05-0121:01Daniel Craigthat might be worth looking into as well#2023-05-0123:05lreadif you try SDKMan you might be interested in checking out its https://sdkman.io/usage#env#2023-05-0205:51practicalli-johnhttps://www.jenv.be/ is a very simple to use tool to set the version of Java jdk to use#2023-05-0207:31Oliver MarksSDKMan is a good option for managing your JDK environment docker tends to complicate things a bit when it comes to jacking in#2023-05-0121:13diego.videcoHi everyone, I’m having trouble running tests in a Clojure project with CIDER. Specifically, I’m trying to use the cider-test-run-project-tests function, but it keeps telling me that there are no tests to be run, even though there are. I’m using a deps.edn project and have confirmed that my test files are named properly and located in the right directory. I can run them from the command line with clojure -M:test. Any ideas on what might be causing this issue? Thanks in advance for your help!#2023-05-0122:18Evan Bernardhave you evaluated all of the forms in the project yet? it ought to evaluate all forms on startup, but if there’s a form that fails to evaluate and yet you don’t hear about it, the tests might will have been prevented from loading#2023-05-0203:16diego.videcoyes. also I believe that clojure -M:test would do that as well#2023-05-0203:58diego.videco… seems like I was missing "test" in here :paths ["src" "test"]#2023-05-0217:53Brandon OlivierDoes anybody else have issues with rich comments on an m1 mac?
There’s some kind of font locking issue I haven’t been able to resolve that freezes up Emacs.#2023-05-0217:58Brandon OlivierI actually checked and this has nothing to do with cider. The problem function, based on my profiler is markdown-fontify-code-blocks-generic which has some kind of issue with comment blocks.#2023-05-0218:08dpsuttoni’ve got a patch that i think fixes this#2023-05-0218:09dpsuttondo you have clojure-toplevel-inside-comment-form set?#2023-05-0218:10Brandon OlivierThat’s exactly what’s causing the issue#2023-05-0218:10dpsuttonyeah. i seem to have thrown away the patch. let me try to recreate it#2023-05-0218:10Brandon OlivierFound a GH thread that wasn’t around last time I was messing with this.#2023-05-0218:10dpsuttonthere’s an infinite loop in the logic. and i just put a “if we’re over 200 then give up”#2023-05-0218:10Brandon OlivierNo worries, I don’t use top level eval in comments often enough for it to make much of a difference#2023-05-0218:10dpsuttonnot a great fix#2023-05-0218:10Brandon OlivierThanks, though!#2023-05-0218:10Brandon Olivierlol#2023-05-0218:11Brandon OlivierI think the latest release has a fix, which involved changing the beginning of defun functions, but I’m on Doom, so I’m not inclined to mess with that#2023-05-0218:11dpsuttonhmm. i’m gonna have to check it out#2023-05-0218:11dpsuttondo you have a link to what makes you think there’s a fix?#2023-05-0218:11dpsuttonmaybe someone did it better than my fix#2023-05-0218:11Brandon OlivierHold on a sec, you authored this fix 😂#2023-05-0218:12Brandon Olivierhttps://github.com/emacs-lsp/lsp-mode/issues/2698#2023-05-0218:14dpsuttonwhich fix?#2023-05-0218:14Brandon Olivierhttps://github.com/clojure-emacs/cider/pull/2412/files#2023-05-0218:15dpsuttonyeah that moves it to clojure-mode#2023-05-0218:15dpsuttonbut i wrote it originally#2023-05-0218:15dpsutton> [#2375](https://github.com/clojure-emacs/cider/issues/2375): Move cider-eval-toplevel-inside-comment-form into clojure-mode as clojure-toplevel-inside-comment-form so beginning-of-defun is aware of comment forms.#2023-05-0306:17Christian JohansenI have some macros whose name starts with def, e.g. defpage. These used to be colored like def, but after I installed a newer cider they don’t. I have cider-20230426.1815. Is this expected behavior?#2023-05-0307:12OknoLombardaYeah, that's expected, but that comes from clojure-mode. It had no way of figuring out which form is a def form and which one is not, so all forms that started with def were specially colored. This led to cases where forms like (default-something...) were colored the same way as a def form. Now only a known preset of def forms are colored, but it can be manually extended
https://github.com/clojure-emacs/clojure-mode#font-locking#2023-05-0307:23Christian JohansenAwesome, thanks 👍#2023-05-0407:49daveliepmannI'm writing up a Discussion about https://clojurians.slack.com/archives/C03S1KBA2/p1683142572115519 and want to make sure I'm not missing a setting which already does what I want.
In the Clojure cli, a form like (let [x]) produces a short, informative message and hides the stacktrace. In CIDER 1.7 on my machine, cider-eval-last-sexp (meaning, from a namespace buffer, not in the REPL buffer) the same form produces a pretty substantial and complex stacktrace with the root cause pretty well obscured.
Does CIDER currently provide a way for this error to surface nicely (that is, more like the CLI)? I'd still want an option to drill down to the full stacktrace, of course.#2023-05-0412:44daveliepmannI started a discussion https://github.com/clojure-emacs/cider/discussions/3338#2023-05-0413:11robert-stuttafordnicely argued, Dave!#2023-05-0415:10yuhanI use the setting (setq cider-show-error-buffer nil) which shows the error message as an overlay at the end of the form being evaluated - the vast majority of the time I find this a much better user experience, and can always bring up the stacktrace buffer with cider-selector if needed.#2023-05-0415:14yuhane.g. here's what I see on cider-eval-defun:#2023-05-0412:44daveliepmannI started a discussion https://github.com/clojure-emacs/cider/discussions/3338#2023-05-0504:55joshchoHi all, my current project has shadow-cljs for frontend and lein for the backend. This creates problems in CIDER, where I cannot be connected to both instances. I would like to use cider-connect-clj&cljs, and it seems I need both to be the same build tool (lein or shadow-cljs). How would I accomplish this? I currently have a project.clj and shadow-cljs.edn. Do I need to change shadow-cljs.edn to use lein, or somehow convert project.clj into shadow-cljs?#2023-05-0505:02joshchoI am reading up on https://clojurians.slack.com/archives/C0617A8PQ/p1644353386501839, but I am open to simply use something different from lein#2023-05-0507:45Christian JohansenI’m using a regex to highlight custom def* macros. It highlights defwhatever the way I want, presumably using font-lock-keyword-face. But what’s the name of the font-lock-*-face for the symbol being defined?#2023-05-0507:50elkenYou can do M-x describe-char to give you the face(s) of the char under point, in this case it looks like font-lock-function-name-face but that could be because of clojure-ts-mode
It's worth binding it to something, Doom uses C-h '#2023-05-0507:57Christian JohansenAmazing, did not know that 🙏 #2023-05-0507:57Christian JohansenThanks!#2023-05-0508:01elkenYou're welcome 😄#2023-05-0702:56mister_mUsing the step debugger, is it possible to break on an exception in order to inspect the local variables at that frame?#2023-05-0708:23yuhanThere's a PR for this at https://github.com/clojure-emacs/cider-nrepl/pull/769 , I've tried it out locally (but not in anger) and it seems to work so far#2023-05-0714:18mister_mthat's really neat!@#2023-05-0708:46valtteriI’m getting this with cider-connect and cider-connect-* functions
> Error while decrypting with “/usr/local/bin/gpg”:
>
> gpg: no valid OpenPGP data found.
> gpg: decrypt_message failed: Unknown system error
Any idea what this could be about? This error ☝️ pops up before the usual prompt for host & port.
• MacOS 13.1
• GNU Emacs 29.0.90 (build 1, x86_64-apple-darwin22.2.0, NS appkit-2299.30 Version 13.1 (Build 22C65)) of 2023-05-07 (emacs-plus via homebrew)
• gpg (GnuPG) 2.4.1
I’ve tried the usual tricks, nuking elpa/ and updating & installing everything from scratch but no difference.
EDIT: Solved!#2023-05-0708:50valttericider-jack-in-* works fine :thinking_face:#2023-05-0708:53yuhanHave you tried toggle-debug-on-error to see the full backtrace?#2023-05-0708:56valtteriThanks! That was helpful! It seems like it dies while accessing ~/.authinfo.gpg file. Maybe it’s corrupted or otherwise broken :thinking_face:#2023-05-0708:58valtteriI deleted the file and now it works 🙌
Thanks for rubber ducking. 🙂 Next time I’ll remember to debug 😉#2023-05-0709:01valtteriI looked into the .authinfo.gpg and it seems to be created by https://github.com/wandersoncferreira/code-review which I tried a while ago but deleted after trying. Might be helpful In case someone hits this in the future.#2023-05-0916:12agDid cider-pprint-eval-last-sexp break lately? it either won't work at all, with a stacktrace like this:
Error printing return value (ClassCastException) at clojure.lang.Numbers/lt (Numbers.java:253).
class clojure.lang.PersistentVector cannot be cast to class java.lang.Number (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
ERROR: Unhandled REPL handler exception processing message {:op analyze-last-stacktrace, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70, :length []}, :session 782e50bd-c3b9-4128-9826-c06397e3519c, :id 13}
java.lang.ClassCastException: class clojure.lang.PersistentVector cannot be cast to class java.lang.Number (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
or it would eval the wrong thing. I'm trying something as simple as: {:foo :bar}, or [:foo :bar :zap :zop]#2023-05-0916:19agIt's the same thing with cider-pprint-eval-last-sexp-to-comment, it inserts this:
;; => [Error printing return value (ClassCastException) at clojure.lang.Numbers/lt (Numbers.java:253).
;; class clojure.lang.PersistentVector cannot be cast to class java.lang.Number (clojure.lang.PersistentVector is in unnamed module of loader 'app'; java.lang.Number is in module java.base of loader 'bootstrap')
but other eval commands like cider-eval-last-sexp appear to be working just fine#2023-05-0916:50vemvanalyze-last-stacktrace has been reworked in recent months so an issue would be most welcome#2023-05-0917:43agI dug around this and I couldn't find anything in cider's code that would cause this. Maybe some nrepl, cider-nrepl change?#2023-05-0918:09vemvanalyze-last-stacktrace surely uses https://github.com/clojure-emacs/haystack#2023-05-0918:35agCould it be this commit? https://github.com/clojure-emacs/cider-nrepl/commit/a53ab41c7ae56fda9f4a7b5916c5bd1f8fa60d95#2023-05-0918:37agI tried tweaking cider-injected-middleware-version & cider-injected-nrepl-version, using older versions, but that didn't fix the issue for me.#2023-05-1007:52r0man@U0G75ARHC This looks suspicious to me: {:right-margin 70, :length []} I would expect :length to be a number or nil . Probably this is set somewhere to nil and the bencode messes this up. I can't reproduce the issue with pretty printing the simple forms you showed. Which pretty printer function are you using? And did you configure any print options? https://docs.cider.mx/cider/usage/pretty_printing.html#print-options#2023-05-1015:20agOMG, @U0CKBRBD2 many thanks, turns out I accidentally got my cider-print-options borked somehow and didn't notice. You saved me so many hours of frustration.#2023-05-1015:23r0manNice! You are welcome.#2023-05-1015:30agDarn it. Even after years of using Clojure, I never learned how to properly read stacktraces. I wonder if chatgpt can "read" them for me 🙂#2023-05-1015:49r0manWell, I just happened to face this nil vs [] in a NREPL middleware I'm working on at the moment.#2023-05-0919:34Steven LombardiCross posting because I'm unsure which channel this question belongs in:
https://clojurians.slack.com/archives/C17JYSA3H/p1683660740358509#2023-05-1013:11pauldHi folks, I've posted this on #CFN4QDHPS and #C09C8GRLY but it seems to be particular to emacs because I can run the repl in the git bash shell but not jack in from emacs cider. I get:
[nREPL] Starting server via "c:/Users/Paul Dumais/scoop/shims/clojure.exe" -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Error building classpath. Don't know how to create ISeq from: clojure.lang.Symbol#2023-05-1013:12pauldIt was working fine 2 days ago, but something about rebooting seems to have broken things. I tried rolling back changes to my spacemacs repo and elpa packages but this did not help.#2023-05-1013:39vemvDoes this command succeed in your terminal?
"c:/Users/Paul Dumais/scoop/shims/clojure.exe" -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
Maybe there's a small typo in there?
Or in deps.edn#2023-05-1013:53pauldThe command works in my terminal.#2023-05-1013:53pauldI have tried several other projects with simple deps.edn files.#2023-05-1013:54pauldAt least it's not a show stopper. Using cider-connect is usually better anyway.#2023-05-1014:24vemvoh, sorry for reading too quickly.
Given that the command works, maybe it's an issue related to delimited quoting. clojure and Windows can both act funny#2023-05-1014:25vemvif you're able to obtain a full stracktrace (for example, precede your invocation with M-x toggle-debug-on-error , probably we'd appreciate a GH issue.#2023-05-1014:25pauldOk I'll put that in an issue.#2023-05-1014:27pauldI get this in *Backtrace*:#2023-05-1014:27pauldDebugger entered--Lisp error: (error "Could not start nREPL server: Error building class...")
error("Could not start nREPL server: %s (%S)" "Error building classpath. Don't know how to create..." "exited abnormally with code 1")
nrepl-server-sentinel(#<process nrepl-server> "exited abnormally with code 1\n")#2023-05-1014:29vemvyeah that would not be enough of a lead 😞 perhaps you'd have better luck in the nrepl log buffer#2023-05-1014:43pauldI made an issue and included the trace in my *Messages* buffer.#2023-05-1014:44pauldIt's mostly the same as what's in the nrepl-server buffer.#2023-05-1522:58mister_mWhen running some tests I ran into an infinite loop in a future -- I feel that interrupting a running test with C-c C-b does not always work in this situation and I need to kill the whole repl in order to kill the test. Is there a way around killing my whole repl? I can try to provide more info if that is helpful I'm just not sure what's relevant and what isn't#2023-05-1606:48vemvhow does the deftest look like? I can't imagine how a future might cause it to hang#2023-05-1614:52mister_mI'll try to see if I can make a minimal test of the situation#2023-05-1614:53mister_mthat would probably be much more helpful#2023-05-1812:38yuhanPosted some findings on https://github.com/clojure-emacs/cider/issues/3343, curious to know if anyone else faces similar performance issues (stuttery typing, long freezes after jack-in/connect). Any insight into the CLJS dev aspect of things also appreciated :)#2023-05-1820:31mister_mDoes anyone use imenu ? I am not currently using LSP or LSP-UI with CIDER but I am wondering if there is anything that could enhance it a bit to differentiate functions, defs, etc#2023-05-3120:14SamHave you tried consult-lsp-symbols?#2023-05-1919:38bozhidarWe're considering disabling cider-auto-mode (and maybe even removing it completely going forward) - if you have opinion about its usefulness, please share it here https://github.com/clojure-emacs/cider/issues/3346#2023-05-2101:17JohnIs there a standard way to eval sexp at point like eval defun (C-c C-c) but ignore an outer (comment ..) ? Without going to the end of it and "eval prior sexp"#2023-05-2101:45dpsutton(setq clojure-toplevel-inside-comment-form t)#2023-05-2101:45dpsuttonand then you’re good to go#2023-05-2208:19Colin (fosskers)Oh heck yes, thank you#2023-05-2415:46stathissiderishas anything changed recently in the cider-interrupt function? It used to be pretty effective at stopping stuff in the REPL and now it seems that pressing it makes the prompt appear but doesn’t stop whatever is running#2023-05-2416:03vemvnot that I heard of
are you familiar with the fact that it first tries to interrupt gracefully (via Thread/interrupt), and then only uses Thread .stop as a last resource.
You may need to try twice to force the stop ping.#2023-05-2416:03stathissiderisgot it, I just have to hit C-c harder then 😄#2023-05-2416:04stathissideristhanks for the tip#2023-05-2416:04vemvLet us know if it persists#2023-06-0922:06stathissiderisThis seems to be persisting, I have this function:
(defn infinite []
(while true
(apply * (range 100))))
I run it in the REPL, I see the CPU of the java process going to 100%, I then press C-c C-c, I get back a responsive REPL but CPU stays at 100%.#2023-06-0922:08stathissiderisREPL sample session:
;; Connected to nREPL server -
;; CIDER 1.7.0 (Côte d'Azur), nREPL 1.0.0
;; Clojure 1.12.0-alpha2, Java 20.0.1
;; Docs: (doc function-name)
;; (find-doc part-of-name)
;; Source: (source function-name)
;; Javadoc: (javadoc java-object-or-class)
;; Exit: <C-c C-q>
;; Results: Stored in vars *1, *2, *3, an exception in *e;
;; Startup: /usr/local/bin/clojure -A:dev -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
user>
zuper.nlp> (infinite)
ERROR:
zuper.nlp> (+ 1 1)
2#2023-06-0922:08stathissideristhe ERROR: line appears some time after I press C-c C-c#2023-06-0922:10stathissiderisa subsequent call to (infinite) makes java got to 200%, and it stays there even after being interrupted#2023-06-0922:10stathissideristhis is on macOS Monterey (12.3.1)#2023-06-0922:15phronmophobicDoes the error occur if you manually call M-x cider-interrupt? I ask because C-c C-c isn't bound to cider interrupt for me, but I'm not totally sure if that's because my setup has been customized.#2023-06-0922:16stathissiderisI can try, but:
C-c C-c runs the command cider-interrupt (found in cider-repl-mode-map), which
is an interactive byte-compiled Lisp function in 'cider-client.el'.
It is bound to C-c C-c, C-c C-b, <menu-bar> <repl> <Interrupt evaluation>,
<menu-bar> <repl> <Test> <Interrupt running tests>.
(cider-interrupt)
Interrupt any pending evaluations.
#2023-06-0922:16phronmophobicOh, nevermind. C-c C-c is cider interrupt in the repl for me, but not in the clj file.#2023-06-0922:18phronmophobicDoes the problem also happen if you don't load any code and just try it from the user namespace?#2023-06-0922:20stathissiderislet me see…#2023-06-0922:21stathissiderisyes, it still happens in a fresh REPL:
user> (while true
(apply * (range 100)))
ERROR:
user> #2023-06-0922:22phronmophobicand you have confirmed the issue happens in a "clean" project without any plugins or dependencies?#2023-06-0922:23phronmophobicBasically, just trying to narrow it down to make sure the problem is cider related rather than some other dependency#2023-06-0922:23stathissiderissure, let me give that a try#2023-06-0922:29stathissiderisOK, so I’ve renamed my ~/.clojure to something else (because I had a deps.edn in there) and made a new project that has just a deps.edn file in the folder with:
{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha2"}}}
And I’m still getting the same behaviour#2023-06-0922:30phronmophobicoh, interesting. I'm seeing it now#2023-06-0922:30stathissiderisI can start changing the versions of Clojure, CIDER, the JDK etc to see which one is to blame#2023-06-0922:31stathissiderisoh can you actually reproduce it?#2023-06-0922:31phronmophobicYea#2023-06-0922:32stathissiderisI’m so glad!#2023-06-0922:32phronmophobicI think I was seeing it before, but just didn't check the CPU usage.#2023-06-0922:33stathissiderisit’s my fans that gave it away, it’s pretty hot over here#2023-06-0922:34phronmophobicMy macbook air quietly churns.#2023-06-0922:35stathissideriswould you like me to write this up as an issue on github?#2023-06-0922:38phronmophobicI don't work on cider. I was just trying to help debug.#2023-06-0922:39stathissiderisoh, many thanks in any case, I’ll report this and send you the link in case you’d like to mention that you’re also experiencing it#2023-06-0922:40stathissiderismaybe mentioning your versions would be helpful#2023-06-0922:45phronmophobicI wanted to check if writing some code to the interruption also had the same problem:
(defn start-thread-and-kill []
(let [t1 (Thread.
(fn []
(infinite)))
t2 (Thread.
(fn []
(Thread/sleep 3000)
(.stop t1)))]
(.start t1)
(.start t2)
(.join t1)))#2023-06-0922:45phronmophobicand it does.#2023-06-0922:46phronmophobicWhich led me to check Thread.stop for https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/lang/Thread.html#stop(). Compared to https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/Thread.html#stop(), it now says:
> Throws:
> UnsupportedOperationException - always#2023-06-0922:46stathissiderisInterestingly, cider-interrupt works for this:
user> (defn infinite []
(while true
(prn :foo)
(Thread/sleep 1000)))
#'user/infinite
user> (infinite)
:foo
:foo
Execution error (InterruptedException) at java.lang.Thread/sleep0 (Thread.java:-2).
sleep interrupted
user>#2023-06-0922:46phronmophobicif you call thread.stop() in Java 20, it looks like it doesn't stop the thread instead just throws UnsupportedOperationException.#2023-06-0922:47stathissiderisbut this keeps printing!
(defn infinite []
(while true
(prn :foo)))#2023-06-0922:47phronmophobicAs mentioned earlier, cider-interrupt first calls thread.interrupt() and then waits a bit before calling thread.stop() , so since sleep checks the interrupt flag, then it works.#2023-06-0922:48phronmophobicIf you remove the sleep, then there's no longer any code that checks the interrupt flag#2023-06-0922:48stathissiderisyeah, that makes sense#2023-06-0922:48phronmophobicThis also gracefully stops:
(defn infinite-with-interrupt []
(while (not (Thread/interrupted))
(apply * (range 100))))#2023-06-0922:49phronmophobicSo it seems like the root "cause" is that thread.stop() no longer actually stops the thread starting in Java 20.#2023-06-0922:55stathissiderisalso see https://bugs.openjdk.org/browse/JDK-8289610#2023-06-0923:05stathissiderisraised as https://github.com/clojure-emacs/cider/issues/3351#2023-06-0923:14stathissiderisDowngrading to openjdk 17 fixes this#2023-06-0923:15phronmophobic👍 , yes, that's good to double check.#2023-06-0923:16stathissiderisNot just that, but also essential for me to have a working REPL while the good developers of CIDER work on a more permanent fix, thank you very much for your help with this!#2023-06-1001:49phronmophobicJust skimmed through the ticket and basically, it doesn't seem like there's any way to force another thread to stop if the thread itself doesn't cooperatively check if it should stop itself.#2023-06-1001:50phronmophobicMaybe some answer will present itself via project loom?#2023-06-1211:00vemvMy notes on the topic https://github.com/clojure-emacs/cider/issues/3351#issuecomment-1587036038#2023-06-0922:06stathissiderisThis seems to be persisting, I have this function:
(defn infinite []
(while true
(apply * (range 100))))
I run it in the REPL, I see the CPU of the java process going to 100%, I then press C-c C-c, I get back a responsive REPL but CPU stays at 100%.#2023-05-2518:18Charles ComstockI recently ran into some trouble with M-. breaking on a CLJS project and no longer recognizing any namespaces. My quick fix was to force the usage of cider-find-var instead of xref-find-definitions I'm aware of cider-use-xref but I think that only work if declared before cider loads, so I just hardcoded the bindings in cider-mode-map. Skimming over the changes in cider this spring it seems unlikely this was due to a change there, and is instead more likely caused by upstream changes to xref in emacs trunk, but I haven't diagnosed the cause. Anyway, not sure if this is actually a bug in cider or elsewhere, but thought I would mention it here if someone else had the same problem.#2023-05-2611:14mkvlri have a macro that’s like a def except adding the ability to define var meta not on meta of the name name of the def but also after the name so (def my-var "docstring" {:var :meta} ,,,). Can I teach cider to indent like a def and give it the (italic in my theme) docstring treatment?#2023-05-2612:29OknoLombardaYou can change indentation of macro via https://docs.cider.mx/cider/config/indentation.html#dynamic-indentation, e. g.
{:style/indent 1}
As for docstring treatment, I believe you'll have to do it by extending https://github.com/clojure-emacs/clojure-mode#font-locking, like so
(put '>defn 'clojure-doc-string-elt 2)
#2023-05-2812:29pavlosmelissinosCan CIDER tell if a namespace/symbol is "dirty" (i.e. the version on the disk is different from the one loaded in the REPL)?#2023-05-2813:07practicalli-johnYWhen evaluating def and defn a mark is placed in the margin. If the code is changed, the mark is automatically removed. I've never looked to see if ns form behaves the same, but I assume it should.
Depending on theme, the margin mark may not be that obvious#2023-05-2813:21pavlosmelissinosOh, you're right, I've noticed it but never put 2 and 2 together! Thanks!#2023-05-2912:00simonkatzHah, I’ve just been reminded about the evaluation fringe indicators.
They’re obviously useful, but I think I would get more benefit from them if (1) an indicator was used to show code that has been changed without being re-evaluated (rather than code that has been evaluated), and (2) the indicator extended to every line of the form (rather than just the first line).
The display would be unobtrusive for evaluated code (no fringe), and would alert you to unevaluated code even when the first line of the form was beyond the top of the window.
If there’s any interest:
• I can create a ticket. Perhaps two separate options, one to change when the indicator is shown (and I guess change the colour of the indicator, to red perhaps), and another to extend the indicator to highlight the whole form. Perhaps that should be two separate tickets.
• I’d be happy to have a go at this myself, but probably not in the immediate future.#2023-05-2916:47practicalli-johnThere are previous Cider issues on this subject which seem relevant.
I agree the current form is subtle, although the subtle approach helps avoid interference with other markers that use the gutter, e.g. git-gutter, etc..
Original issue: https://github.com/clojure-emacs/cider/issues/2748
Follow-on issue (examples of gutter conflicts) https://github.com/clojure-emacs/cider/pull/2924#2023-05-2918:29simonkatzAh, right. There’s more to think about than I realised. I won’t create that ticket after all.
Thanks.#2023-05-3115:42Matthew OdendahlIs there any way to show the evaluation fringe indicators in the terminal?#2023-06-0118:07vemvAt least in my emacs/cider, when I jump to definition of a Clojure source located in a .jar, I can M-x undo and the buffer will become empty. Which makes no sense for a buffer in read-only-mode.
This can interfere with muscle memory. Can y'all reproduce?#2023-06-0118:13Omarjust tried, doesn't work for me#2023-06-0118:19vemvThanks for your time cider !#2023-06-0314:07mister_mSort of a weird issue but I am noticing that I am consistently unable to cider-jack-in when my laptop battery is low. There is some kind of nREPL sync step that seems to fail consistently. I don't feel like it is a specific cider issue but I am curious if anyone else has experienced this sort of thing#2023-06-0316:22vemvI have no idea, but if I had to take a wild guess, I'd look into whether the OS throttles CPU, which slowness might cascade into a timeout being triggered?
If you use Lein, make sure to increase :timeout. Its default often bites people#2023-06-0316:56mister_mVery likely there is some kind of "power mode" setting at play in my gnome fedora install during low battery times. "Automatic power saver" I think it is called#2023-06-0600:53mister_mI seem to get a java.lang.NullPointerException whenever I quit the step debugger - is that expected? The message is " Cannot invoke "java.lang.Thread.stop()""#2023-06-0601:44Colin (fosskers)This often happens upon pressing q yeah#2023-06-0606:03vemvFeel free to open an issue#2023-06-0606:03Colin (fosskers)Will do, thanks#2023-06-0607:42Colin (fosskers)https://github.com/clojure-emacs/cider/issues/3350#2023-06-0612:16mister_mThanks Colln#2023-06-0619:53mister_mIn the step debugger, am I able to prevent the debugger from previewing the values of objects? I sometimes have maps that are quite large and it just reads as line noise to me to see something large previewed inline. I’d be fine inspecting locals instead #2023-06-0710:19jmckitrickWhere is the variable that controls how/when the REPL is cleared after it fills with output? I’ve checked cider and nrepl, and cannot find it.#2023-06-0710:21tomdcider-repl-buffer-size-limit?#2023-06-0807:00bozhidarFYI - https://docs.cider.mx/cider/repl/configuration.html#auto-trimming-the-repl-buffer#2023-06-0919:37jmckitrickIs this the one that seems to clear the window, but if you scroll up, all the content is still there?#2023-06-0812:03rolthello, I'm having an issue in a cljs cider-repl buffer (I haven't encountered it in a clj repl): after a while, smartparens functions stop working properly: sp-kill-word will kill the word fine, but also move my cursor to the beginning of the line (before the *ns*> "prompt") and the message "Text is read only" will show up below. I have to run cider-repl-clear-buffer and then everything works fine again (until the problem re-appears). I'm using smartparens-strict-mode in cider-repl buffers
I'm using doom emacs, I can't remember if I had it when I was using regular emacs
I feel like it's more of a smartparens issue than a cider issue (when buffer gets too large ?), has anyone encountered this issue ?#2023-06-0812:15practicalli-johnUsing the cider repl buffer is not going to be as effecitve as using the source code buffers, especially if logs, long lines or lots of content is pushed to the repl buffer.
Perhaps there is a size limit set on the repl buffer, usually via the Cider variable, e.g. cider-repl-buffer-size-limit 100#2023-06-0812:16practicalli-johnAlso suggest setting cider-repl-display-help-banner nil to reduce the size of the repl buffer, to avoid slowdown#2023-06-0812:20roltthanks i'll try to set cider-repl-buffer-size-limit and see if it works#2023-06-0812:24practicalli-johnNote that I do not use the REPL buffer, so 100 is a very low number. I think the default is something like 1000#2023-06-0812:25roltIt was nil for me, only history size limit was set#2023-06-1212:48jmckitrickShould cider offer to re-use old clj connections, as well as old cljs connections?#2023-06-1306:52bozhidar@jmckitrick It should be doing it even now.#2023-06-1310:04jmckitrick@bozhidar That’s what I thought, I it seems like it did it before. But it’s only doing so with cljs connections. :thinking_face:#2023-06-1518:36yuhanI've noticed this too recently... just did some digging and it looks like a regression introduced here
https://github.com/clojure-emacs/cider/commit/4004862521836ad613c26dc6a3e8ba94c68a229e#2023-06-1518:47yuhansubmitted an issue https://github.com/clojure-emacs/cider/issues/3353#2023-06-1910:38jmckitrickExcellent, nice work! I thought for sure it was just some weird combination of settings I had.#2023-06-1314:22jpmonettashi everybody! Is there a way of adding jack-in extra middlewares only for a specific projects? (like some .dir-locals magic). The thing is that I have a dubugging middleware that I can add to cider-jack-in-nrepl-middlewares, the problem with doing that globally is that jacking in to projects that don't contain that middleware dependency will fail.#2023-06-1314:59dakraYou can pass a predicate to cider-jack-in-nrepl-middlewares.
E.g. I have this in https://github.com/dakra/dmacs/blob/aae23978b67c7e41c26b80ae7fe9162c08511405/init.org?plain=1#L5324-L5339 to automatically add reveal oder shadowcljs middleware depending if I have a :reveal or :cljs alias set (via dir-locals).
(defmacro -cider-check-alias-fn (alias)
"Return predicate function that check if cider contains alias string ALIAS."
`(lambda (&rest _)
(or
(and cider-clojure-cli-aliases
(s-contains? ,alias cider-clojure-cli-aliases))
(and cider-clojure-cli-global-options
(s-contains? ,alias cider-clojure-cli-global-options)))))
;; Inject reveal middleware in cider-jack-in when the `:reveal' alias is set
(add-to-list 'cider-jack-in-nrepl-middlewares
`("vlaaad.reveal.nrepl/middleware" :predicate ,(-cider-check-alias-fn ":reveal")))
;; Inject shadowcljs nrepl middleware in cider-jack-in when the `:cljs' alias is set
(add-to-list 'cider-jack-in-nrepl-middlewares
`("shadow.cljs.devtools.server.nrepl/middleware" :predicate ,(-cider-check-alias-fn ":cljs")))#2023-06-1315:57jpmonettasoh interesting, thanks#2023-06-1410:54jpmonettasHi! I'm trying to use the cider debugger with evil-mode but evil is capturing the debugger minor modes keys. I see there is evil-emacs-state-modes for modes you want evil to automatically go to normal emacs, but it doesn't seem to work for minor modes like the cider debugger. Any ideas?#2023-06-1412:48tomdI think the best approach is to use https://github.com/emacs-evil/evil-collection/#2023-06-1412:54tomdOtherwise you can bind the keys back to their original definitions by using evil-define-minor-mode-key with a list like what they have https://github.com/emacs-evil/evil-collection/blob/97a57c91d200a278d0bf91199e2eae45f7d875b0/modes/cider/evil-collection-cider.el#L101-L113#2023-06-1412:55jpmonettasoh that is interesting#2023-06-1412:55jpmonettasthanks a lot#2023-06-1415:05tomdOne other approach:
(defun emacs-state-cider-debug ()
(if cider--debug-mode
(evil-emacs-state 1)
(evil-force-normal-state)))
(add-hook 'cider--debug-mode-hook 'emacs-state-cider-debug)#2023-06-1415:06jpmonettasthanks!!#2023-06-1717:59hugodIn cider-nrepl, how does one pass cider-print-options so that *print-readably* is set to nil? Using ("print-readably" nil) results in *print-readably* being set to [].#2023-06-1904:18yuhanAs far as I'm aware that's a limitation with the nrepl protocol - see https://github.com/nrepl/nrepl/discussions/275#discussioncomment-2790176 and the linked issues#2023-06-1914:46hugodThanks for the pointer. As this is a limitation of nrepl at the moment, it seems that this could be considered a bug in cider’s implementation of print options.#2023-06-1901:06DeepReef11I'm trying to eval a line from the buffer but no keybinding seems to work. I'm in doom emacs, Cider is connected to my logseq plugin and I am able to send a command that works when I type it. But when I'm in the .cljs buffer, I haven't found anything that can eval that same command. In vim iced, I could do that with <leader> e e.#2023-06-1904:13yuhanAre you at the REPL buffer or a source file?#2023-06-1911:37DeepReef11Source file (.cljs)#2023-06-1913:50yuhanIs it just a keybindings issue? Check if manually calling M-x cider-eval-defun works and if cider-mode is enabled#2023-06-1913:52yuhanYou can also describe-function (`C-h f` ) to find out what keys a command is bound to#2023-06-1915:49DeepReef11My cursor is on the '(' character. if I yank ( y y ) and paste in the window below, it works. But if I do M-x , cider-eval-defun-at-point, it does nothing. I also tried cider-mode (disable then enable), it doesn't change anything#2023-06-1916:12DeepReef11I also have this warning which doesn't seem to correspond to anything when I click on "More Information", plus I don't see why the connect would work and execute command but would not work in the buffer
WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!#2023-06-1916:12DeepReef11So I suspect it is not related to my problem#2023-06-2012:10DeepReef11THere's a command (that I already forgot, need to find it back) that when I do it in the .cljs file, it says I'm not connected to a REPL, but I launched cider-connect-cljs from there and the repl under works (the command says it is connected in that window). What am I doing wrong?#2023-06-2018:12DeepReef11Ok, so I've been able to use cider-jack-in-cljs with logseq. But when I open a cljs file in the project and try to run any cider-eval, nothing happens. But yank and then copy into the mini buffer works. How to connect the mini buffer repl to the currently editing cljs?#2023-06-2018:20vemvDo you mean by "mini buffer repl"...?
• https://www.gnu.org/software/emacs/manual/html_node/emacs/Minibuffer.html ?
• the cider repl, which looks like this...?
#2023-06-2018:23DeepReef11This at the bottom#2023-06-2018:31vemvI'm not sure what that is. What does M-: (buffer-name) say?#2023-06-2018:46DeepReef11What's that command? I tried to type it but I end up in an eval prompt#2023-06-2018:48DeepReef11I tried to find a buffer-name command with M-x but didn't find it#2023-06-2018:51DeepReef11The title in the title bar (where minimize and close buttons are) I have this written:
*Cider repl (folder of the project)#2023-06-2018:52DeepReef11In the above pane, I simply have the file name#2023-06-2019:01vemvyeah M-: evaluate one elisp sexpr https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html#2023-06-2019:01vemvSo, it seems it simply is the cider repl :)#2023-06-2019:03vemvSo does absolutely nothing cider-related work in the cljs file buffer? Is cider-mode enabled?#2023-06-2019:10vemvAnother thing you can try is M-: (cider-current-repl) from your cljs file buffer, and check if the cljs (not clj!) repl name is returned#2023-06-2019:57DeepReef11I get nil for cider-current-repl#2023-06-2019:58DeepReef11While the window below gives me cider (as expected)#2023-06-2019:59DeepReef11If I run cider-mode, it says disabled, then rerun again, enabled, but still not working with the repl#2023-06-2020:01DeepReef11So just to be sure I'm not doing anything wrong, I'm in the cljs buffer, I press M-x then type cider-eval-defun... then RET .#2023-06-2020:02DeepReef11Then it tells me I can run that command (that didn't do anything) with its shortcut. When I try the shortcut (SPCE m e d) it acts as if it wasn't bound to anything (I get SPCE m e d typed in the bottom bar)#2023-06-2020:28vemvMmm, I can't diagnose that off my head atm
It's worth noting that not all CIDER functionality works in clojurescript. But some basics like repl or autocompletion certainly work.
It might help to create an minimal project following some template? For instance https://docs.cider.mx/cider/cljs/overview.html has Figwheel and shadow-cljs sections.
If after following those steps you still get the same issues, a github issue would be most welcome#2023-06-2021:42DeepReef11So I tried something different. This time I tried eval within the mini buffer where the repl works. I get the same results as in the cljs buffer, it simply doesn't work. I'm using doom emacs, do I have to enable other things than the clojure langage?#2023-06-2021:42DeepReef11I suppose that if I have access to cider commands, it shouldn't be the installation at fault though#2023-06-2022:02vemv> I suppose that if I have access to cider commands, it shouldn't be the installation at fault though
It depends, because there are a few ways of obtaining cljs functionality (shadow, figwheel, variations thereof). And some aspects could be polished CIDER-side even for a correctly setup project/emacs.
I'd recommend querying the #C0617A8PQ archive for clojurescript issues (particularly for your shadow/figwheel choice). Github as well (cider, and doom repos)
As mentioned, if after that you still can't get a working setup, a detailed GH issue would be welcome. The more details the better.
The good news is that we have a specific plan to improve the cljs side in the next few months!#2023-06-2115:32DeepReef11Ok thanks, there it is:
https://github.com/clojure-emacs/cider/issues/3357#2023-06-2113:11bozhidarWe've started to make some plans for CIDER 2.0 - you can follow them here https://github.com/clojure-emacs/cider/issues/3356 I expect one final CIDER 1.x release before we start working on some more ambitious changes for CIDER 2.#2023-06-2116:15Eric ScottI recently encountered a problem the details of which I posted here: https://clojurians.slack.com/archives/C03S1L9DN/p1687360555858089.
After fiddling a bit, it appears that there is a minimal pair between invoking clj -M:test -m cljs.main --repl-env node (which works) and doing the equivalent in cider.#2023-06-2116:22Eric ScottThe basic problem seems to be that the method dispatch is missing on the value of cljs.compiler/emit-constant*, searching for a tagged literal under ont_app.vocabulary.dstr/DatatypeStr, but listed in the methods for emit-constant as ont-app.vocabulary.dstr/DatatypeStr. So somewhere something about the method resolution is not taking the _/- thing into account. There are more details at the link above, but this does only appear to be happening in cider. I'm using shadow-cljs also, if that might make a difference (sorry, don't do a lot of cljs, but I'm trying to support it with the library I'm writing).
Can anyone shed some light on what might be happening differently in these two environments that might explain the difference in behavior? What can I do to gain visibility into this?#2023-06-2302:29Drew VerleeWhen i connect to my shadow-cljs apps nrepl server using calva, I can eval expressions and see the output, when i do so in emacs (cider-connect-cljs), nothing happens. No errors in the message buffer.
any advice would be welcome 🙂#2023-06-2306:37vemvSomeone had a similar issue a few posts above, so I'll check if everything keeps working in a vanilla project following the official instructions#2023-06-2314:24DeepReef11If you're talking about me, it works in the minibuffer but not in the cljs file (so it does connect properly). I think adding the dependencies as mentionned in the cider documentation in shadow-cljs.edn made cider connect work. But for me, I can't go in a cljs file and eval from there, it won't work for some reasons#2023-06-2314:25DeepReef11In my case, it wasn't working with calva either. I mean, I was able to connect with cider to calva from vscodium, but still not able to eval from cljs file#2023-06-2315:22vemvYeah I was talking about you. I'll try to investigate the issue you created.
Thanks for it wasn't working with calva either. Please add that to the GH issue#2023-06-2421:34vemv@U0DJ4T5U1: I created https://github.com/reducecombine/shadow-cljs-cider-demo just now since I see reports like yours all the time in #cider sadly 😞
But the thing is it works! It's fairly simple/minimal, I followed cider/shadow-cljs doc and grabbed a bit from metabase's shadow-cljs.
It has a simple readme.
Note that I'm using cider-connect-cljs. connect* variants tend to be easier to debug.#2023-06-2421:41Drew VerleeThanks, I'll take a look.
If i start the nrepl server from the command line, so i need to add any nrepl middle ware or deps to run cider jack in cljs?#2023-06-2421:42vemvYou do. In my repo, the middleware is already defined in shadow-cljs.edn#2023-06-2421:44Drew VerleeI'll go check to see if that got removed... Hmmm#2023-06-2615:05Drew VerleeThe issue, not being able to see the output of the evaling an expression, was fixed by using the shadow-cljs.edn middlware cider.nrepl/cider-middleware and refactor-nrepl.middlware/wrap-refactor.
We had removed wrap-refactor at some point, but i thought it was working after that, maybe not.
I think my confusion is understanding the full necessary set of deps and middlware to make shadow cljs and nrepl happy.
Then understanding the ideal place to declare this. Ideally, unless someone wants to convince me otherwise, editor dependencies are up to the developer and so shouldn't make their way into the project.
So that's a point against putting it in the shadow-cljs.edn. Though I'm happy to bend with the wind here, as long as my sails go in the right direction. ⛵
But it looks like the shadow docs imply nprel middleware can go in the ~/.nrepl/nrepl.edn. So i'll put it there.
But where else can it go? I have a .clojure deps.edn that has an alias that i have been using for shadow projects for quite a while that injects the middleware
:cider-cljs
{:extra-deps {cider/cider-nrepl #:mvn{:version "RELEASE"},
cider/piggieback #:mvn{:version "RELEASE"},
nrepl/nrepl #:mvn{:version "RELEASE"},
refactor-nrepl/refactor-nrepl #:mvn{:version "RELEASE"}},
:main-opts
["-m" "nrepl.cmdline" "--middleware"
"[shadow.cljs.devtools.server.nrepl/middleware,refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
are all those extra deps necessary? would it be possible to use this alias to launch my shadow client from the cli? THat's what i was doing before, that plus another alias :shadow-cljs
clj -M:cider-cljs:shadow-cljs run web3.build/watch -- staging
:shadow-cljs
{:main-opts ["-m" "shadow.cljs.devtools.cli"]}
can you even chain two main-opts values? like that?#2023-06-2615:06Drew Verleeyou can but only the last will be used, as per the docs.#2023-06-2615:42vemv> The issue, not being able to see the output of the evaling an expression, was fixed by using the shadow-cljs.edn middlware cider.nrepl/cider-middleware and refactor-nrepl.middlware/wrap-refactor.
Nice! FWIW I don't think refactor-nrepl makes a difference. But the cider middleware is of course essential.
You should get a warning when it's absent - did you not? (Yesteday I that experiment. I got the expected warning)
The key part is: make sure cider-nrepl is in the classpath. Actually, shadow-cljs adds the cider middleware to the middleware stack if it can find it in the classpath#2023-06-2615:43vemv> are all those extra deps necessary?
piggieback is not, beyond any doubt.
I also would question nrepl/nrepl. shadow-cljs has its own repl server, so it has to depend on it
refactor-nrepl... only if you intend to use it (we're currently working on very nice ,cljc completions for cljr-slash , btw)#2023-06-2615:44vemvFor your scenario, it seems nice to create a :shadow-cider alias. Then users can opt in to activate it like this:
> You may also specify additional aliases via the command line using -A, eg. shadow-cljs -A:foo:bar ….
(copied verbatim from https://shadow-cljs.github.io/docs/UsersGuide.html)#2023-06-2615:51vemvThe docs also talk about .nrepl.edn , that seems the expected place to define project-specific middleware. You'd gitignore that for not affecting other users#2023-06-2619:10Drew Verlee> You should get a warning when it's absent - did you not?
I got no error at the terminal or the messages buffer.#2023-06-2619:12Drew VerleeWe were on a much older version of shadow, then we updated, i thought the repl was working after the update, but maybe not.#2023-06-2619:14Drew VerleeI think i'm confused about the role of the middleware, it seems like you have to have given some dependencies, but at the same time, i have to manage it but putting it in the nrepl.edn. What is the flexibility getting me? hmm it says shadow does add the nrepl middleware...#2023-06-2619:22Drew Verleemaybe that doesn't happen if you use deps. Maybe i should stop using deps for this project. i'm not sure its helping, this is the first time it's been an annoyance though.#2023-06-2619:27vemv> I got no error at the terminal or the messages buffer.
It;s printed at the repl IIRC. I checked just yesterday#2023-06-2619:28vemv> I think i'm confused about the role of the middleware, it seems like you have to have given some dependencies, but at the same time, i have to manage it but putting it in the nrepl.edn.
I have trouble parsing this#2023-06-2619:30Drew VerleeI got nothing in the repl either, but i'm not sure that's interesting.
> I think i'm confused about the role of the middleware, it seems like you have to have given some dependencies, but at the same time, i have to manage it but putting it in the nrepl.edn.
Sorry, that was poorly worded. Ill give an example or say nothing at all 🙂
My current headscratcher is this
clj -M:shadow-cljs-cider:shadow-cljs run web3.build/watch -- staging
[2023-06-26 14:27:30.298 - WARNING] :shadow.cljs.devtools.server.nrepl/middleware-fail - {:sym cider.nrepl/cider-middleware}
FileNotFoundException Could not locate cider/nrepl__init.class, cider/nrepl.clj or cider/nrepl.cljc on classpath.
given this alias
:shadow-cljs-cider {:extra-deps {cider/cider-nrepl {:mvn/version "RELEASE"}
refactor-nrepl/refactor-nrepl {:mvn/version "RELEASE"}}}#2023-06-2619:33Drew Verlee^^ it seems i also have the middleware key and values in my shadow-cljs.edn.#2023-06-2619:34Drew Verlee:middleware [cider.nrepl/cider-middleware
refactor-nrepl.middleware/wrap-refactor]
#2023-06-2619:35vemvheadscratcher indeed. That enters into #shadow-cljs support territory. I've done all my testing using the shadow-cljs npm executable
For emacs/cider purposes, I'd suggest using said executable and a minimal project (follow the official doc or clone https://github.com/reducecombine/shadow-cljs-cider-demo). That way you'll make sure it can work
Hope it helps!#2023-06-2619:38Drew Verleethanks vemv.#2023-06-2421:04vemvCan I get cider to not prompt me for a host and port when connecting?
It's smart enough to understand RET RET with blank inputs, and detect the port from e.g. the shadow-cljs port file, but RET RET still feels like unnecessary friction.#2023-06-2512:19yuhanOh I have exactly this in my personal tweaked version of cider, could extract it into a PR#2023-06-2512:21yuhanYeah, it's literally a (defvar-local cider-connect-default-params nil)
and then splicing it into the cider-connect-clj thread-first form.#2023-06-2512:23vemvNice! Looking forward to a PR#2023-06-2512:23yuhanThen in a .dir-locals.el for a project I specify:
((clojure-mode
. ((cider-connect-default-params . (:host "localhost" :port 2171)))))
#2023-06-2512:25vemvAn important part would be the ability to specify :port :detect , detection is important, and probably nil would translate to "prompt", not "detect"#2023-06-2512:26yuhanhmm, might be a different workflow than what you suggested above - this leans more explicit / user would have to specify the same port twice in the shadow edn file and the dir-locals, which seems like a reasonable amount of "magic"#2023-06-2512:29yuhanRight, a non-default :detect option would probably be nice for those who opt in to it - probably complicates the implementation a little#2023-06-2512:30vemvYep
shadow-cljs already writes its port to a well-known file that CIDER is aware of.
So :detect would simply tell CIDER to try reading that file#2023-06-2512:30vemvI agree that there are possible complications, e.g. for a clj + cljs project type (two repls, to connections to be performed), the right port would have to be detected for each context#2023-06-2512:30yuhanis that the standard .nrepl-port in the project root?#2023-06-2512:31vemvIt also checks .shadow-cljs/nrepl.port#2023-06-2512:34yuhanHmm yeah, again I haven't used cljs besides poking around with it 2 years ago, so very aware that a lot of these 'tweaks' are not as generalized as they could be, or I'd have turned them into PRs#2023-06-2512:34vemvhttps://github.com/clojure-emacs/cider/blob/1367b25eb38b74bd9f87c763d5631d602b7161ae/nrepl-client.el#L233-L246
these functions have no clj/cljs awareness so it could be a pretty involved change... maybe it's not the right time to work on this (I have Sesman on the radar atm)#2023-06-2512:37yuhanIn any case I could push my "naive" clj-only commit as a draft PR or in a quick issue, would that be helpful or just create repo noise#2023-06-2512:39vemvFeel free to!#2023-06-2814:02frozenlockWhen running tests with CIDER shortcuts, is it possible to make it ignore some or all of the ns fixtures?
I have small fixture that prints untested public functions, but unfortunately it's currently also used when calling cider-test-run-test (run the test at point) 😕#2023-06-2814:08frozenlockPerhaps there's something that could be leveraged from the lein :test profile instead... :thinking_face:#2023-06-2814:41frozenlockHa! I can define something via profile injection and dispatch on that without even touching CIDER.#2023-06-2900:52Colin (fosskers)TIL: you can cider-undef on a defonce in order to be able to rerun/redefine it in the current REPL session without needing to restart the whole REPL#2023-06-2912:56SturmI've seen someone bind a keyboard shortcut in Cursive to call a clojure function eg. (reload) to reload a web server process during local development. Is that something I could do in cider?#2023-06-2913:15dakraSure. A simple solution would be something like
(define-key cider-mode-map (kbd "<f12>") (lambda () (interactive) (cider-interactive-eval "(reload)")))#2023-06-2914:00Sturmthanks @UFAP0C8KU!#2023-06-2914:10vemvThere's also cider-ns-refresh#2023-06-2914:52jpmonettas@UDE7BJK1N here https://www.youtube.com/watch?v=2nH59edD5Uo&t=2289s I'm demoing a "dev menu" I create for my projects. This is a way of binding a key to show a menu per project with different key actions for that project, like reload, start webserver, clear a chache, calling profilers, etc. You can see the code here https://github.com/jpmonettas/elisp-utils/blob/master/clojure.el#2023-06-2921:18Sturmthanks @U45T93RA6 and @U0739PUFQ!#2023-06-2920:46ennDo folks feel like this is a bug?
user> (list 'var 'foo)
#'foo
Compare to bare Clojure REPL:
user=> (list 'var 'foo)
(var foo)
#2023-06-2920:54dpsutton100% a bug.#2023-06-2921:14Alex Miller (Clojure team)#'foo desugars to (var foo) so these are equivalent semantically, the question is what the printer does for a var I think. Clojure's printer re-sugars back to var quote, and I assume something in cider is making a different choice there. it's different, but not sure it's a bug?#2023-06-2921:16dpsutton(list 'var 'foo) should never get identified with any foo vars right? It seems an unequivocal bug if CIDER is identifying the symbol foo in the form (list 'var 'foo) with a var of that name, right?#2023-06-2921:17Alex Miller (Clojure team)no?#2023-06-2921:18phronmophobicWhat does (deref foo) print?#2023-06-2921:19vemvI would guess that cider's #' formatting tries to accomplish something that Clojure lacks by default. Without an example of that feature it's harder to assess if the bug can be fixed#2023-06-2921:19enn@U7RJTCH6J it throws because it’s not actually a var.#2023-06-2921:19phronmophobicoops. I meant (list 'deref 'foo)#2023-06-2921:19ennI’m not sure if it’s a bug either, but I think the behavior of the standard Clojure printer is better because it makes clear that I’m looking at a list and not a var.
I ran into this today because my code was throwing trying to call one of these things, and I was looking at it in the REPL and thinking it was a var, because CIDER prints them indistinguishably.#2023-06-2921:20Alex Miller (Clojure team)(list 'var 'foo)
at the repl is evaluating that list. var is a special form that returns a var. the repl is then printing that var. the default printer re-sugars vars to print them as var quotes, #'foo. But the printer is open and you could print vars as (var foo) and it means the same thing.#2023-06-2921:20enn@U7RJTCH6J that also throws because it’s not actually a var, it’s just printing like one. it’s a list so it throws class clojure.lang.PersistentList cannot be cast to class java.util.concurrent.Future#2023-06-2921:23ennthere is no actual var foo here in this example. Just the list ('var 'foo) . which might evaluate to a var, but it’s not being evaluated, it’s just a list of symbols.
user> (list 'var 'foo)
#'foo
user> (type *1)
clojure.lang.PersistentList
#2023-06-2921:23Alex Miller (Clojure team)oh right, I am confusing myself here#2023-06-2921:23Alex Miller (Clojure team)then yes, I agree it's a bug :)#2023-06-2921:23phronmophobicuser> (list 'deref 'foo)
(deref foo)
For both cider and the clojure cli repl.#2023-06-2921:25ennoh, sorry @U7RJTCH6J, I misread, I thought you were asking about (deref (list 'var 'foo)). Yes, lists with other symbols render normally, only lists of length 2 with 'var as the first value render in this confusing way AFAICT.#2023-06-2921:27phronmophobicThe reason I ask:
> (= '@foo (list `deref 'foo))
true
clojure cli:
user=> (list `deref 'foo)
(clojure.core/deref foo)
cider:
user> (list `deref 'foo)
@foo
#2023-06-2921:28phronmophobicand with var:
user> (= '#'foo (list 'var 'foo))
true
#2023-06-2921:30phronmophobicuser> (= ''foo (list 'quote 'foo))
true
clojure cli:
user=> (list 'quote 'foo)
(quote foo)
cider:
user> (list 'quote 'foo)
'foo
#2023-06-2921:33phronmophobicI assume you probably get a similar result for some other sugars like ~ and ~@ .#2023-06-2921:36dpsutton(-->
id "35"
op "eval"
time-stamp "2023-06-29 16:34:07.272187000"
code "(list 'var 'foo)"
ns "user"
)
(<--
id "35"
value "#'foo"
)
it’s some bug in the printer.
user> (list 'var 'foo)
#'foo
user> (type *1)
clojure.lang.PersistentList
#2023-06-2921:37enninteresting that for deref it behaves differently depending on whether the symbol is namespaced or not, but not in these other examples#2023-06-2921:39phronmophobicJust checked. deref behaves similarly to ~, but cider doesn't re-sugar ~@.#2023-06-2921:41phronmophobicI think the reason deref must be namespaced is just based on the how the reader desugars @foo and ~foo. Those desugar to the fully qualified functions, deref and unquote while var and quote are special forms that can't be fully qualified.#2023-06-2921:43phronmophobicFun fact, afaik (var foo) always refers to the special form even if you try to make a local binding:
user> (let [var (constantly 42)]
(var 10))
Syntax error (ClassCastException) compiling var class java.lang.Long cannot be cast to class clojure.lang.Symbol (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.Symbol is in unnamed module of loader 'app')#2023-06-2922:21hifumi123one of the consequences of being a lisp-1 instead of a lisp-2#2023-06-3014:57mkvlris there a way to set sesman-link-with-directory using a .dir-locals.el?#2023-06-3015:04mkvlrI think this works ((clojure-mode . ((default-directory . ",,,")))) . Not sure if this is too general / breaks other stuff.#2023-07-0307:08bozhidar@mkvlr I'm afraid you'll have to dig into sesman's implementation, as I barely remember any of the code there.#2023-07-0307:08bozhidarThe Source is still strong with CIDER & Emacs:#2023-07-0308:57SamI can't get the deps.edn dev alias working with CIDER.
This is the alias:
:dev {:extra-paths ["dev"]
:extra-deps
{org.clojars.abhinav/snitch {:mvn/version "0.1.14"}}}
If I run clj -A:dev in a terminal I can import snitch:
user=> (require '[snitch.core :refer [defn* defmethod* *fn *let]])
nil
However, when I start the repl through CIDER I get not found in classpath.
I set this: (setq cider-clojure-cli-parameters "-A:dev") but it didn't fix it.
I also tried running C-u cider-jack-in and appending -A:dev but same result.
Anything else to try?#2023-07-0309:11jkxyzThe option to add an alias to the jack-in command is cider-clojure-cli-aliases: https://docs.cider.mx/cider/basics/up_and_running.html#clojure-cli-options#2023-07-0309:27SamPerfect, thank you!#2023-07-0315:34practicalli-johnOnly the alias name is required, i.e. :dev, not the execution option, i.e. -A (which is stripped from the argument within the cider code.
Further examples at:
https://practical.li/spacemacs/clojure-development/project-configuration/#2023-07-0613:39SamThank you!#2023-07-0503:53didibusIs there a command in Emacs/Cider to get the jack in command. I've realized I prefer to run the nRepl at the command line, so if I eval something too big, or run in an infinite loop, I have a way to kill it and not crash Emacs.
Now I jack in, close the repl, copy the command in Message buffer. Which is a bit long#2023-07-0504:25Colin (fosskers)Yes#2023-07-0504:25Colin (fosskers)cider-connect-clj#2023-07-0504:25Colin (fosskers)SPC m c in Doom#2023-07-0504:27Colin (fosskers)It'll ask you where your nrepl is running (localhost + some port) and then it'll connect.#2023-07-0504:32Colin (fosskers)For quick (babashka) scripts that don't belong to a project, you can run a quick bb nrepl-server in the terminal, and then connect to localhost:1667 via Cider and hack away.#2023-07-0505:08bozhidar@U0K064KQV Interrupt doesn’t work for you?#2023-07-0505:08bozhidarThere’s no dedicated command that would just spit the command-line string, but I was thinking a few times in the past that might be kind of useful.#2023-07-0506:05didibusInterrupt hasn't been reliable. I think sometimes it's already reached Emacs, trying to display too much, and it all gets laggy.
Also I've been in situations where interrupt didn't seem to work for some infinite-ish loop#2023-07-0506:06didibusAnd to be honest, I enjoy being able to restart Emacs and not lose my repl as well.
So ya, such a command would be great, because finding the right combination of nrepl and cider and all to inject is hard otherwise#2023-07-0506:07bozhidarInteresting. With streaming output/values it should work pretty much always, but we're not really using streaming values in the source buffers as it's a bit hard to present them there.#2023-07-0506:07bozhidarAt any rate - Java 20 will kill "interrupt", so looking for an alternative makes sense now.#2023-07-0506:11didibusI exclusively eval from source buffers.
Also, sometimes, I don't catch it soon enough, so Emacs is already lagging so much it's not even able to execute the interrupt command#2023-07-0506:11didibusWhat's happening in Java 20 ?#2023-07-0507:20iarenaza@U0K064KQV https://github.com/clojure-emacs/cider/issues/3351#2023-07-0507:39bozhidar@U0K064KQV There was an idea in the past to stream somehow the responses into the source buffers, but the UI there is pretty tricky to get right as you'd have to redraw the overlay on every chunk of result.#2023-07-0509:53didibusAh, that sucks. The new Oracle stewards really love killing useful APIs haha.#2023-07-0510:06didibusI also don't really understand the issue. It was throwing a runtime exception. So does that mean all uncaught exceptions thrown in a thread are unsafe as well?#2023-07-0511:26dpsuttonI almost added this feature a while ago. To grab the exact startup command. It also prints in the repl buffer so you don’t have to go to the message buffer unless you have silenced the welcome splash #2023-07-0511:27bozhidar@U11BV7MTK The problem is you still need to start something just to see the command. #2023-07-0512:26jpmonettas> Is there a command in Emacs/Cider to get the jack in command.
@U0K064KQV I guess you can create something like :
(defun cider-insert-jack-in-command ()
(interactive)
(insert (format "clojure %s" (cider-inject-jack-in-dependencies nil nil 'clojure-cli))))
then it should insert it in your current buffer, where you can then copy#2023-07-0512:42dpsuttonI don’t think so. The command must be created before anything can be started. We just haven’t added the logic#2023-07-0512:44jpmonettas@U11BV7MTK wdym? currently if I run that it gives me the command to paste on the terminal#2023-07-0512:45dpsuttonif that works for you great. I think there are quite a few options in how the statup command gets created that that might miss. jvm opts, aliases, etc. But if that covers your needs then go for it#2023-07-0512:48jpmonettasI mean, I don't use it, just tried that quick hack in case it works for @U0K064KQV , if I run that command it inserts on my buffer :
clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[flow-storm.nrepl.middleware/wrap-flow-storm,refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -Mdev:dev-tools:storm:cider/nrepl
which is everything, not sure what else could I need#2023-07-0512:49jpmonettasjust looked at cider-jack-in and saw that it is using that to create the command (plus some extra encoding stuff if you are in power shell on windows)#2023-07-0512:50bozhidarAnd there are nuances like the use of enrich-classpath that would change quite a lot how this command looks exactly.#2023-07-0512:50bozhidarAnyways, getting the precise command is not complex, it's just something we never bothered to do.#2023-07-0512:50bozhidarThat's enrich - https://github.com/clojure-emacs/enrich-classpath#2023-07-0512:51dpsuttonlooking at the code, a few things in no particular order: that won’t do powershell encoding, is hardcoded to clojure rather than detecting project type, skips the global opts, skips params like “repl :headless :host localhost” for lein, etc#2023-07-0512:52dpsuttoni think we could add a new option to params that runs the normal startup, grabs :jack-in-cmd and the new option to params prevents or short-circuits the code that actually starts the process and puts the jack-in-cmd on the clipboard/kill-ring#2023-07-0512:52dpsuttonthen it would work for all situations and would be exactly what CIDER would have started up#2023-07-0512:54dpsuttonsomething close to
(defun cider-copy-jack-in (params)
"docstring"
(interactive "P")
(let ((params (thread-first params
(cider--update-project-dir)
(cider--update-jack-in-cmd))))
(kill-new (plist-get params :jack-in-cmd))))#2023-07-0520:48didibusShould I open an issue for it?#2023-07-0515:10vemvcider-jack-in-cljs is failing for me with:
Debugger entered--Lisp error: (error "Could not start nREPL server: env: node: No such file or directory\n (\"exited abnormally with code 127\")")
I'm already using (exec-path-from-shell-initialize) - has been untouched for years
I also (conj! exec-path "/Users/vemv/.nvm/versions/node/v18.12.1/bin/") which used to work
Any ideas as for how to make npm/node/npx better available on Emacs?#2023-07-0515:14dpsuttondoes that path for node still exist? Perhaps you’ve updated the node version and that has been removed?#2023-07-0515:15vemvexists - freshly updated + restarted emacs#2023-07-0515:15dpsuttonin eshell try “which node”, or maybe use shell-command-to-string?#2023-07-0515:21vemvthat gave me some ideas, thanks!
I got it working by adding export PATH="/Users/$USER/.nvm/versions/node/v18.12.1/bin:$PATH" to my zshrc. Although ideally I wouldn't have that redundancy, given there's already init code for node.#2023-07-0515:24dpsuttonyeah. you might try to do something that calls which node and then grabs that dir and puts it on your path rather than hardcoding to a particular version. would work after you update the version#2023-07-0519:00bozhidarIf you wanted to monitor your applications logs from CIDER you'll totally love our latest feature https://docs.cider.mx/cider/debugging/logging.html Special thanks to @r0man for making it happen! 🚀 cider#2023-07-0722:19DerekJust started playing around with this. Very cool and great work (as always) 🙂#2023-07-0622:18hifumi123Any idea why C-j does not work with ClojureScript? I can push C-x C-e to evaluate, and it displays just fine in my buffer, but C-j never appends to my buffer#2023-07-0702:25frankWhat do you see if you do a C-h k C-j?#2023-07-0702:30hifumi123C-j runs the command electric-newline-and-maybe-indent (found in
global-map), which is an interactive native-compiled Lisp function in
'electric.el'.
i guess that explains it#2023-07-0710:59vemvℹ️ we've released refactor-nrepl / clj-refactor.el 3.7.1, with @dgtized's priceless contributions.
If you are a cljr-slash fan, you can try its revamped version by customizing cljr-slash-uses-suggest-libspec t .
For instance, if you type priority/ , you will now get .cljc completions when suitable:
#?(:clj [clojure.data.priority-map :as priority]
:cljs [tailrecursion.priority-map :as priority])
There's smart, well-tested logic behind.
This is still beta - feedback welcome!#2023-07-0717:39DeepReef11How to bind key for cider in doom emacs?
I have the following:
(map! :prefix "SPC e"
"e" #'cider-eval-defun-at-point)
But it doesn't work. Plus I think I may need to add something else to make ti works while in clojure file or something.
I want to bind SPC e e#2023-07-0717:57aisamuOn your doom installation folder (usually ~/.emacs.d), go to modules/lang/clojure/config.el for some examples!#2023-07-0718:04DeepReef11Does :localleader means SPC m (by default) ?#2023-07-0718:04DeepReef11Is localleader something defined in doom emacs or specific to cider?#2023-07-0718:04aisamuIIUC, that’s specific to doom#2023-07-0718:05aisamulocalleader is what you get with ,#2023-07-0718:05aisamuleader, SPC#2023-07-0718:06DeepReef11Ok, and spc m is local leader as a mode for keybinding#2023-07-0718:06DeepReef11Not specific to cider#2023-07-0718:07aisamuYup! All major modes have local leaders, also accessible via ,#2023-07-0718:08aisamu(map! (:localleader
(:map (clojure-mode-map clojurescript-mode-map clojurec-mode-map)
"'" #'cider-jack-in-clj
This means that, when clojure-mode is active, , ' will invoke cider-jack-in-clj#2023-07-0718:08DeepReef11So if I want to map spc e e, it would be
(map! :leader
:prefix "e"
"e" #'fx)#2023-07-0718:09aisamuFor leader definitions, you can find examples under modules/config/default/+evil-bindings.el#2023-07-0718:10aisamuIIRC you can just
(map! :leader "e e" #'fx)
#2023-07-0718:10DeepReef11Great it works, thanks a lot!#2023-07-0718:11aisamuBut note that a leader will always be active (i.e. SPC e e will try to invoke cider even if you’re visiting a markdown file)#2023-07-0718:13aisamuIf you’re using the doom module for clojure, that’s already bound for you:#2023-07-0718:13aisamuThis is the output of running SPC h f and typing the search query#2023-07-0718:14DeepReef11Yes I know, I wanted to remap because spc e e makes more sens to me#2023-07-0718:15DeepReef11And if I understand properly, this:
(:map (clojure-mode-map clojurescript-mode-map clojurec-mode-map)
means that it loads the map only when it is clojure?#2023-07-0718:16DeepReef11Oh seems like not... have to find that#2023-07-0718:16DeepReef11I suppose it is because I would need to use the localleader?#2023-07-0718:46aisamuYes, but indirectly. It adds the bindings to those keymaps… which are only active when their respective modes are active#2023-07-0719:52practicalli-johnhttps://github.com/practicalli/doom-emacs-config/blob/main/%2Bclojure.el has lots of examples of key bindings for Clojure
There are other key bindings in +bindings.el file#2023-07-1108:54alexyakushevReposting also here for visibility:) https://twitter.com/unlog1c/status/1678685253127352320#2023-07-1120:38frozenlockI have a huge map with references to other places in the map. Those references are similar to paths. Is there something I can do with CIDER to be able to quickly jump to the reference destination? Something with the inspector and nav perhaps?#2023-07-1121:02vemvHow does a reference look like?#2023-07-1121:06frozenlockIt's a map with enough information to get back to another document from the root of the DB map, but you can consider it's a vector [:some :path].#2023-07-1121:11vemvJumping to "source" (a line) would require some serious rewrite-clj hackery, we don't have such a feature at the moment
But it's a fun thought experiment to imagine how to implement it :)#2023-07-1121:15frozenlockOh I'm sorry, I didn't mean in the source. Just as a way to get the value of the referenced document.
{:ref [:a :b]
...
:a {:b {:title "hello"}}}
If my point is at [:a :b] , is there some magic I could do to get to {:title "hello"}?
I vaguely remember something about clojure navigable, but I don't know if it could apply.#2023-07-1121:16aisamuIIUC datafy/nav could perhaps help you there (maybe not in the exact way you’re expecting), but even then I’m not sure if there’s native cider support to navigate a datafied structure#2023-07-1121:17frozenlockYeah I don't mind adding those implementations to my map and references, but I don't know where I could leverage it in CIDER 😕#2023-07-1121:18aisamuI think I’ve seen a datafied section on the inspector, but I couldn’t find it in the docs so I might have hallucinated it#2023-07-1121:18vemv> Just as a way to get the value of the referenced document.
That sounds more easily at hand. I'd suggest you check out cider-nrepl / orchard for the inspector's basic API.
With that knowledge, you could implement additional middleware that accepted a "path" as an argument
Same applies to https://clojurians.slack.com/archives/C0617A8PQ/p1689108789097459#2023-07-1121:20vemvFWIW I don't think datafy/nav are the solution here... under that approach you'd have two options...?
• Extend clojure's vectors globally
• pollute your map's vectors with metadata
Instead I'd grab [:a :b] with Elisp, edn-encode it, and send it to cider-nrepl as a new op e.g. navigate-to-path#2023-07-1121:22frozenlockThanks, I'll think about that for a little while#2023-07-1200:29jpmonettasone quick hack could be something like :
(defun set-root-map ()
(interactive)
(cider-sync-request:inspect-def-current-val "user" "root-map"))
(defun inspect-reference ()
(interactive)
(cider-sync-request:inspect-def-current-val "user" "current-ref")
(cider-inspect-expr "(get-in root-map current-ref)" "user"))
So you first open the root map in the cider-inspector, and on the inspector M-x set-root-map
Then navigate with normal inspector functions, until you get a reference, so when you have the reference value in the inspector M-x inspect-reference to move the inspector to the reference dest.
Does it make sense?#2023-07-1201:46frozenlockIt does, thanks!#2023-07-1120:53frozenlockWhile I'm in the inspector with maps: is there a way to drill down multiple levels at once? Using enter to go down one level is quite tedious when I have 10 levels to go.#2023-07-1204:59bozhidarCurrently no. Feel free to open a feature request ticket or a discussion, though.#2023-07-1205:00bozhidarIn other news - yesterday marked 11 years since CIDER's first public release (back then the project was named nrepl.el)! 🎂Here's to many more birthdays to come! cider#2023-07-1210:49joost-diepenmaatIs there a way in cider (or clojure-mode or clojure-lsp) to sort map literal entries by key? I.e. i’ve got
{:foo 1
:bar 2
:baz 3}
and I want to get
{:bar 2
:baz 3
:foo 1}#2023-07-1210:52lassemaattaclojure-lsp has a code action for Sort map#2023-07-1211:05joost-diepenmaatAh nice! Thanks.#2023-07-1212:07frozenlockI have this long function I use to sort a bunch of things, including vectors and maps.
It can even deal with comments between lines
(defun me/sort-sexp ()
"Sort sexps between point and end of current sexp.
With multilines sexp, comments and blank lines are considered part of the following
sexp. Comments at the end of a line (after some other content)
are considered part of the preceding sexp."
(interactive)
(save-excursion
(save-restriction
(up-list)
(backward-sexp)
(let* ((map? (looking-at "{"))
(start (1+ (point)))
(end (progn (forward-sexp)
(1- (point))))
(multiline? (< (line-number-at-pos start)
(line-number-at-pos end)))
;; Should really check every line, but the only the first with a sexp should be enough
(one-sexp-per-line? (save-excursion
(goto-char start)
;; Skip start comment, if any
(let ((sexp2-end (progn (clojure-forward-logical-sexp 2) (point)))
(sexp2-start (progn (clojure-forward-logical-sexp -2) (point))))
(< (line-number-at-pos sexp2-start)
(line-number-at-pos sexp2-end))))))
(narrow-to-region start end)
;; Delete last empty line, if any
(save-excursion
(beginning-of-line)
(when (looking-at "[[:blank:]]*$")
(backward-char)
(delete-region (point) (point-max))))
(goto-char start)
(sort-subr nil
(lambda ()
(if (and multiline? one-sexp-per-line?)
(progn (message "forward line")
(forward-line))
(search-forward-regexp "[^:blank:]" nil :no-error)))
;; Move to end of current top-level thing.
(lambda ()
(condition-case nil
(while t (up-list))
(scan-error nil))
;; We could be inside a symbol instead of a sexp.
(unless (looking-at "\\s-\\|$")
(clojure-forward-logical-sexp))
(when (and multiline? one-sexp-per-line?)
;; move past comments at the end of the line.
(search-forward-regexp "$")))
;; Start of record
(lambda ()
(when multiline?
(skip-chars-forward "\r\n[:blank:]")
(comment-forward)
(skip-chars-forward "[:blank:]\n\r[("))
(condition-case nil
(progn (clojure-forward-logical-sexp)
(forward-sexp -1))
(scan-error nil))
nil)
;; End of record
(lambda ()
(clojure-forward-logical-sexp (if map? 2 1)))
(lambda (a b)
(let* ((s1 (buffer-substring (car a) (cdr a)))
(s2 (buffer-substring (car b) (cdr b)))
;; Ignore namespaces for keywords
(s1* (replace-regexp-in-string
"^::" ""
(if (string-match "^::.*/\\(.*\\)" s1)
(match-string 1 s1)
s1)))
(s2* (replace-regexp-in-string
"^::" ""
(if (string-match "^::.*/\\(.*\\)" s2)
(match-string 1 s2)
s2))))
(string< s1* s2*))))
;; Delete starting whitespaces
(goto-char (point-min))
(delete-region (point) (progn (skip-chars-forward "[:blank:]") (point)))
;; Go to the end and insert newline if we end with a comment.
(goto-char (point-max))
(when (nth 4 (parse-partial-sexp (point-min) (point)))
(insert "\n"))
;; Clean superfluous spaces
(when (not multiline?)
(goto-char (point-min))
(while (re-search-forward "\\s-+" nil t)
(replace-match " ")))
;; Fill paragraph
(when (and (not map?) (not one-sexp-per-line?))
(fill-region-as-paragraph start end))))
;; Indent
(let ((end (progn (up-list) (point)))
(start (progn (progn (clojure-forward-logical-sexp -1)) (point))))
(indent-region start end))))#2023-07-1212:07frozenlock[:z
:d
;; comment for :abc
:abc
:e]
Will become
[;; comment for :abc
:abc
:d
:e
:z]
#2023-07-1406:34BenjaminI ended up using zprint for this
(defun mm/zprint-region ()
(interactive)
(save-excursion
(shell-command-on-region (mark) (point) "zprint" (buffer-name) t)))
#2023-07-1210:49joost-diepenmaatI’ve got a whole bunch of these entries#2023-07-1319:07DeepReef11Is there a way to get docstring (or something like that) from function at cursor point?#2023-07-1319:13dpsutton#2023-07-1319:13dpsuttonhttps://docs.cider.mx/cider/usage/cider_mode.html#2023-07-1404:24bozhidarIf you have eldoc mode enabled you’ll also see the docstring automatically in the minibuffer.#2023-07-1319:10Benjaminhttps://faster-than-light-memes.xyz/zappy-cider-eval-overlays.html maybe you will enjoy performance hacks for cider eval overlays#2023-07-1407:10djmlength instead of string-width what does this refer to?#2023-07-1407:17BenjaminA detail in
cider--make-result-overlay
(cider-overlays.el)#2023-07-1407:20BenjaminI am clarifying it in the blog post now. Thanks for the feedback 🙂#2023-07-1404:26bozhidar@benjamin.schwerdtner You reminded me that probably for CIDER 2.0 we should make the use of overlays the default and stop printing results in the minibuffer for efficiency’s sake.#2023-07-1405:22alexyakushevPlease, don't take away the minibuffer! 🙂#2023-07-1405:22alexyakushevOr do you mean to make it toggleable+disabled by default?#2023-07-1405:59didibus> The visual effect of an overlay is the same as of the corresponding text property (see https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html). However, due to a different implementation, overlays generally don’t scale well (many operations take a time that is proportional to the number of overlays in the buffer). If you need to affect the visual appearance of many portions in the buffer, we recommend using text properties.
Are they not slow?#2023-07-1406:33Benjamin@U0K064KQV cider eval overlay is only 1 overlay. We are not using it to color the buffer or something which would be a use case for text properties.#2023-07-1406:45bozhidar@U06PNK4HG It's just a matter of what the default setting should be. Now values are printed twice, which seems like a bad default. There are also option to print only in the minibuffer (which was the original behavior) and only in an overlay.#2023-07-1406:46bozhidarOne big advantage of printing in the minibuffer is that it's easy to track down previous results, and that's also the default evaluation behaviour for most similar tools in Emacs.#2023-07-1409:49hifumi123I dislike output in minibuffer a lot ever since I used CIDER. The text overlay when evaluating is so convenient that every time I return to Common Lisp and use SLY I think "wow I wish this behaved more like CIDER"#2023-07-1409:50Benjamin❤️ cider overlays#2023-07-1410:29hifumi123seriously though, huge thanks to the people who implemented that gratitude #2023-07-1411:54bozhidarI think that was Artur - a fellow Rubyist and a colleague of mine at Toptal. Great engineer!#2023-07-1411:54bozhidarHe's also the author of CIDER's debugger.#2023-07-1412:34didibusCider debugger is GOAT#2023-07-1417:07ennIs there a way to fully disable the CIDER error buffer? and just see the standard printed stacktrace that Clojure itself generates, with no post-processing (ideally in the REPL)#2023-07-1417:09dpsuttonhttps://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration
(setq cider-show-error-buffer nil)#2023-07-1417:09dpsuttonthen you can interact with your repl as you like#2023-07-1417:09dpsutton*e, (pst) etc#2023-07-1417:11ennhmm, that doesn’t seem to affect errors thrown during tests#2023-07-1417:11ennwhich are the main ones I care about#2023-07-1417:12dpsuttonwhat is the behavior like without CIDER? ie in a bare clj repl#2023-07-1417:12dpsuttonerrors in tests aren’t really bound to *e right?#2023-07-1417:15ennThey aren’t bound to *e but I see a helpful, complete stacktrace from a bare clj repl#2023-07-1417:15ennIn CIDER I see this:#2023-07-1417:15enn#2023-07-1417:16ennI remember that I used to be able to click on the exception to see a stacktrace (although often the useful parts were hidden; the exception being shown here is the topmost exception, not the underlying cause). But that hasn’t worked in a long time for me. I can’t interact with this at all.#2023-07-1417:16dpsuttonthat’s CIDER’s custom test runner. What do you see if you run the tests in your repl?#2023-07-1417:17dpsuttoni see what you mean. I suspect this would require a lot of surgery, since it’s CIDER’s own test runner#2023-07-1417:18dpsuttoni think you’ll have to go code spelunking. m-x nrepl-toggle-message-logging can show you exactly what’s coming over nrepl. If it includes the “normal” output, then you can just change the client code in emacs. If that is already customized you’ll have to go diving into CIDER’s middleware#2023-07-1417:19dpsuttonI have a handy function that grab’s a test name and sticks it in a register as (clojure.test/run-test <test-name>) and inserts it in the repl. that might be a workflow you would like#2023-07-1417:19dpsuttonespecially if you stick the namespace on it and use it fully qualified#2023-07-1417:20ennyeah, I was just thinking that’s probably what I want, and then I can just re-bind C-c , t to that#2023-07-1417:20dpsuttonexactly what i do#2023-07-1417:20dpsuttoni stick it in register i for individual and have (clojure.test/run-tests) in register t#2023-07-1417:20dpsutton(defun personal/set-test ()
(interactive)
(if (clojure-top-level-form-p "deftest")
(save-excursion
(beginning-of-defun)
(forward-char 1)
(clojure-forward-logical-sexp)
(clojure-forward-logical-sexp)
(clojure-backward-logical-sexp)
(set-register ?i (s-concat "(clojure.test/run-test " (thing-at-point 'symbol) ")"))
(message "set i register to: %s" (get-register ?i)))
(message "not looking at test")))#2023-07-1417:21dpsuttonhttps://gist.github.com/dpsutton/7556cf1f4ecfc97da7b7e9d6dbf210c6#2023-07-1417:21dpsuttonis how to wire it up with CIDER to send register contents to the repl#2023-07-1417:22dpsuttonnote my personal/set-test doesn’t handle metadata on the test name. so you might need to update it to skip over that stuff if needed#2023-07-1611:20joshchoHow do I disable certain macros from font-locking? I tried
(font-lock-remove-keywords 'clojurescript-mode '("div"))
to no success.#2023-07-1706:37bozhidar@joshcho Keep in mind this won't work if dynamic font-locking is enabled, as the font-lock gets auto-updated to match the known symbols.#2023-07-1720:20frozenlockIs there a print-method or something similar that I can define for a REPL representation of an object that wouldn't impact pr ?#2023-07-2018:39Patrick BrownI can evaluate an expression in a connected shadow-cljs repl buffer, js/alert pops up an alert, all that expected behavior, but if I do eval-last-sexp or similar action in a buffer with a cljs file nothing happens. Anybody know what I’m doing wrong?#2023-07-2018:46Patrick BrownI should probably that this behavior only happens if I don’t have a clj repl connected on a different server.#2023-07-2109:50BenjaminHard to say but it probably has to do with cider-repls which you could trace to see what happens#2023-07-2113:12vemv:male-detective: Informal poll - any clojurescript user finds there's a 'bleeding' (or at least annoying) bug currently present in cider?
(other than the features that have never been present, e.g. running tests)
As a maintainer, I recently checked out again things, and everything worked correctly for me, with shadow-cljs.
I'd say that a certain chunk of bug reports were simply bad setups. We've refined doc here and there recently, to prevent that sort of thing.#2023-07-2113:19frozenlockI've had a bug nagging me for year(s): My cljs Cider REPL doesn't stay in the current namespace. After each evaluation it will jump back to a particular NS.
I'll give it another round of updates in a short while to see if it can solve the issue, but every time I did it previously it didn't solve the issue.
If it rings a bell I would greatly appreciate any insight you might have on the subject.#2023-07-2113:21frozenlock3-4 months ago I also tried converting my projects to shadow-cljs and fighweel-main and it didn't solve the issue. 😕#2023-07-2113:22vemvInteresting, thanks!
> After each evaluation it will jump back to a particular NS.
Just to get an idea, what sort of ns is that? A fixed one? Follows some sort of logic?
Kudos for trying to tackle it directly 🔨#2023-07-2113:31frozenlockI can manually select a ns (ns my.ns). No problem there.
But any time I use cider-repl-set-ns, it will do 1 evaluation and then go back to the previous ns.
Looking more into it, cider-repl-set-ns won't have any effect (switching to a 3rd ns) until my repl reverted back to the previous ns.
Really weird.#2023-07-2113:35bozhidarSounds to me similar to https://github.com/clojure-emacs/cider/issues/3236#2023-07-2113:37frozenlockIt does sound exactly like what I'm experiencing 😮#2023-07-2113:38bozhidarI'm guessing we should probably revert this https://github.com/clojure-emacs/cider/commit/5f705b0a3a0266e4e64bc37016135a6284d2321f, given that no one expressed the desire to work on a better fix.#2023-07-2119:22vemvwe got it https://github.com/clojure-emacs/cider/pull/3376 , thanks for bringing attention to this @U0ERZQ1K2 cider#2023-07-2119:36frozenlockAmazing. Thank you very much!#2023-07-2123:19hifumi123the most annoying bug i face daily is the lack of support for indent metadata in CLJS macros#2023-07-2223:28Drew Verlee@U45T93RA6 cider browse namespace is browsing a different namespace than the one I selected in this project. it always seems to pick the same wrong namespace. So put another way, no matter what ns i pick, it picks this other one.#2023-07-2309:58vemv@U0479UCF48H I got it https://github.com/clojure-emacs/cider-nrepl/pull/785 , to be included in cider 1.8.0
@U0DJ4T5U1 will check out. Does it only happen for cljs namespaces for you?#2023-07-2309:59hifumi123Wow, that will be a game changer for me! Thank you so much#2023-07-2309:59hifumi123Do you accept donations via GitHub?#2023-07-2310:03vemvAny choice of those listed at https://github.com/clojure-emacs/cider#funding would be nice!#2023-07-2800:52nikolavojicicI still have this problem:
https://clojurians.slack.com/archives/C0617A8PQ/p1618165538236200?thread_ts=1618165538.236200&cid=C0617A8PQ#2023-10-0600:29mikerod@U0ERZQ1K2 did you issue get resolved by https://clojurians.slack.com/archives/C0617A8PQ/p1689967366335979?thread_ts=1689945136.802289&cid=C0617A8PQ ?
I’m using the latest cider snapshot today and I get the same issue you described where the CLJS buffer immediately switches to the last ns when you eval anything - when you first set it via cider-repl-set-ns.
ie. CIDER 1.8.0-snapshot (package:
I have to manually do (in-ns 'some.ns) for it to now reset after a single eval#2023-10-0606:11vemvFeel free to create a GH issue right away#2023-10-0606:53vemvI couldn't reproduce. I used https://github.com/reducecombine/icd.scroll as a sample project which is minimal but also reasonably realistic and has up-to-date shadow and cider-nrepl#2023-10-0613:28mikerodI am using figwheel-main here. I wonder if that somehow matters. I’ll see if I can make a minimum project that does it#2023-10-0613:29vemvI also have a fig-main project around. Will check it out just now. I'd appreciate if you could create a GH issue, no repro is needed atm#2023-10-0614:36mikerodI’d be shocked if fig vs shadow had an influence here. I had no issues until yesterday when I bumped cider versions up (I was like a year old).
I saw same issue on emacs 28 and 29. I can make one in a few. I was curious if @U0ERZQ1K2 ever got past this, since it sounded like the same problem and I never saw if that was the case here or not.#2023-10-0614:38vemvFWIW I just tried things again with figwheel-main 0.2.18 and cider-jack-in-clj&cljs. It all works perfectly.#2023-10-0618:02mikerod@U45T93RA6 do you have an example project I could try for that? If not no problem. I can still work on one myself to see if I can reproduce #2023-10-0618:05vemvhttps://github.com/reducecombine/fig-main
Remember to npm install beforehand, else it can fail in a not quite clear way
As mentioned I used cider-jack-in-clj&cljs. It takes a bit for everything to load. Then I choose the dev build, a localhost page is open and everything works#2023-10-0620:14mikerodThanks! I will look in a bit.#2023-10-0716:39mikerod@U45T93RA6 I checked out your git repo above and I get the same problem as I previously described. If I do cider-repl-set-ns in the ns vemv.fig-main the CLJS repl buffer correctly changes to that namespace. I can evaluate exactly 1 single form while in that namespace. It can be as simple as something like (inc 1) or I can even do something that depends on being in that ns, like (multiply 1 2).
I get the eval’ed output correctly. And the CLJS repl buffer prompt immediately changes back to cljs.user after that and I am no longer in the ns as expected, eg. like (multiply 1 2) fails due to being in wrong ns.
cider-version <tel:202310051831|20231005.1831>
emacs version 29.1 (but I had same issue when I was using a 28.x version)
I am using cider-jack-in-clj&cljs in this particular flow as well.#2023-10-0716:40mikerodHappy to log an issue. Also happy to try doing something that may give you more debugging info. I was sort of guessing it was some issue with the nrepl request/response info or something. I was hoping I could see some details of that via advanced logging or something, but perhaps that doesn’t exist.#2023-10-0719:56vemvYes, please do the following:
Quit emacs
Run cd ~/.emacs.d; find . -type f -name "*.elc" -exec rm {} +
Perform: (setq inhibit-message nil), (setq nrepl-log-messages t), M-x toggle-debug-on-error
Repro your issue
Create a GH issue attaching as a gist the following buffers: *messages*, "*nrepl-messages <blah> clj", "*nrepl-messages <blah> cljs"
Thanks!#2023-10-0803:09mikerodOk, I make the issue @ https://github.com/clojure-emacs/cider/issues/3503 with the extra details @ https://github.com/clojure-emacs/cider/issues/3503#issuecomment-1751904188#2023-07-2412:07Breno BarretoWith elisp, how do I print a dict response on the repl? 🧵#2023-07-2412:08Breno BarretoI'm trying to build the following function:
(defun generate-mock ()
(interactive)
(let* ((sym (symbol-at-point))
(current-ns (cider-current-ns))
(require-code "(require '[common-test.generators :as gen])")
(generate (concat "(gen/without-generated-keys (gen/generate " current-ns "/" (symbol-name sym) "))")))
(cider-nrepl-sync-request:eval require-code)
(let ((resp (cider-nrepl-sync-request:eval generate)))
(cider-repl-emit-interactive-stdout (nrepl-dict-get resp "value")))))#2023-07-2412:08Breno BarretoBut cider-repl-emit-interactive-stdout seems to return "Wrong type argument: number-or-marker-p, nil"#2023-07-2412:37vemv(nrepl-dict-get resp "value")
is returning nil
grab the whole dict e.g. (setq debug1 resp), then inspect it in the elisp repl (ielm)#2023-07-2511:23vemvHow do I get the repl to scroll to stdout when it is emitted?
In (much) older cider versions, new stdout was always visible. Nowadays, it may be invisible until you realise there is new stdout at all, and you manually scroll up the repl.#2023-07-2512:22alexyakushevhttps://github.com/clojure-emacs/cider/commit/2e213f92d7bd84da9bf3826a42edb43a4e2fe7b3#2023-07-2512:23alexyakushevThis is what has broken it.#2023-07-2512:25vemvah yes, that commit/discussion was vaguely on my mind :)
the upside is that printing is indeed far faster than it used to be#2023-07-2512:26vemv...Probably it can make sense to selectively, temporarily bind that var when doing stuff that expects a println#2023-07-2512:30alexyakushevJust a sec, I'll share my hack with you#2023-07-2512:32alexyakushev@U45T93RA6 Do you use cider-repl-clear-buffer?#2023-07-2512:34vemvyep, quite often#2023-07-2512:35alexyakushev(defun cider-clear-repl-buffer-with-shift ()
"Needed to side-step ."
(interactive)
(cider-repl-clear-buffer)
(insert "(symbol \"\")")
(cider-repl-return))#2023-07-2512:35alexyakushevI use this function instead of it.#2023-07-2512:36alexyakushevThe effect is that when I clear the buffer, it looks like this.#2023-07-2512:36alexyakushevThe cursor is not on the first line, and thus the printed output does not get hidden above.#2023-07-2512:37alexyakushevWhy (symbol "") ? Because it is a command that once evaluated, does not trigger any printed REPL response, so it looks a bit cleaner.#2023-07-2512:41vemvI see!
I'm having success with a simple (setq cider-repl-display-output-before-window-boundaries t) though. Defaulting to nil and binding it during a couple key commands seems workable to me.#2023-07-2606:23bozhidarWell, for people who don’t care about the performance impact just enabling this permanently is probably the best option.#2023-07-2606:24bozhidarThe main reason I agreed to disable this was that it seemed it was the biggest contributor to REPL slowdowns after excessively long lines.#2023-07-2606:24bozhidarProbably we could have named the config variable a bit better. 🙂#2023-07-2520:49Charles ComstockI've noticed recently that cider-find-dwim doesn't seem to be looking up the whole symbol in certain cases. As example, if I attempt to run M-. on bytes->string, with the point somewhere in the word bytes, it gives a prompt "Jump to: bytes-", instead of bytes->string, and likewise if the point is in string, it will prompt for "Jump to: string". If I type in the part of the symbol that was elided, it will jump to the source of function under point, but it's awkward it's not finding the whole symbol by default. I think I have subword-mode on for other reasons so maybe that's a strange interaction on the boundary there, but wasn't sure if anyone has an idea why it's not detecting the whole symbol. I'm also running a recent build of emacs, so it's possible some behavior has changed there too, but was curious if anyone else has encountered this or found a workaround.
Related to this, I had to switch back to cider-find-dwim a while back and disable cider-use-xref as the xref support stopped working for me in cider (it always looks for a TAGS file instead of using cider runtime lookup). I'd love to switch back to the xref backend, but also curious if anyone has that working.#2023-07-2520:53vemvFor the first issue, it seems quite easy to check the elisp code, e.g.
• what is exactly grabbed / how?
◦ check the source, play on ielm / with M-:
• what is sent to cider-nrepl?
◦ checkable by enabling nrepl-log-messages and perusing the related buffer
◦ mostly a redundant step given the previous one, it's just to make sure#2023-07-2520:55vemvre: xref, we have a PR, with this conclusion: https://github.com/clojure-emacs/cider/pull/3349#issuecomment-1604846650
I'm in a good availability to take it - just had forgotten about with with all the other CIDER stuff I'm up to these days :)
but if you happen to have the time, we'd appreciate the extra hands!#2023-07-2521:00Charles ComstockOk, good to know on the second, which sounds like it's just broken for now so it's not my setup that is to blame. I don't know as I have time at the moment, but I will see.#2023-07-2521:04Charles ComstockAs to the cider-find-dwim it looks like the input symbol-file is only getting bytes- , but I'm not following from what that input is coming from. I hardcoded define-key "M-." to cider-find-dwim in the cider keymap because I thought that was the old function before xref-find-definitions. Is there a different entrypoint intended?#2023-07-2521:09Charles ComstockShould I have bound it to cider-find-var instead?#2023-07-2521:09vemvTaking a quick look at the source, doesn't it boil down to a (cider-symbol-at-point 'look-back) call? What does that sexpr return if evaluated with M-: when the cursor is over bytes->string ?#2023-07-2521:10vemvI do see the correct result in the minibuffer, following that M-:#2023-07-2521:10Charles Comstockif the cursor is on the - that's what I get yea, "bytes->string"#2023-07-2521:10vemv(I'm back later, maybe tomorrow)#2023-07-2521:11Charles ComstockI think the answer is I shouldn't be using cider-find-dwim, but instead of cider-find-var#2023-07-2521:11Charles ComstockI'm just not sure what cider-find-dwim is for#2023-07-2521:24Charles ComstockYep, double checking the normal cider-repl-mode-map "M-." defaults to cider-find-var if cider-use-xref is nil. I think I know why I hardcoded it though, cider-use-xref only happens at load time, and I made the mistake of setting it after cider was loaded so it wasn't actually doing anything, so I hardcoded it to what I thought it was supposed to be instead of cider-find-var.
Still not sure what the intended use case is for cider-find-dwim, but binding to cider-find-var fixes things for this use case.#2023-07-2521:39vemv> I'm just not sure what cider-find-dwim is for
me neither atm. if you could fully describe how you set it up?
my understanding is that you bound it to M-. . but cider-find-dwim (symbol-file) expects one argument - how is it exactly passed from M-.?#2023-07-2521:40vemvon the other topic, I don't use xref, but cider-find-var instead#2023-07-2521:43Charles Comstock(define-key map (kbd "M-.") #'cider-find-dwim) was the setup I used (inside of a (let ((map cider-mode-map)))). I also see there is a mouse version of cider-dwim so maybe that is the intended use case? I don't actually understand how the unary arg was being passed to cider-find-dwim I think that's some emacs magic with default interactive arguments?#2023-07-2521:45vemvI see#2023-07-2521:45vemvit ultimately calls (thing-at-point 'filename) , that was the issue#2023-07-2521:47Charles ComstockGotcha, that is weird but I guess makes sense. Re cider-use-xref, I wonder if instead of setting a defcustom to modify the bindings, the default should be to use cider-find-var, and then add a minor mode to toggle the xref bindings so the load order isn't important? I always find it really frustrating to find a defcustom that has a load order dependency.#2023-07-2521:51vemvI agree it's a bad default. I didn't have input in its introduction
Probably it's too late to change it. With the https://github.com/clojure-emacs/cider/pull/3349 its default shouldn't matter all that much
...I'll allocate tomorrow to fixing it, Thu at most, we want to have a pretty cider 1.8.0 https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md#2023-07-2605:55bozhidarI didn’t read this conversation in great detail, but cider-find-dwim is supposed to work with everything and cider-find-var is supposed to work only with vars.#2023-07-2605:56bozhidarThe symbol at point logic in both should be the same, though.#2023-07-2605:57bozhidar(`cider-find-dwim` should work with vars, keywords, filenames, etc)#2023-07-2605:59bozhidarAs for the cider-use-xref config - it’s kind of hard to do it differently unless we add some wrapper lookup function that checks the value itself. I was hesitant to do this, as it’d obscure a bit what exactly is being called when people use lookup, but I agree that it’s also confusing if a configuration change requires a mode to be restarted.#2023-07-2611:48vemv> (`cider-find-dwim` should work with vars, keywords, filenames, etc)
When used interactively, it uses (thing-at-point 'filename) , which will not take the whole foo->bar token.
This may or not may be the intended behavior. Note the arg name in defun cider-find-dwim (symbol-file) . Because it says "file", it seemingly makes sense to use (thing-at-point 'filename) . Perhaps this could be better documented.#2023-07-2704:45bozhidarYeah, the documentation should be improved. It seems it stayed the same between the introduction of the command https://github.com/clojure-emacs/cider/pull/1036 and it’s expansion of functionality https://github.com/clojure-emacs/cider/pull/2510#2023-07-2612:06bozhidarWe're looking for some feedback for a small cosmetic change in the test report - https://github.com/clojure-emacs/cider/pull/3375#2023-07-2614:32nikolavojicicHow to prevent cider from jumping to error location? E.g. if you eval symbol that doesn't exist, it will jump to the ns declaration.#2023-07-2614:36vemvThat behavior doesn't sound familiar to me - an issue report would be most welcome!
cider 1.8.0 is around the corner.#2023-07-2614:47nikolavojicicWhen I eval something it will jump to ns. Cider 1.7.0 (melpa stable).#2023-07-2614:48vemvhow do you eval?#2023-07-2614:49nikolavojicicVia any of these:
C-x C-e
C-c C-e
C-c C-c#2023-07-2614:49nikolavojicicAlso, C-c C-k does the same.#2023-07-2614:51nikolavojiciccider-eval-last-sexp
cider-eval-defun-at-point
cider-load-buffer#2023-07-2614:51nikolavojicicThat's not how it works for you?#2023-07-2614:55vemvwith cider-eval-defun-at-point:#2023-07-2614:55vemv#2023-07-2614:55vemvSame with cider-eval-last-sexp#2023-07-2614:57vemvWith cider-load-buffer I don't get that exact behavior, it fails silently for me. I might have some setup-specific problem#2023-07-2614:59nikolavojicicThese are mine overrides
https://github.com/nikolavojicic/.emacs.d/blob/master/init.el#L327#2023-07-2615:03roltcider-auto-jump-to-error ?#2023-07-2615:05nikolavojicicThat. Thx!#2023-07-2615:06vemvIt sounds like we still should fix the cider-auto-jump-to-error behavior so that when t , it doesn't jump to non-sensical locations.#2023-07-2615:10nikolavojicicMaybe it guesses that you forgot to :refer in the ns declaration. It is not totally non-sensical so I'm not sure if that is a bug.#2023-07-2615:12nikolavojicicBtw @U45T93RA6 which colour theme do you use? It looks nice :)#2023-07-2615:12vemvI'd find it more likely that it's an oversight in the original logic#2023-07-2615:14nikolavojicicThis is a bug though...#2023-07-2615:17vemvoh, yes, that sounds like useful info for the issue I created https://github.com/clojure-emacs/cider/issues/3381#2023-07-2615:18nikolavojicicI will subscribe to that issue and test / help if needed.#2023-07-2615:20vemvthis is my theme in all its glory https://github.com/zenmacs/.emacs.d/blob/master/lib/non-submodules/vemv.theme.el
it's an unwieldy file that has survived over 10+ years. it actually depends on a personal clojure-mode fork for getting every last detail how I want to
it's probably easier to simply take it as an inspiration, and bootstrap from there :)#2023-07-2615:25roltDepending on whether I use cider or clj i'm not getting the same column in the ex-data. But we don't have the correct line number anyway:
clj: #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "..."}
cider: #:clojure.error{:phase :compile-syntax-check,
:line 1,
:column 8438,
:source "..."}#2023-07-2616:12practicalli-johnI raised a similar issue back in April https://github.com/clojure-emacs/cider/issues/3331#2023-07-2618:46vemvI proposed a fix https://github.com/clojure-emacs/cider/pull/3382#2023-07-2621:27nivekuilwhile we are solving annoyances: in .cljc files we often have reader conditionals. When we C-x C-e a form in one of these it sends it to both clj and cljs repls, and your perfectly fine output gets clobbered by an error in the modeline. Could cider be smarter about that?#2023-07-2621:38vemv> and your perfectly fine output gets clobbered by an error in the modeline
Could you describe this in detail?
(I'll be back tomorrow)#2023-08-0310:22nivekuil@U45T93RA6 #?(:clj (System/getenv "JAVA_OPTS"))
if you have a line like that, you have to move your cursor to include the reader conditional form to eval it, otherwise it will throw an exception in cljs and sometimes you see nil in the buffer/minibuffer instead of the valid output#2023-08-0310:31vemvI see! But the current behavior is also defensible.
One could "mean" to eval any of these:
• "JAVA_OPTS"
• (System/getenv "JAVA_OPTS")
• #?(:clj (System/getenv "JAVA_OPTS"))
• maybe, a surrounding top-level defn...?
How would cider know?
While I can think of some sort of intrincate parsing to make it work for the use case you describe, it would increase complexity IMO.
It's simpler to teach users to use the commands intentfully instead, evaling exactly what one instructed.#2023-08-0310:32vemvRelatedly, yesterday we merged in https://github.com/clojure-emacs/cider/pull/3387 . If you know that your .cljc files are often to be evaled only in the JVM, you could set this new var on a project-wide basis.
(not generally available yet; we'll should cut cider 1.8.0 this week)#2023-08-0310:54nivekuilI was thinking eval could repeatedly call paredit-backward-up and check if the cursor was in a reader conditional#2023-08-0310:56nivekuilnot worth adding if I'm the only one bothered by this but thought I'd throw it out there.. that timely patch seems like a good stopgap though!#2023-08-0311:59vemv> I was thinking eval could repeatedly call paredit-backward-up and check if the cursor was in a reader conditional
Probably that's best left for users to do in their .emacs.d... which is not to say it's not desirable, I have myself a couple dozens of little hacks that use or wrap cider stuff#2023-07-2723:19nikolavojicicFeature idea: undefine (via C-c C-u) a keyword so that it doesn't autocomplete anymore. Also, if keyword is qualified and spec is loaded, undefine that spec, e.g. (s/def :some/keyword nil).#2023-07-2809:53bozhidar@nikolavojicic It's best to submit feature requests to the issue tracker, so we can properly discuss them there.#2023-07-2810:45nikolavojicichttps://github.com/clojure-emacs/cider/issues/3384#2023-07-2812:16frozenlockI'm trying to use #light as described here https://docs.cider.mx/cider/debugging/enlighten.html, but nothing happens.
The minor mode works fine when activated manually, but the #light shortcut doesn't 😕
Can anyone reproduce?#2023-07-3009:16heyarnei have an issue with one project i'm working on; when evaluating a certain form, cider just crashes without raising an error. All it prints is *** Closed on Sun Jul 30 11:15:13 2023 *** . I can execute the namespace with clojure -m …; any idea how I could figure out what's wrong, or get cider to be a bit more talkative about it?#2023-07-3009:18heyarneThe *messages* buffer contains [nREPL] Connection closed unexpectedly (connection broken by remote peer)#2023-07-3011:01vemvI'd recommend to start your JVM/cider-nrepl process in your terminal, and then cider-connect to it.
That way, if it crashes, you should see a stacktrace or other debug info#2023-07-3011:09heyarneHm… it doesn't happen when I start it in a terminal#2023-07-3011:09heyarneMaybe my emacs session is lacking some env vars#2023-07-3011:12vemvJVM flags related to memory perhaps?#2023-07-3011:30heyarneNo, nothing like that… odd#2023-07-3012:50practicalli-johnPerhaps something in a .dir-locals.el file (if that file exists in the root of the Clojure project)
Or on a custom user.clj file if added to the path (possibly by the .dir-locals.el)#2023-07-3013:13heyarneNo, nothing like that. I assumed it's some weird dynamic library issue related to nix / direnv, but I can't find anything in that direction#2023-07-3013:25practicalli-johnIts pretty hard to make the connection go bang, so it seems likely that the REPL process is trying to do something that Nix wont let it do... this would be my guess.#2023-07-3017:47dpsuttondo any of the codepaths have any System/exit 0 type forms? Code can make the jvm exit and you see the messages you are seeing#2023-07-3019:51aisamu> Hm… it doesn’t happen when I start it in a terminal
> No, nothing like that. I assumed it’s some weird dynamic library issue related to nix / direnv, but I can’t find anything in that direction
You can check exactly what command jack-in used to start the REPL (either messages or at the start of the repl buffer, I can’t recall), and then manually run that in the terminal
(I use nix and direnv, so I know it can work)#2023-07-3019:52heyarneThat's what I did, I copied the command that's printed at the beginning of the repl section#2023-07-3019:54aisamuOh! Sometimes I have to actively invoke envrc-allow/envrc-reload-all to make cider pick up the right environment (and apparently not from a magit buffer, for whatever reason)!
I use (executable-find "clojure") (or anything else project-defined) to make sure it matches what I get from a regular terminal session#2023-07-3020:01heyarnesoooo when setting DISPLAY = ":0" I get a stacktrace at least 🙂 the issue arises when using quil (a wrapper for processing), so I think I'm headed in the right direction#2023-07-3020:01heyarneThe env vars weren't identical, I overlooked that for some reason#2023-07-3020:01heyarneThanks to everybody who came to help me out! Very appreciated. Hope you have / had a great weekend#2023-07-3102:45Garrett HopperIs it possible to link a Sesman REPL to a buffer rather than a session with multiple REPLs?
Sesman browser:
CIDER Sessions:
1: Project/example:localhost:62628
linked-to: proj(~/Development/project/)
objects: *cider-repl %s(clj)* *cider-repl %s(cljs:shadow)*
I'd like to link a buffer directly to the cljs REPL only so evaluations aren't sent to both REPLs.
(Context: Trying out hyperfiddle/electric, where both REPLs have to be in the same JVM process, however it'd be convenient to evaluate CLJS code inline without it erroring out on the JVM REPL)#2023-07-3106:16vemvPerhaps you'd have luck by redefining this function to introduce an if :
(defun cider-repl-type-for-buffer (&optional buffer)
"Return the matching connection type (clj or cljs) for BUFFER.
BUFFER defaults to the `current-buffer'. In cljc buffers return
multi. This function infers connection type based on the major mode.
For the REPL type use the function `cider-repl-type'."
(with-current-buffer (or buffer (current-buffer))
(cond
((derived-mode-p 'clojurescript-mode) 'cljs)
((derived-mode-p 'clojurec-mode) (if "<current directory is named my_project>" ;; <---------------
'cljs
'multi))
((derived-mode-p 'clojure-mode) 'clj)
(cider-repl-type))))
Maybe we could introduce a defcustom, at some point
Edit: a more idiomatic way of hacking this defun is to add-advice :filter-return , inspect the return value, modify it if it is 'multi#2023-07-3114:11Garrett HopperPerfect, thank you! 🙂#2023-07-3114:21Garrett HopperHere's what I ended up with:
(defcustom cider-clojurec-repl-type-override nil
"Override the REPL type for the current buffer."
:type '(choice (const :tag "None" nil)
(const :tag "Clojure" clj)
(const :tag "ClojureScript" cljs)
(const :tag "Multi" multi))
:group 'cider)
(defun cider-set-clojurec-repl-type-override ()
"Set REPL type override for the current clojurec buffer."
(interactive)
(let ((type (intern (completing-read "Set REPL type to: " '("nil" "clj" "cljs" "multi")))))
(setq-local cider-clojurec-repl-type-override type)
(message "Set REPL type override to %s" type)))
(defun cider-repl-type-for-buffer (&optional buffer)
"Return the matching connection type (clj or cljs) for BUFFER.
BUFFER defaults to the `current-buffer'. In cljc buffers return
multi. This function infers connection type based on the major mode.
For the REPL type use the function `cider-repl-type'."
(with-current-buffer (or buffer (current-buffer))
(cond
((derived-mode-p 'clojurescript-mode) 'cljs)
((derived-mode-p 'clojurec-mode) (or cider-clojurec-repl-type-override 'multi))
((derived-mode-p 'clojure-mode) 'clj)
(cider-repl-type))))
#2023-07-3117:54vemvCheers. It looks like PR material to me 🙂 feel free to#2023-08-0216:55prncIs it possible to get a “no questions asked” version of cider-jack-in-cljs 😉
Currently I’m getting:
> A CIDER session with the same connection parameters already exists (nette-io/nette:localhost:49169). Are you sure you want to create a new session instead of using `cider-connect-sibling-clj(s)’? (y or n) y
> (helm) select shadow-cljs
> Visit ‘http://localhost:8600’ in a browser? (y or n) n
Is there a config that allows to skip some / all of the steps? Thanks!#2023-08-0217:05vemv>> A CIDER session with the same connection parameters already exists (nette-io/nette:localhost:49169). Are you sure you want to create a new session instead of using `cider-connect-sibling-clj(s)’?
why are you jacking in twice? Is it intentional?#2023-08-0217:07vemv>> Visit ‘http://localhost:8600’ in a browser? (y or n) n
grep for (format "Visit '%s' in a browser? " url) in the cider repo
PR welcome for introducing a defcustom for a fixed answer#2023-08-0217:52practicalli-johnA .dir-locals.el can be used set variables that would otherwise be asked by cider jack-in.
I've used this for Figwheel-main projects, so assume the same can be done for shadow-cljs (if the variables are present)
https://practical.li/spacemacs/clojure-development/project-configuration/#2023-08-0217:54practicalli-johnI sometimes get prompted about a reusing an existing session. I assume this happens when a previous session didn't exist cleanly#2023-08-0309:20prncthanks @U45T93RA6 & @U05254DQM!#2023-08-0310:18nivekuilmy .dir-locals
((nil
(cider-clojure-cli-parameters . "-A:dev")
(cider-preferred-build-tool . shadow-cljs)
(cider-default-cljs-repl . shadow)
(cider-shadow-default-options . ":main")
(cider-offer-to-open-cljs-app-in-browser . nil)
(cider-redirect-server-output-to-repl . nil)
(cider-ns-refresh-after-fn . "user/go")))
and I have (cider-reuse-dead-repls 'any) in init
makes it pretty streamlined#2023-08-0310:18nivekuilactually I use cider-connect not jack-in, but I think a lot still applies#2023-08-0312:59prncthanks @U797MAJ8M will check it out!
(I actually connect to clj but jack in with cljs :face_palm: — just quirks of my current set-up, hence trying to streamline 😜)#2023-08-0315:12Frank Henard;; Startup: /usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.0.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.30.0\"\] -- repl :headless :host localhost
WARNING: CIDER 1.7.0 requires cider-nrepl 0.30.0, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality! (More information)
Notice the warning I'm using cider-nrepl 0.21.1, though I'm requesting 0.30.0. Any ideas why this might be?#2023-08-0315:13vemva Lein plugin or profile? Do you use ~/.lein/profiles.clj?#2023-08-0315:14Frank Henard@U45T93RA6, yes, here it is:
{:repl {:plugins [[cider/cider-nrepl "0.30.0"]]}}#2023-08-0315:15Frank Henardit may be another plugin, I'll dig into that#2023-08-0315:16Frank Henardyep, that was it, thanks!#2023-08-0315:16vemv🍻#2023-08-0318:16prncIs there a way to disable those warnings cider-shadow-cljs-global-options is obsolete (since 1.8.0); use 'cider-shadow-cljs-parameters' instead (CIDER 1.8.0-snapshot)?
Want to ‘hide’ them until I have a minute to figure out how this has changed (as it seems there is a semantics shift, not only naming).#2023-08-0318:42practicalli-johnThere's a long list of Cider variables on https://practical.li/spacemacs/reference/cider/configuration-variables/
Maybe one of them does the trick?#2023-08-0407:52roltobsolete variables is an emacs thing, not cider specific, so either modify that variable in cider or disable warnings entirely i guess ?#2023-08-0411:32prncthanks @U05254DQM, thanks @U02F0C62TC1 — tried suppressing this with setting warning-minimum-log-level to :error but no luck 😛
at this point I’ll probably take the time to understand the actual changes in cider 🙂#2023-08-0413:17rolti think you're looking for warning-minimum-level instead of warning-minimum-log-level
but i really can't recommend hiding warning in emacs#2023-08-0413:59prncthanks & true#2023-08-0414:00roltapparently you can also suppress specific types but i've no idea how it works#2023-08-0414:10bozhidar@U7MHWDLD8 Basically two similar variables were folded into one. If you had something in global options you should move it to parameters.#2023-08-0414:11prncmakes sense, thanks @U051BLM8F!#2023-08-0416:30Sam Ritchiehey all, I KNOW this has come up before and is documented around, but I can’t track it down…
I have a macro that I want to indent like defmacro , but I can’t figure out how to teach emacs / cider about this preference.
can I specify something in .dir-locals.el here?#2023-08-0416:31Sam Ritchieand I would like this:#2023-08-0416:43vemvhttps://docs.cider.mx/cider/indent_spec.html
you'd have to add a :style/indent 1 at clojure level in this case :)#2023-08-0416:44vemvin the upcoming cider 1.8.0 release this will be inferred for a large subset of all cases, so you'd have to add nothing#2023-08-0417:01Sam Ritchieokay!#2023-08-0417:01Sam Ritchie#2023-08-0417:01Sam RitchieI added these two lines and things are looking good#2023-08-0417:02vemvyep. Clojure-level metadata can inform non-emacs consumers#2023-08-0417:20Sam Ritchie@U45T93RA6 I couldn’t figure out how to get the metadata to ‘take’, unfortunately#2023-08-2107:40ZacharyI know that in the meander/epsilon library, there’s an abundance of {:style/indent :defn} in their macros, right before the argument vector. 🤷#2023-08-0420:21vemvI'm trying to develop/fix xref stuff. Not much of a user myself.
Although I saw the CIDER backend activated like 1h ago, I can't anymore. The underlying CIDER code works fine if invoked in isolation, but M-x xref-find-references doesn't seem to hit CIDER at all.
cider-use-xref is t, I also (require 'cider-find) (require 'cider-xref) in advance, no luck. I also removed .elc files just in case.
Any ideas as for how to make sure it's plugged in?#2023-08-0420:25DerekCan you look at xref-backend-functions#2023-08-0420:26vemv(t cider--xref-backend)#2023-08-0420:26DerekMine appears opposite: (cider--xref-backend t)#2023-08-0420:27DerekI'm on emacs 28.2, FWIW#2023-08-0420:29vemv(setq xref-backend-functions '(cider--xref-backend))
removing that mysterious t allowed me to move forward
thanks much for your help!#2023-08-0420:29DerekBizarre, glad I could help#2023-08-0421:32frozenlockCurrently using the debugger.
When a value is large map, it's shown as a long line.
Can this be configured somewhere to pprint the map instead?#2023-08-0421:40alexyakushevNot the direct answer to your question, but you can press p to view it in the inspector.#2023-08-0806:51bozhidarIf I recall correctly it can't be configured. Pretty-printing is tricky when it's not done in a dedicated buffer or the REPL.#2023-08-0516:29Garrett HopperDoes anyone have a good idea of how the Cider -> nREPL middleware could be modified to support regex literals (within cljfmt :indent map)
It's not clear to me how it should be passed through nrepl-bencodeand later parsed by https://github.com/clojure-emacs/cider-nrepl/blob/4e5f68d167e069a626c5d7029a28e2bc074205d0/src/cider/nrepl/middleware/format.clj#L24
Looking to have feature parity with cljfmt #re data reader within EDN files. (https://github.com/weavejester/cljfmt/blob/master/docs/INDENTS.md)#2023-08-0516:30Garrett HopperKind of wondering if Cider should be reading cljfmt.edn files in the first place. :thinking_face:#2023-08-0516:31Garrett HopperErr, if Cider's nREPL middleware should be reading that file#2023-08-0516:32Garrett HopperOr maybe cljfmt.core/reformat-string should just be doing that.
Kinda strange that it's not already? Hmm#2023-08-0516:37Garrett HopperSent over in #cljfmt. (I think ultimately the nREPL middleware function will need to change.)
https://clojurians.slack.com/archives/C8YT051KN/p1691253425667219#2023-08-0517:54vemvI could salvage https://github.com/clojure-emacs/cider-nrepl/pull/754#2023-08-0517:55vemvit avoids encoding regex over the wire altogether, plus we get some clojure-lsp parity#2023-08-0517:57Garrett HopperOh, nice! I hadn't seen that
Agreed, I think it should be handled between Cider nREPL and cljfmt rather than trying to encode the regex in elisp somehow.#2023-08-0517:58Garrett HopperI'd lean towards pushing the actual config parsing to cljfmt though, as they have some more complex logic to allow different file names/formats.#2023-08-0517:59vemvI can take that into account, thanks!
I've been meaning to take over that PR again, it's just that I always have something else to do ;p
If it helps you I'll be happy to include it for the cider 1.8.0 release that we have around the corner.#2023-08-0518:00Garrett HopperThat'd be awesome 🙂#2023-08-0713:09Garrett HopperFYI, from the other thread in #C8YT051KN
> There's a cljfmt.config/load-config function that will load the configuration. If no arguments are given, it'll use the current directory as a starting point. Otherwise it uses the path given. It'll look for the first cljfmt.edn/cljfmt.clj file in the current or any of the parent directories.
>
> So you can load the config, merge or change any options you wish, and then pass it to cljfmt.core/reformat-string.#2023-08-0621:48hifumi123Did some behavior in the latest verison of CIDER change regarding restart command in the REPL? For some reason, restart no longer restarts Clojure on my end. It just restarts the REPL but keeps Clojure running. (This is not the behavior I want. In the past, the behavior I liked and relied on was restarting Clojure and setting up a new REPL afterwards)#2023-08-0622:39vemvThis is the latest related fix https://github.com/clojure-emacs/cider/pull/3363/files
It's in master only atm, but you are free to try it. I expect everything to be stable.
We're aiming to release cider 1.8.0 early in the week#2023-08-0623:20hifumi123Oh, that is good news. I will run M-x straight-pull-all and report back any issues I find. Thanks!#2023-08-1108:18bozhidar📣 We’re about a week away from releasing CIDER 1.8 (see https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md for all the upcoming changes). Now’s a good time for more people to test the snapshot and provide feedback about it. Exciting times ahead! cider#2023-08-1110:26vemv^ we just merged a new batch of PRs
Recently, we asked around here for issues that may be bugging you. A handful of those are now fixed. If you can think of more - bring them in!
Have a great weekend CIDERers 🍎 🍏#2023-08-1305:32jasonjcknCider relies on clojure-mode.el, for example it calls clojure-find-ns , etc, with the emergence of clojure-ts-mode.el, Perhaps we can find a way to have a weaker coupling of cider on clojure-mode.el.
Something like clojure-find-ns could probably be done 'in-house', bring the logic into cider, but other situations will probably be more complex.#2023-08-1308:51vemvFrom intuition, I'd say that we could have shims like the following:
(defun cider-find-ns ()
(cond
((functionp 'clojure-ts-find-ns) (funcall 'clojure-ts-find-ns))
((functionp 'clojure-find-ns) (funcall 'clojure-find-ns))
(t (error "Please install at least one clojure-mode!"))))
we'd have to see if this technique can scale to more complex use cases, but it seems to me that most stuff would be easy.
We could have a lightweight contract, specifying what each clojure.*mode function has to return.
This allows us to keep things DRY. clojure-mode is also used without CIDER (prior to connection, and for inf-mode and clojure-lsp users) so it has to exist independently.
Issue/discussion most welcome!#2023-08-1208:29Danny AlmeidaI've returned to clojure after a long hiatus and so had to upgrade all the packages. I was trying to just start a clojure repl but i'm getting this error. I'm not sure why it's using the -R option.
error in process sentinel: Could not start nREPL server: -R is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool
my deps.edn file is sparse just this :
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}}
}
and my cider version is
1.8.0-snapshot"
here's the message in the emacs message buffer
[nREPL] Starting server via /usr/bin/clojure -R:nrepl:cider-nrepl:cognitect-rebl -A:dev:nrebl -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.35.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[\]\"\]\}\}\} -M:cider/nrepl #2023-08-1210:21practicalli-johnSuggest checking the Clojure CLI tool is up to date
https://clojure.org/guides/install_clojure
Also check for a .dir-locals.el file on the root of a project which may have older variables or execution options. It may be using the deprecated cider-lojure-cli-global-options rather than the current cider-clojure-cli-aliases variable
https://practical.li/spacemacs/clojure-development/project-configuration/#2023-08-1213:34practicalli-johnIt's common to run a repl in a terminal to check there aren't issues with the project itself, so either clojure or clj in the root of the project.
Also, creating a new project from a template can help isolated the root cause.#2023-08-1405:17Danny Almeidathank you for your suggestions.. Clojure CLI too is 1.11.1 and when i run it from command line, it works fine. .dir-locals.el file is not present in this directory. I did use it earlier, however when i saw this error, that as the first thing i checked. Not sure what's going on. Will try with a fresh install of emacs and cider#2023-08-1405:41Danny Almeidajust tried it with a fresh install of emacs and cider and nothing else and still get the same error message.#2023-08-1406:14Danny AlmeidaI apologize.. i didn't realise that the directory one level above had .dir-locals.el file. Stupid me 😞 Sorry for wasting everyone's time.#2023-08-1406:52practicalli-johnWe all make mistakes and hopefully we can all learn from them 😁
Glad the issue is resolved#2023-08-1413:09igrishaevHas anyone ever had an issue with Cider + SSH/Tramp + Jar files? I'm connected to a remove machine via REPL, and I can browse the files in Emacs with dired/sshx. But when I'm trying to jump into a jar file (e.g. cider-find-ns), Emacs says "search has failed". There is an issue I've created a moment ago: https://github.com/clojure-emacs/cider/issues/3409#2023-08-1420:49ZacharyI’m trying to do a cider-connect to an nrepl started from my project directory with these configurations:
{:extra-deps {nrepl/nrepl {:mvn/version "1.0.0"}
cider/cider-nrepl {:mvn/version "0.31.0"}}
:main-opts ["--main" "nrepl.cmdline"
"--middleware" "[cider.nrepl/cider-middleware]"
"--interactive"]}
I’m getting an error:
Debugger entered--Lisp error: (wrong-type-argument stringp ("<my-proj-dir>" "62772"))
directory-file-name(("<my-proj-dir>" "62772"))
(file-name-nondirectory (directory-file-name (car x)))
(list (file-name-nondirectory (directory-file-name (car x))) (nth 1 x))
(closure (t) (x) (list (file-name-nondirectory (directory-file-name (car x))) (nth 1 x)))((("<my-proj-dir>" "62772")))
mapcar((closure (t) (x) (list (file-name-nondirectory (directory-file-name (car x))) (nth 1 x))) ((("<my-proj-dir>" "62772")) ("<my-proj-dir>" "62772")))
(seq-uniq (mapcar #'(lambda (x) (list (file-name-nondirectory (directory-file-name (car x))) (nth 1 x))) (delq nil pairs)))
(let* ((pairs (cider--running-nrepl-paths)) (pairs (let* ((c (and t (and dir ...)))) (if c (cons (cider--path->path-port-pairs c) pairs) pairs)))) (seq-uniq (mapcar #'(lambda (x) (list (file-name-nondirectory (directory-file-name ...)) (nth 1 x))) (delq nil pairs))))
cider-locate-running-nrepl-ports("<my-proj-dir>")#2023-08-1421:06vemvFixed on master yesterday, try updating CIDER again?#2023-08-1422:06ZacharyCan confirm, it’s fixed!! 🙂#2023-08-1422:07ZacharyThanks!#2023-08-1422:11vemvCheers 🍻#2023-08-1713:57jmckitrickI’m occasionally seeing this in my mini-buffer:#2023-08-1713:57jmckitrickerror in process filter: nrepl--dispatch-response: [nREPL] No response handler with id 80 found
error in process filter: [nREPL] No response handler with id 80 found
#2023-08-2709:14vemvI'm seeing this too, with shadow-cljs.
Is it also the case for you?
(Will see if I can fix something, either way)#2023-08-2709:28vemvFix on its way for shadow-cljs and figwheel https://github.com/clojure-emacs/cider/pull/3439#2023-09-0101:37jmckitrick@U45T93RA6 excellent, thanks! I haven’t seen it since#2023-08-1916:56vemvIt would be sweet to be able to cider-jack-in and then "disown" (detach the underlying java process from its Emacs parent) that repl, so that that process would persist even after an Emacs crash.
(It's the reason why some of us prefer to cider-connect to an iTerm repl)
Does that sound 'obviously easy' to any of you? In macOS, from a quick investigation, there didn't seem to be an easy way forward. One can create plists for launchd but it seems too static of an approach?#2023-08-1917:01vlnnGood idea, but how to control this “stray” process afterwards? I’ve found some problems with slow responses from java to nrepl to emacs, which ends with timeout and no real feedback on emacs side. If java process will become separate, wouldn’t it made things even worse for such scenarios?#2023-08-1917:05vemvYeah, forgetting processes is no good.
But let's assume one is used to this workflow, then one would be also used to first try cider-connect , so that cider displays all active nrepl ports (this is a recently revamped feature):#2023-08-1917:05vemvthen, if I see ports being offered, I know that I can either use them, or remember that I have some processes that I should likely kill#2023-08-1917:11dpsuttonCider prints the startup command. I think there’s an issue to easily copy the startup command cider would use so you could paste it in a terminal and then connect#2023-08-1917:13vemvdeleted#2023-08-1917:13dpsuttonThe idea is it would easily through the dynamically conputed startup command into the system clipboard. It would be identical to how cider would startup#2023-08-1917:14vemvI get it now, thanks! One could go as far as scripting iTerm so that it's all automated :thinking_face:#2023-08-1917:16dpsuttonYou’d need an eMacs process to get it from iterm. Could be interesting to add a function that can be called from the terminal to run eMacs to compute the form and then exec it#2023-08-1917:18vemvYeah emacs-client would be one approach, for instance. Another being, sending a bash string to iTerm via some macOS facility, it wouldn't surprise me if it existed#2023-08-1921:44hifumi123launchd is a decent approach#2023-08-1921:44hifumi123just use launchctl to load and unload as needed#2023-08-1921:44hifumi123the issue here is supporting multiple services in a single unit -- i dont think launchd allows it#2023-08-1921:57vemvYeah I'd imagine it can struggle with dynamic or multiple-instance needs
atm I feel pretty convinced to support a function that can be easily invoked with emacsclient --eval , and/or sending the jack-in command to iTerm https://chat.openai.com/share/f39adec6-11f5-4fa8-9d16-7c6d072c1d2a
Both are transparent and have a decent UI. Whereas launchd and friends seem a little more dense for everyone to understand.
(we lose a full 'disown' though)#2023-08-2013:10yuhanI haven't looked into the details, but there was an interesting talk from the last EmacsConf about a detatched.el package to handle similar sounding scenarios:
https://emacsconf.org/2022/talks/detached/#2023-08-2103:11hifumi123I have been attempting to use shadow-cljs recently, but I am getting this error message right before I get to choose a build target.
[nREPL] Starting server via /opt/local/bin/npx shadow-cljs -d nrepl/nrepl:1.0.0 -d cider/cider-nrepl:0.30.0 -d cider/piggieback:0.5.2 server
[nREPL] server started on 50770
error in process filter: parseclj--reduce-coll: parseclj: Syntax error: "At position 617, unmatched :rbrace"
error in process filter: parseclj: Syntax error: "At position 617, unmatched :rbrace"
How can I debug this?#2023-08-2103:23dpsuttonrun
/opt/local/bin/npx shadow-cljs -d nrepl/nrepl:1.0.0 -d cider/cider-nrepl:0.30.0 -d cider/piggieback:0.5.2 server from a command line and see what happens. Somewhere it’s parsing (or erroneously thinks) some bad edn.
My money is malformed shadow-cljs.edn#2023-08-2104:03hifumi123if that were the case, shadow wouldn't even start. ive attempted running npx shadow-cljs watch app then running M-x cider-connect-cljs but this results in the same error
(shadow successfully parses the config and builds the specified target, but some EDN error occurs when connecting to the REPL)#2023-08-2104:12dpsuttoninteresting. you can try turning on nrepl message logging and also set emacs to give you a stack trace on error#2023-08-2104:13dpsuttonyou should be able to then debug the function in emacs and see what edn is acting problematically#2023-08-2104:26vemvparseclj backs https://github.com/clojure-emacs/parseedn
grep for parseedn in cider, luckily there are very few matches
This one calls my attention: (parseedn-read '((shadow/env . identity)))
Off hand, I have no idea what it does. Please give it a shot and report an issue if you aren't lucky#2023-08-2104:26hifumi123Thanks @U11BV7MTK and @U45T93RA6. I will try seeing what exact EDN data is being given to CIDER and try to see what’s going wrong#2023-08-2104:34vemvCheers. Invoking (cider--shadow-get-builds) directly might give you a reproducible case (which doesn't appear to even need an nrepl connection)#2023-08-2107:21hifumi123Here is what I see in the debug minibuffer
Debugger entered--Lisp error: (parseclj-parser-error "At position 562, unmatched :rbrace")
parseclj--error("At position %s, unmatched %S" 562 :rbrace)
parseclj--reduce-coll((#<hash-table equal 3/3 0x4653f237>) ((:token-type . :rbrace) (:form . "}") (:pos . 562)) parseedn-reduce-branch ((:tag-readers (shadow/env . identity))))
parseclj-parser(parseedn-reduce-leaf parseedn-reduce-branch ((:tag-readers (shadow/env . identity))))
parseedn-read(((shadow/env . identity)))
cider--shadow-get-builds()
#2023-08-2111:36vemvNice. May it be an instance of https://github.com/clojure-emacs/parseedn/issues/16 ?
Either way, looks like there's a way to skip going down that code path in your particular project?
The logic is:
(or cider-shadow-default-options
(car cider-shadow-watched-builds)
(completing-read "Select shadow-cljs build: " (cider--shadow-get-builds)))#2023-08-2707:18vemvCurious, did you get to determine the cause?#2023-08-2707:33hifumi123Haven’t tried yet, sorry#2023-08-2707:33hifumi123or rather, I’ve been unable to determine whats really going wrong#2023-08-2707:35vemvwould be happy to help. Is there a namespaced map in shadow-cljs.edn? Like a :mvn{:version declaration?#2023-08-2707:35hifumi123No#2023-08-2707:35hifumi123shadow uses the same syntax as leiningen for dependencies. the shadow-cljs.edn file is very barebones#2023-08-2707:35hifumi123let me try finding where this project is#2023-08-2707:37vemvfeel free to DM me its redacted contents, could be an easy repro#2023-08-2707:41hifumi123Sure. I will send the project causing problems#2023-08-2707:41vemv(shadow-cljs.edn will be enough)#2023-08-2109:44pithylessI'm assuming there is, but I can't find it: is there an easy way to disable switching my focus to the *cider-test-report* buffer when running a test?#2023-08-2110:18practicalli-john(setq cider-auto-select-test-report-buffer nil)
I believe the report still shows bit the report buffer doesn't become active
https://practical.li/spacemacs/reference/cider/configuration-variables/#tests#2023-08-2911:05pithyless@U05254DQM sorry for bringing up an old thread, but I had asked a question and then stepped away to do something else... and next thing you know, a week has passed. Just wanted to let you know, this is exactly what I was looking for and you answered my question.
Many thanks! gratitude and sorry for the radio silence.#2023-08-2317:32Joseph Grahamhow can I simply bring back previous command in repl? equivalent to what up and down arrow would do in a terminal?#2023-08-2317:36respatializedM-p#2023-08-2317:36jpmonettasM-p and M-n are bounded to cider-repl-previous-input and cider-repl-next-input#2023-08-2317:39Joseph GrahamAh! Fantastic#2023-08-2318:51Evan Bernardand M-r if you want to search through your previous input 🙂#2023-08-2319:01jpmonettasany idea how to disable those documentation overlays when you hover over symbols with the mouse? also more general, is there any way on emacs to track down this kinds of gestures? like what code is executing when hovering over a piece of text?#2023-08-2319:54vemvAre you talking about eldoc? https://docs.cider.mx/cider/config/eldoc.html#displaying-eldoc-for-the-symbol-at-point#2023-08-2319:58jpmonettastalking about this popups#2023-08-2320:02respatializedWould love to control this myself#2023-08-2320:05vemvYou could try following that instruction (`(setq cider-eldoc-display-for-symbol-at-point nil)`) to see if it gets disabled#2023-08-2320:06jpmonettasstill there#2023-08-2320:07jpmonettasis also kind of buggy, doesn't always display#2023-08-2320:10vemvok, please (setq nrepl-log-messages t) , cause the popup to show up again, visit the *nrepl-messages [...] buffer, see what request/response cycle is including all that info
requests are marked by --> and have an id and op
responses are marked by <-- and have an id (matching the request) and the response data
then you'd have to grep in the cider package which defuns are calling that op#2023-08-2320:11vemv(Slightly excessive work if it's the first time doing it, but it's a super useful technique)#2023-08-2320:12jpmonettaslooks like something that is requesting a info#2023-08-2320:13vemvYep, that's what I would have guessed :)
Info is obtained via cider-sync-request:info , mainly#2023-08-2320:13jpmonettasbut not for every popup, just for the ones that shows a docstring#2023-08-2320:15vemvthere's defcustom cider-use-tooltips t , responsible for defun cider--help-echo which uses info
hope that's it!#2023-08-2320:16jpmonettasnice! cider-use-tooltips`` did the trick!#2023-08-2320:16jpmonettasthanks!#2023-08-2320:19jpmonettasit would be nice to have a way of tracking those down. I can track most things down in emacs but no idea about those#2023-08-2320:20vemvone way is as shown above, starting by the nrepl log and following that trace of ops and then code
another is M-x describe-key . Sometimes it works with mouse stuff#2023-08-2320:21vemvbtw, we recently added Cider Storm to the docs (soon to be online) https://github.com/clojure-emacs/cider/pull/3425
Kudos for your work!#2023-08-2320:23jpmonettasok I found a way of tracking those, you add a breakpoint to emacs tooltip-show and can edebug them#2023-08-2320:24jpmonettas> btw, we recently added Cider Storm to the docs (soon to be online)
nice!!#2023-08-2320:27jpmonettas> ok I found a way of tracking those, you add a breakpoint to emacs tooltip-show and can edebug them
meh, false alarm. Edebug activates and you can step, but running e (backtrace) doesn't provide any useful info#2023-08-2320:28jpmonettas#2023-08-2320:29jpmonettasa timer ends up firing the tooltip-show#2023-08-2320:29jpmonettasanyways, thanks @U45T93RA6!#2023-08-2411:27andrea.crottimy cider seems a lot slower today after an update, I just tried a simple profiling and I do see something like
14109 89% - ...
13684 86% - sesman-current-sessions
13684 86% - sesman--friendly-sessions
13684 86% - seq-filter
13684 86% - seq-map
13684 86% - apply
13684 86% - #<compiled 0x18438d3d527778b4>
13684 86% - mapcar
13684 86% - #<compiled -0x1c3c5aba76cb956a>
13684 86% - #<compiled 0xa07ea5fb0bf551>
13684 86% - sesman-friendly-session-p
13684 86% - apply
13684 86% - #<compiled 0x12ba488e81173447>
13684 86% - cider--sesman-friendly-session-p
13681 86% - cider-current-ns
13681 86% - cider-current-repl
13681 86% - cider-repls
13681 86% - sesman-current-session
13681 86% - sesman--friendly-sessions
13681 86% - seq-filter
13681 86% - seq-map
13678 86% - apply
13678 86% - #<compiled 0x18438d3d527778b4>
13674 86% - mapcar
13674 86% - #<compiled -0x1c3c5aadc99b3d6a>
13661 86% - #<compiled 0xa07ea5fb0bf551>
13650 86% - sesman-friendly-session-p
13647 86% - apply
13647 86% - #<compiled 0x12ba488e81173447>
13581 85% - cider--sesman-friendly-session-p
10132 64% - file-truename
7722 48% - file-truename
5634 35% - file-truename
3819 24% - file-truename
2233 14% - file-truename
777 4% file-truename
1499 9% + cider-current-ns
1143 7% + seq-find
405 2% + cider--all-path-translations
81 0% + cider-tramp-prefix
50 0% + seq-filter
20 0% process-get
6 0% process-live-p
5 0% + cider-classpath-entries
not sure if that's normal, but I would think it's not#2023-08-2411:28andrea.crottiwhy would file-truename call itself so many times also?#2023-08-2411:53vemvthanks for the report!
Do you have symlinks, Lein checkouts, networked files, any file structure in your project that is out of the norm?#2023-08-2411:57vemvbtw, you can call the new cider-debug-sesman-friendly-session-p function at any time, so that you can reproduce the slowness reliably.
Is it always slow, or only the first time?
(there's some per-repl caching, so things may be slightly slower the first time, for a repl. Not for every file buffer)#2023-08-2412:15vemvFunnily enough, while we've changed that code, one thing that we haven't changed at all is that file-truename call - it's exactly like it's always been.
From a quick googling (https://github.com/emacs-lsp/lsp-mode/issues/1695) it appears that file-truename can simply be slow. lsp-mode has this cache:
https://github.com/emacs-lsp/lsp-mode/blob/f8ed844b6e23c7717fb69d6c645aa41f0772c557/lsp-mode.el#L9172-L9183
And projectile did this refactoring:
https://github.com/bbatsov/projectile/commit/4e3cc0ae40256478198a46d27d9efe41b47f7ca2
And there's this another: https://github.com/Yevgnen/ivy-rich/commit/d2e64aee221228e27e670f6b1c051052cea33ea6
...I'll see what I can do, this evening. Feel free to provide more info as hinted, although probably a deep dive isn't as needed now.#2023-08-2412:21andrea.crottiYeah cool thanks I can also maybe revert to see if it's related to the recent change maybe#2023-08-2412:32vemvThe only file-truename call has been there for years https://github.com/clojure-emacs/cider/commit/906295826d0619146d41e1582b9b3f0b96d3b68c
What would help me the most is - is the underlying filesystem funny in any way? e.g is it a dired / tramp connection?#2023-08-2412:34andrea.crottino not really#2023-08-2412:34andrea.crottijust normal projects on a linux filesystem#2023-08-2412:34andrea.crottiwith btrfs if that makes any difference#2023-08-2412:34andrea.crottiwell I use dired but I'm just working locally on archlinux#2023-08-2412:35vemvAnd there are no symlinks in your project? Or an usually deep directory nesting perhaps?#2023-08-2412:39vemvAnother data point you can provide is M-: in the problematic buffer, (benchmark-run 100 (file-truename (buffer-file-name)))#2023-08-2412:49andrea.crottimm not really symlinks#2023-08-2413:04vemvThe following might improve things - would you generously try this patch locally?
https://gist.github.com/vemv/e22fe3a65c24ba8f0524012168398cd6
(remember to clean any byte-compiled files before: cd ~/.emacs.d; find . -type f -name "*.elc" -exec rm {} +)#2023-08-2413:48andrea.crottineed to find out how to use a local version but I'll try soon#2023-08-2413:49vemvthanks. If you use the default package manager, you can simply edit the files under ~/.emacs.d/elpa/cider*#2023-08-2508:09andrea.crottibtw I tried that change
5816 88% - ...
4864 74% - and
4864 74% - condition-case
4864 74% - substring-no-properties
4864 74% - cider-current-ns
4864 74% - cider-current-repl
4864 74% - cider-repls
4864 74% - sesman-current-session
4864 74% - sesman--friendly-sessions
4864 74% - seq-filter
4864 74% - seq-map
4864 74% - apply
4864 74% - #<compiled 0x18408632590fb8b4>
4864 74% - mapcar
4864 74% - #<compiled -0x1c3c5aaf302c356a>
4864 74% - #<compiled 0xa07e62d16636d1>
4864 74% - sesman-friendly-session-p
4861 74% - apply
4853 74% - #<compiled 0x12ba488ea2146bc7>
4847 74% - cider--sesman-friendly-session-p
4812 73% - let*
4404 67% + if
399 6% + and#2023-08-2508:09andrea.crottibut still same thing I think#2023-08-2508:10andrea.crottithe benchmark you mentioned above
(0.015348688999999999 0 0.0)
#2023-08-2508:10andrea.crottibut yeah it's generally almost unusable now#2023-08-2508:10andrea.crottiI have to revert to an older version#2023-08-2510:51vemvI'm sorry you had that experience.
I'd really appreciate if you could do some analysis at some point, so that you can keep updating CIDER. I reckon this can prevent similar issues for others, too.
In this section,
4404 67% + if
399 6% + and
is that all it says? Can you expand the + if ?
Also remember, you can run M-x cider-debug-sesman-friendly-session-p to run this very code, on demand.
Finally, do you have an unusually large namespace list (number of namespaces in your project) or classpath (a generally large number of dependencies)?
Does the problem persist even a small project?
Thanks much 🙏#2023-08-2511:06vemvHmmm, checking out the profiling in your original post, it looks like cider-current-ns is causing a recursive or semi-recursive execution of the whole cider--sesman-friendly-session-p logic.
I'll fix that today!#2023-08-2511:59andrea.crottiAh cool yeah sorry I can't test anymore since I have a last day of work before some holidays#2023-08-2511:59andrea.crottiBut well if you found the problem already I don't need too I guess#2023-08-2511:59andrea.crottiI suspect everyone should see this issue in theory#2023-08-2511:59andrea.crottiI'm on a pretty fast machine as well#2023-08-2512:10vemvYes, a PR is on its way. Thanks again!#2023-08-2717:30Benjaminwhat if we have metadata on ns or vars to say "call this function when loading the file". Or does this already exist?
The use case is you re-def server routes for instance and want to restart server. Same use case that mount handles#2023-08-2717:36vemvA custom piece of nrepl middleware could do that, yes
I don't think it exists, as far as cider is concerned. Closes thing would be cider's tools.namespace integration, e.g. defcustom cider-ns-refresh-after-fn#2023-08-2717:39Benjaminok interesting#2023-08-2717:50practicalli-johnDoes cider-refresh-before-fn and cider-refresh-after-fn meet your needs? They can be used with a cider restart
((clojure-mode . ((cider-refresh-before-fn . "practicalli.dev/stop")
(cider-refresh-after-fn . "practicalli.dev/start"))))
https://practical.li/spacemacs/clojure-repl/component-lifecycle/#lifecycle-with-cider-refresh
It has been a while since I used them, I typically call the relevant component lifecycle functions myself in a repl buffer#2023-08-2717:52BenjaminI can't find where they are used in the cider repo#2023-08-2717:52Benjaminmaybe they got removed?#2023-08-2718:09vemvthat's its obsolete name, nowadays it's cider-ns-refresh-after-fn#2023-08-2821:34practicalli-johnAh, I didn't notice the variables had changed, I've updated the book, thanks for clarifying.#2023-08-2809:22daveliepmannWhy were symbols and keywords with multiple / slashes added in https://github.com/clojure-emacs/clojure-mode/pull/475? I don't believe any of these are valid. (Context: I'm looking at https://github.com/clojure-emacs/clojure-mode/issues/653)#2023-08-2820:03vemvI don't like it myself, but seg.mnt/ve/yCom|pLex.stu-ff (per https://github.com/clojure-emacs/clojure-mode/pull/475/files) appears to be a valid name, in the same way that clojure.core has (defn / []) for division#2023-08-2820:17daveliepmannkeywords as well, or only symbols?#2023-08-2820:19vemv$ clj
Clojure 1.11.1
user=> :a/a/a
:a/a/a
not that I like it, but I can see why someone would want it supported#2023-08-2820:25daveliepmannfair point, should've tried that myself#2023-08-2813:08bgWhen using clojure-ts-mode C-c C-z doesn’t work in the REPL anymore because the fn cider-repl-type-for-buffer checks for buffers with clojure-mode enabled. I patched the function like this and now it works fine -
(defun cider-repl-type-for-buffer (&optional buffer)
"Return the matching connection type (clj or cljs) for BUFFER.
BUFFER defaults to the `current-buffer'. In cljc buffers return
multi. This function infers connection type based on the major mode.
For the REPL type use the function `cider-repl-type'."
(with-current-buffer (or buffer (current-buffer))
(cond
((seq-some #'derived-mode-p '(clojurescript-ts-mode clojurescript-mode)) 'cljs)
((seq-some #'derived-mode-p '(clojurec-ts-mode clojurec-mode)) cider-clojurec-eval-destination)
((seq-some #'derived-mode-p '(clojure-ts-mode clojure-mode)) 'clj)
(cider-repl-type))))
Is this the best way to fix the issue?#2023-08-2814:03bgThere are a few other issues, all of them are because of certain assumptions that cider makes about clojure-mode being enabled/available. Is there any recommendation on how to use clojure-ts-mode with cider at the moment?#2023-08-2820:00vemvA GH issue would be most welcome
The only input we have so far is https://github.com/clojure-emacs/cider/issues/3356#issuecomment-1601174777#2023-08-2815:04lispers-anonymousCider builds a lot of functionality on top of clojure-mode at the moment and as you've discovered isn't aware of clojure-ts-mode's existence. I suspect some time in the future we will start building awareness of clojure-ts-mode into cider, or perhaps write some sort of compatability layer on top of clojure-ts-mode that acts like clojure-mode. Right now I don't have an "official" suggestion other than to do what you are doing right now and patching things up to make them work as you encounter them. Maybe some of the solutions you find could be submitted to cider? It may not be what we land on but would get the conversation started for how to start integrating clojure-ts-mode and other packages.#2023-08-2815:06vemvhttps://clojurians.slack.com/archives/C0617A8PQ/p1691916711262449?thread_ts=1691749617.883889&cid=C0617A8PQ#2023-08-2815:07lispers-anonymousYeah, that's what I'm thinking of in term of a compatibility layer. You are spot on there.#2023-08-2816:36lispers-anonymousI wonder how it would work if clojure-ts-mode just defined functions with the exact same name in clojure-mode, like clojure-find-ns for instance, and then at the end of the file called (provide 'clojure-mode) . As long as clojure-ts-mode is loaded before cider this would work.
Whatever the solution, it shouldn't be noticed by users IMO#2023-08-2816:52lispers-anonymous(defvar clojure-ts--find-ns-query
(treesit-query-compile
'clojure
'(((source (list_lit
:anchor (sym_lit name: (sym_name) @ns)
:anchor (sym_lit name: (sym_name) @ns-name)))
(:equal @ns "ns")))))
(defun clojure-ts-find-ns ()
"Return the name of the current namespace."
(let ((nodes (treesit-query-capture 'clojure clojure-ts--find-ns-query)))
(treesit-node-text (cdr (assoc 'ns-name nodes)))))
This is the total implementation of find-ns in clojure-ts-mode.
https://github.com/clojure-emacs/clojure-ts-mode/blob/d630cd63af8022d5a1fee0e7aa05450b6e0fd75e/clojure-ts-mode.el#L673-L684#2023-08-2819:43vemv> I wonder how it would work if clojure-ts-mode just defined functions with the exact same name in clojure-mode
Not sure if I would be a fan myself, since older packages would still depend on clojure-mode. So order would be determined by the package dependency tree?
Wouldn't sound fun to troubleshoot / support 🙃#2023-08-2820:44lispers-anonymousHaha, fair enough. Just a fleeting thought.#2023-08-2911:47bozhidarI'd prefer to make the compatibility more explicit myself - like the checks proposed above for CIDER to just wrap whatever functionality it needs from clojure-mode in functions that try both clojure-mode and clojure-ts-mode. (or something along those lines) Perhaps there can be even a config option in CIDER for which major mode to prefer.#2023-08-2911:49bozhidarShouldn't be very hard to do - I guess the only tricky part would be some REPL-powered font-locking and indentation when you're using clojure-ts-mode, but we can simply disable this in the beginning.#2023-08-2912:40lispers-anonymous> I guess the only tricky part would be some REPL-powered font-locking and indentation when you're using clojure-ts-mode, but we can simply disable this in the beginning
That is going to be tricky#2023-08-2912:42bozhidarIt's not essential, so I assume most people will be able live without it for a while. I'm not sure we'll be able to update the TS grammar's on the fly the way we've been doing it for clojure-mode.#2023-08-2912:45lispers-anonymousThe grammar we cannot update on the fly since it is ~statically~ compiled#2023-08-2912:47lispers-anonymousBut some of the rules we may be able to, although many of the tree-sitter facilities are setup such that they are captured when the mode is initialized.#2023-08-2913:42bozhidarWe'll figure something out. As I said that's not an essential feature, so I don't see it as some roadblock.#2023-08-2819:36vemvℹ️ Starting from today's snapshot (`<tel:202308281813|20230828.1813>` , or simply master if Git is your jam), CIDER has a revamped enrich-classpath integration.
Over the last couple months (and after a long pause) I've reworked that lib, and its integration into cider.el.
enrich-classpath allows you to interact with Java sources in autocompletions, navigation, documentation and stacktraces. It makes available both third-party Java sources, and the sources from the JDK itself.
What's new?
• Categorically more robust
• Integrates with Lein and now Clojure CLI
• If you use Lein, your repl will use just one JVM backed by a clean java command, instead of Lein's usual two-JVM approach
https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath and other http://docs.cider.mx pages are its documentation for now. (enrich's https://github.com/clojure-emacs/enrich-classpath on github is outdated atm)
tldr: opt in to (setq cider-enrich-classpath t) , and enjoy it when jacking in to JVM projects. (No cider-connect usage is documented for now)
Bear in mind the first run will be a touch slow for a given project.
Feedback would be extremely useful before releasing CIDER 1.8.0. 🍎🍏#2023-08-2821:14hifumi123Is it intended that cider-jack-in-clj simply freezes emacs while it loads? I am using Emacs 28.2 and just ran M-x straight-pull-package-and-deps and M-x straight-rebuild-package to try out the latest CIDER#2023-08-2821:15hifumi123the previous behavior I would see the leiningen command invoked in my message buffer and wait — it was async#2023-08-2821:16hifumi123these changes also seem to have broken a few leiningen options (e.g. repl options like :init-ns doesnt work anymore)#2023-08-2821:17vemvIt can appear to freeze since it's doing stuff. Can take a good minute on a large project#2023-08-2821:17vemv> these changes also seem to have broken a few leiningen options (e.g. repl options like :init-ns doesnt work anymore)
Interesting. I honor :init but hadn't thought of :init-ns#2023-08-2821:18hifumi123:global-vars doesnt work either#2023-08-2821:18hifumi123in short I have a project with the following set
:repl-options {:init-ns foo.bar}
:global-vars {*warn-on-reflection* true}
and I start in the user namespace with *warn-on-reflection* set to false#2023-08-2821:19vemvI'll see what I can do about that one. Maybe it's easy. Note that Clojure CLI doesn't offer that, so it's in a grey zone#2023-08-2821:20vemv> Is it intended that cider-jack-in-clj simply freezes emacs while it loads?
I infer from your other feedback that the command eventually succeeded?#2023-08-2822:09hifumi123Yes, it succeeded. It just froze all of Emacs until the REPL appeared. The previous behavior in CIDER was spawning lein and I was able to do other things while waiting#2023-08-2822:12vemvThanks. I'll consider it. It's certainly a nuisance.
With Enrich's caching (which is partly shared across projects - much like ~/.m2), as you use it more, load times will decrease.
With a bit of luck I can simply use whatever async facility made this work for traditional jack-in.#2023-08-2822:21hifumi123Is it possible to downgrade CIDER in the meantime? I assume this would depend on the package manager on uses in Emacs#2023-08-2822:22vemvcider-enrich-classpath defaults to nil - you got it changed at some point#2023-08-2822:24hifumi123yeah, I have it set to t by default since I find the functionality useful, though the current workflow is disrupting a few of my lein projects#2023-08-2822:24hifumi123in particular, im noticing the dev profile is not being applied (though this is set by myself in a custom lein command in cider)#2023-08-2822:25vemvDoes it really take more than a few seconds after the first time though?
Profiles should be applied, I've used that myself every day
let's debug it#2023-08-2822:25hifumi123i.e. I have cider-lein-parameters set to "with-profile +dev repl :headless :host localhost", but one of my larger projects is no longer applying some stuff in the dev profile. itll be tough to make a repro but I can try soon#2023-08-2822:26hifumi123I havent tested startup time when restarting cider, but I can try that right now#2023-08-2822:28vemvmy cider-lein-parameters are:
"with-profile \"+async-checking,+test,+dev,+emacs-backend,+emacs-backend-init,+yourkit,+g1gc,+parallel-reload,+cider-nrepl-latest\" repl :headless :host localhost"
And all of them are applied#2023-08-2822:30hifumi123I see. I just attempted restarting CIDER, though the REPL only clears itself. However, if I quit the REPL then run M-x cider-jack-in-clj, Emacs freezes for about 10 seconds, but this is way faster than the first startup 🙂#2023-08-2822:30vemvPlease paste the output of M-: (cider--extract-lein-profiles cider-lein-parameters) ?
The other thing to keep in mind is, as mentioned, :init-ns and :global-vars are disregarded. Which is not a profiles bug, it's something else#2023-08-2822:31hifumi123("with-profile +dev " "repl :headless :host localhost")
#2023-08-2822:32hifumi123It looks like the profiles do work. I just did a search in the java invocation and indeed I see the extra source paths provided by dev. Sorry for the distraction#2023-08-2822:33vemvNo issue!
> Emacs freezes for about 10 seconds, but this is way faster than the first startup
Pretty good news!
> I just attempted restarting CIDER, though the REPL only clears itself.
Ah, I'm not a sesman-restart user myself so it escaped my mind. It's an important thing to support.
Thanks for the round of feedback!
I've gotten awesome value from it.#2023-08-2822:34vemvTo you and anyone else reading - I have to take a pause from CIDER hacking till Friday, then I will happily push the next iteration.#2023-08-2914:12pez👋 I am having an issue in Calva, with output printed from a threads spawned in an evaluation not getting printed in the repl output. CIDER is doing the right thing, and I’d like to know how.
• https://clojurians.slack.com/archives/C17JYSA3H/p1693209818386449#nrepl (among others) contain some of my observations so far https://clojurians.slack.com/archives/C17JYSA3H/p1693209818386449
• Calva issue tracking this: https://github.com/BetterThanTomorrow/calva/issues/2300
If some CIDER maintainer with knowledge about this could assist me, I’ll be forever grateful. 🙏#2023-08-2914:13dpsuttonbeen a bit. but there’s an op called “out-subscribe” or “subscribe-out”. This installs a forking printer as the system out which forwards all output back over the nrepl transport. is calva sending that operation?#2023-08-2914:15dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj#L69#2023-08-2914:15dpsuttonhttps://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/out.clj#L178#2023-08-2914:17pezThanks! Will have a look. We are not using this. When should it be sent? CIDER is not sending it as part of an evaluation, afaict from the nrepl message log.#2023-08-2914:17dpsuttonit’s a message in the startup#2023-08-2914:18pez🙏#2023-08-2914:53pezWho-hoo! Success! Do you know if it should be done for all sessions? Or, do clones of the sessions inherit this?#2023-08-2914:56dpsuttonno idea on that. i imagine clones inherit but don’t know#2023-08-2915:05pezDo you know if this is optional behaviour in CIDER? I’m an Emacs noob and get lost when trying to figure this out.#2023-08-2915:06dpsuttonThere’s an option to prohibit it#2023-08-2915:06dpsutton;; Redirect the nREPL's terminal output to a REPL buffer.
;; If we don't do this the server's output will end up
;; in the *nrepl-server* buffer.
(when (and cider-redirect-server-output-to-repl
(cider-nrepl-op-supported-p "out-subscribe"))
(cider--subscribe-repl-to-server-out))#2023-08-2915:07dpsuttoncider-redirect-server-output-to-repl is default true#2023-08-2915:07pezAwesome. Makes sense. Both that it’s optional and defaults to enabled.#2023-08-2915:25jpmonettaskind of late to the party but I was trying #C03KZ3XT0CF for this kind of bugs, and figured out you can easily compare both cider and calva initializations from the messages POV. So this is Cider#2023-08-2915:25jpmonettaswhile this is calva#2023-08-2915:26jpmonettasso yeah, no out-subscribe on calva#2023-08-2915:28pezVery cool! I didn’t know this log was available in flow-storm.#2023-08-2915:30pezThis build of Calva fixes this: https://output.circle-artifacts.com/output/job/bdd60eab-29e7-4072-ba2d-3f4c2248160d/artifacts/0/tmp/artifacts/calva-2.0.388-2300-subscribe-stdout-5c1ed69b.vsix (Doesn’t have the opt-out yet, but next build will. 😃 )#2023-08-2915:32jpmonettas> Very cool! I didn’t know this log was available in flow-storm.
it is not an nrepl log or anything, is the printer tool, so you can record everything that is happening for nrepl and cider for example, and then print every call to this read bencode form to get that#2023-08-3008:51tatutis there a handy way to get name of var where point is currently inside? (I see clojure-mode has a clojure-beginning-of-defun-function)#2023-08-3010:29vemv(nrepl-dict-get (cider-var-info (cider-symbol-at-point 'look-back)) "name")#2023-08-3010:33tatutworks#2023-08-3010:34tatutand looks like "ns" is available too so I can easily get both and construct a fully qualified var ref#2023-08-3016:55richiardiandreaHi there, has anyone had issues with define-clojure-indent in use-package?
I get a "Eager macro-expansion failure: (wrong-number-of-arguments (2 . 2) 1)" in I put it in the :config section#2023-08-3017:12RomaI have this in my config:
(use-package clojure-mode
:after paredit
:config
(define-clojure-indent
(defroutes 'defun)
(fn-traced 'defun)
(GET 2)
(POST 2)
(PUT 2)
(DELETE 2)
(HEAD 2)
(ANY 2)
(OPTIONS 2)
(PATCH 2)
(rfn 2)
(let-routes 1)
(context 2))
(keymap-set clojure-mode-map "RET" #'paredit-RET))
works fine.#2023-08-3017:29richiardiandreaAre you using Emacs 29.1#2023-08-3017:30Romayes, but this part was here for a while, I think it worked on emacs 27 and 28 as well#2023-08-3017:53richiardiandreaIt was not working here and I ended up using clojure-defun-indents in a :custom and put-clojure-indent 🤷#2023-09-0108:50iarenazaI have a similar config to @U01320BR6US and I don't have any issues in Emacs 29.1 (and I also had that config with Emacs 27 and 28, without any issues).#2023-09-0115:23richiardiandreaSounds good, not sure what differs there but thankfully clojure-mode has a good pattern (functions + macros that call them) so I could fix it on my side - thanks everybody for confirming!#2023-08-3112:12nivekuiltesting cider-enrich-classpath, it seems to break something with git deps. You should be able to repro on https://github.com/nivekuil/scv. jack-in and then try evaling the .clj. hcl.core doesn't make it on the classpath#2023-08-3113:04vemvThanks! I'll attend this today#2023-08-3120:58vemvIt's now fixed and available as cider (melpa snapshot), or simply Git master .
Thanks much for the QA round!#2023-09-0101:34jmckitrickI just tried building emacs -with-poll thinking that poll would be a drop-in replacement for select, right? 😬#2023-09-0101:36jmckitrickI noticed that jacking in to a clojure project started to connect but then never reported success. Is this a simple setting I can tweak, or is the poll change much more impactful on cider and nrepl’s connection functions?#2023-09-0220:13jmckitrickHas anyone tried running emacs and cider using -with-poll ?#2023-09-0106:16vimfunDo anyone encountered this problem?
1. Upgrade cider to version CIDER 1.8.0-snapshot (package:
2. Execute any cider command, then the exception raised.
Debugger entered--Lisp error: (wrong-number-of-arguments (0 . 0) 1)
clojure-find-ns(:supress-errors)
cider-get-ns-name()
cider-eval-ns-form(nil)
funcall-interactively(cider-eval-ns-form nil)
call-interactively(cider-eval-ns-form nil nil)
command-execute(cider-eval-ns-form)
#2023-09-0106:49vemvYou need to also upgrade clojure-mode#2023-09-0106:52vimfunThank U, I will give it a try. :-)#2023-09-0106:57vimfun@U45T93RA6 Thanks! It works!! 🙏:skin-tone-2:#2023-09-0109:30Colin (fosskers)Ah that must have been my problem yesterday. Testing...#2023-09-0109:35Colin (fosskers)Works like a charm, thanks#2023-09-0116:04Joseph Grahamnewbie question. can I turn off these messages in the minibuffer? I find it distracting them resizing the buffer all the time#2023-09-0116:06vemvhttps://docs.cider.mx/cider/config/eldoc.html#disable-ciders-eldoc-function#2023-09-0116:07Joseph Grahamah I see, thankyou#2023-09-0116:08vemvcheers cider#2023-09-0120:08vemvLast Monday I https://clojurians.slack.com/archives/C0617A8PQ/p1693251399445719 to the fine #C0617A8PQ community and asked for some feedback.
We have progress, as all of the feedback you've generously shared with me is now fixed!
Most notably:
• Lein (just like Clojure CLI) no longer blocks the Emacs UI
• Clojure CLI git deps work again
• There's a https://github.com/clojure-emacs/enrich-classpath#emacs-cider-connect guide
◦ This is a zero-overhead way to leverage enrich-classpath - as enabled by the intentful use of a Makefile.
◦ This also is an overall quality-of-life improvement for Lein users, even when disregarding all CIDER and enrich-classpath stuff, i.e. now you can enjoy the full power of Lein (plugins, dynamic project evaluation, etc) with deps-style caching.
CIDER latest (`<tel:202309011752|20230901.1752>` snapshot / Git master) makes these goodies available for you. A second round of feedback would be much appreciated.
We also are in bug fixing mode in preparation for 1.8.0, so if you bring them 🐛 , we squash them 🔨.#2023-09-0220:59John DoeOld time with tool deps, I can just create an alias profile in deps.edn, run clojure -M:dev and cider connect:
{:aliases {:dev {:extra-deps {cider/cider-nrepl {:mvn/version "RELEASE"}
nrepl/nrepl {:mvn/version "RELEASE"}
refactor-nrepl/refactor-nrepl {:mvn/version "RELEASE"}}
:main-opts
["--main" "nrepl.cmdline" "--middleware"
"[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}
Can I do the same with enrich-classpath added? I found the Makefile way kind of cumbersome and hacky and try to avoid that if possible.#2023-09-0221:28vemvYou can't - Enrich isn't a regular dependency.
Note that the Clojure CLI, internally, does the same exact type of caching that is accomplished with the Makefile. The only diffference is that the scripts are hidden somewhere in your machine - not free for you to understand/hack.
So when you have a problem or request, it has to go through a gatekeeper (this of course is not unique to clojure).
Anyway. You can download https://github.com/clojure-emacs/cider/blob/master/clojure.sh and replace clojure <whatever> with clojure.sh clojure <whatever> for commands that intend to launch a repl.
It has some commentary at the header.
Would love if it worked well for you - LMK. I could add it to the readme.#2023-09-0221:34vemv...Note that if you have CIDER snapshot latest (or master), you can find the script at something like ~/.emacs.d/elpa/cider*/clojure.sh , so that can be a stable location that a script of yours (e.g. in .zshrc / .bashrc) could dynamically find.
That way you'd always use the latest-and-greatest script.#2023-09-0221:38John DoeThanks for the explain and tip, I'll give it a go some time!#2023-09-0220:05vemvIn case you find the musing fun, today I spent most of my hack time formatting Javadoc as something that will look clear within a CIDER widget.
It's a fairly wicked problem, because javadoc mixes natural text with html, so you have to parse a not-quite-html string, while preserving newlines and table alignment.
I got it solved with a mixture of Jsoup on the cider-nrepl side, and https://github.com/emacs-mirror/emacs/blob/3dac48d1b73794d2379e233f11736d0279b0733c/lisp/net/shr.el on the elisp side.
You can look at how unusable it was before here: https://github.com/clojure-emacs/orchard/issues/179#2023-09-0305:47vemvSome progress - Java syntax highlighting right in the autocompletion widget#2023-09-0401:21aisamuThanks a lot for this!#2023-09-0411:27vemvCheers guys, thanks for the encouragement :)
I have kept working on this. I replaced Jsoup with JDK's official javadoc parser.
So here you have progress (vs. screenshot in OP):
• unwrapped {:tag :U018HQ11FTK, :attrs nil, :content nil} s
• Nicely formatted Throws/Returns etc#2023-09-0411:28vemvIf you want to help making this a reality, consider giving Enrich a spin! https://clojurians.slack.com/archives/C0617A8PQ/p1693598934327439#2023-09-0317:15lispers-anonymous@vemv what would it take to have clojure-ts-mode work with cider? Just basic "jack-in/connect" and things like switch-to-repl-buffer. I understand now that the dependency on clojure-mode would still exist.#2023-09-0317:24vemvFrom the thread that we (including bbatsov) participated in recently, it seemed that we were all fine with a simple compat layer.
Would that SGTY?
If so, making it work, I reckon, would be a matter of implementing each clojure-* shim, until do are able to get a jack-in.#2023-09-0317:25vemvYou could start with the smallest possible PR, to rest assured that we all indeed are OK with the technique#2023-09-0317:25lispers-anonymousI'm thinking something like another autoload like this one
https://github.com/clojure-emacs/cider/blob/5d87a4d2990cc17e9a1ba88ea9063b3278796fad/cider.el#L2092C1-L2105C1#2023-09-0317:26lispers-anonymousand seeing how far we can get without committing to the compat layer#2023-09-0317:28lispers-anonymousMaybe something with this https://github.com/clojure-emacs/cider/blob/5d87a4d2990cc17e9a1ba88ea9063b3278796fad/cider-selector.el#L135-L137
And a modification to cider-switch-to-last-clojure-buffer#2023-09-0317:28lispers-anonymousMaybe we do need a compat layer for that#2023-09-0317:29vemv> I'm thinking something like another autoload like this one
I have no strong opinion, I mean, if you can propose a small PR, exposing why it's the most sensible approach atm, nothing should go wrong
(also a bit hard to imagine all the implications of the code change without a PR. We have a CI that occasionally brings value 😇)#2023-09-0317:29lispers-anonymousYes of course. I will work on one, I was mostly just gathering my thoughts right now#2023-09-0317:30lispers-anonymousThank you. I hate to cut and run so soon after pinging you, but baby just woke up from nap time and I have to run.#2023-09-0317:32vemvNo issue!
To add another sensitive area: we have some logic based on (derived-mode-p 'clojure-mode) and similar#2023-09-0415:37bozhidar@UDVJE9RE3 I’d just grep for the usages of clojure-* functions. We simply need to wrap all of them in functions like cider-clojure-* that would pick which major mode to use. Those are mostly trivial ns and sexp navigation commands, which I assume exist in clojure-ts-mode already.#2023-09-0415:39bozhidarUsing with-eval-after-load will also work, of course. It’d be nice if we experiment with a couple of approaches and agree which yields the simplest code.#2023-09-0416:50lispers-anonymous> It’d be nice if we experiment with a couple of approaches and agree which yields the simplest code.
Yes I think that will be a wise approach.
Thinking out loud, I wonder what it would look like to invert the relationship between cider and clojure(-ts)-mode here. Have cider expose a couple of things like devfar clojure-find-ns-function things and clojure-ts-mode sets those vars. It could similarly set up the bindings for things like jack-in functions. I am not sure how the load order would work with that though. Shims may need to be written in clojure-ts-mode in case cider is not installed.#2023-09-0505:27bozhidarThen we might have a load ordering issue if someone has installed both modes and we haven’t done something explicitly about that load order. That’s why I think it’d be nice to be able to force on CIDER’s end which mode to use if both are around.#2023-09-0512:55lispers-anonymousYeah that sounds abut right. Load order issues are the worst and I want to try to avoid them as much as possible.#2023-09-0713:42telekidStrange issue. When I run cider-jack-in-clj , I see the following as expected:
Starting server via /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:dev:cider/nrepl
but then... nothing happens. Nothing printed to *messages*, no repl starts, nada. If I copy that command string and run it in a terminal, I can cider-connect-clj just fine. Any suggestions for troubleshooting this?#2023-09-0714:40vemvSomeone reported a similar issue when using Emacs 29 built with --with-poll : https://github.com/clojure-emacs/cider/issues/3455
If that is not it, perhaps try anyway with a few Emacs versions (27, 28, if you're on Mac, from https://emacsformacosx.com/ which are as vanilla as they can get)
Otherwise I'll be happy to attend a detailed github issue.#2023-09-0715:52vemv> Any suggestions for troubleshooting this?
I've never faced this, but a few possible suggestions are:
• Restart emacs
• enable nrepl-log-messages (defcustom) beforehand
• M-x toggle-debug-on-error beforehand
• Try jacking in again
• Check for *cider-nrepl* and/or *nrepl-messages* buffers
◦ (the latter is enabled by nrepl-log-messages)
◦ are they're there? Do they have any content?#2023-09-0717:43daveliepmannhttps://docs.cider.mx/cider/platforms/babashka.html#differences-with-clojure says jump-to-definition doesn't work for built-in vars. I'm seeing this for vars I define as well; is this a bug or expected behavior?#2023-09-0807:18bozhidarCan't remember at this point, but given the documentation it sounds like a bug. Haven't touched babashka since I've worked on adding support for it in CIDER.#2023-09-0807:24daveliepmannThanks, I'll write up a ticket babashka#2023-09-0807:39daveliepmannhttps://github.com/clojure-emacs/cider/issues/3456#2023-09-0804:09hifumi123There seems to be a regression in clojure-mode. For some reason lots of random property names in ClojureScript are being highlighted on my end. For instance (.. props -field -name) results in -name being highlighted when I dont want it to be highlighted. It gets the same highlighting as name.#2023-09-0807:16bozhidar@hifumi123 Can you share a screenshot?#2023-09-0807:33hifumi123#2023-09-0807:34bozhidarAnd this happens without CIDER being active? It definitely seems like a bug, I'm just trying to figure out if it's a bug in CIDER or in clojure-mode.#2023-09-0807:36hifumi123Looks like it is a CIDER bug after all. I do not reproduce this issue in a scratch buffer after restarting Emacs#2023-09-0807:36hifumi123#2023-09-0807:37hifumi123this is with fresh emacs instance and running M-x cider-scratch#2023-09-0807:37bozhidarOkay, please submit a ticket on CIDER's issue tracker then. Might be something to do with the track-state improvements @U45T93RA6 was recently working on.#2023-09-0808:53vemvIt looks like the mentioned improvements made an existing issue more likely :)
We want to highlight name (as a cljs.core function) but not -name .#2023-09-0810:17vemvI took a quick look, can repro. First step is (setq cider-font-lock-dynamically '(macro deprecated core)) .
Probably cider--compile-font-lock-keywords has a very subtle bug such that when we construct a huge regex, it's slightly unaccurate so that it matches -name besides from name .
We build these regexes with regexp-opt which warns:
> Each string should be unique in STRINGS and should not contain
> any regexps, quoted or not
Possibly, a cljs.core function happens to be a valid Elisp regex?#2023-09-0810:20vemvPlease be advised, it might be a while until we're in the mood for debugging huge regexes 😄 but GH issue welcome.
Note that this bug doesn't happen with (-> x .-foo .-bar .-baz) , which actually is what I'd normally use. -> is pretty universal: property access, interop method calls, normal threading stuff.#2023-09-1312:27ericdalloIs there any way to tell cider to never re-use a dead repl and always create a new one? (even nicer if killing the old ones)?
I feel like this should exists or was already asked before 😅#2023-09-1312:30vemvYup! It's on cider master https://github.com/clojure-emacs/cider/blob/a786c527da04ea44b6eb1374f14387f55deab2cf/CHANGELOG.md?plain=1#L14#2023-09-1312:31ericdalloawesome! thank you!#2023-09-1312:31elkenOh this is cool, will this be on the next release then?#2023-09-1312:33vemvCertainly! Working towards it
You can also help us by trying out master / or a "melpa unstable" snapshot. Nothing unstable about it :)#2023-09-1312:33ericdalloI have cider unpined always on my doom @U043RSZ25HQ so it's already available to me#2023-09-1312:33elkenCool! And yeah eric the module is due for a bump 🙂 This would be great to have in#2023-09-1312:53ericdalloyeah, agreed#2023-09-1319:10hifumi123This existed before but something happened between the 1.6.0 and 1.7.0 releases that made it stop working on my end#2023-09-1319:10hifumi123Glad to hear it’s been fixed though. I’ve gotten used to quit repl then running M-x cider every time I want to restart the REPL#2023-09-1420:53ericdallohey, reporting here just in case it's a cider bug and not a doom-emacs one 🧵#2023-09-1420:53ericdallohttps://clojurians.slack.com/archives/C01GE5PD249/p1694724014971619?thread_ts=1694715725.912309&cid=C01GE5PD249#2023-09-1420:53ericdalloStack:
Debugger entered--Lisp error: (wrong-number-of-arguments #<subr clojure-find-ns> 1)
clojure-find-ns(:supress-errors)
cider-get-ns-name()
cider-ns-form()
cider-load-buffer(#<buffer transfer_out.clj<2>> nil nil)
#<subr funcall-interactively>(cider-load-buffer #<buffer transfer_out.clj<2>> nil nil)
apply(#<subr funcall-interactively> (cider-load-buffer #<buffer transfer_out.clj<2>> nil nil))
funcall-interactively(cider-load-buffer #<buffer transfer_out.clj<2>> nil nil)
#<subr call-interactively>(cider-load-buffer nil nil)
apply(#<subr call-interactively> (cider-load-buffer nil nil))
explain-pause--wrap-call-interactively(#<subr call-interactively> cider-load-buffer nil nil)
apply(explain-pause--wrap-call-interactively #<subr call-interactively> (cider-load-buffer nil nil))
call-interactively(cider-load-buffer nil nil)
command-execute(cider-load-buffer)
#2023-09-1420:53ericdalloUsing latest cider from master#2023-09-1420:57vemv(replied over there)#2023-09-1517:30nivekuilis there anything blocking https://github.com/clojure-emacs/clj-refactor.el/issues/517? not sure what the replacement for pkg-info would be#2023-09-1517:56vemvI'll work on this today
Perhaps I had forgotten about it since we didn't get more reports.
Also, I've stuck to Emacs 26.
Either way - will get it to a better state!#2023-09-1518:53vemvDone https://github.com/clojure-emacs/clj-refactor.el/pull/549
clj-refactor.el 3.9.2 has been cut. It will be visible into MELPA within a few hours, or if you use Git dependencies, you can simply pull :)#2023-09-1806:34nivekuilcljr-version: Symbol's value as variable is void: cljr-version -- I get this on repl connect, should https://github.com/clojure-emacs/clj-refactor.el/blob/eb8c75bb5d0c4bbffb7adab1ad3084da50b93ece/clj-refactor.el#L3432 be a hard coded defconst like cider-version?#2023-09-1809:59vemvI'll check it out. I thought this was working because I can both cider-connect and cider-jack-in.
Anyway, this code path only is hit when you try running an older refactor-nrepl version. 3.9.0 is required. Try bumping it?
Thanks!#2023-09-1810:18vemvI have applied your suggested fix. It will be visible into MELPA within a few hours, or into Git master right now#2023-09-1816:35nivekuilah I forgot to bump that. wish we could inject middleware on connect (maybe we can now with repl.deps?) thanks for the fix#2023-09-1817:11vemvThanks to you!
You can also specify "RELEASE" as a version, it will resolve to latest. A bit loose of an specification, but we will very rarely have breaking changes.#2023-09-1817:12nivekuilwow, I never knew that#2023-09-1712:43Nikolas S.Are there some commands, guides, packages or "tricks" that can help me with error-handling? I am a beginner and often I see the stacktrace, but cannot really do much with it. I have used debug at point, but sometimes it doesn't work for some reason.#2023-09-1713:33vemvwhat cider version are you using?#2023-09-1713:37practicalli-johnSome basic advice dealing with errors and stack traces https://practical.li/spacemacs/debug-clojure/understanding-errors/#stack-trace-for-lazy-functions#2023-09-1713:38practicalli-johnIt's also worth looking at the tools available in the Cider error buffer, which can help reduce the number of lines in the error report
https://docs.cider.mx/cider/usage/dealing_with_errors.html#navigating-stacktraces#2023-09-1714:53vemv...I asked about the version because if you're using a recent snapshot (from melpa unstable) or Git master, no stackraces will be shown for Clojure compilation errors:#2023-09-1714:57vemvFor that screenshot, Clojure's own message is printed (it indicates that it expects an even number of forms) and no stacktrace will pop up.
(you can learn more about error phases https://clojure.org/reference/repl_and_main#_at_repl)
The insight I want to share is, if you are learning Clojure, most of the times you don't need a stacktrace, and looking at them might not be that useful.
...Of course, they do have plenty of use cases, but as a beginner, most times the 'fault' will reside in your own code and not in Clojure's, or a third-party lib's, so you might find there's little point in looking at their internals.#2023-09-1716:47Nikolas S.I am using CIDER 1.60 with Doom Emacs, just tried upgrading to the Master but couldn't get it to work. I will just ignore the stacktrace buffer then. I still get that message in the CIDER buffer, so I will pay more attention to the repl buffer then.#2023-09-1716:48Nikolas S.Also thanks to you two for the pointers and suggestions, I will check out the the links and dive a little bit deeper!#2023-09-1718:52jasonjckndoes anyone do a hack like this, while working with reducible at the REPL, and is there a better approach than this, since this feels wrong to me#2023-09-1818:04vemvInformal / fun poll.
Do you like clojure.core's original docstring formatting, considering how it will look in your widget of choice (corfu, company, the echo area)?
Example:#2023-09-1818:06vemvThis style (named 'fill-column' I believe) has always seemed barely legible to me - I need some paragraphs to make sense of stuff :)
So I was considering it CIDER could cleanly (non-mutatively) and optionally replace those with a nicer formatting: some extra newlines here, some backticks (for code formatting) there.#2023-09-1818:25nivekuilI never liked the minibuffer randomly exploding, so I pretty much disable those with (eldoc-echo-area-use-multiline-p nil)#2023-09-1818:28aisamu(nivekuil) re: exploding, I usually keep the eldoc buffer open in a separate frame/monitor precisely because of that#2023-09-1818:37practicalli-johnI like how completion and lsp-mode / lsp-ui displays the docs in a floating window so my eyes don't have to jump around. I think lsp adds some additional rendering which may help some doc strings (although most doc strings are very terse)
I usually use clojure-docs or an internet search if it's more than a brief reminder of something#2023-09-1818:55vemvThere are certainly plenty of choices for rendering the docstring - I'm not too concerned about that.
I'm most curious about the formatting of the clojure.core docstrings themselves - even if terse, can't they look slightly unreadable because of the lack of newlines?
There's this style which has gained popularity. I'm not sure I like it 100%, but at least it's a standard that I could easily point at. https://asciidoctor.org/docs/asciidoc-recommended-practices/#one-sentence-per-line#2023-09-1818:57aisamu> This style
>
Note that this optimizes for writing, leveraging the fact that markdown/asciidoc only starts a paragraph after an empty line (so, at read time/after rendering, it'll look like one single paragraph)#2023-09-1818:59vemvThat's fair, for Clojure docstrings though, there generally isn't a distinction between write-time and read-time - CIDER and the like will just render the string literally.
I could see however how it can be slightly confusing to use a document indended for purpose X to be used as reference for purpose Y.#2023-09-1819:24aisamuUnfortunately, cores's docstrings are a bit all over the place in terms of uniformity.
Note that some do have paragraphs, such as https://github.com/clojure/clojure/blob/6975553804b0f8da9e196e6fb97838ea4e153564/src/clj/clojure/core.clj#L6770-L6792
I probably wouldn't mind having it reflown to a wider (120?) width, but even that may not be always an improvement 😕#2023-09-1819:25aisamu(NB: I completely get what you're saying.
e.g. a great example of how hard it can get https://github.com/clojure/clojure/blob/6975553804b0f8da9e196e6fb97838ea4e153564/src/clj/clojure/core.clj#L6890-L6899#2023-09-1819:45vemvYeah. It probably would be nearly impossible to programatically improve these (well, without using GPT somewhere in the stack ;p)
I had in mind to create, say, an .edn file mapping the existing docstrings to hand-crafted improved docstrings. Typically the improvements would be whitespace-only. It sounds something small enough to do for clojure.core and a few others.#2023-09-1914:11Ruben SevaldsonHello 🙂 newbie question incoming: after calling cider-debug-defun-at-point, is there a way to remove the generated breakpoint?#2023-09-1914:12dpsuttonjust reevaluate the function#2023-09-1914:13dpsuttondebug-defun-at-point is basically throwing a bunch of code inside your regular function to step through it. so to remove that code you just redefine whatever your function is back to your regular version#2023-09-1914:14Ruben SevaldsonMany thanks 🙂#2023-09-1914:15dpsutton👍#2023-09-1918:06nivekuilI believe enrich-classpath drops :local/root deps from the classpath, a similar bug to the missing git deps which was fixed a few weeks ago https://github.com/clojure-emacs/enrich-classpath/pull/41/commits/3d5ba3edb2c126ee060dece2de8c7d04380ede66#2023-09-1918:22vemvWhat enrich version are you using?#2023-09-1918:26nivekuilshould be the one injected by CIDER 1.8.0-snapshot (package: <tel:202309171951|20230917.1951>)#2023-09-1918:26nivekuilno enrich in the deps.edn#2023-09-1918:31vemvTo make sure, please check clojure.sh within ~/.emacs.d/elpa/cider*/clojure.sh. It should be 1.17.0
There's specific test coverage for :local/root and I also test this out from time to time.
Do you have a project you could share? Or a redacted deps.edn maybe?#2023-09-1918:36nivekuiloutput=$(2>&1 "$clojure" -Sforce -Srepro -J-XX:-OmitStackTraceInFastThrow -J-Dclojure.main.report=stderr -Sdeps '{:deps {mx.cider/tools.deps.enrich-classpath {:mvn/version "1.17.0"}}}' -M -m cider.enrich-classpath.clojure "$clojure" "$here" "true" "$@") looks like 1.17. ill make a repro if you think it should work#2023-09-1918:37nivekuilI should note, this was with :local/root outside the project dir, i.e. starting with ../#2023-09-1918:40vemvI'll add test coverage for that today and will let you know if there was a bug there.
If not I might need more info
In the meantime you can set (cider-enrich-classpath . nil) in the .dir-locals for the affected project#2023-09-1918:49nivekuilupdated the same repro repo as last time, git clone --recurse-submodules #2023-09-1918:51vemvThank you. Investigating this as we speak!#2023-09-1919:05vemvFix on its way. Great job pointing to a relevant commit 🙌#2023-09-1919:15nivekuilyeah, that keep looked a little suspicious 🙂#2023-09-1919:40vemvIt's here :) https://clojars.org/mx.cider/enrich-classpath/versions/1.17.1
It's on CIDER master now. If you use MELPA, you'll have to wait up to 3 hours until the new package is visible. You can always edit the mentioned clojure.sh script by hand#2023-09-2017:55lilactownmyself and another user of #CRRJBCX7S have noticed with the latest CIDER that indentation after hitting a new line/making a structural update seems to have changed.
Previous default indentation (expected, desired)
($ some-symbol
{:A 1 :B 2}
foo
bar)
Current default indentation (undesired):
($ some-symbol
{:A 1 :B 2}
foo
bar)#2023-09-2017:57vemvI assume $ is a macro. Could you please indicate its source?#2023-09-2018:01lilactownhttps://github.com/lilactown/helix/blob/ecaafdb06c832893a47144986d0082a53d2a05bc/src/helix/core.clj#L14#2023-09-2018:04vemvcider-nrepl probably inferred that it has a :style/indent of 1 given that arglist
It a value of 0 (or :form, or :defn) would produce the desired indentation, please declare it, as usual
https://docs.cider.mx/cider/indent_spec.html#overview
(inference is new - see the last section)#2023-09-2018:07lilactownThanks, easy enough. Created https://github.com/lilactown/helix/issues/146 to track#2023-09-2018:13vemvNice. Tbh, checking out https://github.com/lilactown/helix/blob/master/docs/creating-elements.md#-macro it seems that the produced indentation is exactly what is considered idiomatic (at least in these circles)
In the example from that .md, these lines:
($ my-component ($ "div" "first")
($ "div" "second"
Seem badly indented to me, since it makes one believe that $ is a vanilla defn, while it is in fact a macro.#2023-09-2018:14lilactownit's only a macro for performance reasons; semantically it is a function that takes data and returns data#2023-09-2018:15vemvGot it. Yeah those pop up from time to time :)#2023-10-1416:57lilactownrevisiting this, I am not finding that CIDER is picking up the right indentation even when I set the style/indent metadata. Please let me know if I'm doing something wrong https://github.com/lilactown/helix/pull/148/files#2023-10-1416:59lilactownI'm using cider 1.8.0-snapshot from Sep 14, commit 09d72192a4734653ca0b1b4b227c38760880fc63#2023-10-1417:02lilactownjust tested with the official 1.8.0 release, same issues#2023-10-1418:13vemvThe metadata map goes before the arglist 👀#2023-10-1418:30lilactownaye, I found that out. I fixed every place I think, but still the DOM macros and fnc are not indented correctly#2023-10-1418:31vemvRestart emacs for good measure , if it persists I'll check out the repo/branch#2023-10-1419:21lilactownrestarted and it persists#2023-10-1420:02vemvAlright, I'll look into it sometime during the weekend#2023-09-2222:28Karl Xavercider-enrich-classpath t seems to break #flow-storm: cider-jack-in won't load the modified clojure version. Haven't looked into it, but I suspect there's a problem with :classpath-overrides?
deps.edn:
{:classpath-overrides {org.clojure/clojure nil} ;; for disabling the official compiler
:deps {com.github.jpmonettas/clojure {:mvn/version "1.12.0-alpha4_3"}
com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.7.3"}}}#2023-09-2306:08vemvSeems plausible b/c it's the first time I hear of classpath-overrides :)
I'll look into it today#2023-09-2307:54vemvFixed!
Note that :classpath-overrides can only go within :aliases - I assume you abbreviated your example
You can bump enrich-classpath by:
• Git pull (if you use cider via git)
• Using the latest CIDER MELPA snapshot (it will be available up to 3 hours from now)
• hand-editing ~/.emacs.d/elpa/cider*/clojure.sh#2023-09-2316:08Karl XaverAwesome, works perfectly. Thanks for the quick fix!
And yeah, had it in an alias initially, sorry for creating confusion. Should have double checked that it still works.#2023-09-2322:28vemvCheers. Your testing is greatly appreciated. We are adding (WIP) the finishing details to CIDER that will make enrich-classpath shine: better Company, Corfu, *cider-doc* and mouse tooltip popups for Java documentation. It's all looking very pretty.#2023-09-2222:32Karl Xaver(cider-version)
"CIDER 1.8.0-snapshot (package: #2023-09-2602:14hifumi123To help with https://github.com/lilactown/helix/issues/146
Some change in clojure-mode (or CIDER) causes the $ macro to indent as if by :style/indent 1 … is this intentional?#2023-09-2602:30dpsuttonhttps://clojurians.slack.com/archives/C0617A8PQ/p1695232536190509#2023-09-2602:35hifumi123I somehow missed that. Thanks for sharing#2023-09-2613:14vemvℹ️ CIDER master / {:tag :tel:_20230926113920230926.1139, :attrs nil, :content nil} features a revamped cider-test-run-test (run test at point).
Now, it will run the first valid test found at point for:
• the current *cider-test-report* failure
• deftests, and deftest-like forms (`cider-test-defining-forms` is no longer necessary and now deprecated) in the current namespace
• :test metadata that may be present in vanilla defns
• deftests for the current src/ defn, as found (and configurable) by cider-test-infer-test-ns
◦ We search for a var named foo-test in that inferred ns, falling back to foo
Docs: https://docs.cider.mx/cider/testing/running_tests.html#2023-09-2613:14vemvThe usual caveat that tests must be loaded beforehand still applies.
You may want a customization such as:
(advice-add 'cider-test-run-test :around
(lambda (f &rest args)
(save-buffer)
;; Or `(cider-load-buffer)`, `(cider-eval-defun-at-point)`, etc:
(cider-sync-tooling-eval "((clojure.core/resolve 'clojure.tools.namespace.repl/refresh))")
(apply f args)))
#2023-09-2614:53aisamuThank you!#2023-09-2615:11vemvCheers! Kudos also go to @U5JGH2F89#2023-09-2707:22thhellerhttps://github.com/clojure-emacs/cider-nrepl/issues/819#2023-09-3001:06john2xis there a template to start a basic project with cider dependencies and integrations all set up? I just want to start playing with the repl basically.#2023-09-3001:17jpmonettasif it is just for playing you can open emacs, do a cider-jack-in and it can start and connect to a repl without any project. You can then create a .clj file or just put any buffer in clojure-mode and start playing with clojure#2023-09-3001:18john2xoh TIL. That's awesome, thanks!#2023-09-3001:23jpmonettasnext step if you want to start creating a project and adding some dependencies you can :
$ mkdir my-project
$ cd my-project
$ echo '{:deps {hiccup/hiccup {:mvn/version "2.0.0-RC1"}}}' > deps.edn
then open that deps.edn file in emacs and do the cider-jack-in while on that file. It will start a repl but this time with those dependencies loaded#2023-09-3001:24john2xheh, that was going to be next question, how to gradually add dependencies#2023-09-3001:28jpmonettasalso if you have one of the latest clojure cli installed, instead of adding that dependency there you can create your deps.edn like this :
echo '{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha4"}}}' > deps.edn
and start a repl with that, and no other dependency.
That will start a repl with clojure 1.12 which has a nice feature to add libs on the fly, just by typing on your user ns :
user> (add-lib 'hiccup/hiccup {:mvn/version "2.0.0-RC1"})
or whatever library you want to play with, without restarting the repl#2023-09-3013:42practicalli-johnIf you look in the Emacs messages buffer after the jack-in command, you can see the full command that cider uses to start the REPL. Useful if you ever need to customise what command cider runs#2023-09-3013:47practicalli-johnFor future reference, the simplest way to customise repl start up is via a .dir-locals.el file, including aliases to run that provide additional tools
https://practical.li/spacemacs/clojure-development/project-configuration/#2023-10-0102:01ZacharyHow can I change the cider-spinner to show in my file buffer, rather than in the REPL buffer?#2023-10-0105:33alexyakushevThat's a tricky one. I remember having to modify some code inside CIDER sources to achieve that, and my changes got overwritten by an update, so I don't know how to do it anymore 😅#2023-10-0301:09Zachary@alexyakushev Thanks for the response! Watching one of your screencasts for your Clojure profiler and seeing the spinner active in the file buffer is what inspired me to look into this! (It’s not as often that I have a REPL buffer visible, but knowing there’s a longer-running computation is useful feedback.)
I want to thank you so much for your tools! I use them everyday. So much so that I have an emacs shortcut wrapping them to run at a key press. Including in case it’s useful to others:
(defun clojurize-last-sexp (f)
(let* ((bounds (cider-last-sexp 'bounds))
(s (cider-last-sexp))
(clojurize (concat "(" f " " s ")")))
(cider-interactive-eval clojurize nil bounds (cider--nrepl-print-request-map))))
(defun clojurize-defun-at-point (f)
(let* ((bounds (cider-defun-at-point 'bounds))
(s (cider-defun-at-point))
(clojurize (concat "(" f " " s ")")))
(cider-interactive-eval clojurize nil bounds (cider--nrepl-print-request-map))))
;; ----------------------------------------------------------------------
(defun clj-quickbench-at-point ()
(interactive)
(clojurize-defun-at-point "criterium.core/quick-bench"))
(defun clj-quickbench-last-sexp ()
(interactive)
(clojurize-last-sexp "criterium.core/quick-bench"))#2023-10-0307:16ZacharySo, I am able to get the spinner to display in file buffer by modifying two lines in cider-client.el, changing connection to eval-buffer and adding (add-hook 'cider-after-eval-done-hook 'spinner-stop) to my config. Below is the modified function with the original lines commented out:
(defun cider-nrepl-request:eval (input callback &optional ns line column additional-params connection)
"Send the request INPUT and register the CALLBACK as the response handler.
If NS is non-nil, include it in the request. LINE and COLUMN, if non-nil,
define the position of INPUT in its buffer. ADDITIONAL-PARAMS is a plist
to be appended to the request message. CONNECTION is the connection
buffer, defaults to (cider-current-repl)."
(let ((connection (or connection (cider-current-repl nil 'ensure)))
(eval-buffer (current-buffer)))
(run-hooks 'cider-before-eval-hook)
(nrepl-request:eval input
(lambda (response)
(when cider-show-eval-spinner
;; (cider-eval-spinner connection response)
(cider-eval-spinner eval-buffer response)
)
(when (and (buffer-live-p eval-buffer)
(member "done" (nrepl-dict-get response "status")))
(with-current-buffer eval-buffer
(run-hooks 'cider-after-eval-done-hook)))
(funcall callback response))
connection
ns line column additional-params)
;; (cider-spinner-start connection)
(cider-spinner-start eval-buffer)))#2023-10-0309:02alexyakushevCool that you've got to the bottom of it! Perhaps, this could make a good feature request for Cider. I also almost never have the REPL buffer open, so a spinner in the current code buffer makes more sense.#2023-10-0310:45lassemaattaThis would be a nice feature (e.g. I have keybindings for running stuff like (user/reset) for integrant-repl which take a non-trivial amount of time to execute). I tried hacking together a solution some time ago but had to abort as I realized I just don't understand elisp enough 🙂#2023-10-0322:32Zachary@U0178V2SLAY You should be able to just replace cider-nrepl-request:eval into cider-client.el with the one above, and remember to add and evaluate (add-hook 'cider-after-eval-done-hook 'spinner-stop) somewhere in your user config, otherwise the spinner handler isn’t receiving the finished signal properly. Hooks are like event handlers that get run after some condition happens. If for some reason you get an infinite spinner, you can always manually run M-: (spinner-stop) .
This change has been working great for my intentions. The code I changed only effects the spinner logic, so I don’t see this interfering with anything else.#2023-10-0103:41deep-symmetryOh no… I’m finally finding some time to do a little work on one of my open source projects, and something about the current versions of cider and my other Clojure packages are breaking in a bad way. As soon as I jack in, I get the following error popping up in the minibar:
error in process filter: Wrong number of arguments: ((clojure-mode-abbrev-table paredit-mode paredit-version paredit-space-for-delimiter-predicates font-lock-end font-lock-beg calculate-lisp-indent-last-sexp t) nil "Return the namespace of the current Clojure buffer.
Return the namespace closest to point and above it. If there are
no namespaces above point, return the first one in the buffer.
The results will be cached if `clojure-cache-ns' is set to t." (if (and clojure-cache-ns clojure-cached-ns) clojure-cached-ns (let ((ns (save-excursion (save-restriction (widen) (condition-case nil (progn (while t (up-list nil t t))) (error nil)) (or (clojure--find-ns-in-direction 'backward) (clojure--find-ns-in-direction 'forward)))))) (setq clojure-cached-ns ns) ns))), 1
The same error prevents me doing things like evaluating s-expressions or defns. I am basically dead in the water. Is there any hope anyone might be able to help me troubleshoot this?#2023-10-0103:50deep-symmetryThis is with cider 20230930.751.#2023-10-0103:58deep-symmetryThe middle of that looks like the doc string and start of the implementation of clojure-find-ns from clojure-mode.el but I can’t imagine why that is showing up as an argument to something in the process filter? Whatever that means?#2023-10-0103:59deep-symmetryI can’t find the string clojure-mode-abbrev-table anywhere in my elpa downloads.#2023-10-0105:47deep-symmetryWell, after much flailing and pulling out some of my few remaining strands of hair, I was able to figure out how to revert to the melpa-stable version of Cider, which works again.#2023-10-0108:25vemvAll what was needed was to update clojure-mode besides from CIDER
Happy hacking!#2023-10-0108:27deep-symmetryCan you clarify this? Is there a way to continue using the melpa version of Cider? What clojure-mode does it need?#2023-10-0108:27deep-symmetry(If so, Cider should give that instruction instead of crashing in such a horrible and cryptic way.)#2023-10-0108:52vemvAll you need to do is to use clojure-mode latest (stable and unstable happen to be the same commit today, for clojure-mode)#2023-10-0108:55vemvYou encountered a more cryptic error message than usual, but it's not undecipherable. Either way, it's not on CIDER to work around the nature of Elisp#2023-10-0115:57deep-symmetryThanks, I will give that a try! And please understand I wasn’t trying to insult CIDER here, if it sounded like that, it is because I was extremely tired and fried after being up much later than I should be, trying to get the Clojure development environment I have come to rely on so profoundly to work again so I could help one of my own users. I was wondering whether, if CIDER depends on a particular version of clojure-mode, and that version is not present, there is any way it could give an explicit warning about that, the way it does with cider-nrepl. Otherwise, even someone like myself, who has been using Emacs since 1987, who wrote the chapter on Elisp in the current revision of O’Reilly’s “Learning GNU Emacs,” and who has been living in CIDER for my personal and professional projects for roughly a decade, can be stuck in a panic for a while. Of course, if I had taken a breath, stepped back, and waited until the morning to see if anyone on this channel had advice in response to my messages, you would have saved me from all that. 😄#2023-10-0116:47vemvIt's no issue :)
CIDER declares its clojure-mode dep in a vanilla fashion: https://github.com/clojure-emacs/cider/blob/9b300bf817e77f611f9c589c9cdd665f19d98c5f/cider.el#L15
Then it's the package manager's concern to take care of transitive deps. I feel that making sure that the package manager did its work properly would exceed what is expected for a package. We cannot reasonably e.g. wrap every defun in a try/catch and try to automatically perform a diagnostic when things go wrong.
Probably if we wanted to zap all possible sources of confusion, we could only accept Github issues as a form of support, and place a very stringent form (not template) that makes sure that users have performed all the basic troubleshooting themselves. I took that approach with https://github.com/rm-hull/nvd-clojure/ (try opening an issue there) and issue reports have greatly dropped since.
But things are quite good as they are right now.#2023-10-0118:08deep-symmetryAgreed, and trying to get the package manager to behave better would probably be as effective as attacking a windmill with a lance. 🙂#2023-10-0202:01deep-symmetryAnd I can confirm that after fighting with the package manager for a bit more—I think I need to remove the lines from my init.el that require these packages—everything is working with the latest versions. Thanks again!#2023-10-0301:09Zachary@alexyakushev Thanks for the response! Watching one of your screencasts for your Clojure profiler and seeing the spinner active in the file buffer is what inspired me to look into this! (It’s not as often that I have a REPL buffer visible, but knowing there’s a longer-running computation is useful feedback.)
I want to thank you so much for your tools! I use them everyday. So much so that I have an emacs shortcut wrapping them to run at a key press. Including in case it’s useful to others:
(defun clojurize-last-sexp (f)
(let* ((bounds (cider-last-sexp 'bounds))
(s (cider-last-sexp))
(clojurize (concat "(" f " " s ")")))
(cider-interactive-eval clojurize nil bounds (cider--nrepl-print-request-map))))
(defun clojurize-defun-at-point (f)
(let* ((bounds (cider-defun-at-point 'bounds))
(s (cider-defun-at-point))
(clojurize (concat "(" f " " s ")")))
(cider-interactive-eval clojurize nil bounds (cider--nrepl-print-request-map))))
;; ----------------------------------------------------------------------
(defun clj-quickbench-at-point ()
(interactive)
(clojurize-defun-at-point "criterium.core/quick-bench"))
(defun clj-quickbench-last-sexp ()
(interactive)
(clojurize-last-sexp "criterium.core/quick-bench"))#2023-10-0307:16ZacharySo, I am able to get the spinner to display in file buffer by modifying two lines in cider-client.el, changing connection to eval-buffer and adding (add-hook 'cider-after-eval-done-hook 'spinner-stop) to my config. Below is the modified function with the original lines commented out:
(defun cider-nrepl-request:eval (input callback &optional ns line column additional-params connection)
"Send the request INPUT and register the CALLBACK as the response handler.
If NS is non-nil, include it in the request. LINE and COLUMN, if non-nil,
define the position of INPUT in its buffer. ADDITIONAL-PARAMS is a plist
to be appended to the request message. CONNECTION is the connection
buffer, defaults to (cider-current-repl)."
(let ((connection (or connection (cider-current-repl nil 'ensure)))
(eval-buffer (current-buffer)))
(run-hooks 'cider-before-eval-hook)
(nrepl-request:eval input
(lambda (response)
(when cider-show-eval-spinner
;; (cider-eval-spinner connection response)
(cider-eval-spinner eval-buffer response)
)
(when (and (buffer-live-p eval-buffer)
(member "done" (nrepl-dict-get response "status")))
(with-current-buffer eval-buffer
(run-hooks 'cider-after-eval-done-hook)))
(funcall callback response))
connection
ns line column additional-params)
;; (cider-spinner-start connection)
(cider-spinner-start eval-buffer)))#2023-10-0207:35CaseyI am editing a cljs (shadow-cljs) project that has a clj and cljs repls. Both are configured with nrepl. I am seeing double dispatch in cljc files to both repls. Is this possible to turn off? https://docs.cider.mx/cider/0.24/usage/managing_connections.html if i am readit it correctly, says that it should only dispatch to the "most recently viewed REPL of the relevant type".#2023-10-0207:41vemvYou're checking out the docs for 0.24 which is pretty old. Hopefully it wasn't google that directed you there? :)#2023-10-0207:41vemvAnswering to your q, we now have cider-clojurec-eval-destination as documented on
https://docs.cider.mx/cider/cljs/up_and_running.html#working-with-cljc-files
(Git master or melpa snapshot only)#2023-10-0208:19Caseyoh crikey didn't notice the version of the docs.. i think i landed there from a slack search :face_palm:#2023-10-0209:44Casey@U45T93RA6 is there a way to target a clj or cljs repl specifically when using cider-nrepl-sync-request:eval in emacs?#2023-10-0209:45CaseyI want to be able to eval some clj code via a shortcut when my open buffer is cljs#2023-10-0209:46vemvYes, pass as the connection argument: (cider-current-repl 'cljs 'ensure)#2023-10-0211:30CaseyWorks perfect thanks#2023-10-0214:42λHello, I've seen some folks have their require section automatically filled when using emacs #2023-10-0214:46vemvit's cljr-slash from clj-refactor.el 🙂#2023-10-0215:31λoh nice #2023-10-0215:32λthanks!#2023-10-0215:51practicalli-johnIt could also be Clojure Lsp which has a feature to add requires when using functions from a different library/namespace#2023-10-0214:42λis this a cider function #2023-10-0214:43λfor example, typing (str/replace) auto adds [clojure.string :as str] to the (ns (:require...))#2023-10-0309:53magnarsI see that in a fairly recent CIDER update there has been a change to only popping up the stacktrace-buffer for runtime errors. This makes some sense, since popping up the big stacktrace-buffer isn't necessary for things like syntax errors, but I apparently need help writing code that compiles at times, and now the error message is only found in the REPL buffer. Is there some way to show me the error in the minibuffer, perhaps?#2023-10-0310:04dakraI think there landed a fix for this 3 days ago https://github.com/clojure-emacs/cider/issues/3487#issuecomment-1741711828#2023-10-0310:16magnarsoh, nice! Cheers, @UFAP0C8KU 🙏#2023-10-0310:35magnarsI'm on CIDER 1.8.0-snapshot <tel:202310011157|20231001.1157> on melpa, and not seeing the red overlay that is supposed to take the place of the stacktrace buffer. I'm triggering a syntax error to verify the behavior. I get the message only in the repl. Where can I start to investigate what is going on?#2023-10-0311:00magnarsMore information: I get the red overlay when running cider-eval-last-sexp , but not when running cider-load-buffer .#2023-10-0311:02magnarsThis seems more like a different use case for me. I've asked in the relevant issue. https://github.com/clojure-emacs/cider/issues/3487#2023-10-0407:28daveliepmannThanks for reporting, I'm not yet on this version but this is part of my workflow too#2023-10-0421:30hifumi123Has anyone else seen identation break for helix's defnc macro in latest CIDER? and other def-like macros#2023-10-0422:03vemvSee https://github.com/lilactown/helix/issues/146 and related threads over #cider
The fix would be very simple, namely declare indentation metadata explicitly (as people always were supposed to)
https://docs.cider.mx/cider/indent_spec.html
You can, in the meantime, alter-meta! the vars to add a sensible :style/indent in user.clj
Hope it helps!#2023-10-0509:10vemvI have good news though, def-like macros will get no more inference starting from the next cider-nrepl release (should be available around tomorrow)
https://github.com/clojure-emacs/orchard/pull/194
Some macros like helix' $ will still need to get an explicit specification for them to behave as usual.#2023-10-0513:08dawdlerStruggling a bit with deps.edn and cider. Have not had any problems with it earlier. Any reason why extra deps
…
:aliases
{:dev
{:extra-paths ["dev"]
:extra-deps {integrant/repl {:mvn/version "0.3.3"}}}
…
gives java.io.FileNotFoundException could not locate ..., and is therefore not available on classpath from ROOT/dev/user.clj? (Using Emacs+Cider, starting REPL with -A:dev). It used to work so smoothly, iirc — it’s been a while.
Output from clj -X:deps list :aliases '[:dev]':
$ clj -X:deps list :aliases '[:dev]'
...
integrant/integrant 0.8.1 (MIT)
integrant/repl 0.3.3 (MIT)
...
What am I missing?#2023-10-0513:11Alex Miller (Clojure team)what's the actual error you're seeing? could not locate ... what?#2023-10-0513:13dawdler2. Unhandled clojure.lang.Compiler$CompilerException
...
1. Caused by java.io.FileNotFoundException
Could not locate integrant/repl__init.class, integrant/repl.clj or
integrant/repl.cljc on classpath.
#2023-10-0513:14dawdlerStarting cider with C-u C-c M-j adding -A:dev#2023-10-0513:15jpmonettascan you paste the clojure command that cider is running? it will show it when it starts the repl#2023-10-0513:15dawdlerCIDER 1.8.0-snapshot#2023-10-0513:16dawdler/opt/homebrew/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.38.1\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.9.0\"\}\}\
\:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:cider/nrepl -A:dev#2023-10-0513:16dawdlerOops, that's ugly#2023-10-0513:16Alex Miller (Clojure team)that -A:dev has to be before the -M to take effect#2023-10-0513:17jpmonettasyeah that is weird, mine puts all the aliases in -M#2023-10-0513:17Alex Miller (Clojure team)-M (and -X and -T) consume all args after them#2023-10-0513:17Alex Miller (Clojure team)combining into -M would be better :)#2023-10-0513:17dawdlerOhh... is that new? Or have I somehow, for unknown reasons, just imagined it working before. Testing...#2023-10-0513:17Alex Miller (Clojure team)not new, has been like that for al ong time#2023-10-0513:18magnarsSetting cider-clojure-cli-aliases to -A:dev should insert the alias correctly.#2023-10-0513:18dawdlerOkay, thanks a lot, folks. This will bring me on my merry way. 👍#2023-10-0513:19jpmonettasyeah, I normally have a .dir-locals.el on each project with at least :
((clojure-mode . ((cider-clojure-cli-aliases . "dev:dev-tools:storm"))))
#2023-10-0513:20jpmonettasthat will allow different aliases for different projects, now if you want to try that remember that this vars are set when you open a buffer, so you will have to re-open the buffers after creating that .dir-locals.el (just the first time)#2023-10-0513:21dawdlerMany thanks#2023-10-0513:21vemvAliases should start with a colon btw (not critical, and cider fixes it if missing)
In Alex' words:
> aliases should always use :
> in some cases, aliases without colons are tolerated (but don't do that)#2023-10-0513:23vemvbtw your problem is a usual one for tools.dps - not the best UX from CIDER's side.
Today I put an improvement in the hammock: https://github.com/clojure-emacs/cider/issues/3497#issuecomment-1748510919#2023-10-0513:28dawdlerTo be fair, there is a warning about using -M and not -A. That's on me. But the issue comment looks like it could bring some improvement to the UX, indeed.#2023-10-0516:38practicalli-johnhttps://practical.li/spacemacs/clojure-development/project-configuration/ has examples of using .dir-locals.el with Clojure CLI aliases and other variables, also covers the basic syntax.
In Emacs, the universal argument, i.e. C-u can be used before calling jack-in to check the command that will be used to jack-in (and edit it if required)#2023-10-0519:47vemvℹ️ cider-nrepl 0.39.0, as bundled with CIDER latest (Git master / {:tag :tel:_20231005183120231005.1831, :attrs nil, :content nil} snapshot) bundles refinements in the https://docs.cider.mx/cider/indent_spec.html#indentation-inference feature, such that it will work better with def-like and threading macros.
It also powers something else which will be demoed tomorrow 👀#2023-10-0618:53vemvLoading parentheses... oparen loading cparen#2023-10-0618:54vemvCIDER master / {:tag :tel:_20231006175020231006.1750, :attrs nil, :content nil} snapshot introduces Java doc comment rendering and improved type inference for Java interop.
You need to enable enrich-classpath as described https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath.
What does that mean?
• Java doc comments (informally "docstrings", "javadocs") are rendered from their not-exactly-html format into a readable, syntax-colored format that is guaranteed to reasonably fit into UI widgets, without resorting to dumb trimming
• Arglists are rendered with useful type info expressed as metadata: ^PrintStream [this, ^java.util.Locale l, ^String format, ^Object args]
• Provided that you use type hints (as you already might be doing, to zap reflection warnings), and sometimes without hints at all, we can provide very accurate Java interop completion and documentation .
This functionality can be seen in:
• https://docs.cider.mx/cider/usage/code_completion.html#auto-completion
• M-x cider-doc
• https://docs.cider.mx/cider/config/eldoc.html
• https://docs.cider.mx/cider/usage/working_with_documentation.html#displaying-documentation-as-tooltips
30 second demo:#2023-10-0619:10aisamuThis is great! Thank you!#2023-10-0620:08ZacharyNeat! One issue I’m having when enabling this is that my java-source alias no longer goes to definition when I M-. xref-find-definitions. Emacs hangs indefinitely(?) until I C-g. Definitely excited to see more support for java lookup! One thing I haven’t gotten to work yet is to do lookup on included java libraries or clojure’s java implementation. (I manually go to file if I care enough to understand more.)
:src/java20
{:extra-deps
{openjdk/java-sources {:local/root "<my-local-java-src>"}}}#2023-10-0620:14vemvThanks for the input!
I don't recommend that style of aliases. Adding java sources 'manually' can be problematic, for contrived reasons. By using enrich-classpath, the same sources (and then some more: Clojure's, those of 3rd-party deps, and so on) are added, but in a way that isn't problematic (technically: they're placed at the end of the classpath).
enrich-classpath recently got tools.deps support and I've duly fixed all little issue reports - often in less than 2 hours from report to release time.
I'd suggest giving it a try, and if it fails feel free to report a GH issue right away.#2023-10-0909:03vemvI tried xref-find-definitions specifically and it works.
If it keeps being a problem (especially if you enable Enrich and disable the custom alias), please perform (setq nrepl-log-messages t), retry, and create a GH issue attaching the *nrepl-messages* buffer.
Thanks!#2023-10-0923:49ZacharyYes, xref-find-definitions is working for me as well, but wasn’t when I had set the java-sources manually. I’m excited that this is working now “out of the box”. 👏
A few things:
• I’m noticing that xref-find-definition works only if connected to REPL. It hangs otherwise. I’m usually connected, and I think this was similar to before, so not a big deal.
• When jacking in, a java process begins to download hundreds of megabytes from maven and clojars, thus taking quite a while to connect to repl. This happens even on subsequent jack-ins. This is only happening when cider-enrich-classpath is set. Connects immediately otherwise. 👀 ⏲️
• When I xref-find-definition on Clojure java source, or other imported Java library, No definitions are found (I have never been able to get this to work, wonder if it’s in-scope for enrich-classpath/intended to work/how to make work? 🤷
#2023-10-1007:06vemvFor the first bullet point, it's normal that it doesn't work, but it's not that it hangs 😱 I'll file an issue.
For the second, it would surprise me very much. Caching is one of enrich-classpath's more stable parts, it's described https://github.com/clojure-emacs/enrich-classpath#notes-on-caching. Are you sure you are trying the same project, with the same profiles?
If it persists, after a successful jack in please check that the following files exist: ~/.cache/enrich-classpath-cache (file), ~/.cache/mx.cider/ (dir)
For the last point, it's one of most basic things that Enrich does. Feel free to file an issue, attaching your classpath (please grab it with ps aux | grep java - one of the entries should correspond to your project). Example: https://gist.githubusercontent.com/vemv/d307061feb0d67d602bf93947730cb91/raw/20bf234b1adac7b8cdb8a69e4fa2f9b13daf9f64/gistfile1.txt
...if the classpath doesn't include something like mx.cider/enrich-classpath/<some digits>.jar, that's the problem#2023-10-1007:44vemvI tried to repro the first bug, but couldn't. What's your value for xref-backend-functions when in clojure mode and not connected?
For me it's (etags--xref-backend)#2023-10-1008:52vemv...I sense that if you used M-x cider-find-var instead (at least as a temp experiment) you'd get the correct results, and no blocking. Probably something else is shadowing the cider xref backend.#2023-10-1300:25ZacharyAs for the downloading upon successive jack-ins… It doesn’t seem to be doing that anymore. I think I may have been switching between different java versions at that time, causing this. That said, jacking-in with enriched class-paths takes ~16 seconds, whereas it takes ~2 seconds otherwise. With enriched enabled, I do notice a bash process calling instead, and also Java Class: clojure main process making network calls, but not significantly (anymore)…#2023-10-1300:27ZacharyWhen I ps aux | grep java there is indeed no …enrich-classpath…. How to ensure this is there? The ~/.cache/enrich… and ~/.cache/mx.cider files are present so that’s all good.#2023-10-1300:35ZacharyMy xref-backend-functions returns (cider--xref-backend t), so that’s different and may explain the difference there. Definitely hanging still for me when not connected, but does that also with enrich-classpath not set, so probably not enrich-classpath.#2023-10-1304:25vemv but not significantly (anymore)…that's the caching in action, so that's good news 👍
> The ~/.cache/enrich… and ~/.cache/mx.cider files are present so that’s all good.
So, the files exist in disk but they're not in the final classpath, it seems? One likely explanation is that the jack in with the bash process (i.e. with enrich-classpath) failed, so the .sh script decided to fall back to not use enrich-classpath
When that happens, normally the cause is printed to *messages*, do you see anything?#2023-10-1304:31vemv> My xref-backend-functions returns (cider--xref-backend t), so that’s different and may explain the difference there.
Sounds like some piece of config is adding it for you eagerly. You should only see that value after jacking in / connecting#2023-10-1304:38ZacharyNot seeing anything in *messages* :,/#2023-10-1304:41vemvSay that you see:
[nREPL] Starting server via bash /Users/vemv/.emacs.d/lib/cider/clojure.sh /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.0.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.39.1\"\}\ refactor-nrepl/refactor-nrepl\ \{\:mvn/version\ \"3.9.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[refactor-nrepl.middleware/wrap-refactor\,cider.nrepl/cider-middleware\]\"\]\}\}\} -M:dev:test:cider/nrepl
What happens if you copy the command and run it in the terminal? (remember to cd to the project dir first)
You might see more output there#2023-10-1304:50ZacharyWhen running in terminal, getting back a nREPL server started on port 63921 on host localhost - ,#2023-10-1304:54vemvDid it output anything else? Does its classpath include mx.cider stuff?#2023-10-1304:55ZacharyNo other output#2023-10-1305:01vemvIn specific terms, if you ps aux | grep java you should see items like
• --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
• .cache/mx.cider/enrich-classpath/1601/707673445/3456644593.jar
• /Library/Java/JavaVirtualMachines/adoptopenjdk-16.jdk/Contents/Home/lib/src.zip
If they're there, it suceeded; if not, fallback logic was applied#2023-10-1305:05ZacharyOk, none of those are showing in the output#2023-10-1305:08vemvThanks. I'd recommend to temporarily modify clojure.sh to debug info
Specifically, you can add:
cat $output > foo.txt and share it as a Gist#2023-10-1305:13ZacharyI’m looking at clojure.sh in the latest cider directory. Anywhere I should be adding that line?#2023-10-1305:14vemvoutput=$(2>&1 "$clojure" -Sforce -Srepro -J-XX:-OmitStackTraceInFastThrow -J-Dclojure.main.report=stderr -Sdeps '{:deps {mx.cider/tools.deps.enrich-classpath {:mvn/version "1.18.1"}}}' -M -m cider.enrich-classpath.clojure "$clojure" "$here" "true" "$@")
cat $output > foo.txt#2023-10-1305:22ZacharyAdded that to line 41 of the clojure.sh it didn’t output anything to file that I can tell, but is outputting to terminal:#2023-10-1305:24vemvmy bad, it should have been echo instead of cat#2023-10-1305:26Zacharyhmmm…. not seeing any *.txt. It should be where the bash script is, in the cider directory, right?#2023-10-1305:27vemvmmm, make it an absolute path to be sure#2023-10-1305:29ZacharySLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See for further details. [:cider.enrich-classpath/classifiers #{"sources" "javadoc"}] Completed in 0.00 minutes. clojure.lang.ExceptionInfo: Could not find artifact bouncycastle:bctsp-jdk14:jar:138 in central () {:lib bouncycastle/bctsp-jdk14, :coord {:mvn/version "138", :deps/manifest :mvn, :dependents [com.lowagie/itext], :parents #{[incanter/incanter-pdf com.lowagie/itext]}}} at clojure.tools.deps.extensions.maven$get_artifact.invokeStatic(maven.clj:167) at clojure.tools.deps.extensions.maven$get_artifact.invoke(maven.clj:155) at clojure.tools.deps.extensions.maven$eval3286$fn__3289.invoke(maven.clj:178) at clojure.lang.MultiFn.invoke(MultiFn.java:244) at clojure.tools.deps$download_libs$fn__2864$fn__2865.invoke(deps.clj:465) at clojure.lang.AFn.applyToHelper(AFn.java:152) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.core$apply.invokeStatic(core.clj:667) at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1990) at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1990) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.RestFn.applyTo(RestFn.java:132) at clojure.core$apply.invokeStatic(core.clj:671) at clojure.core$bound_fn_STAR_$fn__5818.doInvoke(core.clj:2020) at clojure.lang.RestFn.invoke(RestFn.java:397) at clojure.lang.AFn.call(AFn.java:18) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1623) /opt/homebrew/bin/clojure "-A:dev/reloaded:portal" "-Sdeps" "{:deps {nrepl/nrepl {:mvn/version \"1.0.0\"} cider/cider-nrepl {:mvn/version \"0.39.0\"} refactor-nrepl/refactor-nrepl {:mvn/version \"3.9.0\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]\"]}}}" "-M:dev/reloaded:cider/nrepl"#2023-10-1305:31vemvInteresting... that's our issue
Does your deps.edn define a special Maven repo where bouncycastle:bctsp-jdk14:jar:138 should be fetched from?#2023-10-1305:34ZacharyI don’t think soo…. It’s sort of a catch-all project for me to test out a bunch of different stuff#2023-10-1305:38vemvIs it a deps.edn that you can share?#2023-10-1305:38ZacharyOh, lol… everything is working on other projects… yeah… very cool… but also… weird#2023-10-1305:38ZacharyI’d be embarrased to, but yeah no problem lol#2023-10-1305:40Zachary{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/core.async {:mvn/version "1.6.673"}
org.clojure/math.combinatorics {:mvn/version "0.2.0"}
com.rpl/specter {:mvn/version "1.1.4"}
criterium/criterium {:mvn/version "0.4.6"}
metosin/malli {:mvn/version "0.11.0"}
meander/epsilon {:mvn/version "0.0.650"}
org.clj-commons/digest {:mvn/version "1.4.100"}
org.clojure/data.zip {:mvn/version "1.0.0"}
org.clojure/data.json {:mvn/version "2.4.0"}
aero/aero {:mvn/version "1.1.6"}
com.xtdb/xtdb-core {:mvn/version "1.23.1"}
com.xtdb/xtdb-rocksdb {:mvn/version "1.23.1"}
cheshire/cheshire {:mvn/version "5.10.0"}
http-kit/http-kit {:mvn/version "2.7.0-alpha4"}
clj-http/clj-http {:mvn/version "3.12.3"}
aleph/aleph {:mvn/version "0.6.1"}
manifold/manifold {:mvn/version "0.4.0"}
;; bouncycastle/bcprov-jdk16-nosign {:mvn/version "140"}
org.clojure/java.data {:mvn/version "1.0.95"}
incanter/incanter {:mvn/version "1.9.3"
:exclusions [com.lowagie/itext]}
tesser.core/tesser.core {:mvn/version "1.0.6"}
org.mentat/emmy {:mvn/version "0.31.0"}
techascent/tech.ml.dataset {:mvn/version "7.000-beta-35"}
techascent/tech.ml.dataset.sql {:mvn/version "6.046-01"}
techascent/tech.ml {:mvn/version "6.019"}
techascent/tech.io {:mvn/version "4.30"}
com.cnuernber/ham-fisted {:mvn/version "1.000-beta-97"}
com.climate/claypoole {:mvn/version "1.1.4"}
;; scicloj/scicloj.ml {:mvn/version "0.2.2"}
scicloj/tablecloth {:mvn/version "7.000-beta-27"}
net.clojars.wkok/openai-clojure {:mvn/version "0.5.1"}
org.apache.commons/commons-lang3 {:mvn/version "3.12.0"}
;; for parquet
;;
org.apache.parquet/parquet-hadoop
{:mvn/version "1.12.0"
:exclusions [org.slf4j/slf4j-log4j12]}
org.apache.hadoop/hadoop-common
{:mvn/version "3.3.0"
:exclusions [com.sun.jersey/jersey-core
com.sun.jersey/jersey-json
com.sun.jersey/jersey-server
com.sun.jersey/jersey-servlet
dnsjava/dnsjava
org.eclipse.jetty/jetty-server
org.eclipse.jetty/jetty-servlet
org.eclipse.jetty/jetty-util
org.eclipse.jetty/jetty-webapp
javax.activation/javax.activation-api
javax.servlet.jsp/jsp-api
javax.servlet/javax.servlet-api
io.netty/netty-codec
io.netty/netty-handler
io.netty/netty-transport
io.netty/netty-transport-native-epoll
org.codehaus.jettison/jettison
org.apache.zookeeper/zookeeper
org.apache.curator/curator-recipes
org.apache.curator/curator-client
org.apache.htrace/htrace-core4
org.apache.hadoop.thirdparty/hadoop-shaded-protobuf_3_7
org.apache.hadoop/hadoop-auth
org.apache.kerby/kerb-core
commons-cli/commons-cli
commons-net/commons-net
org.apache.commons/commons-lang3
org.apache.commons/commons-text
org.apache.commons/commons-configuration2
com.google.re2j/re2j
com.google.code.findbugs/jsr305
com.jcraft/jsch
log4j/log4j
org.slf4j/slf4j-log4j12]}
;; We literally need this for 1 POJO formatting object.
org.apache.hadoop/hadoop-mapreduce-client-core
{:mvn/version "3.3.0"
:exclusions [org.slf4j/slf4j-log4j12
org.apache.avro/avro
org.apache.hadoop/hadoop-yarn-client
org.apache.hadoop/hadoop-yarn-common
org.apache.hadoop/hadoop-annotations
org.apache.hadoop/hadoop-hdfs-client
io.netty/netty
com.google.inject.extensions/guice-servlet]}
;; M-1 mac support for snappy
org.xerial.snappy/snappy-java {:mvn/version "1.1.8.4"}
;; --------------------------------------------------
;; arrow deps
org.apache.arrow/arrow-vector
{:mvn/version "6.0.0"
:exclusions [commons-codec/commons-codec
com.fasterxml.jackson.core/jackson-core
com.fasterxml.jackson.core/jackson-annotations
com.fasterxml.jackson.core/jackson-databind
org.slf4j/slf4j-api]}
com.cnuernber/jarrow {:mvn/version "1.000"}
;; --------------------------------------------------
io.github.nubank/morse {:git/tag "v2023.04.27.01" :git/sha "7a85e46"}
;;io.github.discourje/development (:git/sha "817e0696aaefa9551caa190943e39bb8220a9100")
com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.0.4"}
djblue/portal {:mvn/version "0.38.0"}}
:aliases
{:run-m {:main-opts ["-m" "karma3.covalent"]}
:run-x {:ns-default karma3.covalent
:exec-fn greet
:exec-args {:name "Clojure"}}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.8.2" :git/sha "0ffdb4c"
;; since we're building an app uberjar, we do not
;; need deps-deploy for deployment:
:deps/root "slim"}}
:ns-default build}
:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "48c3c67"}}}}}#2023-10-1305:41vemvThanks much! I have an approximate idea of how to improve things, with the deps.edn it should be even easier
Feel free to give any other feedback in the projects where this is working#2023-10-1305:42Zacharyhaha, will do, glad I could provide something 🙂#2023-10-1706:31AkizNo, or rather - I don’t see how I managed to get the overlay stuck in this position. I’ve played with it now and it mostly gets stuck in the original position. But that’s the problem 🙂.
If you can create a ticket, that’s great. I recorded a video here of me playing around with it. If I figure out how to reproduce the weird position, I’ll add info.
https://www.loom.com/share/4b2096a56d134fc386a9640cb1573417#2023-10-1711:06vemvAre you able to use the completing-read , i.e. the prompt that asks you for a class?#2023-10-1712:45AkizWhen I selected the prompt and pressed enter, the candidate was not completed and the corfu pop-up got stuck.
Anyway, suddenly I don’t have a prompt, I don’t understand why. The only thing I did was that I removed orderless from the cider.#2023-10-1717:01Akiz@U45T93RA6 i tried to reproduce it but i dont know where to start to get prompt back.#2023-10-1721:18vemvI'll create an issue in corfu tomorrow.#2023-10-2111:32vemvI've created an issue in Robe (its author is the Company author, and Corfu uses Company-specific properties like :company-doc-buffer)
Both Company's author and me agree that things are not ideal, which also ultimately affect Corfu. I proposed a way forward here https://github.com/dgutov/robe/issues/144#issuecomment-1773761965
With an improvement like that, Corfu could just add the improved Company 'api' and the issue would disappear.#2023-10-2111:34vemv...I'd much prefer to ask the Corfu maintainer 'use this new option' instead of 'fix this edge case'.
Taking a look at the history of its issue tracker, I was pretty afraid that the latter would not have succeeded.#2023-10-0618:58vemvFeedback will be extremely appreciated before we call this CIDER 1.8.0!#2023-10-0713:06Karl XaverUnsure if that's ciders fault, but I noticed that completing
(.| "")
fails when completion-styles is set to
partial-completion, substring or flex --> the only candidate is ".."
orderless, initials --> 700+ unrelated completions
And trying it with
(Thread/|)
I get "no match" for all of them.
It only seems to work properly with the basic / emacsXX completion-styles, so this fixed it for me:
(add-to-list 'completion-category-overrides '(cider (styles basic)))
#2023-10-0713:11vemvhttps://github.com/clojure-emacs/cider/issues has a couple pinned issues related to completion styles.
I never faced an issue related to completion styles (I simply leave them unconfigured - using Emacs 27 here) so I can't relate much at the moment.
If it's working properly, that great news. We'd certainly appreciate extra input in those pinned issues, so that we can make a fully informed decision.#2023-10-0713:52Karl XaverAye, will look into these issues.
If my experience is not an isolated one (I tried it in plain emacs 29.1), a lot of people will run into this. Basically everyone who customized completion-styles in any way, e.g. all the Doom Emacs and "vertico/orderless/embark/..."-stack folks. And for many (like me) it might go unnoticed for quite some time, especially if they also have lsp running. I didn't even know how awesome Ciders completions can be! Thanks a ton for that :)
To repro, something like
(setq completion-styles '(flex initials partial-completion))
should do it.#2023-10-0812:23vemvThanks! I've created https://github.com/clojure-emacs/cider/pull/3504 with your suggested fix.
Of course, ideally we'd support orderless proper, but it's what we have the capacity for atm.
(a PR in that direction would be, of course, welcome)#2023-10-0909:00vemvIt's merged. Note that flex needs an additional setting https://docs.cider.mx/cider/usage/code_completion.html#completion-styles#2023-10-0706:01SamHey, I'm working on this PR as my first contribution: https://github.com/clojure-emacs/cider/pull/3496
Is there any additional behavior I could add to the command?
It would be cool to add some command like cider-eval-defun-to-comment but I'm not sure how it could be distinguished from cider-eval-defun-at-point.#2023-10-0706:41vemvThanks! It's in now.
> It would be cool to add some command like cider-eval-defun-to-comment but I'm not sure how it could be distinguished from cider-eval-defun-at-point.
Feel free to create an issue hammock#2023-10-0706:51SamThank you!#2023-10-0817:05Carsten BehringHi all, I am lately working a lot in a "Cider in Docker container running in remote host" scenario.
In this case the existing Cider documentation for working in remote hosts (and the existing cider functionality) commes to its limits:
https://docs.cider.mx/cider/basics/up_and_running.html#working-with-remote-hosts
I am wondering , if we could the docu in some form, as it is for me a more and more common szenario.#2023-10-0818:56vemvThanks for looking into it!
Let us know which specific parts are lacking
Note that there are "local path translations" as well, often very handy for Docker development (locally, at the very least) https://docs.cider.mx/cider/config/basic_config.html#translate-file-paths#2023-10-0818:59vemv...Earlier this summer I checked out carefully both local Docker development, and tramp development. The two dirs we have here have reproducible instructions - feel free to propose a new similar dir if you feel it's its own category https://github.com/clojure-emacs/cider/tree/master/dev
For both cases, I fixed performance and nagivational concerns. If anything still feels off, do raise an issue :)#2023-10-0818:59Carsten BehringMaybe firstly distinguish the documentation in some form in this three "remote" scenarios:
(which all three assume a "Local emacs" and editing files using TRAMP)
1. Connect local Emacs to a Nrepl process running in a container running on localhost
2. Connect local Emacs to a Nrepl process running on a remote host
3. Connect local Emacs to a Nrepl process running in a container in a remote host
Maybe then pointing out that Cider "remote support" was mainly made and is tested in scenario 2)
Using "ssh and bash and other magic" we can partly make all 3 scenarios look like 2) from the cider point of view, so they might work alreday.
Addionally we could as well mention that remote can mean as well "run emacs inside ssh". This is quite simple, as this is not really remote, from the Emacs/Cider point of view.
(so works always)
To talk about further "solutions" gets then a bit complex, I use for example "devcontainer" in my scenario 3), which is docker at the end , but uses a specific cli tools to control the Docker process#2023-10-0819:20Carsten BehringRegarding the scenario 3) which I use, a "setup" is a bit more complex, as it requires "setup" of the remote server, like the devcontainer-cli need to be installed on it.#2023-10-0819:21vemv> Maybe firstly distinguish the documentation in some form in this three "remote" scenarios:
SGTM
> Maybe then pointing out that Cider "remote support" was mainly made and is tested in scenario 2)
Maybe, maybe not. I'd be happier with comprehensive issue reports (one per problem) and get them solved :)
> Addionally we could as well mention that remote can mean as well "run emacs inside ssh".
SGTM
> To talk about further "solutions" gets then a bit complex, I use for example "devcontainer" in my scenario 3), which is docker at the end , but uses a specific cli tools to control the Docker process
I'd have to learn more about devcontainers to have an opinion. If it's too different from 3, it SGTM to have a "4".
(and it would be extremely nice to have a reproducible example under https://github.com/clojure-emacs/cider/tree/master/dev)#2023-10-0820:08Carsten BehringI made a attempt to rather general describe the "remote scenarios" as part of the cider docu:
https://github.com/clojure-emacs/cider/pull/3505
I left it very general on purpose.#2023-10-0820:15vemvRead ✅ , seems a good start to me!#2023-10-0818:59Carsten BehringMaybe firstly distinguish the documentation in some form in this three "remote" scenarios:
(which all three assume a "Local emacs" and editing files using TRAMP)
1. Connect local Emacs to a Nrepl process running in a container running on localhost
2. Connect local Emacs to a Nrepl process running on a remote host
3. Connect local Emacs to a Nrepl process running in a container in a remote host
Maybe then pointing out that Cider "remote support" was mainly made and is tested in scenario 2)
Using "ssh and bash and other magic" we can partly make all 3 scenarios look like 2) from the cider point of view, so they might work alreday.
Addionally we could as well mention that remote can mean as well "run emacs inside ssh". This is quite simple, as this is not really remote, from the Emacs/Cider point of view.
(so works always)
To talk about further "solutions" gets then a bit complex, I use for example "devcontainer" in my scenario 3), which is docker at the end , but uses a specific cli tools to control the Docker process#2023-10-0910:29practicalli-johnWhen evaluating ClojureScript code in the source code buffer, the inline results are not being displayed. This seems only to affect clojurescript-mode, as inline evaluation results are displaying in clojure-mode.
I am using cider jack-in to start a Clojure CLI repl, using the following .dir-locals.el file
((clojurescript-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . ":figwheel/env")
(cider-default-cljs-repl . figwheel-main)
(cider-figwheel-main-default-options . "dev")
(cider-repl-display-help-banner . nil))))
Are there any configuration changes that could make this happen?
I'm fairly sure this happen recently, I'll try earlier package versions to see if I can tell when it started occurring.
I am using CIDER 1.8.0-snapshot (package: 20231009.804) with Emacs 30 (native compilation, built from source on Linux)#2023-10-0910:30vemvI could eye this in a bit
Do the *nrepl-messages* logs say anything interesting?
(remember there's one for cljs specifically)#2023-10-0910:40practicalli-johnI think the problem is the cljs repl is not starting. Using sesman-browse its only showing the clj repl I believe. If that is so, then its no wonder eval is not working :)
1: practicalli/practicalli.github.io:localhost:43611
linked-to: proj(~/projects/practicalli/practicalli.github.io/)
objects: *cider-repl %s(clj)*
I'll try a few different ways to start the REPL...#2023-10-0910:43vemvif it helps, I published https://github.com/reducecombine/fig-main yesterday for another problem (now fixed)
It's npm install and then cider-jack-in-cljs#2023-10-0910:57practicalli-johnSorry, I think this was user error, as I have it working now.
I think I was selecting jack-in-clj and not jack-in-cljs so that would explain why there was a clj repl and not a cljs repl facepalm
Someone else was reporting in the #C09C8GRLY channel of the same issue, so I jumped to conclusions a bit too quickly...
I do wish to figure out how to run a ClojureScript REPL on the command line with an appropriate nrepl connection and connect to that repl from Cider. I can run figwheel, but need to also figure out the library and config for nrepl too (which I should be able to do from the cider command in theory 🙂#2023-10-0911:00vemvI don't have fresh Fig knowledge in my head...
However shadow-cljs excels at running an nrepl server - it even has built-in logic/config for cider-nrepl and refactor-nrepl#2023-10-0911:01vemvI had the impression that fig-main isn't good at re-connecting either? i.e. with shadow I can quit localhost from Chrome, open it again and the repl will re-connect flawlessly.#2023-10-0911:09practicalli-johnI havent had any issues using figwheel-main (once I use the right jack-in commands) or any need to reconnect as projects are relatively simple (for the front end)
One day I will find the time to read through the excellent shadow-cljs user guide (although currently have no reason to use javascript in my ClojureScript projects, so figwheel-main has kept things simple even though it has the option to bundle js packages - but no perceived value as yet to my projects).
So using jack-in is just fine for ClojureScript projects I use. Its more curiosity on how to run from a terminal as that is how I start all the Clojure projects I work on.#2023-10-1013:34bozhidar🔥 CIDER 1.8 is finally feature-complete and will be released before the end of the week! It’s going to be a huge release (see https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md#master-unreleased) and everyone’s encouraged to play with the the current snapshot before it gets promoted to a stable release. 🔥#2023-10-1013:39vemvIn case you missed out, this is one of our most prominent new features: https://clojurians.slack.com/archives/C0617A8PQ/p1696618492372739#2023-10-1014:33terjesbLooking forward to new CIDER release. Upgraded to current snapshot.. Java doc looks great.
cider-repl-set-ns does not seem to work anymore on my machine.. how should I report this?
Jacking in to a local project, starts correctly.
C-C M-n (M-) n does not work correctly for cider-repl-set-ns
I expect the repl buffer to switch ns to the ns for the current file.
Instead, I’m getting the following:
Wrong type argument: stringp, #[257 “\310^A\311\“\310^B\312\“\310^C\313\“\310^D\314\“\310^E\315\“\310^F^F\316\“\310^F^G\317\“\310^F^H\320\“\310^F \321\“\322\307!\203A^@r\307q\210^D\203@^@\323\324!\204@^@\325^E!\210)^F^H\203`^\
@\301\203`^@\301\307^F \326\230\203Z^@\327^F !\202\\^@^F^H^F^K#\207^E\203n^@\306\205\370^@\306\307^F^G\“\207^C\203{^@\305\205\370^@\305\307^E\“\207^B\203\210^@\304\205\370^@\304\307^D\“\207^A\205\370^@\300\203\243^@\330^B\235\
\203\243^@\331\332\333^N*!\“\300\307^B\“\266^B\334^B\235\203\271^@\310^F
\335\“\310^F^K\336\“\337^B^B\“\266^C\340^B\235\203\303^@\341\342!\210\343^B\235\203\321^@\302\206\317^@^N+ \210\344^B\235\203\335^@\341\345^F^F\“\210\346^B\235\203\347^@\347\307!\210\350^B\235\205\370^@\351^A!\210\303\205\370\
^@\303\307!\207” [nil nil nil #[257 “\300^A!\207" [cider-repl-emit-prompt] 3 ”
(fn BUFFER)“] #[514 “\300^B^B\“\207" [cider-repl-emit-stderr] 5 ”
(fn BUFFER ERR)“] #[514 “\300^B^B\“\207" [cider-repl-emit-stdout] 5 ”
(fn BUFFER OUT)“] #[514 “\300\207" [nil] 3 ”
(fn BUFFER VALUE)“] #<buffer cider-repl code/myproj:localhost:53237(clj)> nrepl-dict-get “content-type” ...] 15 ”
(fn RESPONSE)“]#2023-10-1014:36bozhidarAn issue on GitHub would be the best way to report the problem you’ve encountered.#2023-10-1014:51vemvFixed https://github.com/clojure-emacs/cider/commit/27c018cb488e35304b54425fb37d7c9083b806c2 - expect a snapshot to be visible within 1-2 hours#2023-10-1017:10terjesbLatest snapshot fixes cider-repl-set-ns for me. Thank you for the expedited fix!#2023-10-1106:27hifumi123In newer versions of CIDER, the async macro from cljs.test seems to no longer indent as before. In particular, the old indentation behaved like defn . e.g.
(async done
(go
...
(done)))
However CIDER 1.8.0-snapshot gives me
(async done
(go
...
(done)))
Was this change intentional?#2023-10-1107:35RomaThere is a new feature called indentation inference for macros in CIDER 1.8. https://github.com/clojure-emacs/cider/issues/3490#2023-10-1108:48vemvI'll fix it for async given that it seems unlikely that clojurescript will ever use :style/indent metadata#2023-10-1115:03vemvTurns out, it seemingly has nothing to do, because cljs namespaces were handled long ago: https://github.com/clojure-emacs/cider-nrepl/blob/69f4b18317328a5e87a42e01dc335f4acd554f3d/src/cider/nrepl/middleware/track_state.clj#L54-L55#2023-10-1121:03vemvasync has never been declared in https://github.com/clojure-emacs/clojure-mode/blob/master/clojure-mode.el so it would surprise me if it really ever indented as you wanted? (which I agree that is better)
(put-clojure-indent 'async 1) works. Maybe you were used to a project that had something similar in .dir-locals.el ?
Anyway, it sounds like we could just add an entry here https://github.com/clojure-emacs/clojure-mode/blob/5fab97d0efc1ed932518fba0cb90afe6dcd00191/clojure-mode.el#L1815#2023-10-1204:25hifumi123I don’t recall any particular overrides with dir-locals. (I do have dir-locals in the project involving async cljs tests, but the values are for configuring CIDER and fill-mode, not clojure-mode)#2023-10-1204:26hifumi123Assuming clojure-mode has never indented this form and CIDER does not infer the indentation of the macro, this may be a case of manual indentation in the past and I simply forgot about it.#2023-10-1204:27vemvThanks! Good timing, I was looking into adding it to clojure-mode just now.#2023-10-1214:46vemvclojure-mode 5.17.1 is out!#2023-10-1113:56Pavel FilipencoIs stack overflow when inspecting a long string a known issue?#2023-10-1113:57vemvNever hard of it, feel free to create an issue right away
(if possible, post the stacktrace, even if long. If it's long, please use a Gist)#2023-10-1113:59Pavel Filipencoissue? maybe I'll post a minimal example for you to see if it's the same? maybe it's my emacs thing#2023-10-1114:01vemvI'd prefer a GH issue so that I can allocate my time better#2023-10-1117:01Pavel Filipencohttps://github.com/clojure-emacs/cider/issues/1115
https://github.com/clojure-emacs/cider/issues/3219
seems like related issues. (setq cider-repl-display-output-before-window-boundaries t) doesn't work.#2023-10-1118:10vemvIn your OP you mentioned a stack overflow when inspecting a string.
Neither of those issues has to do much with StackOverflowErrors or the cider inspector.
Please simply post exactly the problem that you're experiencing, don't be afraid to post a duplicate. Those issues are closed so any occurrence now is considered new.#2023-10-1118:44Pavel FilipencoOkay, I posted the issue https://github.com/clojure-emacs/cider/issues/3511#2023-10-1116:13alexyakushevI enabled cider-enrich-classpath and now I'm getting this when trying to jack in:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: /Users/user/.emacs.d/elpa/cider-20231010.1449/clojure.sh: eval: line 47: syntax error near unexpected token `('
Can help investigate.#2023-10-1116:18dpsuttonit’s ending up in the clojure.sh script which i’m not familiar with
https://github.com/clojure-emacs/cider/blob/master/clojure.sh#2023-10-1116:18dpsuttoni’d modify that to write $cmd to a file and see what it’s trying to eval#2023-10-1116:20dpsuttoncmd=$(tail -n1 <(echo "$output")) I wonder if some stderr is getting involved or some kinds of logging#2023-10-1116:31alexyakushevI tried that, but the $cmd it generates is a huge swath of classpath entries and other things, so I'd wait for somebody familiar with the feature to give me directions before I dig into that 😄#2023-10-1116:33dpsuttoni saw there was a change 2 weeks ago to that file that changed the enrich classpath version 1.17.2 -> 1.18.0
old
> output=$(2>&1 “$clojure” -Sforce -Srepro -J-XX:-OmitStackTraceInFastThrow -J-Dclojure.main.report=stderr -Sdeps ‘{:deps {mx.cider/tools.deps.enrich-classpath {:mvn/version “1.17.2"}}}’ -M -m cider.enrich-classpath.clojure “$clojure” “$here” “true” “$@“)
new
> output=$(2>&1 “$clojure” -Sforce -Srepro -J-XX:-OmitStackTraceInFastThrow -J-Dclojure.main.report=stderr -Sdeps ‘{:deps {mx.cider/tools.deps.enrich-classpath {:mvn/version “1.18.0"}}}’ -M -m cider.enrich-classpath.clojure “$clojure” “$here” “true” “$@“)
maybe you could change that version back to the old one and see if it works?#2023-10-1118:20vemvI tested it now again (as I did a couple days ago) and it keeps working. Recently I added a shellcheck CI check to it as well.
I'd try to run it in a small project first to check if there's any fundamental issue.
Another thing you can do is modify this script to e.g. dump data to debug.txt so that you can check if there's anything suspicious.
Finally, there's this alternative way of running enrich-classpath that doesn't involve clojure.sh, but a Makefile instead: https://github.com/clojure-emacs/enrich-classpath#any-lein-or-toolsdeps-project
You can try that Makefile, and, just like before, modify it at will
(In a future, a .bb script will be the main offering - it's neater and runs everywhere)#2023-10-1118:22vemvUltimately, of course, feel free to create an issue.#2023-10-1118:29vemv> I tried that, but the $cmd it generates is a huge swath of classpath entries and other things, so I'd wait for somebody familiar with the feature to give me directions before I dig into that
Ah I didn't read this - happy that both of you figured out that it was possible :)
Please share that as a gist, for instance#2023-10-1118:45alexyakusheveval '/opt/homebrew/bin/clojure -Sforce -Srepro -J-XX:-OmitStackTraceInFastThrow -J-Dclojure.main.report=stderr -Scp src:res:vendor:/Users/alex/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar:/Users/alex/.m2/repository/org/clojure/core.async/1.5.644/core.async-1.5.644.jar:/Users/alex/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar:/Users/alex/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar:/Users/alex/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar:/Users/alex/.m2/repository/org/clojure/data.codec/0.1.0/data.codec-0.1.0.jar:/Users/alex/.m2/repository/org/clojure/data.json/2.4.0/data.json-2.4.0.jar:/Users/alex/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar:/Users/alex/.m2/repository/org/clojure/data.xml/0.2.0-alpha6/data.xml-0.2.0-alpha6.jar:/Users/alex/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar:/Users/alex/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar:/Users/alex/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.1/tools.analyzer.jvm-1.2.1.jar:/Users/alex/.m2/repository/org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar:/Users/alex/.m2/repository/org/clojure/tools.gitlibs/2.4.181/tools.gitlibs-2.4.181.jar:/Users/alex/.m2/repository/org/clojure/tools.logging/1.2.1/tools.logging-1.2.1.jar:/Users/alex/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar:/Users/alex/.m2/repository/cider/cider-nrepl/0.39.0/cider-nrepl-0.39.0.jar:/Users/alex/.m2/repository/nrepl/nrepl/1.0.0/nrepl-1.0.0.jar:/Users/alex/.m2/repository/refactor-nrepl/refactor-nrepl/3.9.0/refactor-nrepl-3.9.0.jar:/Users/alex/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/alex/.m2/repository/cider/orchard/0.16.1/orchard-0.16.1.jar:/Users/alex/.m2/repository/clj-http/clj-http/3.10.0/clj-http-3.10.0.jar:/Users/alex/.m2/repository/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar:/Users/alex/.m2/repository/com/clojure-goes-fast/clj-async-profiler/1.0.5/clj-async-profiler-1.0.5.jar:/Users/alex/.m2/repository/com/clojure-goes-fast/clj-java-decompiler/0.3.4/clj-java-decompiler-0.3.4.jar:/Users/alex/.m2/repository/com/clojure-goes-fast/clj-memory-meter/0.3.0/clj-memory-meter-0.3.0.jar:/Users/alex/.m2/repository/com/clojure-goes-fast/virgil/0.2.0/virgil-0.2.0.jar:/Users/alex/.m2/repository/com/cognitect/http-client/1.0.110/http-client-1.0.110.jar:/Users/alex/.m2/repository/com/cognitect/aws/api/0.8.539/api-0.8.539.jar:/Users/alex/.m2/repository/com/cognitect/aws/endpoints/1.1.12.150/endpoints-1.1.12.150.jar:/Users/alex/.m2/repository/com/cognitect/aws/s3/814.2.1053.0/s3-814.2.1053.0.jar:/Users/alex/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/Users/alex/.m2/repository/com/google/errorprone/error_prone_annotations/2.7.1/error_prone_annotations-2.7.1.jar:/Users/alex/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/Users/alex/.m2/repository/com/google/guava/guava/31.0.1-android/guava-31.0.1-android.jar:/Users/alex/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/Users/alex/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/Users/alex/.m2/repository/commons-codec/commons-codec/1.12/commons-codec-1.12.jar:/Users/alex/.m2/repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:/Users/alex/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/alex/.m2/repository/criterium/criterium/0.4.5/criterium-0.4.5.jar:/Users/alex/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar:/Users/alex/.m2/repository/javax/enterprise/cdi-api/1.2/cdi-api-1.2.jar:/Users/alex/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/alex/.m2/repository/mx/cider/logjam/0.1.1/logjam-0.1.1.jar:/Users/alex/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpasyncclient/4.1.4/httpasyncclient-4.1.4.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.5.8/httpclient-cache-4.5.8.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpcore-nio/4.4.10/httpcore-nio-4.4.10.jar:/Users/alex/.m2/repository/org/apache/httpcomponents/httpmime/4.5.8/httpmime-4.5.8.jar:/Users/alex/.m2/repository/org/apache/maven/maven-artifact/3.8.4/maven-artifact-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-builder-support/3.8.4/maven-builder-support-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-core/3.8.4/maven-core-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-model/3.8.4/maven-model-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-model-builder/3.8.4/maven-model-builder-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-plugin-api/3.8.4/maven-plugin-api-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-repository-metadata/3.8.4/maven-repository-metadata-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-resolver-provider/3.8.4/maven-resolver-provider-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-settings/3.8.4/maven-settings-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/maven-settings-builder/3.8.4/maven-settings-builder-3.8.4.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-api/1.6.3/maven-resolver-api-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-connector-basic/1.6.3/maven-resolver-connector-basic-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-impl/1.6.3/maven-resolver-impl-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-spi/1.6.3/maven-resolver-spi-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-file/1.6.3/maven-resolver-transport-file-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-http/1.6.3/maven-resolver-transport-http-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.6.3/maven-resolver-util-1.6.3.jar:/Users/alex/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.3.4/maven-shared-utils-3.3.4.jar:/Users/alex/.m2/repository/org/bitbucket/mstrobel/procyon-compilertools/0.6.0/procyon-compilertools-0.6.0.jar:/Users/alex/.m2/repository/org/bitbucket/mstrobel/procyon-core/0.6.0/procyon-core-0.6.0.jar:/Users/alex/.m2/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar:/Users/alex/.m2/repository/org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar:/Users/alex/.gitlibs/libs/org.clojure/tools.deps.alpha/8f8fc2571e721301b6d52e191129248355cb8c5a/src/main/resources:/Users/alex/.gitlibs/libs/org.clojure/tools.deps.alpha/8f8fc2571e721301b6d52e191129248355cb8c5a/src/main/clojure:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0.jar:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar:/Users/alex/.m2/repository/org/codehaus/plexus/plexus-utils/3.4.1/plexus-utils-3.4.1.jar:/Users/alex/.m2/repository/org/eclipse/jetty/jetty-client/9.4.44.v20210927/jetty-client-9.4.44.v20210927.jar:/Users/alex/.m2/repository/org/eclipse/jetty/jetty-http/9.4.44.v20210927/jetty-http-9.4.44.v20210927.jar:/Users/alex/.m2/repository/org/eclipse/jetty/jetty-io/9.4.44.v20210927/jetty-io-9.4.44.v20210927.jar:/Users/alex/.m2/repository/org/eclipse/jetty/jetty-util/9.4.44.v20210927/jetty-util-9.4.44.v20210927.jar:/Users/alex/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5.jar:/Users/alex/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.5/org.eclipse.sisu.plexus-0.3.5.jar:/Users/alex/.m2/repository/org/openjdk/jol/jol-core/0.16/jol-core-0.16.jar:/Users/alex/.m2/repository/org/ow2/asm/asm/9.5/asm-9.5.jar:/Users/alex/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.30/jcl-over-slf4j-1.7.30.jar:/Users/alex/.m2/repository/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar:/Users/alex/.m2/repository/potemkin/potemkin/0.4.5/potemkin-0.4.5.jar:/Users/alex/.m2/repository/riddley/riddley/0.1.12/riddley-0.1.12.jar:/Users/alex/.m2/repository/slingshot/slingshot/0.12.2/slingshot-0.12.2.jar:/Library/Java/JavaVirtualMachines/jdk-17.0.3+7/Contents/Home/lib/src.zip:/Users/alex/.m2/repository/com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar:/Users/alex/.cache/mx.cider/enrich-classpath/1703/3446834096/2898174095.jar:/Users/alex/.cache/mx.cider/unzipped-jdk-sources/1703 -J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -e (load-file,(str,(System/getProperty,"user.home"),"/.clojure/user.clj"))'
#2023-10-1118:46dpsuttonit said it had an error at (. if you drop the -e stuff with the corfield comma i suspect it will work again?#2023-10-1118:47alexyakushevI have a custom -e command in one of the aliases, so I guess that's what breaks it. But it works fine when running clj in the shell#2023-10-1118:47alexyakushev@U11BV7MTK Yes, it works without the -e form#2023-10-1118:49dpsuttonah i think there’s some weird level of quoting going on#2023-10-1118:50dpsuttonthe good thing is this is presumably easy to test. you can just put that in a file and then get its contents and pass it to eval. and keep playing with the quoting required#2023-10-1118:59vemvHow do you get that -e to be there in the first place? Is it some cider option that produces it?
enrich-classpath (a JVM program that produces a command dynamically) applies pr-str over most args, so the -e value should be escaped, I believe https://github.com/clojure-emacs/enrich-classpath/blob/b57f1659f3fed36e4f05f1a8fc5706eb0329efd8/tools.deps/src/cider/enrich_classpath/clojure.clj#L162
(I'll be adding some unit tests in the meantime)#2023-10-1119:01alexyakushevI've just look at all CIDER custom variables that I have, and -e is nowhere to be found. So it must be coming from deps.edn.
:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/user.clj\"))"]
#2023-10-1119:08vemvProbably I'll have a nice and tested fix today / tomorrow morning. Thanks for the report!#2023-10-1120:34vemvIt's here! Merged https://github.com/clojure-emacs/cider/pull/3512
Expect the snapshots to be available within 1-2 hours.#2023-10-1309:15jrychterMy indentation for rum/defc and rum/defcs forms broke today and I'm pulling my hair out trying to find out why. I did a MELPA upgrade of clojure-mode to 5.17.1 today, I think I was on 5.17.0 before, but I can't find anything that could cause this. My forms are indented correctly until I load them in CIDER, at which point they get plenty of extra indentation.#2023-10-1309:17vemvHey! It's https://docs.cider.mx/cider/indent_spec.html#indentation-inference
Could you please point at the defc source? Most likely it's missing style/indent metadata (which is what we always expected to be declared)#2023-10-1309:17jrychterAnd it's something tied to CIDER, because the moment I cider-quit, I am back to normal (e.g. what worked for the last 8 years).#2023-10-1309:20jrychterWell, this is the source: https://github.com/tonsky/rum/blob/45ca02046aa9e0b13eca6db7ec4e3fc7dcc9f95d/src/rum/core.clj#L71 — but I don't think I can expect all libs to be changed. Also, I'm confused about why this worked for the last 8 years and suddenly changed now.
This is what I consider "correct":
(rum/defcs form-component < rum/static (mixins/local-nofirstrender {})
;; Are we sure that :rum/local exists at this point in :init? Yes, we are, because we do not use rum/local,
;; but our own mixin, which does its work in the :init phase.
{:init (fn [{local-state :rum/local
[initial-model-data xforms _ initial-metadata _ options] :rum/args
:as state}]
And this is what I get after I cider-connect:
(rum/defcs form-component < rum/static (mixins/local-nofirstrender {})
;; Are we sure that :rum/local exists at this point in :init? Yes, we are, because we do not use rum/local,
;; but our own mixin, which does its work in the :init phase.
{:init (fn [{local-state :rum/local
[initial-model-data xforms _ initial-metadata _ options] :rum/args
:as state}]#2023-10-1309:21jrychterWell, slack mangles indentation beyond recognition. So, in pictures: this is correct#2023-10-1309:21jrychterAnd this is what I get after cider-connect:#2023-10-1309:22jrychterI can't figure out what recent change caused this behavior.#2023-10-1309:22vemvWe introduced a feature (https://docs.cider.mx/cider/indent_spec.html#indentation-inference) based on our observations and what we'd like things to be like. Note that not only CIDER honors style/indent metadata, but also clojure-lsp so it's a pretty big win in terms of standardization!#2023-10-1309:23vemvIf you feel frustrated I'd understand that btw, note that adding the metadata (with alter-var-meta, until a commit is added upstream) should take you a few minutes.
I'll be happy to help.#2023-10-1309:24jrychterHey, I'm all for standardization, but at the moment I have this code base of 10k lines (my SaaS) that I need to work on to pay the bills, so I'm looking to quickly find out which recent change caused this and revert it.#2023-10-1309:25vemvPlease add (alter-var-meta #'rum/defc assoc :style/indent <some value that works>) in user.clj, it doesn't take more than a few mins#2023-10-1309:26jrychterSorry if this comes across as harsh, it's just my reality at the moment: I really can't afford to spend time on this right now.#2023-10-1309:28jrychterDo you mean alter-meta! ?#2023-10-1309:28vemvYes#2023-10-1309:30vemvIf you want to revert, use CIDER 1.7.0 and cider-nrepl 0.30.0 (as bundled with 1.7.0)#2023-10-1309:31jrychterI think I'll revert. This is quite a bit more involved than it seems.#2023-10-1309:31jrychter(to begin with, there is no good place to put this in a huge app that is being compiled in various ways and that I cider-connect to)#2023-10-1309:32jrychterBut I wonder why this happened today, the only thing I upgraded today was clojure-mode from MELPA.#2023-10-1309:32vemvdev/user.clj, it's pretty standard to have a dev profile that doesn't impact other compilation targets#2023-10-1309:33vemv> But I wonder why this happened today, the only thing I upgraded today was clojure-mode from MELPA.
Most likely it's cider-nrepl#2023-10-1309:34jrychterAs a side note, I did set :style/indent on my own macros for quite some time now. And it worked. But something changed the formatting of Rum macros recently.#2023-10-1309:34jrychterI did not upgrade cider-nrepl today. Nor cider, for that matter. Only clojure-mode.#2023-10-1309:36jrychterOk, I give up. I'm trying, but I have no idea whether my alter-meta! works at all, the behavior doesn't seem to change. I also have no idea what the "right" settings are, and I can't spend much time on this… I think I'll just have to cider-quit every time before final formatting and committing.#2023-10-1309:38vemvYou could always run cljfmt or such right before committing as it would be a less dramatic measure
Anyway, feel free to get back at this thread anytime. Personally I can't work with the "has to work right now" constraint, I also have stuff to do
Have a great one!#2023-10-1309:40jrychterOh, to be clear, I'm not "demanding" this to be fixed immediately 🙂 (although I've been a noticeable CIDER sponsor for many years now). Just looking realistically at what my options are.#2023-10-1309:40vemvThere are options. We can continue later (or over GH)#2023-10-1309:41jrychterWhat could be a data point is that none of my attempts at setting :style/indent for rum macros work, but also :style/indent from my other macros stopped working. Something that worked for a while now.#2023-10-1309:42jrychterSo it's not just about rum macros not having indent information, something else must have changed.#2023-10-1309:44vemv> but also :style/indent from my other macros stopped working.
That would be a severe problem, feel free to create a detailed issue, including an example of the macro.#2023-10-1310:28jrychterOk, I've spent some time on this and I'm totally confused and I think I have to give up. Here's what I'm seeing:
• Start with fresh Emacs, indentation is OK for rum macros, but wrong for my macros.
• cider-connect and indentation for rum macros breaks, but my macros are now indented correctly.
• do (alter-meta! #'rum.core/defcs assoc :style/indent :defn) in the REPL and rum/defcs macros are now indented correctly, rum/defc macros are not
• do (alter-meta! #'rum.core/defc assoc :style/indent :defn) in the REPL and rum/defc macros are still not indented correctly, e.g. no change in behavior for rum/defc; rum/defcs is still OK.
• cider-quit and cider-connect again and both rum/defc and rum/defcs macros are indented correctly
It almost seems like there is some sort of per-namespace caching going on. I don't understand this, and I can't spend any more time on it. Just wanted to point out that something must have changed recently that caused all this. For the last 8 years I've been looking at correctly indented Rum macros, and I upgrade CIDER, cider-nrepl and clojure-mode regularly. This broke today, and the only thing I upgraded today was clojure-mode to 5.17.1.#2023-10-1310:34vemvI know that something has changed, because we changed it, with code review and tests.
There's indeed per-ns caching, as there's always been.
tbh I don't want to further spend time in this thread. It's frustrating to see intermittent interest in having this truly solved - either you have "given up" or not. Hypotheses and partial info are not useful to me.
However I'll be happy to provide support via our primary means, namely Github, which ensures that we have all the context we need.#2023-10-1310:44vemvin the REPL I suggested to do this in user.clj which has the special semantic of being executed before anything else.
In user, require rum, perform the alter-meta! and caching will be irrelevant
Restart your JVM just this time, to discard any current caching.
(I'll try to add this to our docs)#2023-10-1908:03jrychterI'm sorry if my interest came across as "intermittent". It very much isn't. I live in CIDER. I spend most of my working hours in it and thanks to it I can make a living. I just have to juggle priorities, so sometimes I have to report something and just hope for the best. And the latest releases fixed all of my issues beautifully: no more indentation issues!#2023-10-1318:44vemvToday's a great day 🍎🍏#2023-10-1319:13César OleaCongrats to the whole CIDER team for their new release and thank you for your efforts! CIDER is an awesome development environment that I enjoy using both for professional and personal projects.#2023-10-1319:24vemvGracias, César 🤝#2023-10-1320:03nivekuil@U45T93RA6 thanks for the massive amount of work you've done for us 🙂#2023-10-1707:55AkizI noticed that with enrich-classpath repl takes much longer to start. Does it have any effect on performance even when it is turned on?#2023-10-1711:04vemvNo, it has zero effect, since it only adds stuff to the classpath, there's no runtime effect
Note that enrich has a built-in layer of caching. One can use further caching by using the cider-connect -friendly https://github.com/clojure-emacs/enrich-classpath#any-lein-or-toolsdeps-project.
In a future we'll automate this caching for cider-jack-in too.#2023-10-1318:47vemvIf you've experienced issues with enrich-classpath or indentation inference, please make sure to use CIDER latest (master / 1.8.0 stable / <tel:202310131425|20231013.1425> snapshot).
Those (and others) have been improved very frequently based on your gracious feedback cider#2023-10-1319:27Carsten BehringIs there a way in Cider to "copy/paste" the command which would be use by CIDER for cider-jack-in ? This could be very useful in "sending" jack-in commands into an remote shell opened in Emacs#2023-10-1319:29Evan Bernardwhat I’ve done before is C-u M-x -jac, which gives me the ability to edit the jack-in command. but, in your case, rather than edit the command, you’d just select it all while in the mini-buffer#2023-10-1319:29dpsuttonthere’s a https://clojurians.slack.com/archives/C0617A8PQ/p1688529209320339 above with some solutions. I don’t think anyone made an issue so you should#2023-10-1319:30dpsuttonit’s not hard (i don’t think). just needs to be issue-ed so it gets done. I think it’s a great feature#2023-10-1319:44Carsten BehringI opened issue for it:
https://github.com/clojure-emacs/cider/issues/3519#2023-10-1413:17practicalli-johnAfter being called, the jack-in command is also sent to the *messages* buffer from where it can be seen, a useful way to check if custom configuration from .dir-locals.el , e.g. including Clojure CLI aliases#2023-10-1415:11dpsuttonIt prints it at the top of the repl too. To remove “the magic”. You can see it’s just a startup command#2023-10-1412:58aisamuI wouldn't mind having this baked-in!
Also made me think that I should probably try to make and bind a re-eval-deftest+re-test
(Thanks, @timothypratley) https://x.com/timothypratley/status/1713043658403156225?s=20#2023-10-1414:15vemvDefining/running a retriable form sounds suspiciously similar to defining/running a deftest :)
So https://clojurians.slack.com/archives/C0617A8PQ/p1695734047060379 would be relevant
OTOH I'd understand if it's excessively formal to some.#2023-10-1416:57aisamu> Defining/running a retriable form sounds suspiciously similar to defining/running a deftest :)
>
Yes! But I would miss the nice test report!#2023-10-1418:18vemvFor that reason I'd favor deftests instead of ad-hoc repling :)
(while of course I respect alternative workflows)
One aspect that where CIDER (or clj-refactor) could be improved is that they make super easy to create a deftest. e.g. with a single keybinding have a file + ns form + stubbed deftest, ready to be run.#2023-10-1509:53hifumi123When using lsp-mode, setting up the ns is halfway done for you as soon as you create a file. But I agree this can be automated a lot. We would have to be careful with ClojureScript, however, since there are differences in namespace and functionality of language itself.
e.g. in JVM Clojure, I think this is idiomatic
(ns some.example-test
(:require [clojure.test :refer :all]
[some.example :as example]))
(deftest ...)
However, ClojureScript uses cljs.test and does not implement :refer :all. So the idiomatic way to scaffold the test namespace is like so.
(ns some.example-test
(:require [cljs.test :refer [deftest testing is]]
[some.example :as example]))
(deftest ...)
but we also have to be careful in what we refer, since many people use clojure-lsp, which will warn of unused bindings. Similarly, clj-kondo warns of any usage of :refer :all, even though its one (and only!) intended use case, according to the person who implemented it, is to pull in all public symbols of clojure.test.#2023-10-1510:48vemvclj-refactor.el also does something very similar, including clj/s differences. One can customize the ns snippets as well.
But it only happens when you create a new test file - that one step (plus the deftest insertion) is what I'd like to automate as a single action.#2023-10-1509:58Carsten BehringI was lately tinkering a lot using alternative value inspectors in CIDER, such as Clerk and Portal.
One "generic" way to integrate them a bit closer into a CIDER based workflow, is to enable "automatic tapping of CIDER evaluation results.
And then configuring Portal or Clerk to show all tapped results in a browser.
This will then result in seeing all evaluation results in a Browser.
At least for Clerk's tap-inspector this works well as it deals well with (and folds) long results automatically.
This can be done rather easily already today, by advising cider-nrepl-request:eval
(Thanks to @daslu for initial code snippet)
(defun clojure-tap (&rest r)
(cons (concat "(let [__value "
(caar r)
"] (tap> __value) __value)")
(cdar r)))
(defun cider-nrepl-enable-auto-tap ()
(interactive)
(advice-add 'cider-nrepl-request:eval
:filter-args #'clojure-tap))
Should this become functionality of CIDER itself, as being generic ?#2023-10-1510:56vemvhttps://github.com/clojure-emacs/cider/issues/3055#issuecomment-1736099756 is the approach I intend to get into cider, as far as tapping is concerned
I'd be wary of tapping everything. While it doesn't sound disastrous, it's also not the sort of thing that we should officially foster#2023-10-1510:58Carsten Behringfine for me.
Users can do it on "own risk"#2023-10-1511:18Carsten BehringI read over the discussions, and can now give my comment here, more about my "request".
One question is if / if not CIDER should have "support" for easely "tapping" everything. In my view this is a yes/no question, no further config.
Either it "taps" nothing "on evaluation", as now.
Or it allows easely to "tap everything". This has indeed a certain "risk" of exploding memory, so fore sure should be disabled by default.
It is of course already "easy", as my snippet shows.
The second question is, if CIDER should make it more easy to add tap handlers, and if / if not something should happen automatically when epl starts.
Maybe it helps as well to think about my initial use case, which is to "keep a visual list of all past evaluations results", which CIDER does not have at all as feature. (+ it allows me to have that list rendered in Browser, so having richt output)#2023-10-1511:19Carsten BehringCIDER supports this in some form, but only of the last three results, just as Clojure does.#2023-10-1511:48practicalli-johnHaving an option in cider that sends nrepl eval results to any registered tap source could simplify tool uses, although it seems the main tap tools already support nrepl evals.
Portal data inspector works very well when tapping via nrepl middleware, automatically sending all evaluation results to Portal and keeping a full history ( Portal clear command will remove history if required)
https://cljdoc.org/d/djblue/portal/0.37.1/doc/guides/nrepl
I also send mulog log event message to Portal with a custom mulog event publisher that taps every log event.
I enable this configuration and launch portal via a https://practical.li/clojure/data-inspector/portal/#editor-commands, so it can be selectively enabled when starting the repl.#2023-10-1512:05Carsten BehringIndeed, middleware is an other option.
I was searching once for a generic nrepl middleware which is simply "tapping" all results, but did not find any.#2023-10-1513:37vemvIt should be reasonably easy to implement a custom piece of middleware and add it to your stack
This also may answer your second question - given a smart enough piece of nREPL middleware, it could be configured to satisfy diverse needs easily.#2023-10-1516:38vemvℹ️ We've released cider-nrepl 0.40.0 which fixes a subtle but generalized issue with macro metadata under ClojureScript.
It's included in CIDER 1.8.2 / {:tag :tel:_20231015133420231015.1334, :attrs nil, :content (" snapshot")} / master.#2023-10-1601:37lilactownthanks vemv#2023-10-1517:15daveliepmannRe: CIDER 1.8.x's https://github.com/clojure-emacs/cider/discussions/3338#discussioncomment-7285955, is it possible to get these short/non-stacktrace error messages as an overlay, without changing the *cider-error*-opening behavior of errors which involve stacktraces?#2023-10-1517:18vemvYes, we've worked specifically on it very recently
Do you not see an overlay?
It may be some setting, can check if you don't find it first :)#2023-10-1517:19daveliepmannI checked https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration but didn't see a setting#2023-10-1517:19daveliepmannI only see messages in the minibuffer#2023-10-1517:44vemvThe logic for deciding whether an overlay is displayed is as follows:
(or
;; if we won't show *cider-error*, because of configuration, the overlay is adequate because it compensates for the lack of info in a compact manner:
(not cider-show-error-buffer)
(not (cider-connection-has-capability-p 'jvm-compilation-errors))
;; if we won't show *cider-error*, because of an ignored phase, the overlay is adequate:
(and cider-show-error-buffer
(member phase cider-clojure-compilation-error-phases)))#2023-10-1517:45vemvAnd it looks like this:#2023-10-1517:56daveliepmannI'm stumped. cider-version is 1.8.2 Geneva, cider-show-error-buffer is t (tho I also tried with nil), m-x : (cider-connection-has-capability-p 'jvm-compilation-errors) => nil. Yet I still see no overlay. i'm using cider-eval-last-sexp#2023-10-1517:58vemvWhat about cider-eval-sexp-at-point ?#2023-10-1517:59daveliepmannnvm, i got it — another part of my config was setting cider-use-overlays which I guess is also in the logic chain somewhere#2023-10-1518:01vemv👍 . If you feel cider-use-overlays is too coarse-grained for your preferences, I'd be happy to discuss it over GH#2023-10-1518:26daveliepmannhttps://github.com/clojure-emacs/cider/issues/3522#2023-10-1811:24danielnealI’ve just updated and are getting these new exciting looking overlays. But they are just saying “Error in Thread” rather than adding any specific information. What am I missing?#2023-10-1811:27danielneal#2023-10-1811:36daveliepmannSeems related to https://github.com/clojure-emacs/cider/discussions/3338#discussioncomment-7286434 specifically this possible config fix https://github.com/clojure-emacs/cider/issues/3525 (not yet released AFAIK)#2023-10-1811:37daveliepmannwait, no, I get a stacktrace and cider-error buffer on that#2023-10-1811:38daveliepmanndo you have any config related to showing the cider-error buffer?#2023-10-1811:40danielnealI don’t have any#2023-10-1811:40danielnealMy config is very minimal, out of the box#2023-10-1811:40danielnealAdd a paredit mode#2023-10-1811:47vemvIs that the entire overlay? Your screenshot seems trimmed#2023-10-1811:48danielnealThe rest is more about the thread than the error#2023-10-1811:50vemvMost times they're useful#2023-10-1811:51vemvIf you use the absolute latest Git master / MELPA snapshot you'll have available the latest customization options for them as seen at the top of https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md
These implement @U05092LD5’s feedback for this feature.#2023-10-1811:51danielnealI get the error in thread for (let [1]) too#2023-10-1811:52vemvI don't, never have, please create an issue#2023-10-1811:54danielnealCool, I’ll see if I can get a minimal reproduction#2023-11-1411:16vemvWe got the same report when using Flowstorm's custom clojure version. Was it that?
A fix should be on its way from their side#2023-11-1412:27danielnealAhhh yeah that was it good catch!!!!#2023-11-1412:28vemv🍻 !
Fix should be out soon I guess https://clojurians.slack.com/archives/C03KZ3XT0CF/p1699961805678759?thread_ts=1699898076.576449&cid=C03KZ3XT0CF#2023-10-1811:54lassemaattawhat's the cider-error-hoover overlay and can I disable it? Our logging implementation prints stuff in the REPL and it looks like that particular overlay is applied to some parts of some lines (not all). Accidentally clicking on such a line segment will open dired in the project root, which is a bit confusing.#2023-10-1811:55lassemaattaI have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399#2023-10-1811:55vemvSounds dense enough to warrant an issue :)
Please create it and I'll be happy to attend it right away#2023-10-1811:56vemv> I have a feeling that sometimes clicking on such a link would also trigger this: https://clojurians.slack.com/archives/C099W16KZ/p1692351993871399
Unrelated, however you are in luck, because we're fixing that today#2023-10-1812:03vemv...Done https://github.com/clojure-emacs/cider/pull/3538 . Expect a couple hours for a MELPA release, and make sure that clojure-mode gets updated as well.#2023-10-1812:07lassemaattahttps://github.com/clojure-emacs/cider/issues/3539#2023-10-1813:28Pavel FilipencoWhat setup is required with deps.edn for cider to load the namespaces and switch to some default? Also, are there any global deps.edn setup files (like .lein/profiles.clj) to add some universal user deps/plugins?#2023-10-1813:30mjhikaI can't answer the first question, but for the second you can use ~/.clojure/deps.edn#2023-10-1813:32mjhikathis is a very featured user deps.edn https://github.com/practicalli/clojure-cli-config#2023-10-1813:41vemvI believe that setting a initial ns is hard. Lein achieves so in a hacky way.
I asked about it here https://clojurians.slack.com/archives/C17JYSA3H/p1693584814024819
Ultimately, we could just add that feature to https://github.com/nrepl/nrepl#2023-10-1813:41vemvLoading the namespaces is a touch easier. What's your workflow - tools.namespace or repl-driven?#2023-10-1813:43Pavel Filipenco@U45T93RA6, repl-driven, if that means what I think it means. I don't know about tools.namespace.
@U01C9CMAPK4, thanks for the link, helped me find more information, and I'm reading the practicalli guide now.#2023-10-1813:48vemvOne way could be to add to user.clj (a ns named user is always required automatically by Clojure) sufficient requires.
Another approach would be to add a cider-connected-hook such that it performs requires or other stuff.
Note that this will make your repl start more slowly, and may fail on startup.
I believe that a purist approach would be to require stuff by hand, but not close your REPL too often. For that I'd recommend cider-connect over cider-jack-in, so that you can restart Emacs without losing your repl stuff.#2023-10-1813:58practicalli-johnWhen using Cider with Clojure CLI, then only the Clojure CLI install is needed.
https://practical.li/clojure/clojure-cli/ provides examples of common tasks on top of the Clojure CLI
Evaluating code in source code buffers automatically evaluates the code in the correct namespace.
Using rich comment forms allow experimental code to be separate from more stable code.
A https://practical.li/clojure/clojure-cli/repl-startup/, although not for setting the namespace (code can be added to switch the namespace, but it will likely be superceded by the repl startup process
Using the -e flag to pass an expression to evaluate code such as switching to a namespace should work fairly consistently. This is usually done within an alias that used when starting the repl#2023-10-1813:58alexyakushev@U060FHA3K28 This is how I do it:
1. Have ~/.clojure/user.clj file with the things I want to be present in every project.
2. Have this alias in ~/.clojure/deps.edn:
:user {:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/user.clj\"))"]}
3. Ensure that :user alias is appended to every clj call. For CIDER, you can add it to cider-clojure-cli-aliases variable. In the terminal, I went with a shell alias, like alias clj="clj -A:user"#2023-10-1814:03vemvPlenty of cool approaches being shared :)
A last one I can think of is setq cider-repl-require-ns-on-set t . By requiring the ns'es you visit, you'd get a recursive requiring.
Similarly, there's cider-repl-init-code , which is good to tweak on .dir-locals.el#2023-10-1814:03Pavel Filipenco@U06PNK4HG, thanks. Isn't there a standard clojure way to find where the config is located? XDG_CONFIG_HOME is much nicer, for example.#2023-10-1814:07alexyakushevIf it is set, yes. It is empty for me on MacOS.#2023-10-1816:38practicalli-john@U060FHA3K28
I use XDG standard for Clojure CLI and Emacs (and Neovim), although there are a fewconfigs that don't support it, so I use symbolic links
Here is a guide with details
https://practical.li/blog/posts/adopt-FreeDesktop.org-XDG-standard-for-configuration-files/#2023-10-1819:06vemvℹ️ We've released https://github.com/clojure-emacs/cider/blob/v1.8.3/CHANGELOG.md#183-2023-10-18 with a tasty batch of bugfixes, improvements and customization options, all Elisp side.
One particular area that has gotten attention lately is error overlays (as seen in the screenshot).
You can learn more about them here:
https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration
https://docs.cider.mx/cider/usage/code_evaluation.html#overlays
Thanks much to everyone involved in giving accurate feedback.#2023-10-1819:20aisamuThank you, vemv!#2023-10-1819:22vemvThanks to you / all of the frequent #C0617A8PQ dwellers!#2023-10-1819:17vemvMake sure to also bump clojure-mode (5.18.0) to completely obliterate the dreaded No comment syntax is defined prompt 💥#2023-10-1907:30Karl XaverI want to set up a clean env to hack on cider "reproducibly". First attempt was just cloning the repo and using a minimal init.el with
(setq load-prefer-newer t)
(use-package cider
:load-path "~/contrib/cider"
:demand t)
Though this will complain about
Error (use-package): cider/:catch: Cannot open load file: No such file or directory, parseedn
Before I go any further: should I just add all the packages that are required manually like above, or am I on the wrong path entirely?
Any further advice/resources are highly appreciated, e.g. on
• possible pitfalls, like stale [native?]compiled files
• testing against multiple emacs versions#2023-10-1907:34vemvProbably that approach is workable, but a more standard and enjoyable one would be to make cider a git submodule (or git clone) within your usual .emacs.d
i.e. cider wouldn't be your root thing, but instead just another lib
On non-hack days you would make the repo point at the latest tag (or master).
On hack days, you branch out#2023-10-1907:34vemvPersonally I use bare submodules, although https://github.com/radian-software/straight.el is surely more enjoyable#2023-10-1907:36vemv> testing against multiple emacs versions
I wouldn't care about that a lot, we have a CI matrix. But yeah it's possible! https://github.com/clojure-emacs/cider/blob/f85d5c17043a430d0bb730c6637fba52f5a7f94f/Makefile#L6
Normally I run make (default task) before any commit and most relevant tests/linting would be run.
Happy hacking!#2023-10-1908:03Karl XaverThanks!#2023-10-1908:05jrychterJust wanted to thank the team (especially @vemv) for the latest releases: they fixed the indentation issues I ran into a while back! Thanks! ❤️#2023-10-1908:18vemvThanks to you!
Curious, were you using clojurescript?
Because that one has a funny story behind#2023-10-1908:21jrychterYes, my app is Clojure+ClojureScript (a lot of both).#2023-10-1908:28vemvOn ClojureScript, repl detection used to be wrong (it was detected as a clj repl, at times), so fixing that broke indentation
The fix was using the clojurescript analyzer info more comprehensively.
Sometimes things have go get worse before they get improved 🌀#2023-10-1908:44jrychterWell, thanks for looking into it, despite the very limited info I provided. I'm thinking about how to avoid disruption in the future, though — when CIDER breaks, my work essentially stops. This indentation problem meant I couldn't commit changes, for example. And Emacs doesn't make it easy to downgrade MELPA packages.#2023-10-1908:49vemvIn an ideal world we would have a fantastic test suite. We currently have a just-fine one.
Everyone deserves stability, so a good measure if you cannot afford 'downtime' so to speak would be to use Git-based lib management (e.g. https://github.com/radian-software/straight.el) instead of package-based.
Personally I use a mixture of MELPA (most stuff) and bare git submodules (critical bits). I've had it like that for 10+y and it's fanstatic - my Emacs is the one place in my laptop that never randomly breaks :)#2023-10-2008:51jrychterThat's a good suggestion, thanks! I'll look into it.#2023-10-1908:25danielnealI also want to thank whoever elucidated why I was getting No comment syntax defined all the time. I’ve unbound comment-line now, too, so hopefully I’m not going to trip up on that while bumbling around emacs#2023-10-1908:30vemv@U01320BR6US found it and we got it in here https://github.com/clojure-emacs/cider/pull/3538 (cider + clojure-mode)#2023-10-1908:26danielnealThat was driving me crazy!#2023-10-1910:41vemvWe're working on these https://github.com/clojure-emacs/cider/labels/inspector , if there's anything else you'd like to see in the Inspector, this is your chance shipit#2023-10-2110:12vemvGood one - added!#2023-10-2117:57Carsten BehringI suppose that the tapping of values from the inspector is in your pipeline already. See my PR here
https://github.com/clojure-emacs/cider-nrepl/pull/824
which implements the nrepl side of it.#2023-10-2117:58vemvYes, I should get to it!#2023-10-2416:31danielnealHaving the inspector as a tap target would be cool, if that’s not already on the list.#2023-10-2416:32danielnealLike a cider portal#2023-10-2416:35vemvYes, we have https://github.com/clojure-emacs/cider/issues/3055
it's possible to quickly hack something locally as described in OP. I've been using something like that, for a few weeks.
The main challenge is making it truly 'production ready'#2023-10-2416:39danielnealOh cooll!! Glad to see you’re thinking about this#2023-10-2416:39danielnealYeah makes sense the last 5% is always 95% of the work 😄#2023-10-2103:03phronmophobicI get Symbol's value as variable is void: text-scale-mode-amount after calling cider-inspect. cider-inspect works the first time I use it, but I get the error every subsequent call until I restart emacs#2023-10-2103:08phronmophobicNot really sure how to debug, but I'm happy to provide more info. Here's some random info that might be helpful:
• OS: Mac OSX
• emacs version: GNU Emacs 29.1
• cider version(s): I tried CIDER 1.8.4-snapshot (package: and CIDER 1.8.3 (Geneva)
• clojure-mode: clojure-mode (version 5.18.0) #2023-10-2110:15vemvAre you using CLI emacs perhaps?
text-scale-mode-amount comes from text-scale-mode which is built-in to emacs#2023-10-2112:22vemvFixed https://github.com/clojure-emacs/cider/commit/4c99c02b5762c107cdf771a771a1216b040ba53e , expect a snapshot within 2 hours#2023-10-2118:44phronmophobicI can confirm it fixed the issue for me. Thanks!#2023-10-2118:49vemvcurious, were you on CLI Emacs?#2023-10-2118:49phronmophobicYes#2023-10-2118:50phronmophobicStill rocking the terminal#2023-10-2118:51vemvI wish this edge case didn't escape to me :)
I'll try to think about the CLI more often before we ship stuff.#2023-10-2118:52phronmophobicNo worries. It was easy to write a workaround to hardcode the font-size.#2023-10-2316:37deep-symmetryAh, does this thread mean that the issue with popup positioning when text has been scaled up for pairing with my coworkers is being investigated? 😀#2023-10-2316:54vemv@U0EHA00G1 never had heard of that one, I believe. Feel free to create a GH directly - there's an Inspector batch in progress 👀#2023-10-2316:55deep-symmetryOK, thanks, I’ll take some screen shots and organize an issue.#2023-10-2119:33akishey all, I'd like to try 1.8 but I'm having trouble upgrading it with emacs doom. I tried doom/upgrade but that doesn't seem to work. Inspecting cider shows that it's pinned on 1ed5163433c991c00ea83fdd4447e8daf4aeccbe#2023-10-2119:41Karl XaverYou can unpin packages in your $DOOMDIR/packages.el
see: https://github.com/doomemacs/doomemacs/blob/986398504d09e585c7d1a8d73a6394024fe6f164/lisp/doom-packages.el#L613#2023-10-2119:44Karl XaverI'd advise to unpin the whole module, so ciders dependencies (like clojure-mode) are updated too. Otherwise you might experience inconsistencies.#2023-10-2120:03practicalli-john#C01GE5PD249 channel may have more specific help#2023-10-2120:08akisthat worked @U01RN5VR18X, thank you!
when you say whole module, did you mean (unpin! cider) ? What's the alternative, out of curiosity?#2023-10-2120:13vemvbtw, apparently the official bump is on its way https://github.com/doomemacs/doomemacs/pull/7515#issuecomment-1772641803#2023-10-2121:18aisamuI think Karl meant
(unpin! (:lang clojure))
This will also unpin other packages required by the clojure module, such as clojure-mode, jet, and etc.#2023-10-2121:40akisoh interesting, thank you!#2023-10-2319:55respatializedWhat's the easiest way to interactively pass the result of a cider evaluation to an elisp function (as a string)?#2023-10-2319:59vemv(cider-nrepl-sync-request:eval "(+ 1 2)")#2023-10-2322:15mikerodI’ve ran into some trouble with “indentation inference” now too, as mentioned several times here now. It became a bit problematic in some codebases that I work in that macro forms started to indent at different levels than before. Adding alter-meta! to all of these cases is a fairly tedious and brittle task I’d say too.
Perhaps I can move past that though, but one thing that still bothers me about it is that indentation works differently in a clj/cljs/cljc buffer if I have a REPL running vs not.
I think this is quite confusing since the indentation will move around depending on this state. What if someone were to just want to format a file statically without running things?
Lastly, I’ve noticed that the indentation inference doesn’t seem to happen in the actual REPL buffer running with cider-mode?. It only seems to affect the clj/cljs/cljc buffers that have clojure-mode. I thought that was quite odd/confusing when I first encountered since I’d think something “dynamic” coming from cider runtime state would be more likely to affect a cider buffer than not.#2023-10-2406:28vemv> Adding alter-meta! to all of these cases is a fairly tedious and brittle task I’d say too.
If it's your code, it should be declared as :style/indent - as we always have expected over the years!
If not, alter-meta! is only suggested as a temp patch. The actual desired endgame is that libs get improved upstream for everyone (which not only includes CIDER users, but also clojure-lsp users since it also understands :style/indent).
> indentation works differently in a clj/cljs/cljc buffer if I have a REPL running vs not.
This has been the case with CIDER since, approximately. forever :)
I get that it can be frustrating though, so I created https://github.com/clojure-emacs/cider/issues/3401
> Lastly, I’ve noticed that the indentation inference doesn’t seem to happen in the actual REPL buffer running with cider-mode?.
I can take a look at it.#2023-10-2413:33mikerodThanks I appreciate the feedback and the follow-up issue looks good.#2023-10-2413:33mikerodAnd indeed my problems come from other libs so far. So just have to work with those for now.#2023-10-2413:37vemvDoes the inference look off for your case? Feel free to provide a screenshot + the macro in question
Generally inference works well by now but I'd be interested in edge cases#2023-10-2419:45mikerodIn my case it just made the body of a macro go from indenting 1 space to 2 spaces. Aesthetically this isn’t a big deal. The issue is just that we wanted to avoid indentation changing/thrash across dev env’s on our large codebase that uses this macro often.#2023-10-2419:46mikerodThe macro in question that came up the most was a re-frame testing macro. It now does 2 indentations for the body since it’s signature is & body.#2023-10-2419:46mikerodAnd as I’ve mentioned, when the repl is not connected, we get 1 indentation due to the inference not being on.#2023-10-2419:50vemvBut would you find the produced indentation wrong, when comparing it with similar macros?
[& body] would sound like a 2-space indent macro to me.
If you prefered no-churn diffs over idiomatic indentation, I'd kind of understand it but for us, producing the right result always comes first.#2023-10-2419:51vemvThe ideal result for the average team is that you'd add style/indents here, maybe a cljfmt config there, and have stuff look better than before#2023-10-2515:19mikerodFair enough. And yeah, I think that 2-space indent seemed to be what I saw happen most of the time anyways, so I wasn’t strongly against it becoming 2 spaces. I just didn’t like the churn and confusion it brought this time around. At least it is understood now and I think indeed a general solution is to use some sort of auto formatting in builds to make sure everyone remains consistent. And of course use :style/indent more often for cases we want adjustments for.#2023-10-2515:58mikerodIs it still possible to setup emacs elisp sort of rules to override indentation inference of certain macros?#2023-10-2515:58mikerodvia define-clojure-indent#2023-10-2516:21vemvIt's not possible, CIDER's rules always override clojure-mode's. There's no internal distinction between inferred and defined#2023-10-2516:23vemvAs always, you can :style/indent your way into avoiding inference
> At least it is understood now and I think indeed a general solution is to use some sort of auto formatting in builds to make sure everyone remains consistent.
Yes, lein cljfmt check or so is a common sight in teams' CIs. If you run it through clojure-lsp's https://clojure-lsp.io/api/api/ / CLI, it will honor :style/indent#2023-10-2406:00hifumi123was the change in syntax highlighting for some? intentional? using modus-vivendi theme on my end, i see a purple color now where previously itd be pink. the color of other functions, like nil? didnt change, it seems. i dont really consider this a bug, just curious
also: the macro indentation inference in 1.8.0 is awesome#2023-10-2406:18vemvWith:
(setq cider-font-lock-dynamically '(macro deprecated
core ;; for a repro
)
I see some? and nil? highlighted as core. JVM clojure
(edit: also with clojurescript)#2023-10-2406:36vemvOne thing noticed just now is that some? nil? both get highlighted, but only when they look as a function call (i.e. they have the parentheses)#2023-10-2407:59nivekuilcider trying to decrypt authinfo.gpg has been annoying for a while now, seems I'm not the only one going by slack history. should be an easy fix, add a defvar guarding https://github.com/clojure-emacs/cider/blob/master/cider.el#L1768. should I just send a PR?#2023-10-2408:22vemvfeel free to :)#2023-10-2408:29nivekuilsent a pr, the infra runs eldev right? I can't even figure out how to install it 😞#2023-10-2408:34vemvYep, it does. Thanks for the pr!#2023-10-2418:16Carsten BehringWe could in my view simplify the documentation of (remote) containers / devcontainers here:
https://github.com/clojure-emacs/cider/blob/master/doc/modules/ROOT/pages/basics/up_and_running.adoc#working-with-containers-docker-or-others
by only referring to a new tool for this:
https://github.com/loft-sh/devpod
From an Emacs point of view devpod unifies the concrete "place" of the container (local or remote or inside Kubernetes or ....) and creates for all cases a working ssh connection entry in ".ssh/config" and tunnels configured remote ports automatically to "localhost" and makes the code available with a "simple" TRAMP connection 'user@host'. So different docker scenarios "look" the same for Emacs / CIDER.#2023-10-2418:28vemvI don't think it's CIDER's job to promote a particular tool - particularly a new one.
Knowing the Clojure audience well, most developers will be conservative in their choices and will try to stick to vanilla Docker or such.
With that said, if you felt it was necessary we could add a section for it (that would not replace existing sections).
But preferably, CIDER / its doc would be correct enough that one can use newer tools with minimal adaptations.#2023-10-2418:31Carsten BehringYes, I do agree.
Maybe a single phrase saying that "the above" gets simplified using "devpod" is fine,
What we say stays correct, just that for the "lower level" devcontainer-cli we still need to say "from here2 we run it and devpod does more automation in port forrwarding (including creation of '.ssh/config' entries.
"more magic" you could say....#2023-10-2418:36vemvI see!
I don't enjoy saying 'no', but that would sounds like a tutorial to me... in my mind, a tutorial is something pretty detailed, that describes a particular stack (here: devcontainers + devpod?), step by step.
Tutorials tend to bit-rot relatively quickly.
A "reference documentation" is less easy but also less opinionated and more stable. That's IMO what our docs should aspire to be.#2023-10-2511:46Carsten Behringagree, to much for CIDER docu. But I have one other question related, but will start a new thread.#2023-10-2505:00vemvℹ️ We have released the smaller release CIDER 1.9.0 ("Barcelona") mostly to group a batch of Inspector new commands, bugfixes and presentational improvements.
Feel free to go over the https://github.com/clojure-emacs/cider/releases/tag/v1.9.0 / https://docs.cider.mx/cider/1.9/debugging/inspector.html!
We have more Inspector goodness on the radar. Think tap> refinements and cljs compatibility 👀#2023-10-2508:52danielnealQuestion - when evaluating things I like to use C-c C-p cider-pprint-last-sexp.
However if there’s an error the result window pops up with nothing in it, and I can only find there was an error by checking the repl.
When I use C-x C-e I get a nice error overlay now, but if I use C-c C-p, how do I know there was an error? Can it automatically popup an error window or overlay too? I don’t have any config set, just using cider / clojure-mode out the box.#2023-10-2508:54vemv> However if there’s an error the result window pops up with nothing in it,
Sounds like an issue, it should be conveyed either as an overlay or as *cider-error*
Feel free to report it!#2023-10-2509:02danielnealDone https://github.com/clojure-emacs/cider/issues/3553#2023-10-2509:02danielnealThanks!!!#2023-10-2513:11Carsten BehringFor some reasons related to my ssh setup, I needed to "customize" 2 parts of the full string used by CIDER to execute the jackin,
I marked them in bold here:
---
/home/vscode/.asdf/shims/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "-p" "12345" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
---
Is there a way in CIDER to achieve this customization ?#2023-10-2513:41dpsuttonyou can edit the string CIDER uses to connect. You can also leverage nrepl’s own https://nrepl.org/nrepl/1.0/usage/server.html#server-configuration and make a local nrepl.edn file that would include the port you want to use#2023-10-2513:44Carsten Behringyes, that does work
So I manged to start the nrepl server on a fixed port.#2023-10-2513:49dpsuttondoes that completely solve your problem?#2023-10-2513:49Carsten BehringNow I have an other complication for using "cider-jack-in".
My "setup" tunnels the remote 12345 port back to localhost.
So the implicite "connect" done by cider-jack-in should connect to "localhost:12345" (whch would work), but as I edit the files over TRAMP, it tries "remote-host:12345", which does not work...
So cider-jack-in fails, (but it leaves the server started),
so I can do cider-connect localhost:12345#2023-10-2513:50Carsten BehringSo basically I would need a "fallback-to-localhost".....#2023-10-2513:52Carsten BehringI agree, I have an unsual setup. (but it is the default setup when using "devpod" (https://devpod.sh/)#2023-10-2513:54dpsuttoni’m not sure i’m following. sounded like jack in succeeds but editing files is broken. But then you said jack-in is broken.#2023-10-2513:54dpsuttonalso confused why tramp is involved in editing files#2023-10-2513:55Carsten BehringFirst problem was solved. Making sure cider-jack-in starts server on remote host correctly (fixing port to 12345 and using non standrd clojure path)
This is working now,#2023-10-2513:55dpsuttonbut with these kinds of setups, I’d say the following strategy is most likely to work. Start up nrepl from a terminal the “proper” way so you know it is correct. and then cider-connect to it. see if you can connect and edit files and all that jazz. Once you know what the startup form should be, then turn to getting CIDER to start it up correctly#2023-10-2513:56Carsten BehringYes, I agree. I came to that conclusion as well.#2023-10-2513:56Carsten BehringBut I was investigating if I can use teh "compfort" of cider-jack-in as well for my setup.#2023-10-2513:57dpsuttonso does everything work correctly if you start your project and nrepl in a terminal and connecting from CIDER?#2023-10-2513:57Carsten Behringyes#2023-10-2513:57dpsuttonoh that’s annoying.#2023-10-2513:58Carsten Behringcider-jack-in and its configuration options do not handle "all cases", mine is not handled / configurable.#2023-10-2513:58dpsuttoni guess i’m not clear which axis missing#2023-10-2513:59dpsuttonif you do c-u m-x cider-jack-in you can edit the connection string. Can you edit it such that it works completely? Once you know exactly what connection form works it should be decently simple to get it configurable to get you there#2023-10-2513:59Carsten BehringThat the relationship between "emacs buffer name having a host name in case of TRAMP" could still mean "connect to localhost"#2023-10-2513:59dpsuttoni don’t follow that#2023-10-2514:00dpsuttonif you can correctly cider-connect to a startup form, can you edit the jack-in startup form and have a working setup?#2023-10-2514:00Carsten Behringmy buffer says "xxx.clj@a-host`#2023-10-2514:00dpsuttonbecause i understood you said that if you start up the project in a terminal you can cider connect to it and everything works properly#2023-10-2514:00dpsuttonand cider-jack-in or cider-connect shouldn’t have any bearing on buffer names (that i can think of)#2023-10-2514:01Carsten BehringIs it not that CIDER infeers the host to connect to from the TRAMP connection settings ?#2023-10-2514:03dpsuttonbefore we keep diagnosing. Can you confirm the following:
• if you start up the project with a command CIDER works perfectly with cider-connect
• if you edit the connection string CIDER uses (`C-u m-x cider-jack-in` and then edit the startup form) does it work correctly?#2023-10-2514:03Carsten Behringmy TRAMP connection settings have "host = xxxx", but cider connect done by cider-jack-in after having started the server on xxx should connect to "localhost".#2023-10-2514:03Carsten Behringas DEVPOD sets it up this way. It tunnels remote ports to "localhost", they are not existing at "xxxx:12345"#2023-10-2514:05Carsten Behring"starting the server" works.
but the second step of the cider-jack-in (= doing a cider connect internally) fails.#2023-10-2514:06Carsten Behringas it tries alwaas to connect to "servername:port" and not "localhost:port"#2023-10-2514:06Carsten BehringIn my case "servername:host" is not "exposed" only "localhost:port" is exposed.#2023-10-2514:09Carsten Behringso it does work to start the server via "ssh servername clojure ..." BUT
the automatic "connect to servername:port" is not setup, it should use "localhost:port"#2023-10-2514:11Carsten BehringThe log says this:
[nREPL] Starting server via /home/vscode/.asdf/shims/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
[nREPL] server started on 12345
[nREPL] Establishing direct connection to try-langchain-opencity.devpod:12345 ...
[nREPL] Direct connection to try-langchain-opencity.devpod:12345 failed#2023-10-2514:12Carsten BehringIt would all work if CIDER would try (or could be configured) to "establish direct connection to localhost:12345"#2023-10-2514:12Carsten Behringinstead of trying "Establishing direct connection to try-langchain-opencity.devpod:12345"#2023-10-2514:20vemvIn case it helps, note there's https://github.com/clojure-emacs/cider/pull/3544 open#2023-10-2514:31Carsten BehringI know enabled the nrepl-use-ssh-fallback-for-remotes (which might work, depending ho it does the tunnel ..)
But it gives error:
error in process filter: nrepl-connect: Wrong type argument: stringp, nil
#2023-10-2514:33vemvMay be the issue addressed by the pr above? https://github.com/clojure-emacs/cider/issues/3541#2023-10-2514:33Karl XaverInference from the tramp file name is not happening when the connection is made directly, only when made via ssh
But yeah, this is broken at the moment. See the PR above.#2023-10-2514:44Karl XaverYou can try simplyfing the let bindings in nrepl--ssh-tunnel-connect from
((current-buf (buffer-file-name))
(tramp-file-regexp "/ssh:\\(.+@\\)?\\(.+?\\)\\(:\\|#\\).+")
(remote-dir (cond
;; If current buffer is a TRAMP buffer and its host is
;; the same as HOST, reuse its connection parameters for
;; SSH tunnel.
((and (string-match tramp-file-regexp current-buf)
(string= host (match-string 2 current-buf))) current-buf)
;; Otherwise, if HOST was provided, use it for connection.
(host (format "/ssh:%s:" host))
;; Use default directory as fallback.
(t default-directory)))
(ssh (or (executable-find "ssh")
(error "[nREPL] Cannot locate 'ssh' executable")))
(cmd (nrepl--ssh-tunnel-command ssh remote-dir port))
(tunnel-buf (nrepl-tunnel-buffer-name
`((:host ,host) (:port ,port))))
(tunnel (start-process-shell-command "nrepl-tunnel" tunnel-buf cmd)))
to
((remote-dir nrepl-project-dir)
(ssh (or (executable-find "ssh")
(error "[nREPL] Cannot locate 'ssh' executable")))
(cmd (nrepl--ssh-tunnel-command ssh remote-dir port))
(tunnel-buf (nrepl-tunnel-buffer-name
`((:host ,host) (:port ,port))))
(tunnel (start-process-shell-command "nrepl-tunnel" tunnel-buf cmd)))#2023-10-2515:05Karl XaverRegardless of ssh: when jacking in with clojure on a tramp remote, the host string is coming from
https://github.com/clojure-emacs/cider/blob/95a19f09999d57d0c78d8a01795a455b6501e042/nrepl-client.el#L1186C34-L1186C34
(host (or (match-string 2 output)
(file-remote-p default-directory 'host)
"localhost"))
At the moment, this will always be (file-remote-p default-directory 'host) see: https://github.com/clojure-emacs/cider/blob/95a19f09999d57d0c78d8a01795a455b6501e042/nrepl-client.el#L1130#2023-10-2515:14Carsten BehringAs I trey to debug this code, I see that I gon not get a "buffer-name" here:
https://github.com/clojure-emacs/cider/blob/95a19f09999d57d0c78d8a01795a455b6501e042/nrepl-client.el#L590
(defun nrepl--ssh-tunnel-connect (host port)
"Connect to a remote machine identified by HOST and PORT through SSH tunnel."
(message "[nREPL] Establishing SSH tunneled connection to %s:%s ..." host port)
(message "current-buffer-2: %s" (current-buffer))
(message "buffer-name-2: %s" (buffer-name))
(message "buffer-file-name-2: %s" (buffer-file-name))
gives me:
current-buffer-2: *nrepl-server workspaces/try-langchain-opencity:localhost*-263499
buffer-name-2: *nrepl-server workspaces/try-langchain-opencity:localhost*-263499
buffer-file-name-2: nil
I am only having the TRAMP buffer with a Clojure file open when running the cider-jack-in How can this be ???
So how can the current buffer be "not my Clojure file ..."#2023-10-2515:17Karl XaverBecause the execution context of this is the nrepl buffer.#2023-10-2515:19Carsten Behringahhh. OK, I see.
So we do not infeere from buffer filename, but from nrepl-buffer name (whcih has teh same information .
But is is nil... buffer-file-name-2: nil#2023-10-2515:20Carsten Behring(buffer-name) is not nil, but current CIDER code uses (buffer-file-name) which is nil (at least in my case)#2023-10-2515:21Carsten Behringso for me the "parsing" breaks in the beginning alreday#2023-10-2515:23Karl XaverSee what I've written above about changing the let-binding in nrepl--ssh-tunnel-connect. I'd expect that to work, because
nrepl-project-dir is a local that should be available in that context and contain the tramp file-name of the project root.#2023-10-2515:23Carsten Behringand additional the regexp in current CIDER code looks for "/ssh..." which is the format of the "file-name" not name of the nrepl-buffer...#2023-10-2515:24Karl XaverYeah, forget the cond, it will be gone soon.#2023-10-2515:24Carsten BehringI use "current" cider, not your fork.#2023-10-2515:28Carsten BehringSo for me it "looks like" the function
(defun nrepl--ssh-tunnel-connect (host port)
is not only "not taking all cases", but it does not work at all in my setup , because it tries to operate on (buffer-file-name) to detect something , which is "nil" for me...#2023-10-2515:29Karl XaverAye, don't use the fork, it's overcomplicated and fixes only the cider-jack-in-clj path.
Current cider does this:
(remote-dir (cond
;; false in both scenarios (jack-in and connect), because current-buf is the nrepl buffer
((and (string-match tramp-file-regexp current-buf)
(string= host (match-string 2 current-buf))) current-buf)
;; true in both scenarios, because host is always passed as an arg [?]
(host (format "/ssh:%s:" host))
;; never hit
(t default-directory)))
.... with host being passed down as (file-remote-p default-directory 'host), like mentioned above.
EDIT: To clarify, this might just become:
(remote-dir nrepl-project-dir)
#2023-10-2515:37Karl Xaverhost tracing back to (file-remote-p default-directory 'host) is only true for jack-in and not taking sessions, bb and .dir-locals into account. On the connect route host is coming from cider--update-host-port , either
- passed down as :host in params from the top level function
- or the user will get be prompted#2023-10-2515:44Karl XaverI'm still figuring out the big picture and how everything is connected but am a bit short on time. I expect to have an answer on how to solve this properly by the end of the week. Feel free to join the dig :)#2023-10-2519:36Carsten Behringmy nil related problem is tracked here: https://github.com/clojure-emacs/cider/pull/3544
I will wait for a fix for this, in order to further check if in my precise scenario I can use cider-jack-in or not#2023-10-2521:08Carsten BehringI think that a "rather simple" solution for getting "jack-in" type of behaviour working in more scenarios is to add an alternative cider-start-server function to CIDER, which starts the server only, but does not try to connect afterwards.
(so we assume that the users runs cider-connect afterwards and knows host and port)
Somehow my conclusion from previous discussion is, that to deduct "host and port" to connect to from the "server start commands and observing buffer names and looking for .nrepl-port files will never be 100 % perfect.
A local ssh configuration or other "TCP" setups or other "networking tricks" cannot be discovered by CIDER,
This works with existing code, passing nil as the ON-PORT-CALLBACK:
(nrepl-start-server-process
(plist-get params :project-dir)
(plist-get params :jack-in-cmd)
nil)
#2023-10-2521:12vemvRoughly speaking, a PR that split a defun into two defuns would be welcome 🙂#2023-10-2619:55Carsten Behringhttps://github.com/clojure-emacs/cider/pull/3555#2023-10-2703:12john2xI'm having trouble getting my CIDER REPL session to work with AWS credentials (I'm using the Cognitect AWS API library). For context, I'm using AWS SSO and don't want to use API keys.
I found this old https://github.com/cognitect-labs/aws-api/issues/182 about AWS SSO not supported by the Cognitect library.
I'm now trying to use aws-vault which has a --server option which basically emulates the EC2 metadata http endpoint for fetching tokens locally. But this method only seems to works in the shell session where it was launched, so my CIDER REPL isn't able to use it.
Any suggestions?#2023-10-2703:13john2xHmm I could perhaps start the REPL in the shell session and jack into that from CIDER#2023-10-2703:21vemvYes, staring a cider/nrepl server from your terminal and cider-connect ing later would seem simplest#2023-10-2703:38john2xsweet that seems to work. Not ideal, kinda liked jack-in, but it'll do for now#2023-10-2703:39vemvPerhaps you'll get to appreciate it 😁
I favor it (maybe 80-20% vs jack in) as it survives emacs crashes#2023-10-2703:39john2xThat's a good point 🙂#2023-10-2709:11jumarExactly this (well, I do it more than 80%)
> I favor it (maybe 80-20% vs jack in) as it survives emacs crashes#2023-10-2709:41alexyakushev@U050S5ZET There is another way. The default credentials provider also looks at these system properties:
aws.accessKeyId
aws.secretKey
aws.sessionToken
You can set those within the REPL, taking the values from the respective env variables in a shell that is logged in:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_SESSION_TOKEN
I like this approach better because my AWS session is short-lived, and I hate to restart the REPL just to refresh the credentials. To facilitate this approach I wrote a couple of helper scripts and functions for myself, it's too specific to share but I'm sure you can do something similar if you want to go this way.#2023-10-2709:43alexyakushevOne caveat: credentials provider checks system properties after env variables, so you have to make sure that the REPL process is started where those envs are NOT set, otherwise the properties will be ignored.#2023-10-2718:26hifumi123Is it possible to remove the new syntax highlighting on protocols inside deftype forms? Not sure if this is a CIDER or clojure-mode issue#2023-10-2718:40vemvmind to share a screenshot?
we haven't changed that area#2023-10-2718:50vemvalso, please M-x describe-char to provide diagnostic info#2023-10-2719:29hifumi123#2023-10-2719:30hifumi123and IAtom in particular has the face of font-lock-variable-face#2023-10-2719:30vemvthat's cljs, right?#2023-10-2719:31hifumi123yes#2023-10-2719:32hifumi123This is CIDER 1.8.4-snapshot, no idea on the exact commit but I will look for it soon#2023-10-2719:35vemvwhat's your cider-font-lock-dynamically value?#2023-10-2719:37hifumi123(macro core deprecated)#2023-10-2719:49vemvI can repro. The logic responsible for this is (and do-var (not is-function) (not is-macro)) in cider-mode.el
That do-var is truthy should not happen given your custom cider-font-lock-dynamically . Do you set it in a funny way?
I set it via custom-set-variables in init.el before CIDER is started#2023-10-2719:50vemvI hint this b/c we have this logic
(let ((cider-font-lock-dynamically (if (eq cider-font-lock-dynamically t)
'(function var macro core deprecated)
cider-font-lock-dynamically)))
...)
so make sure it's not t at any point. Try debugging to confirm#2023-10-2719:51hifumi123The way I have CIDER (and clojure-mode) set up is with straight.el and use-package like so
(use-package cider
:commands cider-jack-in
:config
(setq cider-use-tooltips nil
cider-lein-parameters "with-profile +dev repl :headless :host localhost"))
#2023-10-2719:51hifumi123So I want to believe most of CIDER is in its default configuration#2023-10-2719:52vemvRight, '(macro core deprecated) is the default value#2023-10-2719:53hifumi123For what it’s worth, CIDER 1.7.0 release does not have this problem. Unfortunately, that does not help us bisect the bug much 😄#2023-10-2719:54hifumi123I am going to try looking at syntax highlighting by progressively updating versions of CIDER from 1.7.0 and let you know when I first see the change#2023-10-2719:55vemvOh please don't bother :)#2023-10-2719:57vemvWe'll refined cljs a lot. In fact I can confidently state that a few things worked by chance, others were plain broken
A side-effect is that if you were very used to this or that aspect, now it may be different#2023-10-2720:00vemvTruth be told the 'bug' seems a feature to me. Which doesn't mean we can't investigate it
At *nrepl-messages* level, you'll see a changed-namespaces property with IAtom in it
Its value is:
(dict doc "\"Marker protocol indicating an atom.\"")
It lacks fn "true" or macro "true" indicators. Which seems correct for a defprotocol#2023-10-2720:02hifumi123yeah, I was used to the protocols simply not having any highlighting, but now that only happens to Object (at least in the case of CLJS)#2023-10-2720:04vemvprobably because Object is not a var#2023-10-2720:04vemvI'll give it a 10-20m debugging session, else chances are I'll have to give up, it's a comparatively minor problem.
Let's see!#2023-10-2720:05hifumi123No need. I understand that supporting the case of Object is tricky since this is CLJS-specific. IIRC JVM Clojure has its own way to add custom methods to a type, but it’s probably using a different symbol#2023-10-2720:06vemvyeah I don't mind about Object, I was talking about OP#2023-10-2720:06hifumi123ah ok#2023-10-2720:24vemvDebugged ✅
and, as suspected, nothing was really broken... rather, things are starting to look as intended
This section is the responsible for the behavior you're seeing https://github.com/clojure-emacs/cider/blob/6baa3c3f315f1dc822d39a90dd5840386f97e954/cider-mode.el#L809-L811
The rationale, I guess, is that core means all of clj/s core, no exceptions. Users in principle don't get a say as to what belongs to core .
You are free to remove core from cider-font-lock-dynamically - it's a defcustom 🙂#2023-10-2720:36hifumi123Thanks!#2023-10-3004:51normanI was working on a clojure project that I wanted to use terminal colors on. The cider REPL currently uses ansi-color-apply from ansi-color.el to process output and interpret terminal color sequences. Unfortunately, that package only interprets the most basic color sequences and is very limiting. I did some digging and found xterm-color (https://github.com/atomontage/xterm-color) which supports 256 color and truecolor modes. (what any modern terminal supports) It was a pretty easy drop in replacement:
(add-hook 'cider-repl-preoutput-hook 'xterm-color-filter)
`
Is anyone else using this? Are there any drawbacks? Maybe cider should consider moving to this or adding it to the docs for people to consider using?
Here's a quick example of some colorful output in the cider repl#2023-10-3004:56norman;; based on awk script from -
(defn colors-demo
([]
(colors-demo 77 "/\\"))
([width input-text]
(doseq [[n c] (map-indexed vector (take width (cycle input-text)))
:let [r (int (- 255 (* 255 (/ n width))))
b (int (* 255 (/ n width)))
g (if (>= b 128)
(- 510 (* 2 b))
(* 2 b))]]
(print (format "\033[48;2;%d;%d;%dm" r g b))
(print (format "\033[38;2;%d;%d;%dm" (- 255 r) (- 255 g) (- 255 b)))
(print (format "%s\033[0m" c)))
(println)))#2023-10-3007:37vemvNice find!
> (what any modern terminal supports)
I recall having to add some magical incantation for truecolor to work in my iTerm. Which is to say, it doesn't seem safe to assume everyone has their terminal ready for an upgrade.
However it would indeed sounds like a good addition to https://docs.cider.mx/cider/additional_packages.html#generic-emacs-extensions , for instance#2023-10-3014:02normanI'm going to give it a couple days of testing in daily usage to see if it messes up anything. Assuming it's suitable, I'll at least submit a docs PR for it. Thanks#2023-11-0115:51normanIs there an easy way to keep the existing ansi color hook out of the list? If this hook processes the color sequences, ansi-color-apply would be redundant. I can't think of how this would be an issue, but it feels look double escaping/unescaping data.#2023-11-0116:09vemvSure,
(setq cider-repl-preoutput-hook (remove #'cider-repl--ansi-color-apply cider-repl-preoutput-hook))
would do it#2023-10-3012:48magraHi,
I have a project that sets (cider-clojure-cli-global-options . "-J--add-opens=java.base/java.nio=ALL-UNNAMED -J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED") in .dir-locals.el.
I get the warning: "cider-clojure-cli-global-options is obsolete (since 1.8.0); use ‘cider-clojure-cli-parameters’ instead"
But putting the options into cider-clojure-cli-parameters does not work. The only difference I see is the order in which these options get passed to clojure.
Maybe the -J options need to be before -M:aliases:cider/nrepl and can not be used after -M:aliases:cider/nrepl?#2023-10-3012:50vemvI'll look into it rn.
However, just a quick sanity check - would it not be more idiomatic to add those options within an alias in deps.edn, and activate said alias via CIDER? (which as a setting for the Clojure CLI aliases)#2023-10-3012:53magraYou are propably right ;-)#2023-10-3012:55vemvGive you agree it's nicer I'll investigate it later today. If you still feel there's a strong use case, feel free to create an issue - otherwise we'd enjoy leading users into simpler patterns#2023-10-3012:59magraThe only use case I can think of is when someone wanted to keep it out of deps.edn to give different developers the option to have different .dir-locals.el files. In my case your suggestion is superior.#2023-10-3014:25vemvYeah, normally having an alias named e.g. :nio-opens would not bother the rest of the team. Most often than not it's a nice way to document how-tos.#2023-10-3014:31magraMaybe extend the warning to "use 'cider-clojure-cli-parameters or alias in deps.edn instead'?#2023-10-3014:32vemvThe warning is a generic Emacs deprecation mechanism, so likely not#2023-10-3014:33magraok. thank you!#2023-10-3119:54vemvℹ️ We have released https://github.com/clojure-emacs/cider/releases/tag/v1.10.0, mostly for shipping https://github.com/clojure-emacs/cider-nrepl/blob/v0.42.1/CHANGELOG.md which includes an important performance fix related to var info and code completions.
There's also a small but tasty batch of bugfixes, refinements and a new function. https://github.com/clojure-emacs/cider/blob/v1.10.0/CHANGELOG.md#1100-2023-10-31
1.10.0 ("Sant Cugat") is named after the place where I live, because why not 🌳
Enjoy!#2023-10-3119:55vemv(wait up to a few hours for these to be MELPA-visible)#2023-11-0110:16danielnealYayyy!!!#2023-11-0102:48λWhy does this code output before the cider startup messages https://tildegit.org/michael/irc-bot/src/branch/master/src/irc_bot/core.clj
REPL output: https://paste.rs/LYt0U.clj#2023-11-0102:49λThis happens when I start the REPL in the project #2023-11-0105:55hifumi123I assume its due to
https://tildegit.org/michael/irc-bot/src/branch/master/src/irc_bot/core.clj#L52
evaluating before irc-bot.core finishes loading#2023-11-0117:23Luciano LaratelliHey all, I’m seeing an issue with the debugger. I followed the https://docs.cider.mx/cider/troubleshooting.html#debugging-freezes-lock-ups section in the docs and have a backtrace now, but unsure of how to proceed. Here’s the first few lines from the stack trace:
Debugger entered--Lisp error: (quit)
string-width(#(" => {:database-record/datestr \"10312023\", :databas..." 0 8234077 (face (cider-result-overlay-face default))))
(> (string-width display-string) (- (window-width) (current-column)))
(or (string-match "\n." display-string) (> (string-width display-string) (- (window-width) (current-column))))
Looks like related to displaying a big string (result of an xtdb query)?
The offending line in my code is
(let [dbrs (:database-record/body (biff/lookup db :database-record/datestr (ventas-datestr)))]
;; ... )
#2023-11-0117:27Luciano LaratelliThis is CIDER 1.8.0 in doom emacs. e9936f52432d25fdb2477dc4ec8fe95a7806e784 is the hash I have it pinned at.#2023-11-0117:52vemv> Looks like related to displaying a big string (result of an xtdb query)?
Indeed.
Feel free to create an issue. Please include the entire stacktrace#2023-11-0117:53vemvIf you have it at hand, try performing string-width on a huge string - if it's slow/blocking, that's our problem :)#2023-11-0314:00Johnwhat 'the' way to redirect prints and stuff to my repl from a thread? I expected (def something *out) evaluated from the REPL then binding *out from within the thread to work, but I guess the bound *out* that I save is meant for a single nrepl message#2023-11-0314:05vemvI sense that
(binding [*out* (io/writer System/out)]
(println 42))
should do it, however currently it stack overflows 😱
Otherwise I hadn't hard of an "api" that we had for this.
You can however use any logging framework - its output should go to the repl#2023-11-0314:10Johninfo on timbre doesn't go to the repl (as is at least). i jacked in remotely, and due to issues i dont have a way to read stdout/journal right now#2023-11-0314:10Johnwell, not from within the thread at least#2023-11-0314:11vemvremotely as in production?#2023-11-0314:14Johnyep#2023-11-0314:22vemv> info on timbre doesn't go to the repl
IIRC it does for basic cases on local connections.
Using the repl as a stdout viewer for remote connections is kind of a fringe use case IMO, there are simpler tools e.g tail / less over ssh.
We'd welcome a PR that made this easier (w/o losing simplicity), otherwise it seems an unlikely improvement#2023-11-0314:22vemvThe mentioned Stackoverflow shouldn't really happen, maybe by fixing it we'd enable more usage patterns#2023-11-0314:25Johnhm I'm not starting nrepl with the cider handler, maybe that's a cause#2023-11-0314:26Johnyeah exactly 😛 I can't tail right now due to a bug, which I can fix but I took the opportunity to figure out what if I couldn't#2023-11-0314:27vemv> hm I'm not starting nrepl with the cider handler, maybe that's a cause
likely, cider-nrepl has a special out middleware#2023-11-0314:28Johnstumbled on it's source and now here https://docs.cider.mx/cider-nrepl/nrepl-api/supplied_middleware.html
wrap-out
-
Yes
out-subscribe/out-unsubscribe
Echo the server's output stream to client sessions.
#2023-11-0314:42Johnyeah it was the missing handler 🙃#2023-11-0315:06vemvNice. A useful pattern here could be to selectively enable that middleware in production (otherwise you'll get more stuff required and altering your environment, nrepl functionality, etc)#2023-11-0410:15alexyakushevWith the latest CIDER behavior of not popping error buffer on compilations errors, when I use C-c C-k to compile the file and there is a compilation error, I don't get any notification unless I look into REPL buffer. The minibuffer just continues showing Loading my/file.clj... . Is this a known issue?#2023-11-0411:02daveliepmannhttps://github.com/clojure-emacs/cider/issues/3495#2023-11-0412:35vemvSurely I can prioritize it by now, given that C-c C-k is pretty important#2023-11-0513:08vemvShould be melpa-available around tomorrow https://github.com/clojure-emacs/cider/pull/3571#2023-11-0513:10pesterhazyHi! I'm a simple-minded user of CIDER: I use it only to connect to the running project and eval the current buffer
As a result, I'd like a command that will
• connect to the first currently running backend it finds,
• eval the current buffer, and
• do so without asking my any questions (asking me to choose the port from a list etc)
Essentially, I want to remove all friction from the (only) cider command I use.
I wrote a function that worked for a while, but it's now often not detecting the right nREPL server. So I'm struggling to get it to work. Any help appreciated#2023-11-0513:12pesterhazyHere's what I used, but it's not working
(defun cider-force-connect ()
(interactive)
(let ((repl (cider-current-repl nil nil)))
(when repl
(cider-quit repl))
(cider-connect (plist-put '(:host "localhost" :cljs-repl-type shadow)
:port (cl-second (cl-first (cider-locate-running-nrepl-ports)))))))
(defun cider-force-eval-buffer ()
(interactive)
(let ((repl (cider-current-repl nil nil)))
(when (not repl)
(cider-force-connect))
(cider-eval-buffer)))#2023-11-0513:14vemvFirst and second bullet point should be orthogonal. A connection is supposed to be reasonably long-lived
You most likely don't want to setup/teardown a bunch of stuff every time you want to eval a buffer
I do respect the intent to keep things minimalistic, but I'd heartily recommend to understand how this stuff is supposed to work, and make some minimal adaptations to your intended workflow, accordingly#2023-11-0513:15pesterhazyI think that's I tried to do. My cider-force-eval-buffer has
(when (not repl)
(cider-force-connect))#2023-11-0513:17pesterhazyI tried to understand how port detection is supposed to work, but it's fairly complex. It seems to be using "ps u | grep java | grep -v leiningen | grep nrepl.cmdline" as a heuristic, which often fails
I couldn't figure out how or when .nrepl-port is used (is this documented somewhere?)#2023-11-0513:17vemvBut it also resets the conn, for some reason
(when repl
(cider-quit repl))
but we can leave that aside, ok :)#2023-11-0513:18pesterhazyThese are two different functions. cider-force-connect is only called when no pre-existing repl exists#2023-11-0513:19vemvThe current internal incantation is:
(format "ps u | grep -E 'java|%s' | grep -E 'nrepl.cmdline|%s' | grep -v -E 'leiningen|grep'"
bb-indicator
bb-indicator)
So it understands a bunch of stuff: Lein, pure Java nrepls, bb servers
I'd recommend upgrading, so that you're peeking at the latest and greatest primitives#2023-11-0513:25pesterhazyGood idea. I'll try upgrading to latest CIDER#2023-11-0513:31pesterhazyHaving said that, the newer incantation also won't work, I think, because I'm not using nrepl.cmdline (I'm calling nrepl.server/start-server from the code).
Perhaps .nrepl-port is an easier technique for my use case? It has the advantage of being project-relative (I see the code is using clojure-project-dir, which sounds right)#2023-11-0513:32pesterhazyI'd like to figure out how .nrepl-port is written typcally – is that a lein thing, or does nrepl.cmdline do that?#2023-11-0513:33vemvYes, we have helpers that read .nrepl-port
There's defun nrepl-extract-port (dir) available
> I'd like to figure out how .nrepl-port is written typcally – is that a lein thing, or does nrepl.cmdline do that?
It's standard from https://github.com/nrepl/nrepl so most servers will just write it#2023-11-0513:33pesterhazyAlright, will try that next#2023-11-0514:00pesterhazyOK that worked. Here's what I came up with
(defun cider-force-connect ()
(interactive)
(let ((port (nth 1 (car (cider-locate-running-nrepl-ports (clojure-project-root-path))))))
(if port
(cider-nrepl-connect
(thread-first
nil
(cider--update-project-dir)
(plist-put :host "localhost")
(plist-put :port port)
(cider--check-existing-session)
(plist-put :repl-init-function nil)
(plist-put :session-name nil)
(plist-put :repl-type 'clj)))
(cider-connect))))#2023-11-0614:16Edno idea if you're interested, but there's a (cider-connected-p) that should tell you if cider is connected or not - which might be better than port hunting? Or did that not work?#2023-11-0614:19pesterhazy@U0P0TMEFJ I'm port-hunting to find the right process to connect to, not to see if CIDER is connected#2023-11-0614:39Edfacepalm ... so you are - I missed that - apologies#2023-11-0617:19Charles Comstock@vemv What do you think about enabling cljr-slash-uses-suggest-libspec for clj-refactor by default now? I know https://github.com/clojure-emacs/clj-refactor.el/issues/530 hasn't been fixed, but the primary use case of detecting the project :as aliases and suggesting them works much better with suggest-libspec, so it would be nice to transition folks over to that method. I know there was some discussion about moving cljr-slash into cider, but it still seems like we can move forward in cljr before transitioning it to cider.#2023-11-0617:22vemvLet me check but likely yes, I've been happy with the refactored feature over clj/s :)#2023-11-0617:23Charles ComstockAwesome, glad to hear it. Let me know if we have more steps there.#2023-11-0618:54phronmophobicI'm running into an issue where when I try to hit tab tab for completions, my CPU spikes for a while until I get a OOM exception (See attached stacktrace). I'd be happy to follow up with a github issue or more info. More info in 🧵 .#2023-11-0618:56phronmophobicI'm running emacs via ssh on a pretty dinky server 1G RAM and 1VCPU.#2023-11-0618:56phronmophobicIt's possible that I also have some large jars on the classpath from including binaries resources.#2023-11-0618:58phronmophobicversions:
;; CIDER 1.10.0 (Sant Cugat), nREPL 1.0.0
;; Clojure 1.11.1, Java 18.0.2-ea
Ubuntu linux
#2023-11-0618:59phronmophobicI've had this issue for a while, but I thought it was because I was running old versions. However, I just ran into issue again with the same project on a fresh setup.#2023-11-0619:01alexyakushevYikes, certainly shouldn't happen. Are all of that dependencies public, or is there some private stuff?#2023-11-0619:01phronmophobicMost of it's public#2023-11-0619:02alexyakushevIf you just paste the public part of the dependencies, I'll take a look what's going on#2023-11-0619:02phronmophobichttps://github.com/phronmophobic/slackcommands#2023-11-0619:02phronmophobiceverything there should be public except com.phronemophobic.discord {:local/root "../discord"}#2023-11-0619:03alexyakushevCool, I'm in the middle of refactoring Compliment, so this is very apposite#2023-11-0619:03phronmophobicActually, let me try and reproduce without that dep.#2023-11-0619:04vemvTruth be told, a large category of Clojure programs are subject to fail with just 1GB RAM
knowing Alex, I'd bet that this will be fixed, but in general limited official support can be expected from CIDER under constrained resources#2023-11-0619:05phronmophobicEverything else works fine. I also added 4G of swap which isn't great for performance, but it doesn't need to do anything quickly.#2023-11-0619:05vemv...A good example being clj-kondo, if you want to analyze the whole classpath it can take 4GB with no possible workaround. I'm fine with that.#2023-11-0619:06alexyakushevOooh, I overlooked the 1Gb part. Still, this should certainly be enough for Compliment, I bet there is a bug somewhere and this is not a natural limit#2023-11-0619:08phronmophobicYea, completely turning it off is an acceptable workaround for me.#2023-11-0619:08phronmophobicIt's just my muscle memory hoses the server 😛.#2023-11-0619:08phronmophobicAnyway, just thought I'd make a report since it seems reproducable.#2023-11-0619:09phronmophobicOk, so I was able to reproduce without the private dependency.#2023-11-0619:13alexyakushevAny particular prefix that you try to trigger the completion with?#2023-11-0619:14phronmophobicthere's an example in the error log, but it's usually when I'm in slackcommands.util and trying to call save-large-png#2023-11-0619:14phronmophobicso something like save-l#2023-11-0619:15alexyakushevHm, could not reproduce right away with my default heap sizing, let me try downsize it#2023-11-0619:18alexyakushevHm, works fine on my machine with Xmx1g. Could you check if it still reproduces if you e.g. clear the target directory? I see it isnt' listed in paths so it shouldn't matter but who knows 🤷#2023-11-0619:19phronmophobicthe target directory?#2023-11-0619:19phronmophobicI don't think there is one.#2023-11-0619:19alexyakushevAlright#2023-11-0619:19alexyakushevThere is indeed a good amount of classes on the classpath (100k+) but it goes through without a hitch on my laptop#2023-11-0619:22alexyakushevCould you please try this instead of hitting Tab?
(require '[cider.nrepl.inlined.deps.compliment.v0v4v4.compliment.utils :as cutils])
(count (cutils/namespaces&files-on-classpath))
#2023-11-0619:25phronmophobic1168#2023-11-0619:25alexyakushevBut it finished, that's interesting#2023-11-0619:25alexyakushevWhat if you trigger completion now?#2023-11-0619:27phronmophobicok, now it's working#2023-11-0619:28phronmophobiclet me double check it#2023-11-0619:28vemvI wonder if it's a classic concat / mem problem#2023-11-0619:30alexyakushevI thought of concat as well. Gonna remove each and every of those for sure#2023-11-0619:30alexyakushevHowever, concat was more about stackoverflow I think#2023-11-0619:31phronmophobicoh, ok. just calling that code doesn't fix it. I think I just realized the problem.#2023-11-0619:32phronmophobicWhen I want a completion, I mash a combination of tab and ESC+TAB several times. 😆#2023-11-0619:32phronmophobicWhich I think overloads it.#2023-11-0619:34phronmophobicoh weird. at some point it caches the response and it works fine again?#2023-11-0619:35alexyakushevIt does cache the list of all files/classes/namespaces#2023-11-0619:36alexyakushevStill weird that you run into this because it flies almost instantly. But that's on a decent machine#2023-11-0619:36alexyakushevIn a setup like yours, I can imagine it being slower so that you can squeeze in multiple invocations of that stuff#2023-11-0619:37alexyakushevGuess I gonna protect those fat one-time calls with a mutex just in case.#2023-11-0619:38phronmophobicI was able to reproduce the OOM with the following steps:
• open slackcommands.util
• cider-jack-in
• C-c M-n M-n (cider-repl-set-ns NS)
• C-c C-k cider-load-buffer
• switch to cider terminal
• type save-
• tap ESC+TAB 3 times, then immediately TAB 3 times#2023-11-0619:39phronmophobicmashing the different forms of tab is just muscle memory :man-facepalming:#2023-11-0619:40alexyakushevWould you try this for me? 🙂
(require '[cider.nrepl.inlined.deps.compliment.v0v4v4.compliment.utils :as cutils])
(dotimes [_ 100]
(.start (Thread. #(println (count (cutils/classes-on-classpath))))))
#2023-11-0619:41phronmophobicI didn't include it in the error log, but I also end up with several messages in the cider log:
ERROR: Unhandled REPL handler exception processing message {:op complete, :ns slackcommands.util, :prefix save-la, :context :same, :enhanced-cljs-completion? t, :session 3f3f37d6-2df9-4b11-868b-98810d8eda29, :id 85}#2023-11-0619:44alexyakushevGreat, it hung up on me as well, finally!#2023-11-0619:44phronmophobicOk, running the above snippet. The CPU is pegged and OOM exceptions are being printed sporadically.#2023-11-0619:44alexyakushevNow I have something to work with. Thanks for the help!#2023-11-0619:44phronmophobicThank you!#2023-11-0619:45phronmophobicThanks for the quick response! Glad my impatient mashing is good for something.#2023-11-0715:52AkizHi, I just installed GccEmacs and I reinstalled all packages.
Anytime I get an CLJ error during evaluation, red box with an error (probably) blink for a second inside the buffer and then I get an error (if debug is enabled)...
And It also takes a long time to get this red box / error if I eval whole buffer, it can take even 20s.
I didn’t have this issues yesterday 🙂 .
1. I do not remember getting red box with an exception inside a buffer, so is this something new with a Cider?
2. Do you know how can I get rid of this error?#2023-11-0715:52AkizDebugger entered--Lisp error: (args-out-of-range #(" \n => at clojure.lang.Compiler.analyze(Compiler.ja..." 0 1 (cursor 0) 2 903 (face (cider-error-overlay-face default))) 0 981)
cider--make-result-overlay("at clojure.lang.Compiler.analyze(Compiler.java:699..." :where 4310 :duration command :prepend-face cider-error-overlay-face)
cider--display-interactive-eval-result("at clojure.lang.Compiler.analyze(Compiler.java:699..." error 4310 cider-error-overlay-face)
cider--maybe-display-error-as-overlay("compile-syntax-check" "Syntax error compiling at (/Users/akiz/Projects/BI..." 4310)
#f(compiled-function (buffer err) #<bytecode 0x87b2cc905f1b98b>)(#<buffer product_persistence_test.clj> "Syntax error compiling at (/Users/akiz/Projects/BI...")
#f(compiled-function (response) #<bytecode 0x63054d184a9e8af>)((dict "err" "Syntax error compiling at (/Users/akiz/Projects/BI..." "id" "3742" "session" "12543fd1-a35d-4551-a261-0ba6260324c6"))
nrepl--dispatch-response((dict "err" "Syntax error compiling at (/Users/akiz/Projects/BI..." "id" "3742" "session" "12543fd1-a35d-4551-a261-0ba6260324c6"))
nrepl-client-filter(#<process nrepl-connection> "ompiler.java:6933)\n\11at clojure.lang.Compiler.eval(...")
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:49729(clj)*>)
cider--error-phase-of-last-exception(#<buffer product_persistence_test.clj>)
#f(compiled-function (buffer err) #<bytecode 0x87b2cc905f1b98b>)(#<buffer product_persistence_test.clj> "Error in thread Thread[nREPL-session-12543fd1-a35d...")
#f(compiled-function (response) #<bytecode 0x63054d184a9e8af>)((dict "err" "Error in thread Thread[nREPL-session-12543fd1-a35d..." "id" "3742" "session" "12543fd1-a35d-4551-a261-0ba6260324c6"))
nrepl--dispatch-response((dict "err" "Error in thread Thread[nREPL-session-12543fd1-a35d..." "id" "3742" "session" "12543fd1-a35d-4551-a261-0ba6260324c6"))
nrepl-client-filter(#<process nrepl-connection> "d3:err82:Error in thread Thread[nREPL-session-1254...")#2023-11-0716:08vemvThe 20s thing should have been fixed with cider-nrepl 0.43.0. Could you check which are you currently using?
The elisp error is unfortunate, we should get it fixed
Which exact command were you using for evaluation?#2023-11-0716:12Akiz1. I use 0.43.0
2. I have tried cider-eval-last-sexp and cider-load-buffer
And what about that exception showing in red box inside a file’s buffer instead of special cider buffer I got before?#2023-11-0716:13AkizWas that 20s error related to GccEmacs only?#2023-11-0716:20vemverror handlng slowness was happening cider-nrepl to all consumers were subject to it#2023-11-0716:21vemv> And what about that exception showing in red box inside a file’s buffer instead of special cider buffer I got before?
That can be toggled. Anyway, before that - do you have the chance to share the buffer that caused this issue? That would be greatly helpful#2023-11-0716:25AkizIt is any buffer, for example
(ns backend-api.d)
(d d)
When i evaluate this and i disable toggle-debug-on-error
I see no redbox now and after 30 secs I get a message
nrepl-send-sync-request: Sync nREPL request timed out (op eval code (ns backend-api.d)
) after 30 secs
#2023-11-0716:27vemvAlright, that end state is also weird, but is a separate problem.
Were those the original buffer contents? If possible I need an exact buffer, given the args-out-of-range error#2023-11-0716:27AkizAnd now I don’t… hmph#2023-11-0716:31AkizUnfortunately I cannot share the first buffer.
The point is that either all buffers have a timeout problem (even in the first case I got a timeout if I disabled debug-on-error) or it works but it still seems slower than is usual.#2023-11-0716:31AkizI will try to reproduce it with some public code tommorow.#2023-11-0716:32vemvI'll work on the slowness. Probably I killed most of it recently, but I can think of additional ways in which this slowness can show up#2023-11-0716:33AkizBut i never had the slowness..
So it must be - new version of cider or GccEmacs probably.#2023-11-0716:34Akiz(It is code base with I work daily for 1,5 year)#2023-11-0716:34vemvYeah we've been changing stuff, of course we don't make stuff slower on purpose, but it can happen 😬
It's all at the cider-nrepl, Orchard and Haystack levels clojure-spin#2023-11-0716:43vemvI wonder if the args-out-of-range error happened simply because you modified the buffer during the 20s (which is a totally natural thing to do - we aren't supposed to be that slow).
If you are able to restart Emacs and not perceive the args-out-of-range in particular, that would confirm it.
I'll work on the slowness in the meantime :)#2023-11-0718:33vemvI've accelerated a release https://clojurians.slack.com/archives/C0617A8PQ/p1699381762708279 - the issue should be more rare now.
I'll keep refining things!#2023-11-0719:19Akiz1. i just tried normal (no GccEmacs) Emacs and the problem is still there, it seems even worse (I am stil on 0.43.0).
2. I can’t reproduce args-out-of-range error but your explanation sounds reasonable.
3. The first error in any buffer always take a long time and basically it
a. doesn’t appear anywhere but Messages buffer
b. or ends with timeout
Debugger entered--Lisp error: (error "Sync nREPL request timed out (op analyze-last-stac...")
signal(error ("Sync nREPL request timed out (op analyze-last-stac..."))
error("Sync nREPL request timed out %s after %s secs" ("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) 30)
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:49254(clj)*>)
cider--error-phase-of-last-exception(#<buffer test.clj>)
#f(compiled-function (buffer err) #<bytecode -0x129ce78186562875>)(#<buffer test.clj> "Syntax error compiling at (src/clj/backend_api/lin...")
#f(compiled-function (response) #<bytecode 0x253168fadcbf2f0>)((dict "err" "Syntax error compiling at (src/clj/backend_api/lin..." "id" "12" "session" "d20cbf25-8170-40fe-a8ed-26c230d03feb"))
nrepl--dispatch-response((dict "err" "Syntax error compiling at (src/clj/backend_api/lin..." "id" "12" "session" "d20cbf25-8170-40fe-a8ed-26c230d03feb"))
nrepl-client-filter(#<process nrepl-connection> "d3:err119:Syntax error compiling at (src/clj/backe...")
4. When I re-evaluate, it is usally faster (from 2s - 20s) and it displays error in buffer and in repl#2023-11-0719:22AkizWith 0.43.1 - no improvement (or maybe a small).
It must be something that has been changes in last 30 days (rough guess :-)).#2023-11-0719:28AkizHow can i disable showing error in buffer temp overlay?
I guess this is a new functionality so i just want to see if disabling it makes any difference.#2023-11-0719:32vemvYeah I fixed something but the fix can be more comprehensive, will happen this week.
You can disable the feature by setting :
(setq cider-clojure-compilation-error-phases nil)
which is documented https://docs.cider.mx/cider/usage/dealing_with_errors.html
The idea is that by default you either see compilation errors as red overlays, or runtime errors under *cider-error*#2023-11-0719:33vemvIf you wish to give it one last try as-is, make sure to use a newer JDK (16, 17 or greater)#2023-11-0719:45Akizopenjdk 17.0.8.1 2023-08-24
OpenJDK Runtime Environment Homebrew (build 17.0.8.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.8.1+0, mixed mode, sharing)#2023-11-0719:54Akiz@U45T93RA6 Ha, when i set
(setq cider-clojure-compilation-error-phases nil)
then it is really quick and I get error both in cider-error and in temp overlay,#2023-11-0719:59AkizWhich is great.
Anyway, the configuration doesn’t disable the overlay..#2023-11-0720:42vemvThanks, I'll have a look at that too! We don't mean to inform of the same given error twice.#2023-11-0721:59AkizThanks @U45T93RA6. I just tried more projects and it looks to be a consistent problem.
I recorded a video: https://www.loom.com/share/4faa2779e503421eacb892b38bdf3a13
1st part with cider-clojure-compilation-error-phases set to nil.
And the second one (>00:30) with cider-clojure-compilation-error-phases set to true, it gets blocked for ~30 secs and it ends with an error in a REPL.
I am attaching the file I have used for this..#2023-11-0806:27vemvThanks much!
Keep in mind, one of the first things we now do when starting up cider-nrepl is warming up some caches https://github.com/clojure-emacs/cider-nrepl/blob/5b62ae3d478fd17d1c455758841c7e65475f59af/src/cider/nrepl.clj#L70-L72
This can take 20-60 seconds.
So, while your demo is on point, I'd also expect that if you restart the repl and wait about 1 minute, the performance will feel much different. I believe most real-world usages will be like that.
Note that all this slowness is all "one-time" - once cached, we have these computations there forever.#2023-11-0806:34vemv...the wrong number of arguments shouldn't be there though.
If the nrepl request timed out, it may have to do with that. Please check if it also disappears if waiting ~1m at startup before evaluating errors.
Truth be told, even as of cider-nrepl 0.43.0 I was experiencing 12 seconds at most https://github.com/clojure-emacs/cider-nrepl/issues/828#issuecomment-1789628829 . I'm using a 2019 intel MBP. This code isn't parallel though (it cannot) so the core count isn't much relevant.
There could be other sources of hardware slowness - LMK if you think what it could be!#2023-11-0807:38AkizThanks, i will try some things today.
I am using M1 Pro - and yeah, I never experienced these problems.
Do you know how can I downgrade Cider with Straight.el (or maybe just NREPL)? Do you have some example maybe? I tried to pin specific git commit hash but for some unknown reason it always downloaded the latest version of Cider. I would like to figure out when problems started.
Is cache related to cider-clojure-compilation-error-phases? When this is disabled, everything is fast.#2023-11-0807:47vemvcider-clojure-compilation-error-phases is meant to be customized (it's a defcustom) so I'd recommend that path instead, so that you can keep getting bugfixes, performance improvements, etc
I also understand that you had a bad experience yesterday, but you can consider that after 1m or so (depending on the machine / setup; it was 12s in mine) you won't perceive a problem at all. All caching is performed for you at startup, in the background.
So it would seem sensible to decouple that initial surprise from most real-world usages.
Which doesn't mean we'll stop optimizing this area - we totally will 🙂#2023-11-0807:51vemvIn specific terms, our library named Haystack could request less info to our Orchard lib. The info that is culrpit for the slowness is not even used for these errors.
It's a refactoring that could take just a few days to get shipped.
I do appreciate highlighting the importance of these issues.#2023-11-0808:16AkizI waited for 3 minutes and really - the error appeared in like 5 seconds.
But when I evaluated the same buffer for the second time then I got timeout on 30s again.#2023-11-0808:18AkizI would use is cider-clojure-compilation-error-phases but right now it sabotages my daily work so I can’t 🙂#2023-11-0808:22vemv> But when I evaluated the same buffer for the second time then I got timeout on 30s again. (edited)
Weird. I wonder if it's a different/compound issue. Sorry you're having this experience.#2023-11-0808:23vemv> I would use is cider-clojure-compilation-error-phases but right now it sabotages my daily work so I can’t
I didn't understand this. Wouldn't setting it in your .emacs.d avoid all issues for now?#2023-11-0808:37AkizThank you. It is not a big issue right now because - yes, when it is disabled I got no issues . I try to summarize my experience to avoid confusion 🙂.
Good scenario:
1. I disabled cider-clojure-compilation-error-phases
2. I evaluated the failing buffer i shared
3. I get an error Unable to resolve symbol: defz in this context in a temp overlay, in echo-area and in cider-error buffer.
4. When I evaluate the buffer for the first time (even after waiting >1 minute before that), it takes some time to show cider-error buffer (while the overlay and echo-area errors are almost instant).
5. When I evaluate the buffer for the second time, the cider-error buffer is almost instant.
Bad scenario:
1. I enable cider-clojure-compilation-error-phases
2. I evaluate the buffer and I get:
a. timeout
b. OR error in echo area. Sometimes I see the overlay as well but it is much less consistent than when cider-clojure-compilation-error-phases is disabled.
So currently, I see no advantage of having that enabled. But I still need to take a further look into what this configuration really does 🙂 .#2023-11-0808:40vemvYes, of course, when something is buggy it's of no use 😄
Happy that you have something workable, from what I see.
I'll work on the meantime on optimizing this stuff once and for all. As mentioned in https://clojurians.slack.com/archives/C0617A8PQ/p1699429900779769?thread_ts=1699372329.796729&cid=C0617A8PQ , fortunately I have a plan by now.
Hope to have a bugfix release around Monday.#2023-11-0817:25AkizGreat. Btw. I just noticed another bug.. It should be specs.alpha if i am right
It was also hard to locate the error as i didnt get the cider-error buffer I am used to tbh..#2023-11-0817:29AkizOh, I get the cider-error buffer but it took about 2 minutes 😯.
I will probably need to downgrade something or move to another IDE for now.#2023-11-0817:54vemvAt this point you can permanently set cider-enrich-classpath nil in your .emacs.d
It's a coarse-grained measure, but it will avoid all the slow paths
(NOTE: it's not enrich-classpath itself that is slow, but other components enabled by it that are. In particular, we use official JDK facilities for parsing .java files which are surprisingly slow)#2023-11-0818:43AkizSorry, my mistake, I was sure it is disabled but i left it enabled after some tests 🥵.
I was able to work for some hours with it being enabled, nice.
And thanks again…#2023-11-0818:45vemvNo issue! Hope to be able to leave things nicer in multiple fronts soon.#2023-11-1122:26vemvAs promised 🙌 https://clojurians.slack.com/archives/C0617A8PQ/p1699741115891019#2023-11-1306:58Akiz@U45T93RA6 Thanks, I installed it yesterday and I tested it on small projects - looks much better. But today I’ll work with the behemoth, so we’ll see :-).#2023-11-1309:15AkizStill problematic but faster 🙂, thank you.
The most common error after evaluating buffer with (defz) is
error in process filter: Wrong type argument: listp, t
then red error blinks for second, so basically there is no error report at all and sometimes it is followed by something like
error in process filter: Sync nREPL request timed out (op analyze-last-stacktrace nrepl.middleware.print/stream? 1 nrepl.middleware.print/print cider.nrepl.pprint/porint nrepl.middleware.print/auota 1048576 nrepl.middleware.print/buffer-size 4996 ….) after 30 secs#2023-11-1309:16vemvAre you sure that you're running the latest cider-nrepl there? Maybe it's different for your largest project#2023-11-1309:16AkizStartup: bash /Users/akiz/.emacs.akiz/straight/build/cider/lein.sh /opt/homebrew/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \“1.0.0\“\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \“3.9.0\“\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \“3.9.0\“\] -- update-in :plugins conj \[cider/cider-nrepl\ \“0.43.3\“\] -- update-in :plugins conj \[mx.cider/lein-enrich-classpath\ \“1.18.4\“\] -- update-in :middleware conj cider.enrich-classpath.plugin-v2/middleware -- repl :headless :host localhost#2023-11-1309:18vemvAs for error in process filter: Wrong type argument: listp, t, I'd suggest performing M-x toggle-debug-on-error right after starting Emacs, before doing anything else, then connecting to cider and hopefully you'll get a stacktrace#2023-11-1309:22vemvAs for the second issue, I'm at a loss, however we have another improvement in the radar (https://github.com/clojure-emacs/orchard/issues/211) that would speed up everything - removing the need for any workarounds or bug hunting.
As we observed last week, disabling enrich-classpath in a given project is a reasonable measure (although coarse-grained).#2023-11-1309:55Akiz@U45T93RA6 This is the stacktrace for the first issue..
By the way, what are the benefits of the new changes (enrich-classpath = true)? I wonder if it is worth such a slow down (compared to the older versions of the cider / nrepl).
Debugger entered--Lisp error: (wrong-type-argument listp t)
cider--handle-stacktrace-response((dict "id" "4896" "session" "775c92ac-42a1-45ba-b66b-b1..." "status" ("done")) ((dict "class" "java.lang.RuntimeException" "compile-like" "false" "id" "4896" "message" "Unable to resolve symbol: ..." "phase" nil "session" "775c92ac-42a1-45ba-b66b-b1..." "stacktrace" (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...)) (dict "class" "clojure.lang.Compiler$Comp..." "column" 1 "compile-like" "false" "data" "#:clojure.error{:phase :co..." "file" "/Users/akiz/Projects/BIM/b..." "file-url" "file:/Users/akiz/Projects/..." "id" "4896" "line" 234 "location" (dict "clojure.error/column" 1 "clojure.error/line" 234 "clojure.error/phase" "compile-syntax-check" "clojure.error/source" "/Users/akiz/Projects/BIM/b...") "message" "Syntax error compiling at ..." "path" "src/clj/backend_api/linya/..." "phase" "compile-syntax-check" "session" ...)) "compile-syntax-check")
#f(compiled-function (response) #<bytecode 0x166c9102bbfdcec2>)((dict "id" "4896" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d" "status" ("done")))
nrepl--dispatch-response((dict "id" "4896" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d" "status" ("done")))
nrepl-client-filter(#<process nrepl-connection> "r:file:/Users/akiz/.m2/repository/nrepl/nrepl/1.0....")
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:60875(clj)*>)
cider--error-phase-of-last-exception(#<buffer product_group_persistence.clj>)
#f(compiled-function (buffer err) #<bytecode 0xa914e4e3c0d9d0b>)(#<buffer product_group_persistence.clj> ".session$session_exec$main_loop__26354$fn__26358.i...")
#f(compiled-function (response) #<bytecode 0x630342b53c192af>)((dict "err" ".session$session_exec$main_loop__26354$fn__26358.i..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl--dispatch-response((dict "err" ".session$session_exec$main_loop__26354$fn__26358.i..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl-client-filter(#<process nrepl-connection> "1.0.0/nrepl-1.0.0.jar!/nrepl/middleware/session.cl...")
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:60875(clj)*>)
cider--error-phase-of-last-exception(#<buffer product_group_persistence.clj>)
#f(compiled-function (buffer err) #<bytecode 0xa914e4e3c0d9d0b>)(#<buffer product_group_persistence.clj> "ng.AFn.applyTo(AFn.java:144)\n\11at clojure.core$appl...")
#f(compiled-function (response) #<bytecode 0x630342b53c192af>)((dict "err" "ng.AFn.applyTo(AFn.java:144)\n\11at clojure.core$appl..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl--dispatch-response((dict "err" "ng.AFn.applyTo(AFn.java:144)\n\11at clojure.core$appl..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl-client-filter(#<process nrepl-connection> "d18:changed-namespacesde2:id4:48919:repl-type3:clj...")
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:60875(clj)*>)
cider--error-phase-of-last-exception(#<buffer product_group_persistence.clj>)
#f(compiled-function (buffer err) #<bytecode 0xa914e4e3c0d9d0b>)(#<buffer product_group_persistence.clj> "Syntax error compiling at (/Users/akiz/Projects/BI...")
#f(compiled-function (response) #<bytecode 0x630342b53c192af>)((dict "err" "Syntax error compiling at (/Users/akiz/Projects/BI..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl--dispatch-response((dict "err" "Syntax error compiling at (/Users/akiz/Projects/BI..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl-client-filter(#<process nrepl-connection> "d3:err761:.session$session_exec$main_loop__26354$f...")
nrepl-send-sync-request(("op" "analyze-last-stacktrace" "nrepl.middleware.print/stream?" "1" "nrepl.middleware.print/print" "cider.nrepl.pprint/pprint" "nrepl.middleware.print/quota" 1048576 "nrepl.middleware.print/buffer-size" 4096 "nrepl.middleware.print/options" (dict "right-margin" 70)) #<buffer *cider-repl BIM/backend-api:localhost:60875(clj)*>)
cider--error-phase-of-last-exception(#<buffer product_group_persistence.clj>)
#f(compiled-function (buffer err) #<bytecode 0xa914e4e3c0d9d0b>)(#<buffer product_group_persistence.clj> "Error in thread Thread[nREPL-session-775c92ac-42a1...")
#f(compiled-function (response) #<bytecode 0x630342b53c192af>)((dict "err" "Error in thread Thread[nREPL-session-775c92ac-42a1..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl--dispatch-response((dict "err" "Error in thread Thread[nREPL-session-775c92ac-42a1..." "id" "4891" "session" "775c92ac-42a1-45ba-b66b-b1f43316248d"))
nrepl-client-filter(#<process nrepl-connection> "d3:err82:Error in thread Thread[nREPL-session-775c...")#2023-11-1310:01vemvFor most people it's not nearly as slow to what you've experienced, so that came as a surprise. I don't know much about your environment - maybe something makes it peculiar.
Note that it's disabled by default - later in the year I'll have gained full confidence. https://github.com/clojure-emacs/orchard/issues/211 looks like the last step.
The benefits are described in https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath
(as hinted the problem is not in Enrich itself; but in the Java parser that we had around for years and turned out to have this surprisingly bad performance)#2023-11-1310:02vemvAnyway, thanks for the stacktrace and the overall input, it helps me prioritize things!#2023-11-1310:07AkizAh, I thought everyone suffered from that problem. So I wondered if the benefits were worth it and if I was missing out on something big. I see. Thanks.
I’ve got Chemacs, so I’ll try a second config this week with just cider and maybe I’ll find the root of it.#2023-11-1310:13AkizAnd sorry, I am mixing things up - enrich-classpath is enabled on my side and I have no issues.
The issues are there only when (setq cider-clojure-compilation-error-phases t) 🙂#2023-11-1310:13vemv> I’ve got Chemacs, so I’ll try a second config this week with just cider and maybe I’ll find the root of it.
Probably all the slowness is JVM-side so it may have to do with specific project dependecies, JVM opts, Docker stuff, anything like that#2023-11-1310:14vemvThe stacktrace though may be an easy fix :) please create an issue for it so that you'll get notified#2023-11-1316:57AkizHere it is 🙂
https://github.com/clojure-emacs/cider/issues/3582#2023-11-1609:36Akiz@U45T93RA6 Hi, just to add some info. Yesterday, I have updated my JDK from OpenJDK 17 -> to Temurin 21.
I have also updated FlowStorm to latest version + its Clojure compiler.
As you said - it is not fastest and there is a room for improvement but it seems to be in much better state than a week ago.
Hard to say what exactly caused extremely long hang-ups I got.#2023-11-1609:38vemvThanks!#2023-11-0718:29vemvℹ️ we've released cider-nrepl 0.43.1 / https://github.com/clojure-emacs/cider/releases/tag/v1.11.0 with important performance improvements, as well as improved error reporting on cider-load-buffer, and two tasty Inspector improvements, as shown here:#2023-11-0718:30vemvWhat's shown here:
• You can now inspect an exception by clicking it / hitting i or p
• The inspector shows pretty Java documentation at the bottom of a given class/method/field.
◦ available if you have enabled enrich-classpath.
If you're on MELPA, wait a couple hours before updating cider Enjoy!#2023-11-0812:37Johnis there a snippet integrating *remote-javadocs* and http://javadoc.io (or CIDER/etc)#2023-11-0812:39Johnthe URL's there take a group-id/artifact-id/version-or-latest/ prefix#2023-11-0812:43Johnmaybe I should be trying to get maven to download sources and docs#2023-11-0812:51vemvAre you familiar with the concept of enrich-classpath? It downloads sources
CIDER then parses them and does a number of useful things with them
See yesterday's video in #C0617A8PQ for instance#2023-11-0812:52vemvEnrich also downloads javadocs. Personally I've never used them in any way - given the mentioned parsing, I have everything I need without leaving emacs#2023-11-0813:06Johni've seen it in the docs a bunch of times but it just doesn't happen or doesn't get used think_beret and it is in the clj cmdline when jacking in#2023-11-0813:09Johni see the cache file and it has the content I'd expect#2023-11-0813:13Johnmaybe my expectation that C-d C-d j would leverage this is wrong#2023-11-0813:22vemvDo you see it available in misc places?
Code completion (if you're using CIDER for that), *cider-doc* , the inspector as shown yesterday
I know that Javadocs are there / get passed at nREPL level, but I never got to try them in cider.
Maybe we don't know how to open a Javadoc that's inside a .jar :thinking_face:#2023-11-0813:23Johnohhhh I now recall a bit better, as once upon a time I did investigate it a bit and it had to do with the docs being inside the jar#2023-11-0813:24Johnin *cider-doc* I get Not documented.#2023-11-0813:25Johnit does give me the type and what it extends, which is evidence it's not lost looking for something else#2023-11-0813:52vemvThis is what I see when using M-x cider-doc over Thread#2023-11-0813:53vemvand this is the completions integration (parsing the java doc comments from .java sources)#2023-11-0813:56vemvM-x cider-javadoc probably doesn't know how to dig into .jar javadocs. Feel free to follow https://github.com/clojure-emacs/cider/issues/3575#2023-11-0813:58Johnemacs (well, mine with 123141 doom modules at least) knows to open zips (and therefore jars) transparently, so if cider just lists and finds the file, some find-file magic should work#2023-11-0813:58Johnbut then the browser. yeah right#2023-11-0816:12mikerodIs there a way for cider to close both the clj & cljs buffers upon quit? I’m on the latest prior to yesterday’s release. However, for a long time I’ve noticed that doing cider-quit doesn’t remove both buffers. It only removes the one you are actively looking at and the nrepl server. So I always have to navigate to both buffers manually and quit each every time. Perhaps I’m missing something of how this works though. I use figwheel-main target as well if that matters.#2023-11-0816:19vemvSounds like GH issue material :)
Will be happy to attend it#2023-11-0816:20mikerodOk. I can write one up in a bit that is more structured then.#2023-11-0816:32magnarsC-c C-s q will do sesman-quit IIRC, and will quit both repls. #2023-11-0817:43mikerodInteresting. Would you still need cider-quit (or kill buffer) to remove the nrepl server in that case though?#2023-11-0817:43mikerodSo perhaps it’d be both cider-quit and the sesman-quit. I can mess around with this of course.#2023-11-0821:33magnarsThere is no need to cider-quit after sesman-quit . It will shut it properly down.#2023-11-0921:37Tommy JollyboatHi, I need to pass -A:dev:x to clj, so I've set cider-clojure-clj-aliases to ":dev:x", but cider-jack-in-clj doesn't seem to apply the flags, and I'm getting errors (caused by code that requires these flags). What might I be doing wrong?#2023-11-0921:39vemvThere's a typo in your OP, maybe you repeated it in emacs?
https://docs.cider.mx/cider/basics/up_and_running.html#clojure-cli-options#2023-11-0921:41Tommy Jollyboatwell spotted, thank you!#2023-11-1011:58lassemaattaNot sure if this is a cider or rather a general clojure question, but: how should I write code dealing with Java objects such that cider could provide meaningful code completion candidates?#2023-11-1012:00lassemaattaFor example, let's say I have some Java object factory, which provides methods such as
public SomeClass createSomeClass() { return new SomeClass(); }
#2023-11-1012:01lassemaattaI'd like to write code such as
(let [object (doto (.createSomeClass factory)
(.setFoo 1) ;; #2023-11-1012:04lassemaatta#2023-11-1012:57lassemaatta#2023-11-1014:34vemv#2023-11-1014:35vemv#2023-11-1014:36lassemaatta#2023-11-1014:36vemv#2023-11-1014:38lassemaatta#2023-11-1014:41vemv#2023-11-1014:43lassemaatta#2023-11-1107:03lassemaatta#2023-11-1014:00hugod#2023-11-1014:33vemv#2023-11-1019:40ag#2023-11-1019:46ag#2023-11-1020:04jpmonettas#2023-11-1021:18ag#2023-11-1222:34hifumi123How do I make the cider-error buffer reappear when evaluation results in an exception
I am using version 1.12-snapshot#2023-11-1222:35vemvHi 👋 Further describe please#2023-11-1222:37hifumi123in older versions (e.g. 1.7.0), a cider-error buffer appears when an exception is thrown. now I don't see it#2023-11-1222:38vemvhttps://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration
> Starting from CIDER 1.8.0, only runtime exceptions (and not compilation errors) will cause a stacktrace buffer to be shown.
Continue reading for the fix
Gotta leave today, have a great one!#2023-11-1222:47hifumi123Thanks#2023-11-1311:13Eric DvorsakI discovered the cider-log mode and it looks awesome.
I'm wondering what I'm missing though to get it to work, all my logs are going to the nrepl-server buffer and cider-log stays empty#2023-11-1311:17vemvhi Eric, nice to see you around here 👋
have you checked out https://docs.cider.mx/cider/debugging/logging.html ? It's compatible with a few frameworks, and it needs expicit activation#2023-11-1311:21Eric Dvorsakhi! nice to see you too!
Yes that's where I coming from, I did M-x cider-log
The project uses timbre with this lib https://github.com/runejuhl/clj-journal so I'm not sure what logging framework to pick, actually cider-log only lets me pick java util logging#2023-11-1311:25Eric DvorsakI guess the issue is that timbre doesn't use any java logging framework by default